[jbosstools-commits] JBoss Tools SVN: r39746 - in trunk/runtime-soa: features and 13 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Thu Mar 22 00:46:32 EDT 2012


Author: nickboldt
Date: 2012-03-22 00:46:31 -0400 (Thu, 22 Mar 2012)
New Revision: 39746

Added:
   trunk/runtime-soa/features/org.jboss.tools.runtime.soa.test.feature/
   trunk/runtime-soa/features/org.jboss.tools.runtime.soa.test.feature/build.properties
   trunk/runtime-soa/features/org.jboss.tools.runtime.soa.test.feature/feature.properties
   trunk/runtime-soa/features/org.jboss.tools.runtime.soa.test.feature/feature.xml
   trunk/runtime-soa/features/org.jboss.tools.runtime.soa.test.feature/license.html
   trunk/runtime-soa/features/org.jboss.tools.runtime.soa.test.feature/pom.xml
   trunk/runtime-soa/features/org.jboss.tools.runtime.soa.test.feature/sourceTemplateFeature/
   trunk/runtime-soa/features/org.jboss.tools.runtime.soa.test.feature/sourceTemplateFeature/.gitkeep
   trunk/runtime-soa/tests/
   trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/
   trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/.classpath
   trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/.settings/
   trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/.settings/org.eclipse.jdt.core.prefs
   trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/META-INF/
   trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/META-INF/MANIFEST.MF
   trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/build.properties
   trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/plugin.properties
   trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/plugin.xml
   trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/pom.xml
   trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/requirements.properties
   trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/src/
   trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/src/org/
   trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/src/org/jboss/
   trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/src/org/jboss/tools/
   trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/src/org/jboss/tools/runtime/
   trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/src/org/jboss/tools/runtime/test/
   trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/src/org/jboss/tools/runtime/test/IRuntimeDetectionConstants.java
   trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/src/org/jboss/tools/runtime/test/RuntimeDetectionAllTests.java
   trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/src/org/jboss/tools/runtime/test/RuntimeDetectionTest.java
   trunk/runtime-soa/tests/pom.xml
Modified:
   trunk/runtime-soa/features/pom.xml
   trunk/runtime-soa/pom.xml
   trunk/runtime-soa/site/category.xml
Log:
add org.jboss.tools.runtime.soa.test.feature and org.jboss.tools.runtime.soa.test to runtime-soa component (JBIDE-10968)

Added: trunk/runtime-soa/features/org.jboss.tools.runtime.soa.test.feature/build.properties
===================================================================
--- trunk/runtime-soa/features/org.jboss.tools.runtime.soa.test.feature/build.properties	                        (rev 0)
+++ trunk/runtime-soa/features/org.jboss.tools.runtime.soa.test.feature/build.properties	2012-03-22 04:46:31 UTC (rev 39746)
@@ -0,0 +1,3 @@
+bin.includes = feature.xml,\
+               feature.properties,\
+               license.html

Added: trunk/runtime-soa/features/org.jboss.tools.runtime.soa.test.feature/feature.properties
===================================================================
--- trunk/runtime-soa/features/org.jboss.tools.runtime.soa.test.feature/feature.properties	                        (rev 0)
+++ trunk/runtime-soa/features/org.jboss.tools.runtime.soa.test.feature/feature.properties	2012-03-22 04:46:31 UTC (rev 39746)
@@ -0,0 +1,54 @@
+###############################################################################
+# Copyright (c) 2008-2012 Red Hat, Inc. and others.
+# All rights reserved. This program and the accompanying materials 
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     JBoss by Red Hat - Initial implementation.
+##############################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=JBoss Tools - Tests - Runtime Detection
+
+# "providerName" property - name of the company that provides the feature
+providerName=JBoss by Red Hat
+
+# "updateSiteName" property - label for the update site
+updateSiteName=JBossTools Update Site
+
+# "description" property - description of the feature
+description=JBoss Tools - Tests - Runtime Detection
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=Copyright (c) 2008-2012 Red Hat, Inc. and others.\nAll rights reserved. This program and the accompanying materials\n 
+are made available under the terms of the Eclipse Public License v1.0\n\
+which accompanies this distribution, and is available at\n\
+http\://www.eclipse.org/legal/epl-v10.html\n\
+\n\
+Contributors\:\n\
+JBoss by Red Hat - Initial implementation.\n
+ ############### end of copyright property ####################################
+
+# "licenseURL" property - URL of the "Feature License"
+# do not translate value - just change to point to a locale-specific HTML page
+licenseURL=license.html
+
+# START NON-TRANSLATABLE
+# "license" property - text of the "Feature Update License"
+# should be plain text version of license agreement pointed to be "licenseURL"
+license=Red Hat, Inc. licenses these features and plugins to you under \
+certain open source licenses (or aggregations of such licenses), which \
+in a particular case may include the Eclipse Public License, the GNU \
+Lesser General Public License, and/or certain other open source \
+licenses. For precise licensing details, consult the corresponding \
+source code, or contact Red Hat Legal Affairs, 1801 Varsity Drive, \
+Raleigh NC 27606 USA.
+# END NON-TRANSLATABLE
+########### end of license property ##########################################

Added: trunk/runtime-soa/features/org.jboss.tools.runtime.soa.test.feature/feature.xml
===================================================================
--- trunk/runtime-soa/features/org.jboss.tools.runtime.soa.test.feature/feature.xml	                        (rev 0)
+++ trunk/runtime-soa/features/org.jboss.tools.runtime.soa.test.feature/feature.xml	2012-03-22 04:46:31 UTC (rev 39746)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature id="org.jboss.tools.runtime.soa.test.feature" label="JBoss Tools - Tests - Runtime Detection" version="1.3.0.qualifier">
+
+	<description>
+      %description
+   </description>
+
+	<copyright>
+      %copyright
+   </copyright>
+
+	<license url="%licenseURL">
+      %license
+   </license>
+
+	<plugin id="org.jboss.tools.runtime.soa.test" download-size="0" install-size="0" version="0.0.0" unpack="false" />
+</feature>

Added: trunk/runtime-soa/features/org.jboss.tools.runtime.soa.test.feature/license.html
===================================================================
--- trunk/runtime-soa/features/org.jboss.tools.runtime.soa.test.feature/license.html	                        (rev 0)
+++ trunk/runtime-soa/features/org.jboss.tools.runtime.soa.test.feature/license.html	2012-03-22 04:46:31 UTC (rev 39746)
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+
+<body>
+<p>Red Hat, Inc. licenses these features and plugins to you under
+certain open source licenses (or aggregations of such licenses), which
+in a particular case may include the Eclipse Public License, the GNU
+Lesser General Public License, and/or certain other open source
+licenses. For precise licensing details, consult the corresponding
+source code, or contact Red Hat Legal Affairs, 1801 Varsity Drive,
+Raleigh NC 27606 USA.
+</p>
+</body>
+</html>
\ No newline at end of file

Added: trunk/runtime-soa/features/org.jboss.tools.runtime.soa.test.feature/pom.xml
===================================================================
--- trunk/runtime-soa/features/org.jboss.tools.runtime.soa.test.feature/pom.xml	                        (rev 0)
+++ trunk/runtime-soa/features/org.jboss.tools.runtime.soa.test.feature/pom.xml	2012-03-22 04:46:31 UTC (rev 39746)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.jboss.tools.runtime-soa</groupId>
+		<artifactId>features</artifactId>
+		<version>1.3.0-SNAPSHOT</version>
+	</parent>
+	<groupId>org.jboss.tools.runtime-soa.features</groupId>
+	<artifactId>org.jboss.tools.runtime.soa.test.feature</artifactId>
+	
+	<packaging>eclipse-feature</packaging>
+</project>

Added: trunk/runtime-soa/features/org.jboss.tools.runtime.soa.test.feature/sourceTemplateFeature/.gitkeep
===================================================================
Modified: trunk/runtime-soa/features/pom.xml
===================================================================
--- trunk/runtime-soa/features/pom.xml	2012-03-22 04:45:58 UTC (rev 39745)
+++ trunk/runtime-soa/features/pom.xml	2012-03-22 04:46:31 UTC (rev 39746)
@@ -16,5 +16,6 @@
 		<module>org.jboss.tools.runtime.drools.detector.feature</module>
 		<module>org.jboss.tools.runtime.esb.detector.feature</module>
 		<module>org.jboss.tools.runtime.jbpm.detector.feature</module>
+		<module>org.jboss.tools.runtime.soa.test.feature</module>
 	</modules>
 </project>

Modified: trunk/runtime-soa/pom.xml
===================================================================
--- trunk/runtime-soa/pom.xml	2012-03-22 04:45:58 UTC (rev 39745)
+++ trunk/runtime-soa/pom.xml	2012-03-22 04:46:31 UTC (rev 39746)
@@ -17,7 +17,13 @@
 		<module>plugins</module>
 		<module>features</module>
 		<module>site</module>
+		<module>tests</module>
 	</modules>
+	<!-- to build, need to resolve TP and upstream components
+	     mvn clean install -f ../build/pom-soa-tooling.xml -Pruntime-soa-bootstrap,local.site,jbosstools-nightly-staging-composite,jbosstools-nightly-staging-composite-soa-tooling
+		or
+	     mvn clean install -Pdefault,jbosstools-nightly-staging-composite,jbosstools-nightly-staging-composite-soa-tooling
+	-->
 	
 	<repositories>
 		<!-- To resolve parent artifact -->

Modified: trunk/runtime-soa/site/category.xml
===================================================================
--- trunk/runtime-soa/site/category.xml	2012-03-22 04:45:58 UTC (rev 39745)
+++ trunk/runtime-soa/site/category.xml	2012-03-22 04:46:31 UTC (rev 39746)
@@ -17,4 +17,7 @@
    <feature url="features/org.jboss.tools.runtime.jbpm.detector.feature_0.0.0.jar" id="org.jboss.tools.runtime.jbpm.detector.feature" version="0.0.0">
       <category name="JBoss Tools runtime-soa Nightly Build Update Site"/>
    </feature>
+   <feature url="features/org.jboss.tools.runtime.soa.test.feature_0.0.0.jar" id="org.jboss.tools.runtime.soa.test.feature" version="0.0.0">
+      <category name="JBoss Tools runtime-soa Nightly Build Update Site"/>
+   </feature>
 </site>

Added: trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/.classpath
===================================================================
--- trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/.classpath	                        (rev 0)
+++ trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/.classpath	2012-03-22 04:46:31 UTC (rev 39746)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Added: trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/.settings/org.eclipse.jdt.core.prefs	                        (rev 0)
+++ trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/.settings/org.eclipse.jdt.core.prefs	2012-03-22 04:46:31 UTC (rev 39746)
@@ -0,0 +1,8 @@
+#Thu Mar 24 21:12:52 CET 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6

Added: trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/META-INF/MANIFEST.MF	                        (rev 0)
+++ trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/META-INF/MANIFEST.MF	2012-03-22 04:46:31 UTC (rev 39746)
@@ -0,0 +1,42 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %BundleName
+Bundle-SymbolicName: org.jboss.tools.runtime.soa.test;singleton:=true
+Bundle-Version: 1.3.0.qualifier
+Require-Bundle: org.eclipse.core.runtime,
+ org.junit4,
+ org.jboss.tools.runtime.ui,
+ org.jboss.tools.runtime.core,
+ org.jboss.tools.tests,
+ org.jboss.tools.seam.core,
+ org.eclipse.datatools.connectivity,
+ org.eclipse.datatools.connectivity.db.generic,
+ org.jboss.tools.common,
+ org.jboss.tools.tests,
+ org.jboss.ide.eclipse.as.core,
+ org.eclipse.wst.server.core,
+ org.eclipse.datatools.enablement.hsqldb,
+ org.eclipse.datatools.enablement.hsqldb.dbdefinition,
+ org.eclipse.datatools.enablement.hsqldb.ui,
+ org.eclipse.jst.jee,
+ org.eclipse.jst.jee.ejb,
+ org.eclipse.jst.jee.ui,
+ org.eclipse.jst.jee.web,
+ org.eclipse.ui,
+ org.eclipse.core.resources,
+ org.junit4,
+ org.jboss.tools.jsf.vpe.seam,
+ org.jboss.tools.seam.pages.xml,
+ org.jboss.tools.seam.ui,
+ org.jboss.tools.seam.ui.pages,
+ org.jboss.tools.seam.xml,
+ org.jboss.tools.seam.xml.ui,
+ org.jboss.tools.seam.text.ext,
+ org.jboss.tools.runtime.as.detector,
+ org.jboss.tools.runtime.drools.detector,
+ org.jboss.tools.runtime.jbpm.detector,
+ org.jboss.tools.runtime.seam.detector
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-Vendor: %BundleVendor
+Bundle-Localization: plugin

Added: trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/build.properties
===================================================================
--- trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/build.properties	                        (rev 0)
+++ trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/build.properties	2012-03-22 04:46:31 UTC (rev 39746)
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               plugin.properties,\
+               plugin.xml

Added: trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/plugin.properties
===================================================================
--- trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/plugin.properties	                        (rev 0)
+++ trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/plugin.properties	2012-03-22 04:46:31 UTC (rev 39746)
@@ -0,0 +1,3 @@
+#Properties file for org.jboss.tools.project.examples
+BundleVendor = JBoss by Red Hat
+BundleName = JBoss Runtime Detection Tests
\ No newline at end of file

Added: trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/plugin.xml
===================================================================
--- trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/plugin.xml	                        (rev 0)
+++ trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/plugin.xml	2012-03-22 04:46:31 UTC (rev 39746)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+	<extension
+         point="org.jboss.tools.runtime.core.runtimeDetectors">
+    	<runtimeDetector
+    		id="org.jboss.tools.runtime.handlers.InvalidHandler"
+    		name="Invalid"
+       		class="org.jboss.tools.runtime.handlers.InvalidHandler"
+       		preferenceId="org.jboss.tools.runtime.handlers.InvalidHandler"
+       		priority="9999"/>
+	</extension>
+	
+</plugin>

Added: trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/pom.xml
===================================================================
--- trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/pom.xml	                        (rev 0)
+++ trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/pom.xml	2012-03-22 04:46:31 UTC (rev 39746)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.jboss.tools.runtime-soa</groupId>
+		<artifactId>tests</artifactId>
+		<version>1.3.0-SNAPSHOT</version>
+	</parent>
+	<groupId>org.jboss.tools.runtime.soa.tests</groupId>
+	<artifactId>org.jboss.tools.runtime.soa.test</artifactId>
+	
+	<packaging>eclipse-test-plugin</packaging>
+
+	<properties>
+		<systemProperties>-Djbosstools.test.jboss.home.4.2=${requirement.build.root}/jboss-4.2.3.GA -Djbosstools.test.jboss.home.5.1=${requirement.build.root}/jboss-5.1.0.GA -Djbosstools.test.seam.2.0.1.GA.home=${requirement.build.root}/jboss-seam-2.0.1.GA -Djbosstools.test.seam.2.2.0.GA.home=${requirement.build.root}/jboss-seam-2.2.0.GA -Djbosstools.test.eap.4.3.home=${requirement.build.root}/jboss-eap-4.3 -Dskip.runtime.scanner=true -Djbosstools.test.jboss.home.7.0=${requirement.build.root}/jboss-7.0.0.Beta3</systemProperties>
+	</properties>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.eclipse.tycho</groupId>
+				<artifactId>tycho-surefire-plugin</artifactId>
+				<version>${tychoVersion}</version>
+				<configuration>
+					<testSuite>org.jboss.tools.runtime.test</testSuite>
+					<testClass>org.jboss.tools.runtime.test.RuntimeDetectionAllTests</testClass>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+</project>

Added: trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/requirements.properties
===================================================================
--- trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/requirements.properties	                        (rev 0)
+++ trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/requirements.properties	2012-03-22 04:46:31 UTC (rev 39746)
@@ -0,0 +1 @@
+requirements=jbossas,seam-2.0.1.GA,seam-2.2.0.GA,jbeap,eapseamgen,seamfp
\ No newline at end of file

Added: trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/src/org/jboss/tools/runtime/test/IRuntimeDetectionConstants.java
===================================================================
--- trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/src/org/jboss/tools/runtime/test/IRuntimeDetectionConstants.java	                        (rev 0)
+++ trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/src/org/jboss/tools/runtime/test/IRuntimeDetectionConstants.java	2012-03-22 04:46:31 UTC (rev 39746)
@@ -0,0 +1,32 @@
+/*************************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials 
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.runtime.test;
+
+/**
+ * 
+ * @author snjeza
+ *
+ */
+public interface IRuntimeDetectionConstants {
+	
+	final static String JBOSS_42_HOME = System.getProperty("jbosstools.test.jboss.home.4.2", "E:\\JBossRuntimes\\jboss-4.2.3.GA");
+
+	final static String JBOSS_51_HOME = System.getProperty("jbosstools.test.jboss.home.5.1", "E:\\JBossRuntime2\\jboss-5.1.0.GA");
+
+	final static String JBOSS_70_HOME = System.getProperty("jbosstools.test.jboss.home.7.0", "E:\\jboss-as-7.0.1.Final");
+
+	final static String SEAM_20_HOME = System.getProperty("jbosstools.test.seam.2.0.1.GA.home", "E:\\JBossRuntimes\\jboss-seam-2.0.1.GA");
+
+	final static String SEAM_22_HOME = System.getProperty("jbosstools.test.seam.2.2.0.GA.home", "E:\\JBossRuntime2\\jboss-seam-2.2.1.Final");
+
+	final static String EAP_43_HOME = System.getProperty("jbosstools.test.eap.4.3.home", "E:\\jboss-eap43_cp03");
+
+}

Added: trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/src/org/jboss/tools/runtime/test/RuntimeDetectionAllTests.java
===================================================================
--- trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/src/org/jboss/tools/runtime/test/RuntimeDetectionAllTests.java	                        (rev 0)
+++ trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/src/org/jboss/tools/runtime/test/RuntimeDetectionAllTests.java	2012-03-22 04:46:31 UTC (rev 39746)
@@ -0,0 +1,24 @@
+/*************************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials 
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.runtime.test;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+
+ at Suite.SuiteClasses({
+	RuntimeDetectionTest.class,
+})
+
+ at RunWith(Suite.class)
+public class RuntimeDetectionAllTests {
+
+}
\ No newline at end of file

Added: trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/src/org/jboss/tools/runtime/test/RuntimeDetectionTest.java
===================================================================
--- trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/src/org/jboss/tools/runtime/test/RuntimeDetectionTest.java	                        (rev 0)
+++ trunk/runtime-soa/tests/org.jboss.tools.runtime.soa.test/src/org/jboss/tools/runtime/test/RuntimeDetectionTest.java	2012-03-22 04:46:31 UTC (rev 39746)
@@ -0,0 +1,413 @@
+/*************************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials 
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.runtime.test;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import java.util.jar.Attributes;
+import java.util.jar.JarFile;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.preferences.ConfigurationScope;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IRuntimeType;
+import org.eclipse.wst.server.core.ServerCore;
+import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
+import org.jboss.tools.runtime.as.detector.IJBossRuntimePluginConstants;
+import org.jboss.tools.runtime.core.JBossRuntimeLocator;
+import org.jboss.tools.runtime.core.RuntimeCoreActivator;
+import org.jboss.tools.runtime.core.model.IRuntimeDetector;
+import org.jboss.tools.runtime.core.model.InvalidRuntimeDetector;
+import org.jboss.tools.runtime.core.model.RuntimePath;
+import org.jboss.tools.runtime.core.model.RuntimeDefinition;
+import org.jboss.tools.runtime.ui.RuntimeUIActivator;
+import org.jboss.tools.seam.core.project.facet.SeamRuntime;
+import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
+import org.jboss.tools.seam.core.project.facet.SeamVersion;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+
+/**
+ * 
+ * @author snjeza
+ * 
+ */
+public class RuntimeDetectionTest implements IJBossRuntimePluginConstants {
+	private final static String seamVersionAttributeName = "Seam-Version";
+
+	@BeforeClass
+	public static void create() {
+		RuntimeCoreActivator.getDefault();
+		RuntimeUIActivator.getDefault();
+		addRuntimePaths();
+		createRuntimes();
+	}
+
+	private static void addRuntimePaths() {
+		Set<RuntimePath> runtimePaths = RuntimeUIActivator.getDefault()
+				.getRuntimePaths();
+		String[] paths = { IRuntimeDetectionConstants.JBOSS_42_HOME,
+				IRuntimeDetectionConstants.JBOSS_51_HOME,
+				IRuntimeDetectionConstants.JBOSS_70_HOME,
+				IRuntimeDetectionConstants.SEAM_20_HOME,
+				IRuntimeDetectionConstants.SEAM_22_HOME,
+				IRuntimeDetectionConstants.EAP_43_HOME };
+
+		for (String path : paths) {
+			RuntimePath runtimePath = new RuntimePath(path);
+			runtimePath.setScanOnEveryStartup(false);
+			runtimePaths.add(runtimePath);
+		}
+		RuntimeUIActivator.getDefault().saveRuntimePaths();
+		List<RuntimeDefinition> serverDefinitions = new ArrayList<RuntimeDefinition>();
+		Set<IRuntimeDetector> detectors = RuntimeCoreActivator
+				.getRuntimeDetectors();
+		for (IRuntimeDetector detector : detectors) {
+			if (detector.isEnabled()) {
+				detector.initializeRuntimes(serverDefinitions);
+			}
+		}
+	}
+
+	private static void createRuntimes() {
+		JBossRuntimeLocator locator = new JBossRuntimeLocator();
+		Set<RuntimePath> runtimePaths = RuntimeUIActivator.getDefault()
+				.getRuntimePaths();
+		for (RuntimePath runtimePath : runtimePaths) {
+			List<RuntimeDefinition> serverDefinitions = locator
+					.searchForRuntimes(runtimePath.getPath(),
+							new NullProgressMonitor());
+			runtimePath.getServerDefinitions().clear();
+			for (RuntimeDefinition serverDefinition : serverDefinitions) {
+				serverDefinition.setRuntimePath(runtimePath);
+			}
+			runtimePath.getServerDefinitions().addAll(serverDefinitions);
+		}
+		List<RuntimeDefinition> serverDefinitions = RuntimeUIActivator
+				.getDefault().getServerDefinitions();
+		Set<IRuntimeDetector> detectors = RuntimeCoreActivator
+				.getRuntimeDetectors();
+		for (IRuntimeDetector detector : detectors) {
+			if (detector.isEnabled()) {
+				detector.initializeRuntimes(serverDefinitions);
+			}
+		}
+	}
+
+	@Test
+	public void testRuntimeDetectors() {
+		Set<IRuntimeDetector> detectors = RuntimeCoreActivator
+				.getRuntimeDetectors();
+		assertTrue("Runtime detectors don't exist.", detectors.size() > 0);
+	}
+
+	@Test
+	public void testRuntimePaths() {
+		Set<RuntimePath> runtimePaths = RuntimeUIActivator.getDefault()
+				.getRuntimePaths();
+		assertTrue(
+				"runtimePaths.size()\nExpected: 6\nWas: " + runtimePaths.size(),
+				runtimePaths.size() == 6);
+	}
+	
+	@Test
+	public void testRuntimePathsExists() {
+		Set<RuntimePath> runtimePaths = RuntimeUIActivator.getDefault()
+				.getRuntimePaths();
+		for (RuntimePath runtimePath:runtimePaths) {
+			String path = runtimePath.getPath();
+			File file = new File(path);
+			assertTrue("The '" + file.getAbsolutePath()
+					+ "' path isn't valid.", file.isDirectory());
+		}
+	}
+
+	@Test
+	public void testLocations() {
+		List<RuntimeDefinition> serverDefinitions = RuntimeUIActivator
+				.getDefault().getServerDefinitions();
+		for (RuntimeDefinition serverDefinition : serverDefinitions) {
+			File location = serverDefinition.getLocation();
+			assertTrue("The '" + location.getAbsolutePath()
+					+ "' path isn't valid.", location.isDirectory());
+		}
+	}
+	
+	@Test
+	public void testSeam22Location() throws Exception {
+		String seamHome = IRuntimeDetectionConstants.SEAM_22_HOME;
+		testSeamHome(seamHome, "2.2");
+	}
+	
+	@Test
+	public void testSeam20Location() throws Exception {
+		String seamHome = IRuntimeDetectionConstants.SEAM_20_HOME;
+		testSeamHome(seamHome, "2.0");
+	}
+
+	private void testSeamHome(String seamHome, String seamVersion) throws IOException {
+		File file = new File(seamHome);
+		assertTrue("The '" + file.getAbsolutePath()
+				+ "' path isn't valid.", file.isDirectory());
+		String[] seamFiles = file.list(new FilenameFilter() {
+			
+			public boolean accept(File dir, String name) {
+				if ("seam-gen".equals(name)) {
+					return true;
+				}
+				if ("lib".equals(name)) {
+					return true;
+				}
+				return false;
+			}
+		});
+		assertTrue("seamFiles : " + seamFiles, seamFiles != null
+				&& seamFiles.length == 2);
+		File jarFile = new File(seamHome, "lib/jboss-seam.jar");
+		assertTrue("The '" + jarFile.getAbsolutePath() + "' path isn't valid.",
+				jarFile.isFile());
+		JarFile jar = new JarFile(jarFile);
+		Attributes attributes = jar.getManifest().getMainAttributes();
+		String version = attributes.getValue(seamVersionAttributeName);
+		assertTrue("seamVersion: " + version, version != null && version.startsWith(seamVersion));
+	}
+	
+	@Test
+	public void testServerDefinitions() {
+		List<RuntimeDefinition> serverDefinitions = RuntimeUIActivator
+				.getDefault().getServerDefinitions();
+		Set<RuntimePath> runtimePaths = RuntimeUIActivator.getDefault()
+			.getRuntimePaths();
+		assertTrue("serverDefinitions.size()\nExpected: 6\nWas: "
+				+ serverDefinitions.size() + 
+				"\nserverDefinitions: " + serverDefinitions +
+				"\nruntimePaths=" + runtimePaths, serverDefinitions.size() == 6);
+	}
+
+	@Test
+	public void testSeam22() {
+		SeamRuntime[] seamRuntimes = SeamRuntimeManager.getInstance()
+				.getRuntimes();
+		int count = 0;
+		for (SeamRuntime seamRuntime : seamRuntimes) {
+			SeamVersion version = seamRuntime.getVersion();
+			if (SeamVersion.SEAM_2_2.equals(version)) {
+				count++;
+			}
+		}
+		assertTrue("Seam 2.2\nExpected: 1\nWas: " + count, count == 1);
+	}
+
+	@Test
+	public void testSeam20() {
+		SeamRuntime[] seamRuntimes = SeamRuntimeManager.getInstance()
+				.getRuntimes();
+		int count = 0;
+		for (SeamRuntime seamRuntime : seamRuntimes) {
+			SeamVersion version = seamRuntime.getVersion();
+			if (SeamVersion.SEAM_2_0.equals(version)) {
+				count++;
+			}
+		}
+		assertTrue("Seam 2.0\nExpected: 2\nWas: " + count, count == 2);
+	}
+
+	@Test
+	public void testSeam12() {
+		SeamRuntime[] seamRuntimes = SeamRuntimeManager.getInstance()
+				.getRuntimes();
+		int count = 0;
+		for (SeamRuntime seamRuntime : seamRuntimes) {
+			SeamVersion version = seamRuntime.getVersion();
+			if (SeamVersion.SEAM_1_2.equals(version)) {
+				count++;
+			}
+		}
+		assertTrue("Seam 1.2\nExpected: 1\nWas: " + count, count == 1);
+	}
+
+	@Test
+	public void testSeamRuntimes() {
+		SeamRuntime[] seamRuntimes = SeamRuntimeManager.getInstance()
+				.getRuntimes();
+		assertTrue("seamRuntimes.length\nExpected: 4\nWas: "
+				+ seamRuntimes.length, seamRuntimes.length == 4);
+	}
+
+	@Test
+	public void testJBossAs42() {
+		IRuntime[] runtimes = ServerCore.getRuntimes();
+		int count = 0;
+		for (IRuntime runtime : runtimes) {
+			IRuntimeType runtimeType = runtime.getRuntimeType();
+			if (IJBossToolingConstants.AS_42.equals(runtimeType.getId())) {
+				count++;
+			}
+		}
+		assertTrue("JBoss AS 4.2\nExpected: 1\nWas: " + count, count == 1);
+	}
+
+	@Test
+	public void testJBossAs51() {
+		IRuntime[] runtimes = ServerCore.getRuntimes();
+		int count = 0;
+		for (IRuntime runtime : runtimes) {
+			IRuntimeType runtimeType = runtime.getRuntimeType();
+			if (IJBossToolingConstants.AS_51.equals(runtimeType.getId())) {
+				count++;
+			}
+		}
+		assertTrue("JBoss AS 5.1\nExpected: 1\nWas: " + count, count == 1);
+	}
+	
+	@Test
+	public void testJBossAs70() {
+		IRuntime[] runtimes = ServerCore.getRuntimes();
+		int count = 0;
+		for (IRuntime runtime : runtimes) {
+			IRuntimeType runtimeType = runtime.getRuntimeType();
+			if (IJBossToolingConstants.AS_70.equals(runtimeType.getId())) {
+				count++;
+			}
+		}
+		assertTrue("JBoss AS 7.0\nExpected: 1\nWas: " + count, count == 1);
+	}
+
+	@Test
+	public void testJBossEap43() {
+		IRuntime[] runtimes = ServerCore.getRuntimes();
+		int count = 0;
+		for (IRuntime runtime : runtimes) {
+			IRuntimeType runtimeType = runtime.getRuntimeType();
+			if (IJBossToolingConstants.EAP_43.equals(runtimeType.getId())) {
+				count++;
+			}
+		}
+		assertTrue("JBoss EAP 4.3\nExpected: 1\nWas: " + count, count == 1);
+	}
+
+	@Test
+	public void testWtpRuntimes() {
+		IRuntime[] runtimes = ServerCore.getRuntimes();
+		assertTrue("runtimes.length\nExpected: 4\nWas: " + runtimes.length,
+				runtimes.length == 4);
+	}
+	
+	@Test
+	public void testIncludedDefinitions() {
+		for (RuntimeDefinition serverDefinition:RuntimeUIActivator.getDefault().getServerDefinitions()){
+			String type = serverDefinition.getType();
+			if (EAP.equals(type)) {
+				assertTrue("EAP has to include server definitions", serverDefinition.getIncludedServerDefinitions().size() > 0);
+				for(RuntimeDefinition included:serverDefinition.getIncludedServerDefinitions()) {
+					assertTrue("Invalid parent definition", included.getParent() == serverDefinition);
+				}
+			}
+		}
+	}
+	
+	@Test
+	public void testSavePreferences() throws Exception {
+		// saves preferences
+		Bundle bundle = Platform.getBundle(RuntimeUIActivator.PLUGIN_ID);
+		bundle.stop();
+		// loads preferences
+		bundle.start();
+		// calls tests again
+		testServerDefinitions();
+		testIncludedDefinitions();
+		testRuntimePaths();
+		testRuntimeDetectors();
+		testLocations();
+		testSeamRuntimes();
+		testWtpRuntimes();
+		testSeam22();
+		testSeam22Location();
+	}
+	
+	@Test
+	public void testOldWorkspace() throws Exception {
+		String runtimes = ConfigurationScope.INSTANCE.getNode(
+				RuntimeUIActivator.PLUGIN_ID).get(
+				RuntimeUIActivator.RUNTIME_PATHS, null);
+		// removes version and included definitions
+		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+	    Document doc = factory.newDocumentBuilder().parse(new InputSource(new StringReader(runtimes)));
+		Element runtimePaths = (Element) doc.getElementsByTagName(RuntimeUIActivator.RUNTIME_PATHS).item(0);
+		runtimePaths.removeAttribute(RuntimeUIActivator.PREFERENCES_VERSION);
+		removeIncluded(doc);
+		runtimes = serialize(doc);
+	    // restarts the bundle
+		Bundle bundle = Platform.getBundle(RuntimeUIActivator.PLUGIN_ID);
+		bundle.stop();
+		bundle.start();
+		// saves preferences
+		ConfigurationScope.INSTANCE.getNode(RuntimeUIActivator.PLUGIN_ID).put(
+				RuntimeUIActivator.RUNTIME_PATHS, runtimes);
+		// calls tests again 
+		testIncludedDefinitions();
+		testServerDefinitions();
+	}
+	
+	private void removeIncluded(Node node) {
+		if (node.getNodeType() == Node.ELEMENT_NODE
+				&& node.getNodeName().equals("included")) {
+			node.getParentNode().removeChild(node);
+		} else {
+			NodeList list = node.getChildNodes();
+			for (int i = 0; i < list.getLength(); i++) {
+				removeIncluded(list.item(i));
+			}
+		}
+	}
+	
+	@Test
+	public void testInvalidDetectors() {
+		Set<IRuntimeDetector> detectors = RuntimeCoreActivator.getDeclaredRuntimeDetectors();
+		IRuntimeDetector invalidDetector = null;
+		for (IRuntimeDetector detector:detectors) {
+			if (detector instanceof InvalidRuntimeDetector) {
+				invalidDetector = detector;
+			}
+		}
+		assertFalse("Invalid detector is enabled.", invalidDetector.isEnabled());
+	}
+	
+	private String serialize(Document doc) throws TransformerException {
+		StringWriter stringWriter = new StringWriter(); 
+		Transformer serializer = TransformerFactory.newInstance().newTransformer();
+        serializer.transform(new DOMSource(doc), new StreamResult(stringWriter));
+        return stringWriter.toString(); 
+	}
+}

Added: trunk/runtime-soa/tests/pom.xml
===================================================================
--- trunk/runtime-soa/tests/pom.xml	                        (rev 0)
+++ trunk/runtime-soa/tests/pom.xml	2012-03-22 04:46:31 UTC (rev 39746)
@@ -0,0 +1,19 @@
+<project
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.jboss.tools</groupId>
+		<artifactId>runtime-soa</artifactId>
+		<version>1.3.0-SNAPSHOT</version>
+	</parent>
+	<groupId>org.jboss.tools.runtime-soa</groupId>
+	<artifactId>tests</artifactId>
+	
+	<name>runtime-soa.tests</name>
+	<packaging>pom</packaging>
+	<modules>
+		<module>org.jboss.tools.runtime.soa.test</module>
+	</modules>
+</project>
+	



More information about the jbosstools-commits mailing list