Index: build/pom.xml
===================================================================
--- build/pom.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ build/pom.xml	(working copy)
@@ -109,6 +109,7 @@
 			<modules>
 				<module>../tests</module>
 				<module>../common</module>
+                                <module>../runtime</module>
 				<module>../archives</module>
 				<module>../jmx</module>
 				<module>../as</module>
@@ -417,6 +418,7 @@
 				<module>../as</module>
 				<module>../hibernatetools</module>
 				<module>../common</module>
+				<module>../runtime</module>
 				<module>../jst</module>
 				<module>../xulrunner</module>
 				<module>../vpe</module>
@@ -441,6 +443,7 @@
 			<modules>
 				<module>../tests</module>
 				<module>../common</module>
+                                <module>../runtime</module>
 				<module>../jmx</module>
 				<module>../archives</module>
 				<module>../portlet</module>
@@ -452,7 +455,6 @@
 				<module>../jst</module>
 				<module>../as</module>
 				<module>../usage</module>
-				<module>../runtime</module>
 				<module>../examples</module>
 			</modules>
 		</profile>
@@ -476,9 +478,9 @@
 				<module>../as</module>
 				<module>../hibernatetools</module>
 				<module>../common</module>
+                                <module>../runtime</module>
 				<module>../examples</module>
 				<module>../portlet</module>
-				<module>../runtime</module>
 				<module>../jst</module>
 				<module>../xulrunner</module>
 				<module>../vpe</module>
@@ -571,15 +573,6 @@
 			<modules>
 				<module>../tests</module>
 				<module>../common</module>
-				<module>../jmx</module>
-				<module>../archives</module>
-				<module>../as</module>
-				<module>../hibernatetools</module>
-				<module>../jst</module>
-				<module>../xulrunner</module>
-				<module>../vpe</module>
-				<module>../jsf</module>
-				<module>../seam</module>
 				<module>../usage</module>
 				<module>../runtime</module>
 			</modules>
Index: runtime/features/pom.xml
===================================================================
--- runtime/features/pom.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/features/pom.xml	(working copy)
@@ -14,8 +14,6 @@
 	<packaging>pom</packaging>
 	<modules>
 		<module>org.jboss.tools.runtime.core.feature</module>
-		<module>org.jboss.tools.runtime.as.detector.feature</module>
-		<module>org.jboss.tools.runtime.seam.detector.feature</module>
 		<module>org.jboss.tools.runtime.test.feature</module>
 	</modules>
 </project>
Index: runtime/features/org.jboss.tools.runtime.as.detector.feature/build.properties
===================================================================
--- runtime/features/org.jboss.tools.runtime.as.detector.feature/build.properties	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/features/org.jboss.tools.runtime.as.detector.feature/build.properties	(working copy)
@@ -1,3 +0,0 @@
-bin.includes = feature.xml,\
-               license.html,\
-               feature.properties
Index: runtime/features/org.jboss.tools.runtime.as.detector.feature/feature.xml
===================================================================
--- runtime/features/org.jboss.tools.runtime.as.detector.feature/feature.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/features/org.jboss.tools.runtime.as.detector.feature/feature.xml	(working copy)
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
-      id="org.jboss.tools.runtime.as.detector.feature"
-      label="%featureName"
-      version="1.4.0.qualifier"
-      provider-name="%providerName"
-      plugin="org.jboss.tools.runtime.as.detector">
-
-   <description>
-      %description
-   </description>
-
-   <copyright>
-      %copyright
-   </copyright>
-
-   <license url="%licenseURL">
-      %license
-   </license>
-
-   <plugin
-         id="org.jboss.tools.runtime.as.detector"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-</feature>
Index: runtime/features/org.jboss.tools.runtime.as.detector.feature/pom.xml
===================================================================
--- runtime/features/org.jboss.tools.runtime.as.detector.feature/pom.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/features/org.jboss.tools.runtime.as.detector.feature/pom.xml	(working copy)
@@ -1,47 +0,0 @@
-<?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</groupId>
-		<artifactId>features</artifactId>
-		<version>1.4.0-SNAPSHOT</version>
-	</parent>
-	<groupId>org.jboss.tools.runtime.features</groupId>
-	<artifactId>org.jboss.tools.runtime.as.detector.feature</artifactId>
-	
-	<packaging>eclipse-feature</packaging>
-	
-	<build>
-		<plugins>
-			<plugin>
-				<groupId>org.eclipse.tycho.extras</groupId>
-				<artifactId>tycho-source-feature-plugin</artifactId>
-				<version>${tychoExtrasVersion}</version>
-				<executions>
-					<execution>
-						<id>source-feature</id>
-						<phase>package</phase>
-						<goals>
-							<goal>source-feature</goal>
-						</goals>
-					</execution>
-				</executions>
-			</plugin>
-			<plugin>
-				<groupId>org.eclipse.tycho</groupId>
-				<artifactId>tycho-p2-plugin</artifactId>
-				<version>${tychoVersion}</version>
-				<executions>
-					<execution>
-						<id>attached-p2-metadata</id>
-						<phase>package</phase>
-						<goals>
-							<goal>p2-metadata</goal>
-						</goals>
-					</execution>
-				</executions>
-			</plugin>
-		</plugins>
-	</build>
-</project>
\ No newline at end of file
Index: runtime/features/org.jboss.tools.runtime.as.detector.feature/.project
===================================================================
--- runtime/features/org.jboss.tools.runtime.as.detector.feature/.project	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/features/org.jboss.tools.runtime.as.detector.feature/.project	(working copy)
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.jboss.tools.runtime.as.detector.feature</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.pde.FeatureBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.pde.FeatureNature</nature>
-	</natures>
-</projectDescription>
Index: runtime/features/org.jboss.tools.runtime.as.detector.feature/license.html
===================================================================
--- runtime/features/org.jboss.tools.runtime.as.detector.feature/license.html	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/features/org.jboss.tools.runtime.as.detector.feature/license.html	(working copy)
@@ -1,14 +0,0 @@
-<!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
Index: runtime/features/org.jboss.tools.runtime.as.detector.feature/feature.properties
===================================================================
--- runtime/features/org.jboss.tools.runtime.as.detector.feature/feature.properties	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/features/org.jboss.tools.runtime.as.detector.feature/feature.properties	(working copy)
@@ -1,55 +0,0 @@
-###############################################################################
-# Copyright (c) 2009-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 Runtime AS Detector
-
-# "providerName" property - name of the company that provides the feature
-providerName=JBoss by Red Hat
-
-# "updateSiteName" property - label for the update/discovery sites
-updateSiteName=JBoss Developer Studio Updates
-JBossToolsUpdatesSiteName=JBoss Tools Updates
-
-# "description" property - description of the feature
-description=JBoss Runtime AS Detector, provides detection of JBoss AS installations and configure them as part of JBoss 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 ##########################################
Index: runtime/features/org.jboss.tools.runtime.seam.detector.feature/.project
===================================================================
--- runtime/features/org.jboss.tools.runtime.seam.detector.feature/.project	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/features/org.jboss.tools.runtime.seam.detector.feature/.project	(working copy)
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.jboss.tools.runtime.seam.detector.feature</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.pde.FeatureBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.pde.FeatureNature</nature>
-	</natures>
-</projectDescription>
Index: runtime/features/org.jboss.tools.runtime.seam.detector.feature/license.html
===================================================================
--- runtime/features/org.jboss.tools.runtime.seam.detector.feature/license.html	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/features/org.jboss.tools.runtime.seam.detector.feature/license.html	(working copy)
@@ -1,14 +0,0 @@
-<!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
Index: runtime/features/org.jboss.tools.runtime.seam.detector.feature/feature.properties
===================================================================
--- runtime/features/org.jboss.tools.runtime.seam.detector.feature/feature.properties	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/features/org.jboss.tools.runtime.seam.detector.feature/feature.properties	(working copy)
@@ -1,55 +0,0 @@
-###############################################################################
-# Copyright (c) 2009-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 Runtime Seam Detector
-
-# "providerName" property - name of the company that provides the feature
-providerName=JBoss by Red Hat
-
-# "updateSiteName" property - label for the update/discovery sites
-updateSiteName=JBoss Developer Studio Updates
-JBossToolsUpdatesSiteName=JBoss Tools Updates
-
-# "description" property - description of the feature
-description=JBoss Runtime Seam Detector provides detection of JBoss Seam installations and configure them as part of JBoss 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 ##########################################
Index: runtime/features/org.jboss.tools.runtime.seam.detector.feature/build.properties
===================================================================
--- runtime/features/org.jboss.tools.runtime.seam.detector.feature/build.properties	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/features/org.jboss.tools.runtime.seam.detector.feature/build.properties	(working copy)
@@ -1,3 +0,0 @@
-bin.includes = feature.xml,\
-               license.html,\
-               feature.properties
Index: runtime/features/org.jboss.tools.runtime.seam.detector.feature/feature.xml
===================================================================
--- runtime/features/org.jboss.tools.runtime.seam.detector.feature/feature.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/features/org.jboss.tools.runtime.seam.detector.feature/feature.xml	(working copy)
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
-      id="org.jboss.tools.runtime.seam.detector.feature"
-      label="%featureName"
-      version="1.4.0.qualifier"
-      provider-name="%providerName"
-      plugin="org.jboss.tools.runtime.seam.detector">
-
-   <description>
-      %description
-   </description>
-
-   <copyright>
-      %copyright
-   </copyright>
-
-   <license url="%licenseURL">
-      %license
-   </license>
-
-   <plugin
-         id="org.jboss.tools.runtime.seam.detector"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-</feature>
Index: runtime/features/org.jboss.tools.runtime.seam.detector.feature/pom.xml
===================================================================
--- runtime/features/org.jboss.tools.runtime.seam.detector.feature/pom.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/features/org.jboss.tools.runtime.seam.detector.feature/pom.xml	(working copy)
@@ -1,47 +0,0 @@
-<?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</groupId>
-		<artifactId>features</artifactId>
-		<version>1.4.0-SNAPSHOT</version>
-	</parent>
-	<groupId>org.jboss.tools.runtime.features</groupId>
-	<artifactId>org.jboss.tools.runtime.seam.detector.feature</artifactId>
-	
-	<packaging>eclipse-feature</packaging>
-	
-	<build>
-		<plugins>
-			<plugin>
-				<groupId>org.eclipse.tycho.extras</groupId>
-				<artifactId>tycho-source-feature-plugin</artifactId>
-				<version>${tychoExtrasVersion}</version>
-				<executions>
-					<execution>
-						<id>source-feature</id>
-						<phase>package</phase>
-						<goals>
-							<goal>source-feature</goal>
-						</goals>
-					</execution>
-				</executions>
-			</plugin>
-			<plugin>
-				<groupId>org.eclipse.tycho</groupId>
-				<artifactId>tycho-p2-plugin</artifactId>
-				<version>${tychoVersion}</version>
-				<executions>
-					<execution>
-						<id>attached-p2-metadata</id>
-						<phase>package</phase>
-						<goals>
-							<goal>p2-metadata</goal>
-						</goals>
-					</execution>
-				</executions>
-			</plugin>
-		</plugins>
-	</build>
-</project>
\ No newline at end of file
Index: runtime/features/org.jboss.tools.runtime.test.feature/feature.xml
===================================================================
--- runtime/features/org.jboss.tools.runtime.test.feature/feature.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/features/org.jboss.tools.runtime.test.feature/feature.xml	(working copy)
@@ -18,9 +18,6 @@
 
    <requires>
       <import feature="org.jboss.tools.runtime.core.feature" version="1.3.0" match="compatible"/>
-      <import feature="org.jboss.tools.runtime.as.detector.feature" version="1.3.0" match="compatible"/>
-      <import feature="org.jboss.ide.eclipse.as.serverAdapter.wtp.feature" version="2.3.0" match="compatible"/>
-      <import plugin="org.jboss.ide.eclipse.as.core"/>
    </requires>
 
    <plugin
Index: runtime/plugins/pom.xml
===================================================================
--- runtime/plugins/pom.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/pom.xml	(working copy)
@@ -15,7 +15,5 @@
 	<modules>
 		<module>org.jboss.tools.runtime.core</module>
 		<module>org.jboss.tools.runtime.ui</module>
-		<module>org.jboss.tools.runtime.as.detector</module>
-		<module>org.jboss.tools.runtime.seam.detector</module>
 	</modules>
 </project>
Index: runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/JBossRuntimeLocator.java
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/JBossRuntimeLocator.java	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/JBossRuntimeLocator.java	(working copy)
@@ -38,12 +38,12 @@
 	}
 
 	public List<RuntimeDefinition> searchForRuntimes(IPath path, IProgressMonitor monitor) {
-		List<RuntimeDefinition> serverDefinitions = new ArrayList<RuntimeDefinition>();
-		searchForRuntimes(serverDefinitions, path, monitor);
-		return serverDefinitions;
+		List<RuntimeDefinition> collector = new ArrayList<RuntimeDefinition>();
+		searchForRuntimes(collector, path, monitor);
+		return collector;
 	}
 	
-	private void searchForRuntimes(List<RuntimeDefinition> serverDefinitions, IPath path, 
+	private void searchForRuntimes(List<RuntimeDefinition> runtimeCollector, IPath path, 
 			IProgressMonitor monitor) {
 		File[] files = null;
 		if (path != null) {
@@ -63,7 +63,7 @@
 				if (monitor.isCanceled())
 					return;
 				if (files[i] != null && files[i].isDirectory())
-					searchDirectory(files[i], serverDefinitions, DEPTH, monitor);
+					searchDirectory(files[i], runtimeCollector, DEPTH, monitor);
 				monitor.worked(work);
 			}
 			monitor.worked(workLeft);
@@ -73,7 +73,7 @@
 		
 	}
 	
-	public void searchDirectory(File directory, List<RuntimeDefinition> serverDefinitions,
+	public void searchDirectory(File directory, List<RuntimeDefinition> runtimeCollector,
 			int depth, IProgressMonitor monitor) {
 		if (depth == 0 || monitor.isCanceled() || directory == null || !directory.isDirectory()) {
 			return;
@@ -89,9 +89,9 @@
 			if (!detector.isEnabled()) {
 				continue;
 			}
-			RuntimeDefinition serverDefinition = detector.getServerDefinition(directory, monitor);
-			if (serverDefinition != null) {
-				serverDefinitions.add(serverDefinition);
+			RuntimeDefinition runtimeDefinition = detector.getServerDefinition(directory, monitor);
+			if (runtimeDefinition != null) {
+				runtimeCollector.add(runtimeDefinition);
 				return;
 			}
 		}
@@ -106,7 +106,7 @@
 			for (int i = 0; i < size; i++) {
 				if (monitor.isCanceled())
 					return;
-				searchDirectory(files[i], serverDefinitions, depth - 1, monitor);
+				searchDirectory(files[i], runtimeCollector, depth - 1, monitor);
 			}
 		}
 	}
Index: runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/RuntimeCoreActivator.java
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/RuntimeCoreActivator.java	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/RuntimeCoreActivator.java	(working copy)
@@ -11,6 +11,8 @@
 package org.jboss.tools.runtime.core;
 
 import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.List;
 import java.util.Set;
 import java.util.StringTokenizer;
@@ -29,7 +31,9 @@
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 import org.jboss.tools.runtime.core.model.IRuntimeDetector;
 import org.jboss.tools.runtime.core.model.InvalidRuntimeDetector;
+import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
 import org.osgi.service.prefs.BackingStoreException;
 
 /**
@@ -41,34 +45,29 @@
 
 	// The plug-in ID
 	public static final String PLUGIN_ID = "org.jboss.tools.runtime.core"; //$NON-NLS-1$
-	
 	private static final String ESB_DETECTOR_ID = "org.jboss.tools.runtime.handlers.EsbHandler"; //$NON-NLS-1$
-
 	private static final String RUNTIME_DETECTOR_EXTENSION_ID = "org.jboss.tools.runtime.core.runtimeDetectors";
 	
+	// Extension point property keys
 	private static final String NAME = "name";
-
 	private static final String PREFERENCE_ID = "preferenceId";
-	
 	private static final String ID = "id";
-	
 	private static final String ENABLED = "enabled";
+	private static final String PRIORITY = "priority";
 
+	// Preference key
 	private static final String ENABLED_DETECTORS = "enabledDetectors";
 
-	private static final String PRIORITY = "priority";
-
-	private static Set<IRuntimeDetector> declaredRuntimeDetectors;
-	
-	private static Set<IRuntimeDetector> runtimeDetectors;
-	
-	private static IRuntimeDetector esbDetector;
-	
 	// The shared instance
 	private static RuntimeCoreActivator plugin;
 
-	private static IEclipsePreferences prefs;
+	// Member variables
+	private Set<IRuntimeDetector> declaredRuntimeDetectors;
+	private Set<IRuntimeDetector> runtimeDetectors;
+	private IRuntimeDetector esbDetector;
 	
+	private IEclipsePreferences prefs;
+	
 	/**
 	 * The constructor
 	 */
@@ -102,73 +101,102 @@
 		return plugin;
 	}
 
+	public static IRuntimeDetector getEsbDetector() {
+		return getOrLoadDefaultInstance().getEsbDetector2();
+	}
+
+	private static RuntimeCoreActivator getOrLoadDefaultInstance() {
+		if( getDefault() == null ) {
+			// load bundle
+			Bundle bundle = Platform.getBundle(PLUGIN_ID);
+			try {
+				bundle.start();
+			} catch(BundleException be) {
+				be.printStackTrace();
+			}
+		}
+		return getDefault();
+	}
+	// Convenience method
 	public static Set<IRuntimeDetector> getDeclaredRuntimeDetectors() {
-		if (declaredRuntimeDetectors == null) {
-			declaredRuntimeDetectors = new TreeSet<IRuntimeDetector>();
-			IExtensionRegistry registry = Platform.getExtensionRegistry();
-			IExtensionPoint extensionPoint = registry
-					.getExtensionPoint(RUNTIME_DETECTOR_EXTENSION_ID);
-			IExtension[] extensions = extensionPoint.getExtensions();
-			for (int i = 0; i < extensions.length; i++) {
-				IExtension extension = extensions[i];
-				IConfigurationElement[] configurationElements = extension
-						.getConfigurationElements();
-				for (int j = 0; j < configurationElements.length; j++) {
-					IConfigurationElement configurationElement = configurationElements[j];
-					IRuntimeDetector detector;
-					try {
-						detector = (IRuntimeDetector) configurationElement.createExecutableExtension("class");
-					} catch (CoreException e) {
-						log(e);
-						detector = new InvalidRuntimeDetector();
-						detector.setValid(false);
-					}
-					String name = configurationElement.getAttribute(NAME);
-					String preferenceId = configurationElement.getAttribute(PREFERENCE_ID);
-					String id = configurationElement.getAttribute(ID);
-					detector.setName(name);
-					detector.setPreferenceId(preferenceId);
-					detector.setId(id);
-					String enabled = configurationElement.getAttribute(ENABLED);
-					if (enabled == null || "true".equals(enabled)) {
-						detector.setEnabled(true);
-					} else {
-						detector.setEnabled(false);
-					}
-					String priorityString = configurationElement
-							.getAttribute(PRIORITY);
-					int priority;
-					try {
-						priority = Integer.parseInt(priorityString);
-					} catch (Exception ex) {
-						priority = Integer.MAX_VALUE;
-					}
-					detector.setPriority(priority);
-					declaredRuntimeDetectors.add(detector);
-				}
-			}	
+		return getOrLoadDefaultInstance().getDeclaredRuntimeDetectors2();
+	}
+	
+	// Load all declared runtime detectors
+	public Set<IRuntimeDetector> getDeclaredRuntimeDetectors2() {
+		if( declaredRuntimeDetectors == null) {
+			declaredRuntimeDetectors = loadDeclaredRuntimeDetectors();
 		}
 		return declaredRuntimeDetectors;
 	}
 	
-	public static void log(Throwable e) {
-		IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, e
-				.getLocalizedMessage(), e);
-		getDefault().getLog().log(status);
-	}
 	
-	public static void log(Throwable e, String message) {
-		IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, message, e);
-		getDefault().getLog().log(status);
+	// This method will do a full load and actually instantiate the classes
+	public Set<IRuntimeDetector> loadDeclaredRuntimeDetectors() {
+		Set<IRuntimeDetector> declared = new TreeSet<IRuntimeDetector>();
+		IExtensionRegistry registry = Platform.getExtensionRegistry();
+		IExtensionPoint extensionPoint = registry
+				.getExtensionPoint(RUNTIME_DETECTOR_EXTENSION_ID);
+		IExtension[] extensions = extensionPoint.getExtensions();
+		for (int i = 0; i < extensions.length; i++) {
+			IExtension extension = extensions[i];
+			IConfigurationElement[] configurationElements = extension
+					.getConfigurationElements();
+			for (int j = 0; j < configurationElements.length; j++) {
+				IRuntimeDetector dec = loadOneDeclaredRuntimeDetector(configurationElements[j]); 
+				if( !declared.contains(dec)) {
+					declared.add(dec);
+				}
+			}
+		}
+		return declared;
 	}
 
+	// This method will load one detector from a configuration element
+	private IRuntimeDetector loadOneDeclaredRuntimeDetector(IConfigurationElement configurationElement) {
+		IRuntimeDetector detector;
+		try {
+			detector = (IRuntimeDetector) configurationElement.createExecutableExtension("class");
+		} catch (CoreException e) {
+			log(e);
+			detector = new InvalidRuntimeDetector();
+			detector.setValid(false);
+		}
+		String name = configurationElement.getAttribute(NAME);
+		String preferenceId = configurationElement.getAttribute(PREFERENCE_ID);
+		String id = configurationElement.getAttribute(ID);
+		detector.setName(name);
+		detector.setPreferenceId(preferenceId);
+		detector.setId(id);
+		String enabled = configurationElement.getAttribute(ENABLED);
+		if (enabled == null || new Boolean(enabled).booleanValue()) {
+			detector.setEnabled(true);
+		} else {
+			detector.setEnabled(false);
+		}
+		String priorityString = configurationElement
+				.getAttribute(PRIORITY);
+		int priority;
+		try {
+			priority = Integer.parseInt(priorityString);
+		} catch (Exception ex) {
+			priority = Integer.MAX_VALUE;
+		}
+		detector.setPriority(priority);
+		return detector;
+	}
+	
 	public static Set<IRuntimeDetector> getRuntimeDetectors() {
+		return getOrLoadDefaultInstance().getRuntimeDetectors2();
+	}
+	
+	public Set<IRuntimeDetector> getRuntimeDetectors2() {
 		if (runtimeDetectors == null) {
-			runtimeDetectors = getDeclaredRuntimeDetectors();
+			Set<IRuntimeDetector> tmp = getDeclaredRuntimeDetectors();
 			String enabledDetectors = getPreferences().get(ENABLED_DETECTORS,
 					null);
 			if (enabledDetectors == null) {
-				saveEnabledDetectors(runtimeDetectors);
+				saveEnabledDetectors(tmp);
 			} else {
 				StringTokenizer tokenizer = new StringTokenizer(
 						enabledDetectors, ",");
@@ -179,17 +207,18 @@
 						enabled.add(token);
 					}
 				}
-				for (IRuntimeDetector detector : runtimeDetectors) {
+				for (IRuntimeDetector detector : tmp) {
 					detector.setEnabled(enabled.contains(detector.getId()));
 				}
 			}
+			runtimeDetectors = tmp;
 		}
 		return runtimeDetectors;
 	}
 
-	public static void saveEnabledDetectors(Set<IRuntimeDetector> detectors) {
+	public static void saveEnabledDetectors(Set<IRuntimeDetector> allDetectors) {
 		StringBuilder builder = new StringBuilder();
-		for (IRuntimeDetector detector:detectors) {
+		for (IRuntimeDetector detector:allDetectors) {
 			if (detector.isEnabled()) {
 				builder.append(detector.getId());
 				builder.append(",");
@@ -209,13 +238,17 @@
 	}
 	
 	private static IEclipsePreferences getPreferences() {
+		return getOrLoadDefaultInstance().getPreferences2();
+	}
+	
+	private IEclipsePreferences getPreferences2() {
 		if (prefs == null) {
 			prefs = ConfigurationScope.INSTANCE.getNode(PLUGIN_ID);
 		}
 		return prefs;
 	}
-
-	public static IRuntimeDetector getEsbDetector() {
+	
+	public IRuntimeDetector getEsbDetector2() {
 		if (esbDetector == null) {
 			for (IRuntimeDetector detector:getDeclaredRuntimeDetectors()) {
 				if (ESB_DETECTOR_ID.equals(detector.getId())) {
@@ -225,5 +258,15 @@
 		}
 		return esbDetector;
 	}
+	public static void log(Throwable e) {
+		IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, e
+				.getLocalizedMessage(), e);
+		getDefault().getLog().log(status);
+	}
 	
+	public static void log(Throwable e, String message) {
+		IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, message, e);
+		getDefault().getLog().log(status);
+	}
+	
 }
Index: runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/AbstractRuntimeDetector.java
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/AbstractRuntimeDetector.java	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/AbstractRuntimeDetector.java	(working copy)
@@ -116,17 +116,19 @@
 
 	@Override
 	public int compareTo(IRuntimeDetector o) {
-		if (o == null) {
-			return 1;
-		}
+		if( this.equals(o))
+			return 0;
 		int p1 = this.getPriority();
 		int p2 = o.getPriority();
-		return p1 - p2;
+		int dif = p1 - p2; 
+		if( dif != 0 )
+			return dif;
+		return getId().compareTo(o.getId());
 	}
 
 	@Override
 	public void computeIncludedServerDefinition(
-			RuntimeDefinition serverDefinition) {
+			RuntimeDefinition runtimeDefinition) {
 		
 	}
 	
@@ -139,9 +141,9 @@
 	}
 	
 	@Override
-	public String getVersion(RuntimeDefinition serverDefinition) {
-		if (serverDefinition != null) {
-			return serverDefinition.getVersion();
+	public String getVersion(RuntimeDefinition runtimeDefinition) {
+		if (runtimeDefinition != null) {
+			return runtimeDefinition.getVersion();
 		}
 		return null;
 	}
Index: runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/IRuntimeDetector.java
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/IRuntimeDetector.java	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/IRuntimeDetector.java	(working copy)
@@ -20,8 +20,33 @@
  *
  */
 public interface IRuntimeDetector extends Comparable<IRuntimeDetector> {
-	void initializeRuntimes(List<RuntimeDefinition> serverDefinitions);
+	/**
+	 * The framework is asking you to create or otherwise initialize 
+	 * the runtimes provided in this list. 
+	 * 
+	 * @param runtimeDefinitions
+	 */
+	void initializeRuntimes(List<RuntimeDefinition> runtimeDefinitions);
 
+	/**
+	 * The framework is asking this detector to search the given folder
+	 * and return a runtime definition, or null if this folder
+	 * is not a recognized runtime
+	 * 
+	 * @param root
+	 * @param monitor
+	 * @return
+	 */
+	RuntimeDefinition getServerDefinition(File root, IProgressMonitor monitor);
+	
+	/**
+	 * The framework is asking you to check nested folders for 
+	 * additional runtimes that may be provided.
+	 * 
+	 * @param runtimeDefinition
+	 */
+	void computeIncludedServerDefinition(RuntimeDefinition runtimeDefinition);
+
 	void setName(String name);
 
 	void setPreferenceId(String preferenceId);
@@ -38,19 +63,17 @@
 	
 	boolean isEnabled();
 	
-	RuntimeDefinition getServerDefinition(File root, IProgressMonitor monitor);
-	
+
 	boolean exists(RuntimeDefinition serverDefinition);
 	
 	int getPriority();
 	
 	void setPriority(int priority);
 	
-	void computeIncludedServerDefinition(RuntimeDefinition serverDefinition);
 	
 	boolean isValid();
 	
 	void setValid(boolean valid);
 	
-	String getVersion(RuntimeDefinition serverDefinition);
+	String getVersion(RuntimeDefinition runtimeDefinition);
 }
Index: runtime/plugins/org.jboss.tools.runtime.as.detector/about.html
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.as.detector/about.html	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.as.detector/about.html	(working copy)
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
-<title>JBoss Runtime Detection</title>
-<style type="text/css" media="screen">
-<!--
-  body {
-    font-family: Sans-serif, Arial, Helvetica;
-  }
-
--->
-</style>
-</head>
-<body>
-<h1>JBoss Runtime AS Detector</h1>
-
-<p>
-This plugin is part of the JBoss Tools developed by the <a href="http://www.jboss.com">JBoss Inc.</a>
-</p>
-
-<p>Information about this plugin is available at <a href="http://www.jboss.org/tools">JBoss Tools project page</a></p>
-
-<p>
-This software is distributed under the terms of the Eclipse Public License - v 1.0
-(see <a href="www.eclipse.org/legal/epl-v10.html">Eclipse Public License - Version 1.0</a>).
-</p>
-</body>
-</html>
\ No newline at end of file
Index: runtime/plugins/org.jboss.tools.runtime.as.detector/jboss_about.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: runtime/plugins/org.jboss.tools.runtime.as.detector/plugin.xml
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.as.detector/plugin.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.as.detector/plugin.xml	(working copy)
@@ -1,15 +0,0 @@
-<?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.JBossASHandler"
-    		name="JBoss AS"
-       		class="org.jboss.tools.runtime.handlers.JBossASHandler"
-       		preferenceId="org.eclipse.wst.server.ui.runtime.preferencePage"
-       		priority="100"/>
-	</extension>
-	
-</plugin>
Index: runtime/plugins/org.jboss.tools.runtime.as.detector/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.as.detector/.settings/org.eclipse.jdt.core.prefs	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.as.detector/.settings/org.eclipse.jdt.core.prefs	(working copy)
@@ -1,8 +0,0 @@
-#Mon May 30 12:32:14 CEST 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
Index: runtime/plugins/org.jboss.tools.runtime.as.detector/.classpath
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.as.detector/.classpath	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.as.detector/.classpath	(working copy)
@@ -1,7 +0,0 @@
-<?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>
Index: runtime/plugins/org.jboss.tools.runtime.as.detector/META-INF/MANIFEST.MF
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.as.detector/META-INF/MANIFEST.MF	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.as.detector/META-INF/MANIFEST.MF	(working copy)
@@ -1,25 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %BundleName
-Bundle-SymbolicName: org.jboss.tools.runtime.as.detector;singleton:=true
-Bundle-Version: 1.4.0.qualifier
-Bundle-Activator: org.jboss.tools.runtime.as.detector.RuntimeAsActivator
-Require-Bundle: org.eclipse.ui;bundle-version="3.7.0",
- org.eclipse.core.runtime;bundle-version="3.7.0",
- org.eclipse.core.resources;bundle-version="3.7.0",
- org.eclipse.wst.server.core;bundle-version="1.1.302",
- org.eclipse.ui.navigator;bundle-version="3.5.100",
- org.eclipse.debug.core;bundle-version="3.7.0",
- org.eclipse.jdt.launching;bundle-version="3.6.0",
- org.eclipse.ui.workbench;bundle-version="3.7.0",
- org.eclipse.datatools.connectivity;bundle-version="1.2.2";visibility:=reexport,
- org.eclipse.datatools.connectivity.db.generic;bundle-version="1.0.1",
- org.jboss.tools.common,
- org.jboss.tools.runtime.core,
- org.jboss.ide.eclipse.as.core
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Bundle-Vendor: %BundleVendor
-Bundle-Localization: plugin
-Export-Package: org.jboss.tools.runtime.as.detector,
- org.jboss.tools.runtime.handlers
Index: runtime/plugins/org.jboss.tools.runtime.as.detector/.project
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.as.detector/.project	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.as.detector/.project	(working copy)
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.jboss.tools.runtime.as.detector</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.pde.ManifestBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.pde.SchemaBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.pde.PluginNature</nature>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
Index: runtime/plugins/org.jboss.tools.runtime.as.detector/about.properties
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.as.detector/about.properties	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.as.detector/about.properties	(working copy)
@@ -1,2 +0,0 @@
-blurb=JBoss Runtime AS Detector\n\nVersion\: {featureVersion}\n\n(c) Copyright (c) Red Hat, Inc., contributors and others 2004 - 2012.  All rights reserved.\nVisit http\://jboss.org/tools
-
Index: runtime/plugins/org.jboss.tools.runtime.as.detector/about.mappings
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.as.detector/about.mappings	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.as.detector/about.mappings	(working copy)
@@ -1,5 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
Index: runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/handlers/DriverUtility.java
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/handlers/DriverUtility.java	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/handlers/DriverUtility.java	(working copy)
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- *     Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.runtime.handlers;
-
-import java.io.File;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Properties;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.datatools.connectivity.ConnectionProfileConstants;
-import org.eclipse.datatools.connectivity.ConnectionProfileException;
-import org.eclipse.datatools.connectivity.ProfileManager;
-import org.eclipse.datatools.connectivity.db.generic.IDBConnectionProfileConstants;
-import org.eclipse.datatools.connectivity.db.generic.IDBDriverDefinitionConstants;
-import org.eclipse.datatools.connectivity.drivers.DriverInstance;
-import org.eclipse.datatools.connectivity.drivers.DriverManager;
-import org.eclipse.datatools.connectivity.drivers.IDriverMgmtConstants;
-import org.eclipse.datatools.connectivity.drivers.IPropertySet;
-import org.eclipse.datatools.connectivity.drivers.PropertySetImpl;
-import org.eclipse.datatools.connectivity.drivers.models.TemplateDescriptor;
-import org.eclipse.wst.server.core.IServerType;
-import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
-import org.jboss.tools.runtime.as.detector.IJBossRuntimePluginConstants;
-import org.jboss.tools.runtime.as.detector.Messages;
-import org.jboss.tools.runtime.as.detector.RuntimeAsActivator;
-
-public class DriverUtility implements IJBossRuntimePluginConstants {
-	public static final HashMap<String,String> SERVER_DRIVER_LOCATION = new HashMap<String, String>();
-	static {
-		SERVER_DRIVER_LOCATION.put(IJBossToolingConstants.SERVER_AS_32, HSQLDB_DRIVER_3X_4X_LOCATION);
-		SERVER_DRIVER_LOCATION.put(IJBossToolingConstants.SERVER_AS_40, HSQLDB_DRIVER_3X_4X_LOCATION);
-		SERVER_DRIVER_LOCATION.put(IJBossToolingConstants.SERVER_AS_42, HSQLDB_DRIVER_3X_4X_LOCATION);
-		SERVER_DRIVER_LOCATION.put(IJBossToolingConstants.SERVER_AS_50, HSQLDB_DRIVER_5X_LOCATION);
-		SERVER_DRIVER_LOCATION.put(IJBossToolingConstants.SERVER_AS_51, HSQLDB_DRIVER_5X_LOCATION);
-		SERVER_DRIVER_LOCATION.put(IJBossToolingConstants.SERVER_AS_60, HSQLDB_DRIVER_5X_LOCATION);
-		SERVER_DRIVER_LOCATION.put(IJBossToolingConstants.SERVER_EAP_43, HSQLDB_DRIVER_3X_4X_LOCATION);
-		SERVER_DRIVER_LOCATION.put(IJBossToolingConstants.SERVER_EAP_50, HSQLDB_DRIVER_5X_LOCATION);
-	}
-
-	/**
-	 * Creates HSQL DB Driver
-	 * @param jbossASLocation location of JBoss AS
-	 * @param index 
-	 * @throws ConnectionProfileException
-	 * @return driver instance
-	 */
-	public void createDriver(String jbossASLocation, IServerType serverType) throws ConnectionProfileException {
-		if(ProfileManager.getInstance().getProfileByName(DEFAULT_DS) != null) {
-			// Don't create the driver a few times
-			return;
-		}
-		String driverPath;
-		try {
-			driverPath = getDriverPath(jbossASLocation, serverType);
-		} catch (IOException e) {
-			RuntimeAsActivator.getDefault().getLog().log(new Status(IStatus.ERROR,
-					RuntimeAsActivator.PLUGIN_ID, Messages.JBossRuntimeStartup_Cannott_create_new_HSQL_DB_Driver, e));
-			return;
-		}
-		if (driverPath == null) {
-			RuntimeAsActivator.getDefault().getLog().log(new Status(IStatus.ERROR,
-					RuntimeAsActivator.PLUGIN_ID, Messages.JBossRuntimeStartup_Cannot_create_new_DB_Driver));
-		}
-
-		DriverInstance driver = getDriver(serverType);
-		if (driver == null) {
-			TemplateDescriptor descr = getDriverTemplateDescriptor(serverType);
-			IPropertySet instance = new PropertySetImpl(getDriverName(serverType), getDriverDefinitionId(serverType));
-			instance.setName(getDriverName(serverType));
-			instance.setID(getDriverDefinitionId(serverType));
-			Properties props = new Properties();
-
-			IConfigurationElement[] template = descr.getProperties();
-			for (int i = 0; i < template.length; i++) {
-				IConfigurationElement prop = template[i];
-				String id = prop.getAttribute("id"); //$NON-NLS-1$
-
-				String value = prop.getAttribute("value"); //$NON-NLS-1$
-				props.setProperty(id, value == null ? "" : value); //$NON-NLS-1$
-			}
-			props.setProperty(DTP_DB_URL_PROPERTY_ID, getDriverUrl(serverType)); //$NON-NLS-1$
-			props.setProperty(IDriverMgmtConstants.PROP_DEFN_TYPE, descr.getId());
-			props.setProperty(IDriverMgmtConstants.PROP_DEFN_JARLIST, driverPath);
-			if( isAS7StyleServer(serverType)) {
-				props.setProperty(IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID, "org.h2.Driver");
-				props.setProperty(IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID, "H2 driver");
-				props.setProperty(IDBDriverDefinitionConstants.URL_PROP_ID, "jdbc:h2:mem");
-				props.setProperty(IDBDriverDefinitionConstants.USERNAME_PROP_ID, "sa");
-			}
-			
-			instance.setBaseProperties(props);
-			DriverManager.getInstance().removeDriverInstance(instance.getID());
-			System.gc();
-			DriverManager.getInstance().addDriverInstance(instance);
-		}
-
-		driver = DriverManager.getInstance().getDriverInstanceByName(getDriverName(serverType));
-		if (driver != null && ProfileManager.getInstance().getProfileByName(DEFAULT_DS) == null) { //$NON-NLS-1$
-			// create profile
-			Properties props = new Properties();
-			props.setProperty(ConnectionProfileConstants.PROP_DRIVER_DEFINITION_ID, 
-					getDriverDefinitionId(serverType));
-			props.setProperty(IDBConnectionProfileConstants.CONNECTION_PROPERTIES_PROP_ID, ""); //$NON-NLS-1$
-			props.setProperty(IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID));
-			props.setProperty(IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID,	driver.getProperty(IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID));
-			props.setProperty(IDBDriverDefinitionConstants.DATABASE_VERSION_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.DATABASE_VERSION_PROP_ID));
-			props.setProperty(IDBDriverDefinitionConstants.DATABASE_NAME_PROP_ID, "Default"); //$NON-NLS-1$
-			props.setProperty(IDBDriverDefinitionConstants.PASSWORD_PROP_ID, ""); //$NON-NLS-1$
-			props.setProperty(IDBConnectionProfileConstants.SAVE_PASSWORD_PROP_ID, "false"); //$NON-NLS-1$
-			props.setProperty(IDBDriverDefinitionConstants.USERNAME_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.USERNAME_PROP_ID));
-			props.setProperty(IDBDriverDefinitionConstants.URL_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.URL_PROP_ID));
-
-			if( isAS7StyleServer(serverType)) {
-				ProfileManager.getInstance().createProfile(DEFAULT_DS,	Messages.JBossRuntimeStartup_The_JBoss_AS_H2_embedded_database, H2_PROFILE_ID, props, "", false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-			} else {
-				ProfileManager.getInstance().createProfile(DEFAULT_DS,	Messages.JBossRuntimeStartup_The_JBoss_AS_Hypersonic_embedded_database, HSQL_PROFILE_ID, props, "", false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-			}
-		}
-		
-	}
-
-	protected static String getDriverUrl(IServerType serverType) {
-		if( isAS7StyleServer(serverType)) {
-			return "jdbc:h2:mem";
-		} else {
-			return "jdbc:hsqldb:.";
-		}
-	}
-
-	private static String getDriverDefinitionId(IServerType serverType) {
-		if( isAS7StyleServer(serverType)) {
-			return H2_DRIVER_DEFINITION_ID;
-		} else {
-			return HSQL_DRIVER_DEFINITION_ID;
-		}
-	}
-
-	private static String getDriverName(IServerType serverType) {
-		if( isAS7StyleServer(serverType)) {
-			return H2_DRIVER_NAME;
-		} else {
-			return HSQL_DRIVER_NAME;
-		}
-	}
-
-	protected static TemplateDescriptor getDriverTemplateDescriptor(IServerType serverType) {
-		if( isAS7StyleServer(serverType)) {
-			return TemplateDescriptor.getDriverTemplateDescriptor(H2_DRIVER_TEMPLATE_ID);
-		} else {
-			return TemplateDescriptor.getDriverTemplateDescriptor(HSQL_DRIVER_TEMPLATE_ID);
-		}
-	}
-
-	protected static DriverInstance getDriver(IServerType serverType) {
-		if( isAS7StyleServer(serverType)) {
-			return DriverManager.getInstance().getDriverInstanceByName(H2_DRIVER_NAME);
-		}
-		return DriverManager.getInstance().getDriverInstanceByName(HSQL_DRIVER_NAME);
-	}
-
-	private static String getDriverPath(String jbossASLocation, IServerType serverType)
-			throws IOException {
-		String driverPath;
-		if (isAS7StyleServer(serverType)) {
-			File file = new File(jbossASLocation + "/modules/com/h2database/h2/main").getCanonicalFile();
-			File[] fileList = file.listFiles(new FilenameFilter() {
-				
-				@Override
-				public boolean accept(File dir, String name) {
-					if (name.startsWith("h2") && name.endsWith(".jar")) {
-						return true;
-					}
-					return false;
-				}
-			});
-			if (fileList != null && fileList.length > 0) {
-				return fileList[0].getCanonicalPath();
-			}
-			return null;
-		} else {
-			String loc = SERVER_DRIVER_LOCATION.get(serverType.getId());
-			driverPath = new File(jbossASLocation + loc).getCanonicalPath(); //$NON-NLS-1$
-		}
-		return driverPath;
-	}
-
-	private static boolean isAS7StyleServer(IServerType type) {
-		if( type != null ) {
-			String id = type.getId();
-			return IJBossToolingConstants.SERVER_AS_70.equals(id) || 
-					IJBossToolingConstants.SERVER_AS_71.equals(id) ||
-					IJBossToolingConstants.SERVER_EAP_60.equals(id);
-		}
-		return false;
-	}
-
-}
Index: runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/handlers/JBossASHandler.java
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/handlers/JBossASHandler.java	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/handlers/JBossASHandler.java	(working copy)
@@ -1,414 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- *     Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.runtime.handlers;
-
-import java.io.File;
-import java.io.FileFilter;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Properties;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.datatools.connectivity.ConnectionProfileConstants;
-import org.eclipse.datatools.connectivity.ConnectionProfileException;
-import org.eclipse.datatools.connectivity.ProfileManager;
-import org.eclipse.datatools.connectivity.db.generic.IDBConnectionProfileConstants;
-import org.eclipse.datatools.connectivity.db.generic.IDBDriverDefinitionConstants;
-import org.eclipse.datatools.connectivity.drivers.DriverInstance;
-import org.eclipse.datatools.connectivity.drivers.DriverManager;
-import org.eclipse.datatools.connectivity.drivers.IDriverMgmtConstants;
-import org.eclipse.datatools.connectivity.drivers.IPropertySet;
-import org.eclipse.datatools.connectivity.drivers.PropertySetImpl;
-import org.eclipse.datatools.connectivity.drivers.models.TemplateDescriptor;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IRuntimeType;
-import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerType;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.ServerUtil;
-import org.eclipse.wst.server.core.model.ServerDelegate;
-import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.server.bean.JBossServerType;
-import org.jboss.ide.eclipse.as.core.server.bean.ServerBean;
-import org.jboss.ide.eclipse.as.core.server.bean.ServerBeanLoader;
-import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
-import org.jboss.tools.runtime.as.detector.IJBossRuntimePluginConstants;
-import org.jboss.tools.runtime.as.detector.Messages;
-import org.jboss.tools.runtime.as.detector.RuntimeAsActivator;
-import org.jboss.tools.runtime.core.JBossRuntimeLocator;
-import org.jboss.tools.runtime.core.RuntimeCoreActivator;
-import org.jboss.tools.runtime.core.model.AbstractRuntimeDetector;
-import org.jboss.tools.runtime.core.model.IRuntimeDetector;
-import org.jboss.tools.runtime.core.model.RuntimeDefinition;
-import org.osgi.framework.Bundle;
-
-public class JBossASHandler extends AbstractRuntimeDetector implements IJBossRuntimePluginConstants {
-	
-	private static String[] hasIncludedRuntimes = new String[] {SOA_P, EAP, EPP, EWP, SOA_P_STD};
-	private static final String DROOLS = "DROOLS"; // NON-NLS-1$
-	private static final String ESB = "ESB"; //$NON-NLS-1$
-	
-	// This constants are made to avoid dependency with org.jboss.ide.eclipse.as.core plugin
-	public static final String RUNTIME_TYPES[] = IJBossToolingConstants.ALL_JBOSS_RUNTIMES;
-	public static final String SERVER_TYPES[] = IJBossToolingConstants.ALL_JBOSS_SERVERS;
-	
-	public static final HashMap<String,String> SERVER_DEFAULT_NAME = new HashMap<String, String>();
-	static {
-		SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_AS_32, Messages.JBossRuntimeStartup_JBoss_Application_Server_3_2);
-		SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_AS_40, Messages.JBossRuntimeStartup_JBoss_Application_Server_4_0);
-		SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_AS_42, Messages.JBossRuntimeStartup_JBoss_Application_Server_4_2);
-		SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_AS_50, Messages.JBossRuntimeStartup_JBoss_Application_Server_5_0);
-		SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_AS_51, Messages.JBossRuntimeStartup_JBoss_Application_Server_5_1);
-		SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_AS_60, Messages.JBossRuntimeStartup_JBoss_Application_Server_6_0);
-		SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_EAP_43, Messages.JBossRuntimeStartup_JBoss_EAP_Server_4_3);
-		SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_EAP_50, Messages.JBossRuntimeStartup_JBoss_EAP_Server_5_0);
-		SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_AS_70, Messages.JBossRuntimeStartup_JBoss_Application_Server_7_0);
-		SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_AS_71, Messages.JBossRuntimeStartup_JBoss_Application_Server_7_1);
-		SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_EAP_60, Messages.JBossRuntimeStartup_JBoss_EAP_Server_6_0);
-	}
-
-	public void initializeRuntimes(List<RuntimeDefinition> serverDefinitions) {
-		createJBossServerFromDefinitions(serverDefinitions);
-	}
-		
-	private static File getLocation(RuntimeDefinition serverDefinition) {
-		String type = serverDefinition.getType();
-		String version = serverDefinition.getVersion();
-		if (EAP.equals(type) && version != null && version.startsWith("6") ) {
-			return serverDefinition.getLocation();
-		}
-		if (SOA_P.equals(type) || EAP.equals(type) || EPP.equals(type)) {
-			return new File(serverDefinition.getLocation(), "jboss-as");
-		}
-		if (SOA_P_STD.equals(type)) {
-			return new File(serverDefinition.getLocation(),"jboss-esb"); //$NON-NLS-1$					
-		}
-		if(EWP.equals(type)) {
-				return new File(serverDefinition.getLocation(),"jboss-as-web"); //$NON-NLS-1$
-		}
-		if (AS.equals(type) || EAP_STD.equals(type)) {
-			return serverDefinition.getLocation();
-		}
-		return null;
-	}
-	
-	public static void createJBossServerFromDefinitions(List<RuntimeDefinition> serverDefinitions) {
-		for (RuntimeDefinition serverDefinition:serverDefinitions) {
-			if (serverDefinition.isEnabled()) {
-				File asLocation = getLocation(serverDefinition);
-				if (asLocation == null || !asLocation.isDirectory()) {
-					continue;
-				}
-				String type = serverDefinition.getType();
-				if (SOA_P.equals(type) || EAP.equals(type) || EPP.equals(type)
-						|| SOA_P_STD.equals(type) || EWP.equals(type)
-						|| EAP_STD.equals(type) || AS.equals(type)) {
-					String typeId = new ServerBeanLoader(asLocation).getServerAdapterId();
-					String name = serverDefinition.getName();
-					String runtimeName = name + " " + RUNTIME; //$NON-NLS-1$
-					createJBossServer(asLocation, typeId, name, runtimeName);
-				}
-			}
-			createJBossServerFromDefinitions(serverDefinition.getIncludedServerDefinitions());
-		}	
-	}
-
-	private static boolean serverExistsForPath(IPath locPath) {
-		IServer[] servers = ServerCore.getServers();
-		for (int i = 0; i < servers.length; i++) {
-			IRuntime runtime = servers[i].getRuntime();
-			if(runtime != null && runtime.getLocation() != null && runtime.getLocation().equals(locPath)) {
-				return true;
-			}
-		}
-		return false;
-	}
-	
-	private static IRuntime findRuntimeForPath(IPath locPath) {
-		IRuntime[] runtimes = ServerCore.getRuntimes();
-		for (int i = 0; i < runtimes.length; i++) {
-			if (runtimes[i] == null || runtimes[i].getLocation() == null) {
-				continue;
-			}
-			if (runtimes[i].getLocation().equals(locPath)) {
-				return runtimes[i];
-			}
-		}
-		return null;
-	}
-	
-	private static void createJBossServer(File asLocation, String serverTypeId, String name, String runtimeName) {
-		if (asLocation == null || !asLocation.isDirectory() || serverTypeId == null)
-			return;
-		IServerType serverType = ServerCore.findServerType(serverTypeId);
-		if( serverType == null )
-			return;
-		IRuntimeType rtType = serverType.getRuntimeType();
-		if( rtType == null )
-			return;
-		
-		IPath jbossAsLocationPath = new Path(asLocation.getAbsolutePath());
-		if( serverExistsForPath(jbossAsLocationPath))
-			return;
-		
-		IRuntime runtime = findRuntimeForPath(jbossAsLocationPath);
-		IProgressMonitor progressMonitor = new NullProgressMonitor();
-		try {
-			if (runtime == null) {
-				runtime = createRuntime(runtimeName, asLocation.getAbsolutePath(), progressMonitor, rtType);
-			}
-			if (runtime != null) {
-				createServer(progressMonitor, runtime, serverType, name);
-			}
-
-			new DriverUtility().createDriver(asLocation.getAbsolutePath(), serverType);
-		} catch (CoreException e) {
-			RuntimeAsActivator.log(e,Messages.JBossRuntimeStartup_Cannot_create_new_JBoss_Server);
-		} catch (ConnectionProfileException e) {
-			RuntimeAsActivator.log(e,Messages.JBossRuntimeStartup_Cannott_create_new_DTP_Connection_Profile);
-		}
-	}
-
-	/**
-	 * Creates new JBoss AS Runtime
-	 * @param jbossASLocation location of JBoss AS
-	 * @param progressMonitor
-	 * @return runtime working copy
-	 * @throws CoreException
-	 */
-	private static IRuntime createRuntime(String runtimeName, String jbossASLocation, 
-			IProgressMonitor progressMonitor, IRuntimeType rtType) throws CoreException {
-		IRuntimeWorkingCopy runtime = null;
-		IPath jbossAsLocationPath = new Path(jbossASLocation);
-		runtime = rtType.createRuntime(null, progressMonitor);
-		runtime.setLocation(jbossAsLocationPath);
-		if(runtimeName!=null) {
-			runtime.setName(runtimeName);				
-		}
-		return runtime.save(false, progressMonitor);
-	}
-
-	/**
-	 * Creates new JBoss Server
-	 * @param progressMonitor
-	 * @param runtime parent JBoss AS Runtime
-	 * @return server working copy
-	 * @throws CoreException
-	 */
-	private static void createServer(IProgressMonitor progressMonitor, IRuntime runtime,
-			IServerType serverType, String name) throws CoreException {
-		if (name == null)
-			name = SERVER_DEFAULT_NAME.get(serverType.getId());
-		if( !serverWithNameExists(name)) {
-			createServer2(runtime, serverType, name, LocalPublishMethod.LOCAL_PUBLISH_METHOD);
-		}
-	}
-	
-	private static boolean serverWithNameExists(String name) {
-		IServer[] servers = ServerCore.getServers();
-		for (IServer server:servers) {
-			if (name.equals(server.getName()) ) {
-				return true;
-			}
-		}
-		return false;
-	}
-	
-	public static IServer createServer2(IRuntime currentRuntime, IServerType serverType, String serverName, String mode) throws CoreException {
-		IServerWorkingCopy serverWC = serverType.createServer(null, null,
-				new NullProgressMonitor());
-		serverWC.setRuntime(currentRuntime);
-		serverWC.setName(serverName);
-		serverWC.setServerConfiguration(null);
-		serverWC.setAttribute(IDeployableServer.SERVER_MODE, mode); 
-		return serverWC.save(true, new NullProgressMonitor());
-	}
-
-	public RuntimeDefinition getServerDefinition(File root,
-			IProgressMonitor monitor) {
-		if (monitor.isCanceled() || root == null || !isEnabled()) {
-			return null;
-		}
-		ServerBeanLoader loader = new ServerBeanLoader(root);
-		ServerBean serverBean = loader.getServerBean();
-		
-		if (!JBossServerType.UNKNOWN.equals(serverBean.getType())) {
-			RuntimeDefinition serverDefinition = new RuntimeDefinition(serverBean.getName(), 
-					serverBean.getVersion(), serverBean.getType().getId(), new File(serverBean.getLocation()));
-			calculateIncludedServerDefinition(serverDefinition, monitor);
-			return serverDefinition;
-		}
-		return null;
-	}
-	
-	private void calculateIncludedServerDefinition(
-			RuntimeDefinition serverDefinition, IProgressMonitor monitor) {
-		if (serverDefinition == null || serverDefinition.getType() == null) {
-			return;
-		}
-		String type = serverDefinition.getType();
-		if (!hasIncludedRuntimes(type)) {
-			return;
-		}
-		serverDefinition.getIncludedServerDefinitions().clear();
-		List<RuntimeDefinition> serverDefinitions = serverDefinition
-				.getIncludedServerDefinitions();
-		JBossRuntimeLocator locator = new JBossRuntimeLocator();
-		final File location = getLocation(serverDefinition);
-		File[] directories = serverDefinition.getLocation().listFiles(
-				new FileFilter() {
-
-					@Override
-					public boolean accept(File file) {
-						if (!file.isDirectory() || file.equals(location)) {
-							return false;
-						}
-						return true;
-					}
-				});
-		boolean saved = isEnabled();
-		try {
-			setEnabled(false);
-			for (File directory : directories) {
-				List<RuntimeDefinition> definitions = new ArrayList<RuntimeDefinition>();
-				locator.searchDirectory(directory, definitions, 1, monitor);
-				for (RuntimeDefinition definition:definitions) {
-					definition.setParent(serverDefinition);
-				}
-				serverDefinitions.addAll(definitions);
-			}
-			if (SOA_P.equals(type) || SOA_P_STD.equals(type)) {
-				addDrools(serverDefinition);
-				addEsb(serverDefinition);
-			}
-		} finally {
-			setEnabled(saved);
-		}
-	}
-
-	private void addDrools(RuntimeDefinition serverDefinition) {
-		if (serverDefinition == null) {
-			return;
-		}
-		Bundle drools = Platform.getBundle("org.drools.eclipse");
-		Bundle droolsDetector = Platform
-				.getBundle("org.jboss.tools.runtime.drools.detector");
-		if (drools != null && droolsDetector != null) {
-			File droolsRoot = serverDefinition.getLocation();
-			if (droolsRoot.isDirectory()) {
-				String name = "Drools - " + serverDefinition.getName();
-				RuntimeDefinition droolsDefinition = new RuntimeDefinition(
-						name, serverDefinition.getVersion(), DROOLS,
-						droolsRoot);
-				droolsDefinition.setParent(serverDefinition);
-				serverDefinition.getIncludedServerDefinitions().add(
-						droolsDefinition);
-			}
-		}
-	}
-	
-	private void addEsb(RuntimeDefinition serverDefinition) {
-		if (serverDefinition == null) {
-			return;
-		}
-		Bundle esb = Platform.getBundle("org.jboss.tools.esb.project.core");
-		Bundle esbDetectorPlugin = Platform
-				.getBundle("org.jboss.tools.runtime.esb.detector");
-		if (esb != null && esbDetectorPlugin != null) {
-			String type = serverDefinition.getType();
-			File esbRoot;
-			if (SOA_P.equals(type)) {
-				esbRoot = serverDefinition.getLocation();
-			} else {
-				esbRoot = new File(serverDefinition.getLocation(), "jboss-esb"); //$NON-NLS-1$
-			}
-			if (esbRoot.isDirectory()) {
-				String name = "ESB - " + serverDefinition.getName();
-				String version="";
-				RuntimeDefinition esbDefinition = new RuntimeDefinition(
-						name, version, ESB,
-						esbRoot);
-				IRuntimeDetector esbDetector = RuntimeCoreActivator.getEsbDetector();
-				if (esbDetector != null) {
-					version = esbDetector.getVersion(esbDefinition);
-					esbDefinition.setVersion(version);
-				}
-				
-				esbDefinition.setParent(serverDefinition);
-				serverDefinition.getIncludedServerDefinitions().add(
-						esbDefinition);
-			}
-		}
-	}
-
-	private boolean hasIncludedRuntimes(String type) {
-		for (String t:hasIncludedRuntimes) {
-			if (t.equals(type)) {
-				return true;
-			}
-		}
-		return false;
-	}
-
-	@Override
-	public boolean exists(RuntimeDefinition serverDefinition) {
-		if (serverDefinition == null || serverDefinition.getLocation() == null) {
-			return false;
-		}
-		File location = getLocation(serverDefinition);
-		if (location == null || !location.isDirectory()) {
-			return false;
-		}
-		String path = location.getAbsolutePath();
-		if (path == null) {
-			return false;
-		}
-		IServer[] servers = ServerCore.getServers();
-		for (int i = 0; i < servers.length; i++) {
-			IRuntime runtime = servers[i].getRuntime();
-			if (runtime == null || runtime.getLocation() == null) {
-				continue;
-			}
-			if(path.equals(runtime.getLocation().toOSString())) {
-				return true;
-			}
-		}
-		return false;
-	}
-
-	@Override
-	public void computeIncludedServerDefinition(
-			RuntimeDefinition serverDefinition) {
-		if (serverDefinition == null) {
-			return;
-		}
-		String type = serverDefinition.getType();
-		if (AS.equals(type)) {
-			return;
-		}
-		calculateIncludedServerDefinition(serverDefinition, new NullProgressMonitor());
-	}
-	
-}
Index: runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/messages.properties
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/messages.properties	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/messages.properties	(working copy)
@@ -1,18 +0,0 @@
-JBossRuntimeStartup_Cannot_create_new_JBoss_Server=Can''t create new JBoss Server
-JBossRuntimeStartup_Cannott_create_new_DTP_Connection_Profile=Can''t create new DTP Connection Profile for JBoss AS Hypersonic embedded database
-JBossRuntimeStartup_Cannott_create_new_HSQL_DB_Driver=Can''t create new HSQL DB Driver.
-JBossRuntimeStartup_Cannot_create_new_DB_Driver=Can''t create new DB Driver.
-JBossRuntimeStartup_JBoss_Application_Server_3_2=JBoss Application Server 3.2
-JBossRuntimeStartup_JBoss_Application_Server_4_0=JBoss Application Server 4.0
-JBossRuntimeStartup_JBoss_Application_Server_4_2=JBoss Application Server 4.2
-JBossRuntimeStartup_JBoss_Application_Server_5_0=JBoss Application Server 5.0
-JBossRuntimeStartup_JBoss_Application_Server_5_1=JBoss Application Server 5.1
-JBossRuntimeStartup_JBoss_Application_Server_6_0=JBoss Application Server 6.0
-JBossRuntimeStartup_JBoss_Application_Server_7_0=JBoss Application Server 7.0
-JBossRuntimeStartup_JBoss_Application_Server_7_1=JBoss Application Server 7.1
-JBossRuntimeStartup_JBoss_EAP_Server_4_3=JBoss EAP Server 4.3
-JBossRuntimeStartup_JBoss_EAP_Server_5_0=JBoss EAP Server 5.0
-JBossRuntimeStartup_JBoss_EAP_Server_6_0=JBoss EAP Server 6.0
-JBossRuntimeStartup_Runtime=Runtime
-JBossRuntimeStartup_The_JBoss_AS_Hypersonic_embedded_database=The JBoss AS Hypersonic embedded database
-JBossRuntimeStartup_The_JBoss_AS_H2_embedded_database=The JBoss AS H2 embedded database
Index: runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/RuntimeAsActivator.java
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/RuntimeAsActivator.java	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/RuntimeAsActivator.java	(working copy)
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- *     Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.runtime.as.detector;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class RuntimeAsActivator extends AbstractUIPlugin {
-
-	// The plug-in ID
-	public static final String PLUGIN_ID = "org.jboss.tools.runtime.as.detector"; //$NON-NLS-1$
-
-	// The shared instance
-	private static RuntimeAsActivator plugin;
-	
-	/**
-	 * The constructor
-	 */
-	public RuntimeAsActivator() {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
-	 */
-	public void start(BundleContext context) throws Exception {
-		super.start(context);
-		plugin = this;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
-	 */
-	public void stop(BundleContext context) throws Exception {
-		plugin = null;
-		super.stop(context);
-	}
-
-	/**
-	 * Returns the shared instance
-	 *
-	 * @return the shared instance
-	 */
-	public static RuntimeAsActivator getDefault() {
-		return plugin;
-	}
-	
-	public static void log(Throwable e) {
-		IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, e
-				.getLocalizedMessage(), e);
-		getDefault().getLog().log(status);
-	}
-	
-	public static void log(Throwable e, String message) {
-		IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, message, e);
-		getDefault().getLog().log(status);
-	}
-
-
-}
Index: runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/Messages.java
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/Messages.java	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/Messages.java	(working copy)
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- *     Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.runtime.as.detector;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
-	private static final String BUNDLE_NAME = "org.jboss.tools.runtime.as.detector.messages"; //$NON-NLS-1$
-	public static String JBossRuntimeStartup_JBoss_Application_Server_6_0;
-	public static String JBossRuntimeStartup_JBoss_Application_Server_7_0;
-	public static String JBossRuntimeStartup_JBoss_Application_Server_7_1;
-	public static String JBossRuntimeStartup_Cannot_create_new_JBoss_Server;
-	public static String JBossRuntimeStartup_Cannott_create_new_DTP_Connection_Profile;
-	public static String JBossRuntimeStartup_Cannott_create_new_HSQL_DB_Driver;
-	public static String JBossRuntimeStartup_Cannot_create_new_DB_Driver;
-	public static String JBossRuntimeStartup_JBoss_Application_Server_3_2;
-	public static String JBossRuntimeStartup_JBoss_Application_Server_4_0;
-	public static String JBossRuntimeStartup_JBoss_Application_Server_4_2;
-	public static String JBossRuntimeStartup_JBoss_Application_Server_5_0;
-	public static String JBossRuntimeStartup_JBoss_Application_Server_5_1;
-	public static String JBossRuntimeStartup_JBoss_EAP_Server_4_3;
-	public static String JBossRuntimeStartup_JBoss_EAP_Server_5_0;
-	public static String JBossRuntimeStartup_JBoss_EAP_Server_6_0;
-	// NEW_SERVER_ADAPTER add logic for new adapter here
-	public static String JBossRuntimeStartup_Runtime;
-	public static String JBossRuntimeStartup_The_JBoss_AS_Hypersonic_embedded_database;
-	public static String JBossRuntimeStartup_The_JBoss_AS_H2_embedded_database;
-	static {
-		// initialize resource bundle
-		NLS.initializeMessages(BUNDLE_NAME, Messages.class);
-	}
-
-	private Messages() {
-	}
-}
Index: runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/IJBossRuntimePluginConstants.java
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/IJBossRuntimePluginConstants.java	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/IJBossRuntimePluginConstants.java	(working copy)
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- *     Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.runtime.as.detector;
-
-
-public interface IJBossRuntimePluginConstants {
-	public static final String DEFAULT_DS = "DefaultDS";
-	public static final String RUNTIME = Messages.JBossRuntimeStartup_Runtime;
-	public static final String EAP = "EAP"; //$NON-NLS-1$
-	public static final String EAP_STD = "EAP_STD"; //$NON-NLS-1$
-	public static final String SOA_P = "SOA-P"; //$NON-NLS-1$
-	public static final String SOA_P_STD = "SOA-P-STD"; //$NON-NLS-1$
-	public static final String EPP = "EPP"; //$NON-NLS-1$
-	public static final String EWP = "EWP"; //$NON-NLS-1$
-	public static final String AS = "AS"; //$NON-NLS-1$
-	public static final String JBOSS_EAP_HOME = "../../../../jboss-eap/jboss-as"; 	// JBoss AS home directory (relative to plugin)- <RHDS_HOME>/jbossas. //$NON-NLS-1$
-	public static final String JBOSS_EAP_HOME_CONFIGURATION = "../../jboss-eap/jboss-as"; 	// JBoss AS home directory (relative to plugin)- <RHDS_HOME>/jbossas. //$NON-NLS-1$
-	public static final String SERVERS_FILE_NAME = "application_platforms.properties"; //$NON-NLS-1$
-	public static final String SERVERS_FILE = "../../../../studio/" + SERVERS_FILE_NAME; //$NON-NLS-1$
-	public static final String SERVERS_FILE_CONFIGURATION = "../../studio/" + SERVERS_FILE_NAME; //$NON-NLS-1$
-	public static String RUNTIME_CONFIG_FORMAT_VERSION = "1.0"; //$NON-NLS-1$
-	
-	public static final String HSQLDB_DRIVER_JAR_NAME = "hsqldb.jar"; //$NON-NLS-1$
-	
-	public static final String HSQLDB_DRIVER_3X_4X_LOCATION = "/server/default/lib/" + HSQLDB_DRIVER_JAR_NAME; //$NON-NLS-1$
-	
-	public static final String HSQLDB_DRIVER_5X_LOCATION = "/common/lib/" + HSQLDB_DRIVER_JAR_NAME; //$NON-NLS-1$
-		
-	public static final String JBOSS_AS_HOST = "localhost"; //$NON-NLS-1$
-
-	public static final String JBOSS_AS_DEFAULT_CONFIGURATION_NAME = "default"; //$NON-NLS-1$
-
-	//public static final String FIRST_START_PREFERENCE_NAME = "FIRST_START";
-
-	public static final String HSQL_DRIVER_DEFINITION_ID 
-												= "DriverDefn.Hypersonic DB"; //$NON-NLS-1$
-
-	public static final String H2_DRIVER_DEFINITION_ID 
-												= "DriverDefn.H2 DB"; //$NON-NLS-1$
-
-	public static final String HSQL_DRIVER_NAME = "Hypersonic DB"; //$NON-NLS-1$
-	
-	public static final String H2_DRIVER_NAME = "H2 Database"; //$NON-NLS-1$
-
-	public static final String HSQL_DRIVER_TEMPLATE_ID 
-						= "org.eclipse.datatools.enablement.hsqldb.1_8.driver"; //$NON-NLS-1$
-	
-	public static final String H2_DRIVER_TEMPLATE_ID 
-					= "org.eclipse.datatools.connectivity.db.generic.genericDriverTemplate"; //$NON-NLS-1$
-
-	public static final String DTP_DB_URL_PROPERTY_ID 
-								= "org.eclipse.datatools.connectivity.db.URL"; //$NON-NLS-1$
-
-	public static final String HSQL_PROFILE_ID = "org.eclipse.datatools.enablement.hsqldb.connectionProfile";
-	
-	public static final String H2_PROFILE_ID = "org.eclipse.datatools.connectivity.db.generic.connectionProfile";
-
-}
Index: runtime/plugins/org.jboss.tools.runtime.as.detector/about.ini
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.as.detector/about.ini	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.as.detector/about.ini	(working copy)
@@ -1,27 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-# test
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=jboss_about.png
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
Index: runtime/plugins/org.jboss.tools.runtime.as.detector/plugin.properties
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.as.detector/plugin.properties	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.as.detector/plugin.properties	(working copy)
@@ -1,3 +0,0 @@
-#Properties file for org.jboss.tools.runtime
-BundleVendor = JBoss by Red Hat
-BundleName = JBoss Runtime AS Detector
Index: runtime/plugins/org.jboss.tools.runtime.as.detector/build.properties
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.as.detector/build.properties	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.as.detector/build.properties	(working copy)
@@ -1,13 +0,0 @@
-source.. = src/
-output.. = bin/
-src.includes = *
-src.excludes = src
-bin.includes = META-INF/,\
-               .,\
-               plugin.xml,\
-               plugin.properties,\
-               about.html,\
-               about.ini,\
-               about.mappings,\
-               about.properties,\
-               jboss_about.png
Index: runtime/plugins/org.jboss.tools.runtime.as.detector/pom.xml
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.as.detector/pom.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.as.detector/pom.xml	(working copy)
@@ -1,14 +0,0 @@
-<?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</groupId>
-		<artifactId>plugins</artifactId>
-		<version>1.4.0-SNAPSHOT</version>
-	</parent>
-	<groupId>org.jboss.tools.runtime.plugins</groupId>
-	<artifactId>org.jboss.tools.runtime.as.detector</artifactId>
-	
-	<packaging>eclipse-plugin</packaging>
-</project>
\ No newline at end of file
Index: runtime/plugins/org.jboss.tools.runtime.seam.detector/plugin.properties
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.seam.detector/plugin.properties	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.seam.detector/plugin.properties	(working copy)
@@ -1,3 +0,0 @@
-#Properties file for org.jboss.tools.runtime
-BundleVendor = JBoss by Red Hat
-BundleName = JBoss Runtime Seam Detector
Index: runtime/plugins/org.jboss.tools.runtime.seam.detector/build.properties
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.seam.detector/build.properties	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.seam.detector/build.properties	(working copy)
@@ -1,13 +0,0 @@
-source.. = src/
-output.. = bin/
-src.includes = *
-src.excludes = src
-bin.includes = META-INF/,\
-               .,\
-               plugin.xml,\
-               plugin.properties,\
-               about.html,\
-               about.ini,\
-               about.mappings,\
-               about.properties,\
-               jboss_about.png
Index: runtime/plugins/org.jboss.tools.runtime.seam.detector/pom.xml
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.seam.detector/pom.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.seam.detector/pom.xml	(working copy)
@@ -1,14 +0,0 @@
-<?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</groupId>
-		<artifactId>plugins</artifactId>
-		<version>1.4.0-SNAPSHOT</version>
-	</parent>
-	<groupId>org.jboss.tools.runtime.plugins</groupId>
-	<artifactId>org.jboss.tools.runtime.seam.detector</artifactId>
-	
-	<packaging>eclipse-plugin</packaging>
-</project>
\ No newline at end of file
Index: runtime/plugins/org.jboss.tools.runtime.seam.detector/about.html
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.seam.detector/about.html	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.seam.detector/about.html	(working copy)
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
-<title>JBoss Runtime Detection</title>
-<style type="text/css" media="screen">
-<!--
-  body {
-    font-family: Sans-serif, Arial, Helvetica;
-  }
-
--->
-</style>
-</head>
-<body>
-<h1>JBoss Runtime Seam Detector</h1>
-
-<p>
-This plugin is part of the JBoss Tools developed by the <a href="http://www.jboss.com">JBoss Inc.</a>
-</p>
-
-<p>Information about this plugin is available at <a href="http://www.jboss.org/tools">JBoss Tools project page</a></p>
-
-<p>
-This software is distributed under the terms of the Eclipse Public License - v 1.0
-(see <a href="www.eclipse.org/legal/epl-v10.html">Eclipse Public License - Version 1.0</a>).
-</p>
-</body>
-</html>
\ No newline at end of file
Index: runtime/plugins/org.jboss.tools.runtime.seam.detector/jboss_about.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: runtime/plugins/org.jboss.tools.runtime.seam.detector/plugin.xml
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.seam.detector/plugin.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.seam.detector/plugin.xml	(working copy)
@@ -1,14 +0,0 @@
-<?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.SeamHandler"
-    		name="Seam"
-       		class="org.jboss.tools.runtime.handlers.SeamHandler"
-       		preferenceId="org.jboss.tools.common.model.ui.seam"
-       		priority="200"/>
-	</extension>
-</plugin>
Index: runtime/plugins/org.jboss.tools.runtime.seam.detector/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.seam.detector/.settings/org.eclipse.jdt.core.prefs	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.seam.detector/.settings/org.eclipse.jdt.core.prefs	(working copy)
@@ -1,8 +0,0 @@
-#Mon May 30 13:29:40 CEST 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
Index: runtime/plugins/org.jboss.tools.runtime.seam.detector/.classpath
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.seam.detector/.classpath	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.seam.detector/.classpath	(working copy)
@@ -1,7 +0,0 @@
-<?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>
Index: runtime/plugins/org.jboss.tools.runtime.seam.detector/META-INF/MANIFEST.MF
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.seam.detector/META-INF/MANIFEST.MF	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.seam.detector/META-INF/MANIFEST.MF	(working copy)
@@ -1,18 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %BundleName
-Bundle-SymbolicName: org.jboss.tools.runtime.seam.detector;singleton:=true
-Bundle-Version: 1.4.0.qualifier
-Bundle-Activator: org.jboss.tools.runtime.seam.detector.RuntimeSeamActivator
-Require-Bundle: org.eclipse.ui;bundle-version="3.7.0",
- org.eclipse.core.runtime;bundle-version="3.7.0",
- org.eclipse.core.resources;bundle-version="3.7.0",
- org.jboss.tools.seam.core,
- org.eclipse.ui.navigator;bundle-version="3.5.100",
- org.eclipse.ui.workbench;bundle-version="3.7.0",
- org.jboss.tools.common,
- org.jboss.tools.runtime.core
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Bundle-Localization: plugin
-Bundle-Vendor: %BundleVendor
Index: runtime/plugins/org.jboss.tools.runtime.seam.detector/.project
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.seam.detector/.project	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.seam.detector/.project	(working copy)
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.jboss.tools.runtime.seam.detector</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.pde.ManifestBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.pde.SchemaBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.pde.PluginNature</nature>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
Index: runtime/plugins/org.jboss.tools.runtime.seam.detector/about.properties
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.seam.detector/about.properties	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.seam.detector/about.properties	(working copy)
@@ -1,2 +0,0 @@
-blurb=JBoss Runtime Seam Detector\n\nVersion\: {featureVersion}\n\n(c) Copyright (c) Red Hat, Inc., contributors and others 2004 - 2012.  All rights reserved.\nVisit http\://jboss.org/tools
-
Index: runtime/plugins/org.jboss.tools.runtime.seam.detector/about.mappings
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.seam.detector/about.mappings	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.seam.detector/about.mappings	(working copy)
@@ -1,5 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
Index: runtime/plugins/org.jboss.tools.runtime.seam.detector/src/org/jboss/tools/runtime/seam/detector/RuntimeSeamActivator.java
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.seam.detector/src/org/jboss/tools/runtime/seam/detector/RuntimeSeamActivator.java	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.seam.detector/src/org/jboss/tools/runtime/seam/detector/RuntimeSeamActivator.java	(working copy)
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- *     Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.runtime.seam.detector;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class RuntimeSeamActivator extends AbstractUIPlugin {
-
-	// The plug-in ID
-	public static final String PLUGIN_ID = "org.jboss.tools.runtime.seam.detector"; //$NON-NLS-1$
-
-	// The shared instance
-	private static RuntimeSeamActivator plugin;
-	
-	/**
-	 * The constructor
-	 */
-	public RuntimeSeamActivator() {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
-	 */
-	public void start(BundleContext context) throws Exception {
-		super.start(context);
-		plugin = this;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
-	 */
-	public void stop(BundleContext context) throws Exception {
-		plugin = null;
-		super.stop(context);
-	}
-
-	/**
-	 * Returns the shared instance
-	 *
-	 * @return the shared instance
-	 */
-	public static RuntimeSeamActivator getDefault() {
-		return plugin;
-	}
-
-	public static void log(Throwable e) {
-		IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, e
-				.getLocalizedMessage(), e);
-		getDefault().getLog().log(status);
-	}
-	
-	public static void log(Throwable e, String message) {
-		IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, message, e);
-		getDefault().getLog().log(status);
-	}
-}
Index: runtime/plugins/org.jboss.tools.runtime.seam.detector/src/org/jboss/tools/runtime/handlers/SeamHandler.java
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.seam.detector/src/org/jboss/tools/runtime/handlers/SeamHandler.java	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.seam.detector/src/org/jboss/tools/runtime/handlers/SeamHandler.java	(working copy)
@@ -1,184 +0,0 @@
-/*************************************************************************************
- * Copyright (c) 2010-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.handlers;
-
-import java.io.File;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.jar.Attributes;
-import java.util.jar.JarFile;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.jboss.tools.runtime.core.model.AbstractRuntimeDetector;
-import org.jboss.tools.runtime.core.model.RuntimeDefinition;
-import org.jboss.tools.seam.core.SeamUtil;
-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;
-
-public class SeamHandler extends AbstractRuntimeDetector {
-
-	private final static String seamJarName = "jboss-seam.jar";
-	private final static String seamVersionAttributeName = "Seam-Version";
-	private static final String SEAM = "SEAM"; // NON-NLS-1$
-	
-	private static File getSeamRoot(RuntimeDefinition serverDefinition) {
-		String type = serverDefinition.getType();
-		if (SEAM.equals(type)) {
-			return serverDefinition.getLocation();
-		}
-		return null;
-	}
-	
-	@Override
-	public void initializeRuntimes(List<RuntimeDefinition> serverDefinitions) {
-		
-		Map<String, SeamRuntime> map = new HashMap<String,SeamRuntime>();
-
-		for(RuntimeDefinition serverDefinition:serverDefinitions) {
-			if (serverDefinition.isEnabled()) {
-				String type = serverDefinition.getType();
-				if (SEAM.equals(type)) {
-					addSeam(map, serverDefinition,
-							serverDefinition.getLocation());
-				}
-			}
-			initializeRuntimes(serverDefinition.getIncludedServerDefinitions());
-		}
-		SeamRuntimeManager.getInstance().save();
-	}
-
-	private static void addSeam(Map<String, SeamRuntime> map,
-			RuntimeDefinition serverDefinition, File seamFile) {
-		if (seamFile.exists() && seamFile.canRead() && seamFile.isDirectory()) {
-			SeamVersion seamVersion = getSeamVersion(seamFile.getAbsolutePath());
-			if (seamVersion != null) {
-				String name = "Seam " + serverDefinition.getName() + " " + seamVersion; //$NON-NLS-1$ //$NON-NLS-2$
-				addSeam(map, seamFile.getAbsolutePath(), seamVersion, name);
-			}
-		}
-	}
-
-	private static void addSeam(Map<String, SeamRuntime> map, String seamPath,SeamVersion seamVersion, String name) {
-		if (!seamExists(seamPath)) {
-			File seamFolder = new File(seamPath);
-			if(seamFolder.exists() && seamFolder.isDirectory()) {
-				SeamRuntime rt = new SeamRuntime();
-				rt.setHomeDir(seamPath);
-				rt.setName(name);
-				rt.setDefault(true);
-				rt.setVersion(seamVersion);
-				SeamRuntimeManager.getInstance().addRuntime(rt);
-			}
-		}
-	}
-
-	private static SeamVersion getSeamVersion(String seamGenBuildPath) {
-		if (seamGenBuildPath == null || seamGenBuildPath.trim().length() <= 0) {
-			return null;
-		}
-		String fullVersion = SeamUtil.getSeamVersionFromManifest(seamGenBuildPath);
-		if (fullVersion == null) {
-			return null;	
-		}
-		String version = fullVersion.substring(0,3);
-		SeamVersion seamVersion = null;
-		if (version != null) {
-			seamVersion = SeamVersion.findByString(version);
-		}
-		return seamVersion;
-	}
-	
-	/**
-	 * @param seamPath
-	 * @return
-	 */
-	private static boolean seamExists(String seamPath) {
-		SeamRuntime[] seamRuntimes = SeamRuntimeManager.getInstance().getRuntimes();
-		for (SeamRuntime sr:seamRuntimes) {
-			if (seamPath != null && seamPath.equals(sr.getHomeDir())) {
-				return true;
-			}
-		}
-		return false;
-	}
-
-	@Override
-	public RuntimeDefinition getServerDefinition(File root,
-			IProgressMonitor monitor) {
-		if (monitor.isCanceled() || root == null) {
-			return null;
-		}
-		String seamVersion = getSeamVersionFromManifest(root.getAbsolutePath());
-		if (seamVersion != null) {
-			return new RuntimeDefinition(root.getName(), seamVersion, SEAM, root.getAbsoluteFile());
-		}
-		return null;
-	}
-
-	private static String getSeamVersionFromManifest(String seamHome) {
-		File seamHomeFolder = new File(seamHome);
-		if (seamHomeFolder == null || !seamHomeFolder.isDirectory()) {
-			return null;
-		}
-		String[] seamFiles = seamHomeFolder.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;
-			}
-		});
-		if (seamFiles == null || seamFiles.length != 2) {
-			return null;
-		}
-		File jarFile = new File(seamHome, "lib/" + seamJarName);
-		if(!jarFile.isFile()) {
-			jarFile = new File(seamHome, seamJarName);
-			if(!jarFile.isFile()) {
-				return null;
-			}
-		}
-		try {
-			JarFile jar = new JarFile(jarFile);
-			Attributes attributes = jar.getManifest().getMainAttributes();
-			String version = attributes.getValue(seamVersionAttributeName);
-			if (version == null) {
-				// Seam 2.3
-				version = attributes.getValue("Implementation-Version");
-			}
-			return version;
-		} catch (IOException e) {
-			return null;
-		}
-	}
-
-	@Override
-	public boolean exists(RuntimeDefinition serverDefinition) {
-		if (serverDefinition == null || serverDefinition.getLocation() == null) {
-			return false;
-		}
-		File seamRoot = getSeamRoot(serverDefinition);
-		if (seamRoot == null || !seamRoot.isDirectory()) {
-			return false;
-		}
-		String path = seamRoot.getAbsolutePath();
-		return seamExists(path);
-	}
-
-}
Index: runtime/plugins/org.jboss.tools.runtime.seam.detector/about.ini
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.seam.detector/about.ini	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.seam.detector/about.ini	(working copy)
@@ -1,27 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-# test
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=jboss_about.png
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
Index: runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/JBossRuntimeStartup.java
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/JBossRuntimeStartup.java	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/JBossRuntimeStartup.java	(working copy)
@@ -52,19 +52,18 @@
 			if (directory.isDirectory()) {
 				RuntimePath runtimePath = new RuntimePath(
 						directory.getAbsolutePath());
-				List<RuntimeDefinition> serverDefinitions = locator
+				List<RuntimeDefinition> runtimeDefinitions = locator
 						.searchForRuntimes(runtimePath.getPath(), monitor);
 				runtimePath.getServerDefinitions().clear();
-				for (RuntimeDefinition serverDefinition : serverDefinitions) {
+				for (RuntimeDefinition serverDefinition : runtimeDefinitions) {
 					serverDefinition.setRuntimePath(runtimePath);
 				}
-				initializeRuntimes(serverDefinitions);
+				initializeRuntimes(runtimeDefinitions);
 			}
 		} catch (IOException e) {
 			RuntimeUIActivator.log(e);
 		}
-		final Set<RuntimePath> runtimePaths = new HashSet<RuntimePath>();
-		parseRuntimeLocationsFile(runtimePaths);
+		final Set<RuntimePath> runtimePaths = parseRuntimeLocationsFile();
 		for (RuntimePath runtimePath : runtimePaths) {
 			List<RuntimeDefinition> serverDefinitions = locator
 					.searchForRuntimes(runtimePath.getPath(), monitor);
@@ -105,8 +104,8 @@
 		});
 	}
 	
-	private static void parseRuntimeLocationsFile(Set<RuntimePath> runtimePaths) {
-		
+	private static Set<RuntimePath> parseRuntimeLocationsFile() {
+		final Set<RuntimePath> runtimePaths = new HashSet<RuntimePath>();
 		try {
 			String pluginLocation = FileLocator.resolve(RuntimeUIActivator.getDefault().getBundle().getEntry("/")).getPath(); //$NON-NLS-1$
 			File serversFile = new File(pluginLocation, LOCATIONS_FILE);
@@ -151,6 +150,7 @@
 		} catch (IOException e) {
 			RuntimeUIActivator.log(e);
 		}
+		return runtimePaths;
 	}
 
 	private static String getConfiguration() throws IOException {
Index: runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/preferences/RuntimePreferencePage.java
===================================================================
--- runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/preferences/RuntimePreferencePage.java	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/preferences/RuntimePreferencePage.java	(working copy)
@@ -65,7 +65,6 @@
 import org.eclipse.swt.widgets.Group;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Link;
-import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.Table;
 import org.eclipse.swt.widgets.TableColumn;
 import org.eclipse.swt.widgets.TableItem;
Index: runtime/tests/org.jboss.tools.runtime.test/pom.xml
===================================================================
--- runtime/tests/org.jboss.tools.runtime.test/pom.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/tests/org.jboss.tools.runtime.test/pom.xml	(working copy)
@@ -13,136 +13,11 @@
 	<packaging>eclipse-test-plugin</packaging>
 
 	<properties>
-		<systemProperties>-Djbosstools.test.jboss.home.4.2=${requirementsDirectory}/jboss-4.2.3.GA -Djbosstools.test.jboss.home.5.1=${requirementsDirectory}/jboss-5.1.0.GA -Djbosstools.test.seam.2.0.1.GA.home=${requirementsDirectory}/jboss-seam-2.0.1.GA -Djbosstools.test.seam.2.2.0.GA.home=${requirementsDirectory}/jboss-seam-2.2.0.GA -Djbosstools.test.eap.4.3.home=${requirementsDirectory}/jboss-eap-4.3 -Dskip.runtime.scanner=true -Djbosstools.test.jboss.home.7.0=${requirementsDirectory}/jboss-as-7.0.0.Final -Dorg.jboss.tools.tests.skipPrivateRequirements=${skipPrivateRequirements}</systemProperties>
+		<systemProperties/>
 	</properties>
 	<build>
 		<plugins>
 			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-dependency-plugin</artifactId>
-				<executions>
-					<execution>
-						<id>install-as</id>
-						<phase>pre-integration-test</phase>
-						<goals>
-							<goal>unpack</goal>
-						</goals>
-						<configuration>
-							<artifactItems>
-								<artifactItem>
-									<groupId>org.jboss.jbossas</groupId>
-									<artifactId>jboss-as-dist</artifactId>
-									<version>4.2.3.GA</version>
-									<type>zip</type>
-								</artifactItem>
-								<artifactItem>
-									<groupId>org.jboss.as</groupId>
-									<artifactId>jboss-as-dist</artifactId>
-									<version>7.0.0.Final</version>
-									<type>zip</type>
-								</artifactItem>
-							</artifactItems>
-						</configuration>
-					</execution>
-				</executions>
-			</plugin>
-			<plugin>
-				<groupId>com.googlecode.maven-download-plugin</groupId>
-				<artifactId>maven-download-plugin</artifactId>
-				<executions>
-					<execution>
-						<id>install-as-5.1.0</id>
-						<phase>pre-integration-test</phase>
-						<goals>
-							<goal>wget</goal>
-						</goals>
-						<configuration>
-							<url>http://repository.jboss.org/sourceforge/jboss-5.1.0.GA.zip</url>
-							<md5>78322c75ca0c13002a04418b4a8bc920</md5>
-							<unpack>true</unpack>
-						</configuration>
-					</execution>
-					<execution>
-						<id>install-seam-2.0.1</id>
-						<phase>pre-integration-test</phase>
-						<goals>
-							<goal>wget</goal>
-						</goals>
-						<configuration>
-							<url>http://repository.jboss.org/sourceforge/jboss-seam-2.0.1.GA.zip</url>
-							<unpack>true</unpack>
-							<md5>0a1accf94fd37e40ab1091ee593b8b75</md5>
-						</configuration>
-					</execution>
-					<execution>
-						<id>install-seam-2.2.0</id>
-						<phase>pre-integration-test</phase>
-						<goals>
-							<goal>wget</goal>
-						</goals>
-						<configuration>
-							<url>http://repository.jboss.org/sourceforge/jboss-seam-2.2.0.GA.zip</url>
-							<unpack>true</unpack>
-							<md5>febaf032f989240fe3828a8f0f7fe98a</md5>
-						</configuration>
-					</execution>
-					<execution>
-						<id>install-eap</id>
-						<phase>pre-integration-test</phase>
-						<goals>
-							<goal>wget</goal>
-						</goals>
-						<configuration>
-							<url>http://download.devel.redhat.com/released/JBEAP-4.3.0/CP03/zip/jboss-eap-noauth-4.3.0.GA_CP03.zip</url>
-							<md5>18dc28785c8b156b36e2d92db699064a</md5>
-							<unpack>true</unpack>
-							<skip>${skipPrivateRequirements}</skip>
-						</configuration>
-					</execution>
-					<execution>
-						<id>install-eap-seam-gen</id>
-						<phase>pre-integration-test</phase>
-						<goals>
-							<goal>wget</goal>
-						</goals>
-						<configuration>
-							<url>http://download.jboss.org/jbosstools/test-runtimes/rhds-seam-gen-patch.zip</url>
-							<md5>79b37541804f49844ea7322c0ff599c1</md5>
-							<unpack>true</unpack>
-							<outputDirectory>${requirementsDirectory}/jboss-eap-4.3/seam</outputDirectory>
-							<skip>${skipPrivateRequirements}</skip>
-						</configuration>
-					</execution>
-					<execution>
-						<id>install-eap-fp</id>
-						<phase>pre-integration-test</phase>
-						<goals>
-							<goal>wget</goal>
-						</goals>
-						<configuration>
-							<url>http://download.devel.redhat.com/released/JBEAP-4.3.0/CP03_FP01/zip/jboss-eap-fp-4.3.0.CP03-FP01.zip</url>
-							<md5>38fe2a2a55edc5239ba680eff3b29533</md5>
-							<unpack>true</unpack>
-							<skip>${skipPrivateRequirements}</skip>
-						</configuration>
-					</execution>
-					<execution>
-						<id>install-seam-fp-patch</id>
-						<phase>pre-integration-test</phase>
-						<goals>
-							<goal>wget</goal>
-						</goals>
-						<configuration>
-							<url>http://download.jboss.org/jbosstools/test-runtimes/jbds-seamfp-patch.zip</url>
-							<md5>c3af3b56add0acccb72db88de477f3c7</md5>
-							<unpack>true</unpack>
-							<skip>${skipPrivateRequirements}</skip>
-						</configuration>
-					</execution>
-				</executions>
-			</plugin>
-		
-			<plugin>
 				<groupId>org.eclipse.tycho</groupId>
 				<artifactId>tycho-surefire-plugin</artifactId>
 				<version>${tychoVersion}</version>
@@ -153,4 +28,4 @@
 			</plugin>
 		</plugins>
 	</build>
-</project>
\ No newline at end of file
+</project>
Index: runtime/tests/org.jboss.tools.runtime.test/plugin.xml
===================================================================
--- runtime/tests/org.jboss.tools.runtime.test/plugin.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/tests/org.jboss.tools.runtime.test/plugin.xml	(working copy)
@@ -3,6 +3,12 @@
 <plugin>
 	<extension
          point="org.jboss.tools.runtime.core.runtimeDetectors">
+    	<runtimeDetector 
+    	    id="org.jboss.tools.runtime.handlers.TestHandler1"
+    		name="Test Handler"
+       		class="org.jboss.tools.runtime.handlers.TestHandler1"
+       		preferenceId="org.eclipse.wst.server.ui.runtime.preferencePage"
+       		priority="100"/>
     	<runtimeDetector
     		id="org.jboss.tools.runtime.handlers.InvalidHandler"
     		name="Invalid"
@@ -11,4 +17,5 @@
        		priority="9999"/>
 	</extension>
 	
+	
 </plugin>
Index: runtime/tests/org.jboss.tools.runtime.test/META-INF/MANIFEST.MF
===================================================================
--- runtime/tests/org.jboss.tools.runtime.test/META-INF/MANIFEST.MF	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/tests/org.jboss.tools.runtime.test/META-INF/MANIFEST.MF	(working copy)
@@ -2,37 +2,14 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %BundleName
 Bundle-SymbolicName: org.jboss.tools.runtime.test;singleton:=true
+Bundle-Activator: org.jboss.tools.runtime.test.RuntimeTestActivator
 Bundle-Version: 1.4.0.qualifier
 Require-Bundle: org.eclipse.core.runtime,
  org.junit;bundle-version="4.8.1",
  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.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.seam.detector
+ org.jboss.tools.common
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-Vendor: %BundleVendor
Index: runtime/tests/org.jboss.tools.runtime.test/src/org/jboss/tools/runtime/test/RuntimeDetectionFrameworkTest.java
===================================================================
--- runtime/tests/org.jboss.tools.runtime.test/src/org/jboss/tools/runtime/test/RuntimeDetectionFrameworkTest.java	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ runtime/tests/org.jboss.tools.runtime.test/src/org/jboss/tools/runtime/test/RuntimeDetectionFrameworkTest.java	(working copy)
@@ -0,0 +1,146 @@
+/*************************************************************************************
+ * 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 java.io.File;
+import java.util.List;
+import java.util.Set;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.jboss.tools.runtime.core.JBossRuntimeLocator;
+import org.jboss.tools.runtime.core.RuntimeCoreActivator;
+import org.jboss.tools.runtime.core.model.AbstractRuntimeDetector;
+import org.jboss.tools.runtime.core.model.IRuntimeDetector;
+import org.jboss.tools.runtime.core.model.InvalidRuntimeDetector;
+import org.jboss.tools.runtime.core.model.RuntimeDefinition;
+import org.jboss.tools.runtime.core.model.RuntimePath;
+import org.jboss.tools.runtime.handlers.TestHandler1;
+import org.jboss.tools.runtime.ui.RuntimeUIActivator;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+
+/**
+ * 
+ * @author rob stryker
+ * 
+ */
+public class RuntimeDetectionFrameworkTest extends TestCase {
+	private final static String seamVersionAttributeName = "Seam-Version";
+
+	@BeforeClass
+	public static void create() {
+		RuntimeCoreActivator.getDefault();
+		RuntimeUIActivator.getDefault();
+	}
+
+	@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 displayRuntimes(Set<RuntimePath> paths) {
+		String s = "";
+		for(RuntimePath path:paths) {
+			s += path.getPath() + "\n";
+		}
+		return s;
+	}
+	
+	@Test
+	public void testLoadSaveRuntimePaths() {
+		String path = "test/path/one";
+		Set<RuntimePath> runtimePaths = RuntimeUIActivator.getDefault().getRuntimePaths();
+		assertEquals(displayRuntimes(runtimePaths), 0, runtimePaths.size());
+		RuntimePath runtimePath = new RuntimePath(path);
+		runtimePath.setScanOnEveryStartup(false);
+		runtimePaths.add(runtimePath);
+		RuntimeUIActivator.getDefault().saveRuntimePaths();
+		restartBundle();
+		runtimePaths = RuntimeUIActivator.getDefault().getRuntimePaths();
+		assertEquals(1, runtimePaths.size());
+		runtimePaths.clear();
+		RuntimeUIActivator.getDefault().saveRuntimePaths();
+		restartBundle();
+		runtimePaths = RuntimeUIActivator.getDefault().getRuntimePaths();
+		assertEquals(0, runtimePaths.size());
+	}
+	
+	private void restartBundle() {
+		Bundle bundle = Platform.getBundle(RuntimeUIActivator.PLUGIN_ID);
+		try {
+			// reload prefs
+			bundle.stop();
+			bundle.start();
+		} catch(BundleException be) {
+			
+		}
+	}
+	
+	@Before
+	public void setUp() {
+		IPath stateLoc = RuntimeTestActivator.getDefault().getStateLocation();
+		stateLoc.append("a").toFile().mkdirs();
+		stateLoc.append("b").toFile().mkdirs();
+		stateLoc.append("c").toFile().mkdirs();
+	}
+	
+	@After
+	public void tearDown() {
+		IPath stateLoc = RuntimeTestActivator.getDefault().getStateLocation();
+		stateLoc.append("a").toFile().delete();
+		stateLoc.append("b").toFile().delete();
+		stateLoc.append("c").toFile().delete();
+	}
+	
+	@Test
+	public void testInitializationPaths() {
+		IPath p = RuntimeTestActivator.getDefault().getStateLocation();
+		String path = p.toFile().getAbsolutePath();
+		
+		// Create our path
+		RuntimePath runtimePath = new RuntimePath(path);
+		JBossRuntimeLocator locator = new JBossRuntimeLocator();
+		
+		// Use the locator to find our runtime defs.
+		List<RuntimeDefinition> runtimeDefinitions = locator
+				.searchForRuntimes(runtimePath.getPath(), new NullProgressMonitor());
+		assertEquals(3, runtimeDefinitions.size());
+		
+		
+		// initialize them
+		Set<IRuntimeDetector> detectors = RuntimeCoreActivator.getRuntimeDetectors();
+		for( IRuntimeDetector detector:detectors) {
+			if (detector.isEnabled()) {
+				detector.initializeRuntimes(runtimeDefinitions);
+			}
+		}
+		
+		String[] initialized = TestHandler1.getInstance().getInited();
+		assertEquals(3, initialized.length);
+		
+	}
+}
Index: runtime/tests/org.jboss.tools.runtime.test/src/org/jboss/tools/runtime/test/RuntimeTestActivator.java
===================================================================
--- runtime/tests/org.jboss.tools.runtime.test/src/org/jboss/tools/runtime/test/RuntimeTestActivator.java	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ runtime/tests/org.jboss.tools.runtime.test/src/org/jboss/tools/runtime/test/RuntimeTestActivator.java	(working copy)
@@ -0,0 +1,45 @@
+package org.jboss.tools.runtime.test;
+
+import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.BundleContext;
+
+public class RuntimeTestActivator extends Plugin {
+
+	// The shared instance
+	private static RuntimeTestActivator plugin;
+	
+	
+	/**
+	 * The constructor
+	 */
+	public RuntimeTestActivator() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+		plugin = this;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		plugin = null;
+		super.stop(context);
+	}
+
+	/**
+	 * Returns the shared instance
+	 *
+	 * @return the shared instance
+	 */
+	public static RuntimeTestActivator getDefault() {
+		return plugin;
+	}
+
+}
Index: runtime/tests/org.jboss.tools.runtime.test/src/org/jboss/tools/runtime/test/RuntimeDetectionTest.java
===================================================================
--- runtime/tests/org.jboss.tools.runtime.test/src/org/jboss/tools/runtime/test/RuntimeDetectionTest.java	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/tests/org.jboss.tools.runtime.test/src/org/jboss/tools/runtime/test/RuntimeDetectionTest.java	(working copy)
@@ -10,404 +10,12 @@
  ************************************************************************************/
 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(); 
-	}
+public class RuntimeDetectionTest {
+	// Logic moved to seam tests
 }
Index: runtime/tests/org.jboss.tools.runtime.test/src/org/jboss/tools/runtime/test/RuntimeDetectionAllTests.java
===================================================================
--- runtime/tests/org.jboss.tools.runtime.test/src/org/jboss/tools/runtime/test/RuntimeDetectionAllTests.java	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/tests/org.jboss.tools.runtime.test/src/org/jboss/tools/runtime/test/RuntimeDetectionAllTests.java	(working copy)
@@ -15,7 +15,7 @@
 
 
 @Suite.SuiteClasses({
-	RuntimeDetectionTest.class,
+	RuntimeDetectionFrameworkTest.class
 })
 
 @RunWith(Suite.class)
Index: runtime/tests/org.jboss.tools.runtime.test/src/org/jboss/tools/runtime/handlers/TestHandler1.java
===================================================================
--- runtime/tests/org.jboss.tools.runtime.test/src/org/jboss/tools/runtime/handlers/TestHandler1.java	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ runtime/tests/org.jboss.tools.runtime.test/src/org/jboss/tools/runtime/handlers/TestHandler1.java	(working copy)
@@ -0,0 +1,60 @@
+package org.jboss.tools.runtime.handlers;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.jboss.tools.runtime.core.model.AbstractRuntimeDetector;
+import org.jboss.tools.runtime.core.model.RuntimeDefinition;
+
+public class TestHandler1 extends AbstractRuntimeDetector {
+
+	private static TestHandler1 ME;
+	
+	public static TestHandler1 getInstance() {
+		return ME;
+	}
+	
+	public TestHandler1() {
+		ME = this;
+	}
+
+	private ArrayList<String> initialized = new ArrayList<String>();
+	public void reset() {
+		initialized.clear();
+	}
+	private void addInit(String s) {
+		initialized.add(s);
+	}
+	public String[] getInited() {
+		return (String[]) initialized.toArray(new String[initialized.size()]);
+	}
+	
+	@Override
+	public RuntimeDefinition getServerDefinition(File root,
+			IProgressMonitor monitor) {
+		if( root.isDirectory() && root.list().length == 0 ) {
+			RuntimeDefinition def = new RuntimeDefinition(
+					"Handler1 Folder " + root.getName(), "1.0", 
+					"testHandler", root);
+			return def;
+		}
+		return null;
+	}
+
+	@Override
+	public void initializeRuntimes(List<RuntimeDefinition> serverDefinitions) {
+		for( int i = 0; i < serverDefinitions.size(); i++ ) {
+			String n = serverDefinitions.get(i).getName();
+			addInit(n);
+		}
+	}
+
+	@Override
+	public boolean exists(RuntimeDefinition serverDefinition) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+}
Index: runtime/site/category.xml
===================================================================
--- runtime/site/category.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ runtime/site/category.xml	(working copy)
@@ -11,12 +11,6 @@
    <feature url="features/org.jboss.tools.runtime.core.feature_0.0.0.jar" id="org.jboss.tools.runtime.core.feature" version="0.0.0">
       <category name="JBoss Tools runtime Nightly Build Update Site"/>
    </feature>
-   <feature url="features/org.jboss.tools.runtime.as.detector.feature_0.0.0.jar" id="org.jboss.tools.runtime.as.detector.feature" version="0.0.0">
-      <category name="JBoss Tools runtime Nightly Build Update Site"/>
-   </feature>
-   <feature url="features/org.jboss.tools.runtime.seam.detector.feature_0.0.0.jar" id="org.jboss.tools.runtime.seam.detector.feature" version="0.0.0">
-      <category name="JBoss Tools runtime Nightly Build Update Site"/>
-   </feature>
    <feature url="features/org.jboss.tools.runtime.test.feature_0.0.0.jar" id="org.jboss.tools.runtime.test.feature" version="0.0.0">
       <category name="JBoss Tools runtime Nightly Build Update Site"/>
    </feature>
@@ -25,12 +19,6 @@
    <feature url="features/org.jboss.tools.runtime.core.feature.source_0.0.0.jar" id="org.jboss.tools.runtime.core.feature.source" version="0.0.0">
       <category name="JBoss Tools runtime Nightly Build Update Site"/>
    </feature>
-   <feature url="features/org.jboss.tools.runtime.as.detector.feature.source_0.0.0.jar" id="org.jboss.tools.runtime.as.detector.feature.source" version="0.0.0">
-      <category name="JBoss Tools runtime Nightly Build Update Site"/>
-   </feature>
-   <feature url="features/org.jboss.tools.runtime.seam.detector.feature.source_0.0.0.jar" id="org.jboss.tools.runtime.seam.detector.feature.source" version="0.0.0">
-      <category name="JBoss Tools runtime Nightly Build Update Site"/>
-   </feature>
    <feature url="features/org.jboss.tools.runtime.test.feature.source_0.0.0.jar" id="org.jboss.tools.runtime.test.feature.source" version="0.0.0">
       <category name="JBoss Tools runtime Nightly Build Update Site"/>
    </feature>
Index: seam/features/pom.xml
===================================================================
--- seam/features/pom.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ seam/features/pom.xml	(working copy)
@@ -14,6 +14,7 @@
 	<modules>
 		<module>org.jboss.tools.seam.feature</module>
 		<module>org.jboss.tools.seam.test.feature</module>
+		<module>org.jboss.tools.runtime.seam.detector.feature</module>
 	</modules>
 </project>
 	
Index: seam/features/org.jboss.tools.runtime.seam.detector.feature/.project
===================================================================
--- seam/features/org.jboss.tools.runtime.seam.detector.feature/.project	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/features/org.jboss.tools.runtime.seam.detector.feature/.project	(working copy)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.jboss.tools.runtime.seam.detector.feature</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.pde.FeatureBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.FeatureNature</nature>
+	</natures>
+</projectDescription>
Index: seam/features/org.jboss.tools.runtime.seam.detector.feature/license.html
===================================================================
--- seam/features/org.jboss.tools.runtime.seam.detector.feature/license.html	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/features/org.jboss.tools.runtime.seam.detector.feature/license.html	(working copy)
@@ -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
Index: seam/features/org.jboss.tools.runtime.seam.detector.feature/feature.properties
===================================================================
--- seam/features/org.jboss.tools.runtime.seam.detector.feature/feature.properties	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/features/org.jboss.tools.runtime.seam.detector.feature/feature.properties	(working copy)
@@ -0,0 +1,55 @@
+###############################################################################
+# Copyright (c) 2009-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 Runtime Seam Detector
+
+# "providerName" property - name of the company that provides the feature
+providerName=JBoss by Red Hat
+
+# "updateSiteName" property - label for the update/discovery sites
+updateSiteName=JBoss Developer Studio Updates
+JBossToolsUpdatesSiteName=JBoss Tools Updates
+
+# "description" property - description of the feature
+description=JBoss Runtime Seam Detector provides detection of JBoss Seam installations and configure them as part of JBoss 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 ##########################################
Index: seam/features/org.jboss.tools.runtime.seam.detector.feature/sourceTemplateFeature/.gitkeep
===================================================================
Index: seam/features/org.jboss.tools.runtime.seam.detector.feature/build.properties
===================================================================
--- seam/features/org.jboss.tools.runtime.seam.detector.feature/build.properties	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/features/org.jboss.tools.runtime.seam.detector.feature/build.properties	(working copy)
@@ -0,0 +1,3 @@
+bin.includes = feature.xml,\
+               license.html,\
+               feature.properties
Index: seam/features/org.jboss.tools.runtime.seam.detector.feature/feature.xml
===================================================================
--- seam/features/org.jboss.tools.runtime.seam.detector.feature/feature.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/features/org.jboss.tools.runtime.seam.detector.feature/feature.xml	(working copy)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+      id="org.jboss.tools.runtime.seam.detector.feature"
+      label="%featureName"
+      version="3.4.0.qualifier"
+      provider-name="%providerName"
+      plugin="org.jboss.tools.runtime.seam.detector">
+
+   <description>
+      %description
+   </description>
+
+   <copyright>
+      %copyright
+   </copyright>
+
+   <license url="%licenseURL">
+      %license
+   </license>
+
+   <plugin
+         id="org.jboss.tools.runtime.seam.detector"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+</feature>
Index: seam/features/org.jboss.tools.runtime.seam.detector.feature/pom.xml
===================================================================
--- seam/features/org.jboss.tools.runtime.seam.detector.feature/pom.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/features/org.jboss.tools.runtime.seam.detector.feature/pom.xml	(working copy)
@@ -0,0 +1,47 @@
+<?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.seam</groupId>
+		<artifactId>features</artifactId>
+		<version>3.4.0-SNAPSHOT</version>
+	</parent>
+	<groupId>org.jboss.tools.seam.features</groupId>
+	<artifactId>org.jboss.tools.runtime.seam.detector.feature</artifactId>
+	
+	<packaging>eclipse-feature</packaging>
+	
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.eclipse.tycho.extras</groupId>
+				<artifactId>tycho-source-feature-plugin</artifactId>
+				<version>${tychoExtrasVersion}</version>
+				<executions>
+					<execution>
+						<id>source-feature</id>
+						<phase>package</phase>
+						<goals>
+							<goal>source-feature</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<groupId>org.eclipse.tycho</groupId>
+				<artifactId>tycho-p2-plugin</artifactId>
+				<version>${tychoVersion}</version>
+				<executions>
+					<execution>
+						<id>attached-p2-metadata</id>
+						<phase>package</phase>
+						<goals>
+							<goal>p2-metadata</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
+</project>
Index: seam/plugins/org.jboss.tools.runtime.seam.detector/.project
===================================================================
--- seam/plugins/org.jboss.tools.runtime.seam.detector/.project	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/plugins/org.jboss.tools.runtime.seam.detector/.project	(working copy)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.jboss.tools.runtime.seam.detector</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
Index: seam/plugins/org.jboss.tools.runtime.seam.detector/about.properties
===================================================================
--- seam/plugins/org.jboss.tools.runtime.seam.detector/about.properties	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/plugins/org.jboss.tools.runtime.seam.detector/about.properties	(working copy)
@@ -0,0 +1,2 @@
+blurb=JBoss Runtime Seam Detector\n\nVersion\: {featureVersion}\n\n(c) Copyright (c) Red Hat, Inc., contributors and others 2004 - 2012.  All rights reserved.\nVisit http\://jboss.org/tools
+
Index: seam/plugins/org.jboss.tools.runtime.seam.detector/about.mappings
===================================================================
--- seam/plugins/org.jboss.tools.runtime.seam.detector/about.mappings	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/plugins/org.jboss.tools.runtime.seam.detector/about.mappings	(working copy)
@@ -0,0 +1,5 @@
+# about.mappings
+# contains fill-ins for about.properties
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file does not need to be translated.
+
Index: seam/plugins/org.jboss.tools.runtime.seam.detector/src/org/jboss/tools/runtime/handlers/SeamHandler.java
===================================================================
--- seam/plugins/org.jboss.tools.runtime.seam.detector/src/org/jboss/tools/runtime/handlers/SeamHandler.java	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/plugins/org.jboss.tools.runtime.seam.detector/src/org/jboss/tools/runtime/handlers/SeamHandler.java	(working copy)
@@ -0,0 +1,184 @@
+/*************************************************************************************
+ * Copyright (c) 2010-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.handlers;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.jar.Attributes;
+import java.util.jar.JarFile;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.jboss.tools.runtime.core.model.AbstractRuntimeDetector;
+import org.jboss.tools.runtime.core.model.RuntimeDefinition;
+import org.jboss.tools.seam.core.SeamUtil;
+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;
+
+public class SeamHandler extends AbstractRuntimeDetector {
+
+	private final static String seamJarName = "jboss-seam.jar";
+	private final static String seamVersionAttributeName = "Seam-Version";
+	private static final String SEAM = "SEAM"; // NON-NLS-1$
+	
+	private static File getSeamRoot(RuntimeDefinition serverDefinition) {
+		String type = serverDefinition.getType();
+		if (SEAM.equals(type)) {
+			return serverDefinition.getLocation();
+		}
+		return null;
+	}
+	
+	@Override
+	public void initializeRuntimes(List<RuntimeDefinition> serverDefinitions) {
+		
+		Map<String, SeamRuntime> map = new HashMap<String,SeamRuntime>();
+
+		for(RuntimeDefinition serverDefinition:serverDefinitions) {
+			if (serverDefinition.isEnabled()) {
+				String type = serverDefinition.getType();
+				if (SEAM.equals(type)) {
+					addSeam(map, serverDefinition,
+							serverDefinition.getLocation());
+				}
+			}
+			initializeRuntimes(serverDefinition.getIncludedServerDefinitions());
+		}
+		SeamRuntimeManager.getInstance().save();
+	}
+
+	private static void addSeam(Map<String, SeamRuntime> map,
+			RuntimeDefinition serverDefinition, File seamFile) {
+		if (seamFile.exists() && seamFile.canRead() && seamFile.isDirectory()) {
+			SeamVersion seamVersion = getSeamVersion(seamFile.getAbsolutePath());
+			if (seamVersion != null) {
+				String name = "Seam " + serverDefinition.getName() + " " + seamVersion; //$NON-NLS-1$ //$NON-NLS-2$
+				addSeam(map, seamFile.getAbsolutePath(), seamVersion, name);
+			}
+		}
+	}
+
+	private static void addSeam(Map<String, SeamRuntime> map, String seamPath,SeamVersion seamVersion, String name) {
+		if (!seamExists(seamPath)) {
+			File seamFolder = new File(seamPath);
+			if(seamFolder.exists() && seamFolder.isDirectory()) {
+				SeamRuntime rt = new SeamRuntime();
+				rt.setHomeDir(seamPath);
+				rt.setName(name);
+				rt.setDefault(true);
+				rt.setVersion(seamVersion);
+				SeamRuntimeManager.getInstance().addRuntime(rt);
+			}
+		}
+	}
+
+	private static SeamVersion getSeamVersion(String seamGenBuildPath) {
+		if (seamGenBuildPath == null || seamGenBuildPath.trim().length() <= 0) {
+			return null;
+		}
+		String fullVersion = SeamUtil.getSeamVersionFromManifest(seamGenBuildPath);
+		if (fullVersion == null) {
+			return null;	
+		}
+		String version = fullVersion.substring(0,3);
+		SeamVersion seamVersion = null;
+		if (version != null) {
+			seamVersion = SeamVersion.findByString(version);
+		}
+		return seamVersion;
+	}
+	
+	/**
+	 * @param seamPath
+	 * @return
+	 */
+	private static boolean seamExists(String seamPath) {
+		SeamRuntime[] seamRuntimes = SeamRuntimeManager.getInstance().getRuntimes();
+		for (SeamRuntime sr:seamRuntimes) {
+			if (seamPath != null && seamPath.equals(sr.getHomeDir())) {
+				return true;
+			}
+		}
+		return false;
+	}
+
+	@Override
+	public RuntimeDefinition getServerDefinition(File root,
+			IProgressMonitor monitor) {
+		if (monitor.isCanceled() || root == null) {
+			return null;
+		}
+		String seamVersion = getSeamVersionFromManifest(root.getAbsolutePath());
+		if (seamVersion != null) {
+			return new RuntimeDefinition(root.getName(), seamVersion, SEAM, root.getAbsoluteFile());
+		}
+		return null;
+	}
+
+	private static String getSeamVersionFromManifest(String seamHome) {
+		File seamHomeFolder = new File(seamHome);
+		if (seamHomeFolder == null || !seamHomeFolder.isDirectory()) {
+			return null;
+		}
+		String[] seamFiles = seamHomeFolder.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;
+			}
+		});
+		if (seamFiles == null || seamFiles.length != 2) {
+			return null;
+		}
+		File jarFile = new File(seamHome, "lib/" + seamJarName);
+		if(!jarFile.isFile()) {
+			jarFile = new File(seamHome, seamJarName);
+			if(!jarFile.isFile()) {
+				return null;
+			}
+		}
+		try {
+			JarFile jar = new JarFile(jarFile);
+			Attributes attributes = jar.getManifest().getMainAttributes();
+			String version = attributes.getValue(seamVersionAttributeName);
+			if (version == null) {
+				// Seam 2.3
+				version = attributes.getValue("Implementation-Version");
+			}
+			return version;
+		} catch (IOException e) {
+			return null;
+		}
+	}
+
+	@Override
+	public boolean exists(RuntimeDefinition serverDefinition) {
+		if (serverDefinition == null || serverDefinition.getLocation() == null) {
+			return false;
+		}
+		File seamRoot = getSeamRoot(serverDefinition);
+		if (seamRoot == null || !seamRoot.isDirectory()) {
+			return false;
+		}
+		String path = seamRoot.getAbsolutePath();
+		return seamExists(path);
+	}
+
+}
Index: seam/plugins/org.jboss.tools.runtime.seam.detector/src/org/jboss/tools/runtime/seam/detector/RuntimeSeamActivator.java
===================================================================
--- seam/plugins/org.jboss.tools.runtime.seam.detector/src/org/jboss/tools/runtime/seam/detector/RuntimeSeamActivator.java	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/plugins/org.jboss.tools.runtime.seam.detector/src/org/jboss/tools/runtime/seam/detector/RuntimeSeamActivator.java	(working copy)
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ *     Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.runtime.seam.detector;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class RuntimeSeamActivator extends AbstractUIPlugin {
+
+	// The plug-in ID
+	public static final String PLUGIN_ID = "org.jboss.tools.runtime.seam.detector"; //$NON-NLS-1$
+
+	// The shared instance
+	private static RuntimeSeamActivator plugin;
+	
+	/**
+	 * The constructor
+	 */
+	public RuntimeSeamActivator() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+		plugin = this;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		plugin = null;
+		super.stop(context);
+	}
+
+	/**
+	 * Returns the shared instance
+	 *
+	 * @return the shared instance
+	 */
+	public static RuntimeSeamActivator getDefault() {
+		return plugin;
+	}
+
+	public static void log(Throwable e) {
+		IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, e
+				.getLocalizedMessage(), e);
+		getDefault().getLog().log(status);
+	}
+	
+	public static void log(Throwable e, String message) {
+		IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, message, e);
+		getDefault().getLog().log(status);
+	}
+}
Index: seam/plugins/org.jboss.tools.runtime.seam.detector/about.ini
===================================================================
--- seam/plugins/org.jboss.tools.runtime.seam.detector/about.ini	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/plugins/org.jboss.tools.runtime.seam.detector/about.ini	(working copy)
@@ -0,0 +1,27 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+# test
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%blurb
+
+# Property "windowImage" contains path to window icon (16x16)
+# needed for primary features only
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=jboss_about.png
+
+# Property "aboutImage" contains path to product image (500x330 or 115x164)
+# needed for primary features only
+
+# Property "appName" contains name of the application (not translated)
+# needed for primary features only
+
+# Property "welcomePerspective" contains the id of the perspective in which the
+# welcome page is to be opened.
+# optional
+
+
+
Index: seam/plugins/org.jboss.tools.runtime.seam.detector/plugin.properties
===================================================================
--- seam/plugins/org.jboss.tools.runtime.seam.detector/plugin.properties	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/plugins/org.jboss.tools.runtime.seam.detector/plugin.properties	(working copy)
@@ -0,0 +1,3 @@
+#Properties file for org.jboss.tools.runtime
+BundleVendor = JBoss by Red Hat
+BundleName = JBoss Runtime Seam Detector
Index: seam/plugins/org.jboss.tools.runtime.seam.detector/build.properties
===================================================================
--- seam/plugins/org.jboss.tools.runtime.seam.detector/build.properties	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/plugins/org.jboss.tools.runtime.seam.detector/build.properties	(working copy)
@@ -0,0 +1,13 @@
+source.. = src/
+output.. = bin/
+src.includes = *
+src.excludes = src
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml,\
+               plugin.properties,\
+               about.html,\
+               about.ini,\
+               about.mappings,\
+               about.properties,\
+               jboss_about.png
Index: seam/plugins/org.jboss.tools.runtime.seam.detector/pom.xml
===================================================================
--- seam/plugins/org.jboss.tools.runtime.seam.detector/pom.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/plugins/org.jboss.tools.runtime.seam.detector/pom.xml	(working copy)
@@ -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.seam</groupId>
+		<artifactId>plugins</artifactId>
+		<version>3.4.0-SNAPSHOT</version>
+	</parent>
+	<groupId>org.jboss.tools.runtime.plugins</groupId>
+	<artifactId>org.jboss.tools.runtime.seam.detector</artifactId>
+	
+	<packaging>eclipse-plugin</packaging>
+</project>
Index: seam/plugins/org.jboss.tools.runtime.seam.detector/about.html
===================================================================
--- seam/plugins/org.jboss.tools.runtime.seam.detector/about.html	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/plugins/org.jboss.tools.runtime.seam.detector/about.html	(working copy)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>JBoss Runtime Detection</title>
+<style type="text/css" media="screen">
+<!--
+  body {
+    font-family: Sans-serif, Arial, Helvetica;
+  }
+
+-->
+</style>
+</head>
+<body>
+<h1>JBoss Runtime Seam Detector</h1>
+
+<p>
+This plugin is part of the JBoss Tools developed by the <a href="http://www.jboss.com">JBoss Inc.</a>
+</p>
+
+<p>Information about this plugin is available at <a href="http://www.jboss.org/tools">JBoss Tools project page</a></p>
+
+<p>
+This software is distributed under the terms of the Eclipse Public License - v 1.0
+(see <a href="www.eclipse.org/legal/epl-v10.html">Eclipse Public License - Version 1.0</a>).
+</p>
+</body>
+</html>
\ No newline at end of file
Index: seam/plugins/org.jboss.tools.runtime.seam.detector/jboss_about.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: seam/plugins/org.jboss.tools.runtime.seam.detector/jboss_about.png
===================================================================
--- seam/plugins/org.jboss.tools.runtime.seam.detector/jboss_about.png	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ seam/plugins/org.jboss.tools.runtime.seam.detector/jboss_about.png	(working copy)

Property changes on: seam/plugins/org.jboss.tools.runtime.seam.detector/jboss_about.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: seam/plugins/org.jboss.tools.runtime.seam.detector/plugin.xml
===================================================================
--- seam/plugins/org.jboss.tools.runtime.seam.detector/plugin.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/plugins/org.jboss.tools.runtime.seam.detector/plugin.xml	(working copy)
@@ -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.SeamHandler"
+    		name="Seam"
+       		class="org.jboss.tools.runtime.handlers.SeamHandler"
+       		preferenceId="org.jboss.tools.common.model.ui.seam"
+       		priority="200"/>
+	</extension>
+</plugin>
Index: seam/plugins/org.jboss.tools.runtime.seam.detector/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- seam/plugins/org.jboss.tools.runtime.seam.detector/.settings/org.eclipse.jdt.core.prefs	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/plugins/org.jboss.tools.runtime.seam.detector/.settings/org.eclipse.jdt.core.prefs	(working copy)
@@ -0,0 +1,8 @@
+#Mon May 30 13:29:40 CEST 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
Index: seam/plugins/org.jboss.tools.runtime.seam.detector/.classpath
===================================================================
--- seam/plugins/org.jboss.tools.runtime.seam.detector/.classpath	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/plugins/org.jboss.tools.runtime.seam.detector/.classpath	(working copy)
@@ -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>
Index: seam/plugins/org.jboss.tools.runtime.seam.detector/META-INF/MANIFEST.MF
===================================================================
--- seam/plugins/org.jboss.tools.runtime.seam.detector/META-INF/MANIFEST.MF	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/plugins/org.jboss.tools.runtime.seam.detector/META-INF/MANIFEST.MF	(working copy)
@@ -0,0 +1,39 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %BundleName
+Bundle-SymbolicName: org.jboss.tools.runtime.seam.detector;singleton:=true
+Bundle-Version: 3.4.0.qualifier
+Require-Bundle: org.eclipse.core.runtime,
+ org.junit;bundle-version="4.8.1",
+ 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.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
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-Vendor: %BundleVendor
+Bundle-Localization: plugin
+
Index: seam/plugins/pom.xml
===================================================================
--- seam/plugins/pom.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ seam/plugins/pom.xml	(working copy)
@@ -19,6 +19,7 @@
 		<module>org.jboss.tools.seam.ui.pages</module>
 		<module>org.jboss.tools.seam.xml</module>
 		<module>org.jboss.tools.seam.xml.ui</module>
+		<module>org.jboss.tools.runtime.seam.detector</module>
 	</modules>
 </project>
 	
Index: seam/tests/org.jboss.tools.runtime.seam.detector.test/META-INF/MANIFEST.MF
===================================================================
--- seam/tests/org.jboss.tools.runtime.seam.detector.test/META-INF/MANIFEST.MF	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/tests/org.jboss.tools.runtime.seam.detector.test/META-INF/MANIFEST.MF	(working copy)
@@ -0,0 +1,41 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %BundleName
+Bundle-SymbolicName: org.jboss.tools.runtime.seam.detector.test;singleton:=true
+Bundle-Activator: org.jboss.tools.runtime.seam.detector.test.SeamRuntimeDetectorTestActivator
+Bundle-Version: 3.4.0.qualifier
+Require-Bundle: org.eclipse.core.runtime,
+ org.junit;bundle-version="4.8.1",
+ 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.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;bundle-version="2.4.0",
+ org.jboss.tools.runtime.seam.detector;bundle-version="3.4.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-Vendor: %BundleVendor
+Bundle-Localization: plugin
+Export-Package: org.jboss.tools.runtime.seam.detector.test
Index: seam/tests/org.jboss.tools.runtime.seam.detector.test/.classpath
===================================================================
--- seam/tests/org.jboss.tools.runtime.seam.detector.test/.classpath	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/tests/org.jboss.tools.runtime.seam.detector.test/.classpath	(working copy)
@@ -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>

Property changes on: seam/tests/org.jboss.tools.runtime.seam.detector.test/.classpath
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: seam/tests/org.jboss.tools.runtime.seam.detector.test/.project
===================================================================
--- seam/tests/org.jboss.tools.runtime.seam.detector.test/.project	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/tests/org.jboss.tools.runtime.seam.detector.test/.project	(working copy)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.jboss.tools.runtime.seam.detector.test</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Property changes on: seam/tests/org.jboss.tools.runtime.seam.detector.test/.project
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: seam/tests/org.jboss.tools.runtime.seam.detector.test/src/org/jboss/tools/runtime/seam/detector/test/SeamRuntimeDetectionAllTests.java
===================================================================
--- seam/tests/org.jboss.tools.runtime.seam.detector.test/src/org/jboss/tools/runtime/seam/detector/test/SeamRuntimeDetectionAllTests.java	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/tests/org.jboss.tools.runtime.seam.detector.test/src/org/jboss/tools/runtime/seam/detector/test/SeamRuntimeDetectionAllTests.java	(working copy)
@@ -0,0 +1,23 @@
+/*************************************************************************************
+ * 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.seam.detector.test;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+@RunWith(Suite.class)
+@SuiteClasses({
+	SeamRuntimeDetectionTest.class
+})
+public class SeamRuntimeDetectionAllTests {
+
+}
\ No newline at end of file
Index: seam/tests/org.jboss.tools.runtime.seam.detector.test/src/org/jboss/tools/runtime/seam/detector/test/IRuntimeDetectionConstants.java
===================================================================
--- seam/tests/org.jboss.tools.runtime.seam.detector.test/src/org/jboss/tools/runtime/seam/detector/test/IRuntimeDetectionConstants.java	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/tests/org.jboss.tools.runtime.seam.detector.test/src/org/jboss/tools/runtime/seam/detector/test/IRuntimeDetectionConstants.java	(working copy)
@@ -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.seam.detector.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");
+
+}
Index: seam/tests/org.jboss.tools.runtime.seam.detector.test/src/org/jboss/tools/runtime/seam/detector/test/SeamRuntimeDetectionTest.java
===================================================================
--- seam/tests/org.jboss.tools.runtime.seam.detector.test/src/org/jboss/tools/runtime/seam/detector/test/SeamRuntimeDetectionTest.java	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/tests/org.jboss.tools.runtime.seam.detector.test/src/org/jboss/tools/runtime/seam/detector/test/SeamRuntimeDetectionTest.java	(working copy)
@@ -0,0 +1,424 @@
+/*************************************************************************************
+ * 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.seam.detector.test;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.jar.Attributes;
+import java.util.jar.JarFile;
+
+import junit.framework.Assert;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IRuntimeType;
+import org.eclipse.wst.server.core.IServer;
+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.RuntimeDefinition;
+import org.jboss.tools.runtime.core.model.RuntimePath;
+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.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * 
+ * @author snjeza
+ * @author rob stryker
+ */
+public class SeamRuntimeDetectionTest extends Assert implements IJBossRuntimePluginConstants {
+	private final static String seamVersionAttributeName = "Seam-Version";
+	private final static String SKIP_PRIVATE = "org.jboss.tools.tests.skipPrivateRequirements";
+	
+	@BeforeClass
+	public static void create() {
+		RuntimeCoreActivator.getDefault();
+		RuntimeUIActivator.getDefault();
+	}
+
+	@Before
+	public void setUp() {
+		clearAll();
+	}
+	@After
+	public void tearDown() {
+		clearAll();
+	}
+	
+	public void clearAll() {
+		// remove all wtp servers
+		IServer[] s = ServerCore.getServers();
+		for( int i = 0; i < s.length; i++ ) {
+			try {
+				s[i].delete();
+			} catch(CoreException ce ) {
+				ce.printStackTrace();
+				fail();
+			}
+		}
+
+		// Remove all wtp runtimes
+		IRuntime[] r = ServerCore.getRuntimes();
+		for( int i = 0; i < r.length; i++ ) {
+			try {
+				r[i].delete();
+			} catch(CoreException ce ) {
+				ce.printStackTrace();
+				fail();
+			}
+		}
+		// Remove all seam runtimes
+		SeamRuntime[] seamRuntimes = SeamRuntimeManager.getInstance().getRuntimes();
+		for( int i = 0; i < seamRuntimes.length; i++ ) {
+			SeamRuntimeManager.getInstance().removeRuntime(seamRuntimes[i]);
+		}
+		SeamRuntimeManager.getInstance().save();
+	}
+	
+	
+	@Test
+	public void testRuntimeDetectors() {
+		Set<IRuntimeDetector> detectors = RuntimeCoreActivator.getRuntimeDetectors();
+		assertTrue("Runtime detectors don't exist.", detectors.size() > 0);
+		assertTrue(handlerExists("org.jboss.tools.runtime.handlers.SeamHandler"));
+	}
+	
+	private boolean handlerExists(String id) {
+		Set<IRuntimeDetector> detectors = RuntimeCoreActivator.getRuntimeDetectors();
+		boolean found = false;
+		Iterator<IRuntimeDetector> i = detectors.iterator();
+		while(i.hasNext()) {
+			IRuntimeDetector next = i.next();
+			String nid = next.getId();
+			if( id.equals(nid))
+				found = true;
+		}
+		return found;
+	}
+
+	@Test
+	public void testJBossAs42() {
+		testOneApplicationServer(IRuntimeDetectionConstants.JBOSS_42_HOME, IJBossToolingConstants.AS_42);
+	}
+	
+	@Test
+	public void testJBossAs51() {
+		testOneApplicationServer(IRuntimeDetectionConstants.JBOSS_51_HOME, IJBossToolingConstants.AS_51);
+	}
+	
+	@Test
+	public void testJBossAs70() {
+		testOneApplicationServer(IRuntimeDetectionConstants.JBOSS_70_HOME, IJBossToolingConstants.AS_70);
+	}
+
+	public void testOneApplicationServer(String homeDir, String typeId) {
+		List<RuntimeDefinition> runtimeDefinitions = initializeOnePath(homeDir);
+		RuntimeDefinition def1 = runtimeDefinitions.get(0);
+		
+		def1.setEnabled(false);
+		initializeDefinitions(runtimeDefinitions);
+		int count = countRuntimesOfType(typeId);
+		assertEquals(0, count);
+
+		def1.setEnabled(true);
+		initializeDefinitions(runtimeDefinitions);
+		count = countRuntimesOfType(typeId);
+		assertEquals(1, count);
+	}
+
+	private List<RuntimeDefinition> initializeOnePath(String homeDir) {
+		RuntimePath path = createRuntimePath(homeDir, false);
+		setRuntimePaths(path, true);
+		File file = new File(path.getPath());
+		assertTrue("The '" + file.getAbsolutePath() + "' path isn't valid.", file.isDirectory());
+
+		List<RuntimeDefinition> runtimeDefinitions = createDefinitionsForPath(path);
+		assertEquals(1, runtimeDefinitions.size());
+		RuntimeDefinition def1 = runtimeDefinitions.get(0);
+
+		File location = def1.getLocation();
+		assertTrue("The '" + location.getAbsolutePath() + "' path isn't valid.", location.isDirectory());
+		return runtimeDefinitions;
+	}
+	
+	
+	// 1.2 is bundled in eap ?
+	//	public void testSeam12() {
+//		testOneSeamLocation(IRuntimeDetectionConstants., SeamVersion.SEAM_1_2, "1.2");
+//		int count = countSeamRuntimesForVersion(SeamVersion.SEAM_1_2);
+//		assertEquals(1, count);
+//	}
+	
+
+	@Test
+	public void testJBossEap43() {
+		if( Boolean.getBoolean(SKIP_PRIVATE))
+			return;
+		
+		List<RuntimeDefinition> runtimeDefinitions = initializeOnePath(IRuntimeDetectionConstants.EAP_43_HOME);
+		RuntimeDefinition def1 = runtimeDefinitions.get(0);
+		
+		// Should setting this to false cascade to the nested definitions?
+		//def1.setEnabled(false);
+		setServerDefinitionsEnabledRecurse(def1, false);
+		initializeDefinitions(runtimeDefinitions);
+		int count = countRuntimesOfType(IJBossToolingConstants.EAP_43);
+		assertEquals(0, count);
+		count = countSeamRuntimesForVersion(SeamVersion.SEAM_1_2);
+		assertEquals(0, count);
+		
+		setServerDefinitionsEnabledRecurse(def1, true);
+		initializeDefinitions(runtimeDefinitions);
+		count = countRuntimesOfType(IJBossToolingConstants.EAP_43);
+		assertEquals(1, count);
+		count = countSeamRuntimesForVersion(SeamVersion.SEAM_1_2);
+		assertEquals(1, count);
+	}
+	private void setServerDefinitionsEnabledRecurse(RuntimeDefinition def, boolean enabled) {
+		def.setEnabled(enabled);
+		List<RuntimeDefinition> nested = def.getIncludedServerDefinitions();
+		Iterator<RuntimeDefinition> i = nested.iterator();
+		while(i.hasNext()) {
+			setServerDefinitionsEnabledRecurse(i.next(), enabled);
+		}
+	}
+	@Test
+	public void testSeam20() throws Exception {
+		testOneSeamLocation(IRuntimeDetectionConstants.SEAM_20_HOME, SeamVersion.SEAM_2_0, "2.0");
+	}
+	
+	@Test
+	public void testSeam22() throws Exception  {
+		testOneSeamLocation(IRuntimeDetectionConstants.SEAM_22_HOME, SeamVersion.SEAM_2_2, "2.2");
+	}
+
+
+	public void testOneSeamLocation(String homeDir, SeamVersion version, String versionString) throws Exception {
+		testSeamHome(homeDir, versionString);
+
+		List<RuntimeDefinition> runtimeDefinitions = initializeOnePath(homeDir);
+		RuntimeDefinition def1 = runtimeDefinitions.get(0);
+		
+		def1.setEnabled(false);
+		initializeDefinitions(runtimeDefinitions);
+		int count = countSeamRuntimesForVersion(version); 
+		assertEquals(0, count);
+
+		def1.setEnabled(true);
+		initializeDefinitions(runtimeDefinitions);
+		count = countSeamRuntimesForVersion(version);
+		assertEquals(1, count);
+		
+		List<RuntimeDefinition> nested = def1.getIncludedServerDefinitions();
+		System.out.println(nested.size());
+	}
+	
+	
+	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));
+	}
+	
+	
+
+	/* 
+	 *  Utility methods for counting things 
+	 */
+	
+	/* Pass to all handlers the list of runtime definitions and let them initialize them */
+	private void initializeDefinitions(List<RuntimeDefinition> runtimeDefinitions) {
+		Set<IRuntimeDetector> detectors = RuntimeCoreActivator
+				.getRuntimeDetectors();
+		for (IRuntimeDetector detector : detectors) {
+			if (detector.isEnabled()) {
+				detector.initializeRuntimes(runtimeDefinitions);
+			}
+		}
+	}
+	private List<RuntimeDefinition> createDefinitionsForPath(RuntimePath runtimePath) {
+		JBossRuntimeLocator locator = new JBossRuntimeLocator();
+		List<RuntimeDefinition> serverDefinitions = locator
+				.searchForRuntimes(runtimePath.getPath(),
+						new NullProgressMonitor());
+		
+		// Shouldn't this be done by the framework somehow??
+		runtimePath.getServerDefinitions().clear();
+		for (RuntimeDefinition serverDefinition : serverDefinitions) {
+			serverDefinition.setRuntimePath(runtimePath);
+		}
+		runtimePath.getServerDefinitions().addAll(serverDefinitions);
+		return serverDefinitions;
+	}
+	
+	private RuntimePath createRuntimePath(String path, boolean enableForStartup) {
+		RuntimePath runtimePath = new RuntimePath(path);
+		runtimePath.setScanOnEveryStartup(enableForStartup);
+		return runtimePath;
+	}
+	private void setRuntimePaths(RuntimePath runtimePath, boolean save) {
+		Set<RuntimePath> runtimePaths = RuntimeUIActivator.getDefault().getRuntimePaths();
+		runtimePaths.clear();
+		runtimePaths.add(runtimePath);
+		if( save )
+			RuntimeUIActivator.getDefault().saveRuntimePaths();
+	}
+
+
+	private int countSeamRuntimes() {
+		return SeamRuntimeManager.getInstance().getRuntimes().length;
+	}
+	private int countSeamRuntimesForVersion(SeamVersion version) {
+		SeamRuntime[] seamRuntimes = SeamRuntimeManager.getInstance().getRuntimes();
+		int count = 0;
+		for (SeamRuntime seamRuntime : seamRuntimes) {
+			SeamVersion version2 = seamRuntime.getVersion();
+			if (version.equals(version2)) {
+				count++;
+			}
+		}
+		return count;
+	}
+
+
+	private int countRuntimesOfType(String typeId) {
+		IRuntime[] runtimes = ServerCore.getRuntimes();
+		int count = 0;
+		for (IRuntime runtime : runtimes) {
+			IRuntimeType runtimeType = runtime.getRuntimeType();
+			if (typeId.equals(runtimeType.getId())) {
+				count++;
+			}
+		}
+		return count;
+	}
+
+	public void testWtpRuntimes() {
+		IRuntime[] runtimes = ServerCore.getRuntimes();
+		assertTrue("runtimes.length\nExpected: 4\nWas: " + runtimes.length,
+				runtimes.length == 4);
+	}
+	
+	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);
+				}
+			}
+		}
+	}
+	
+	
+	
+	// Things to test in runtime core test suite, not here
+	
+//	
+//	@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));
+//			}
+//		}
+//	}
+//	
+//	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(); 
+//	}
+}
Index: seam/tests/org.jboss.tools.runtime.seam.detector.test/src/org/jboss/tools/runtime/seam/detector/test/SeamRuntimeDetectorTestActivator.java
===================================================================
--- seam/tests/org.jboss.tools.runtime.seam.detector.test/src/org/jboss/tools/runtime/seam/detector/test/SeamRuntimeDetectorTestActivator.java	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/tests/org.jboss.tools.runtime.seam.detector.test/src/org/jboss/tools/runtime/seam/detector/test/SeamRuntimeDetectorTestActivator.java	(working copy)
@@ -0,0 +1,45 @@
+package org.jboss.tools.runtime.seam.detector.test;
+
+import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.BundleContext;
+
+public class SeamRuntimeDetectorTestActivator extends Plugin {
+
+	// The shared instance
+	private static SeamRuntimeDetectorTestActivator plugin;
+	
+	
+	/**
+	 * The constructor
+	 */
+	public SeamRuntimeDetectorTestActivator() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+		plugin = this;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		plugin = null;
+		super.stop(context);
+	}
+
+	/**
+	 * Returns the shared instance
+	 *
+	 * @return the shared instance
+	 */
+	public static SeamRuntimeDetectorTestActivator getDefault() {
+		return plugin;
+	}
+
+}
Index: seam/tests/org.jboss.tools.runtime.seam.detector.test/plugin.properties
===================================================================
--- seam/tests/org.jboss.tools.runtime.seam.detector.test/plugin.properties	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/tests/org.jboss.tools.runtime.seam.detector.test/plugin.properties	(working copy)
@@ -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
Index: seam/tests/org.jboss.tools.runtime.seam.detector.test/build.properties
===================================================================
--- seam/tests/org.jboss.tools.runtime.seam.detector.test/build.properties	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/tests/org.jboss.tools.runtime.seam.detector.test/build.properties	(working copy)
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               plugin.properties,\
+               plugin.xml
+src.includes = *
Index: seam/tests/org.jboss.tools.runtime.seam.detector.test/pom.xml
===================================================================
--- seam/tests/org.jboss.tools.runtime.seam.detector.test/pom.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/tests/org.jboss.tools.runtime.seam.detector.test/pom.xml	(working copy)
@@ -0,0 +1,156 @@
+<?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.seam</groupId>
+		<artifactId>tests</artifactId>
+		<version>3.4.0-SNAPSHOT</version>
+	</parent>
+	<groupId>org.jboss.tools.seam.tests</groupId>
+	<artifactId>org.jboss.tools.runtime.seam.detector.test</artifactId>
+	
+	<packaging>eclipse-test-plugin</packaging>
+
+	<properties>
+		<systemProperties>-Djbosstools.test.jboss.home.4.2=${requirementsDirectory}/jboss-4.2.3.GA -Djbosstools.test.jboss.home.5.1=${requirementsDirectory}/jboss-5.1.0.GA -Djbosstools.test.seam.2.0.1.GA.home=${requirementsDirectory}/jboss-seam-2.0.1.GA -Djbosstools.test.seam.2.2.0.GA.home=${requirementsDirectory}/jboss-seam-2.2.0.GA -Djbosstools.test.eap.4.3.home=${requirementsDirectory}/jboss-eap-4.3 -Dskip.runtime.scanner=true -Djbosstools.test.jboss.home.7.0=${requirementsDirectory}/jboss-as-7.0.0.Final -Dorg.jboss.tools.tests.skipPrivateRequirements=${skipPrivateRequirements}</systemProperties>
+	</properties>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-dependency-plugin</artifactId>
+				<executions>
+					<execution>
+						<id>install-as</id>
+						<phase>pre-integration-test</phase>
+						<goals>
+							<goal>unpack</goal>
+						</goals>
+						<configuration>
+							<artifactItems>
+								<artifactItem>
+									<groupId>org.jboss.jbossas</groupId>
+									<artifactId>jboss-as-dist</artifactId>
+									<version>4.2.3.GA</version>
+									<type>zip</type>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.jboss.as</groupId>
+									<artifactId>jboss-as-dist</artifactId>
+									<version>7.0.0.Final</version>
+									<type>zip</type>
+								</artifactItem>
+							</artifactItems>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<groupId>com.googlecode.maven-download-plugin</groupId>
+				<artifactId>maven-download-plugin</artifactId>
+				<executions>
+					<execution>
+						<id>install-as-5.1.0</id>
+						<phase>pre-integration-test</phase>
+						<goals>
+							<goal>wget</goal>
+						</goals>
+						<configuration>
+							<url>http://repository.jboss.org/sourceforge/jboss-5.1.0.GA.zip</url>
+							<md5>78322c75ca0c13002a04418b4a8bc920</md5>
+							<unpack>true</unpack>
+						</configuration>
+					</execution>
+					<execution>
+						<id>install-seam-2.0.1</id>
+						<phase>pre-integration-test</phase>
+						<goals>
+							<goal>wget</goal>
+						</goals>
+						<configuration>
+							<url>http://repository.jboss.org/sourceforge/jboss-seam-2.0.1.GA.zip</url>
+							<unpack>true</unpack>
+							<md5>0a1accf94fd37e40ab1091ee593b8b75</md5>
+						</configuration>
+					</execution>
+					<execution>
+						<id>install-seam-2.2.0</id>
+						<phase>pre-integration-test</phase>
+						<goals>
+							<goal>wget</goal>
+						</goals>
+						<configuration>
+							<url>http://repository.jboss.org/sourceforge/jboss-seam-2.2.0.GA.zip</url>
+							<unpack>true</unpack>
+							<md5>febaf032f989240fe3828a8f0f7fe98a</md5>
+						</configuration>
+					</execution>
+					<execution>
+						<id>install-eap</id>
+						<phase>pre-integration-test</phase>
+						<goals>
+							<goal>wget</goal>
+						</goals>
+						<configuration>
+							<url>http://download.devel.redhat.com/released/JBEAP-4.3.0/CP03/zip/jboss-eap-noauth-4.3.0.GA_CP03.zip</url>
+							<md5>18dc28785c8b156b36e2d92db699064a</md5>
+							<unpack>true</unpack>
+							<skip>${skipPrivateRequirements}</skip>
+						</configuration>
+					</execution>
+					<execution>
+						<id>install-eap-seam-gen</id>
+						<phase>pre-integration-test</phase>
+						<goals>
+							<goal>wget</goal>
+						</goals>
+						<configuration>
+							<url>http://download.jboss.org/jbosstools/test-runtimes/rhds-seam-gen-patch.zip</url>
+							<md5>79b37541804f49844ea7322c0ff599c1</md5>
+							<unpack>true</unpack>
+							<outputDirectory>${requirementsDirectory}/jboss-eap-4.3/seam</outputDirectory>
+							<skip>${skipPrivateRequirements}</skip>
+						</configuration>
+					</execution>
+					<execution>
+						<id>install-eap-fp</id>
+						<phase>pre-integration-test</phase>
+						<goals>
+							<goal>wget</goal>
+						</goals>
+						<configuration>
+							<url>http://download.devel.redhat.com/released/JBEAP-4.3.0/CP03_FP01/zip/jboss-eap-fp-4.3.0.CP03-FP01.zip</url>
+							<md5>38fe2a2a55edc5239ba680eff3b29533</md5>
+							<unpack>true</unpack>
+							<skip>${skipPrivateRequirements}</skip>
+						</configuration>
+					</execution>
+					<execution>
+						<id>install-seam-fp-patch</id>
+						<phase>pre-integration-test</phase>
+						<goals>
+							<goal>wget</goal>
+						</goals>
+						<configuration>
+							<url>http://download.jboss.org/jbosstools/test-runtimes/jbds-seamfp-patch.zip</url>
+							<md5>c3af3b56add0acccb72db88de477f3c7</md5>
+							<unpack>true</unpack>
+							<skip>${skipPrivateRequirements}</skip>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+		
+			<plugin>
+				<groupId>org.eclipse.tycho</groupId>
+				<artifactId>tycho-surefire-plugin</artifactId>
+				<version>${tychoVersion}</version>
+				<configuration>
+					<testSuite>org.jboss.tools.runtime.seam.detector.test</testSuite>
+					<testClass>org.jboss.tools.runtime.seam.detector.test.SeamRuntimeDetectionAllTests</testClass>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+</project>
\ No newline at end of file
Index: seam/tests/org.jboss.tools.runtime.seam.detector.test/plugin.xml
===================================================================
--- seam/tests/org.jboss.tools.runtime.seam.detector.test/plugin.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/tests/org.jboss.tools.runtime.seam.detector.test/plugin.xml	(working copy)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+</plugin>

Property changes on: seam/tests/org.jboss.tools.runtime.seam.detector.test/plugin.xml
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: seam/tests/org.jboss.tools.runtime.seam.detector.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- seam/tests/org.jboss.tools.runtime.seam.detector.test/.settings/org.eclipse.jdt.core.prefs	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ seam/tests/org.jboss.tools.runtime.seam.detector.test/.settings/org.eclipse.jdt.core.prefs	(working copy)
@@ -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
Index: seam/tests/pom.xml
===================================================================
--- seam/tests/pom.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ seam/tests/pom.xml	(working copy)
@@ -45,6 +45,7 @@
 
 		<module>org.jboss.tools.seamfp.core.test</module>
 		<module>org.jboss.tools.seamfp.ui.test</module>
+		<module>org.jboss.tools.runtime.seam.detector.test</module>
 	</modules>
 	
 	<properties>
Index: seam/site/category.xml
===================================================================
--- seam/site/category.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ seam/site/category.xml	(working copy)
@@ -11,6 +11,10 @@
 	<feature url="features/org.jboss.tools.seam.test.feature_0.0.0.jar" id="org.jboss.tools.seam.test.feature" version="0.0.0">
 		<category name="JBoss Tools seam Nightly Build Update Site"/>
 	</feature>
+        <feature url="features/org.jboss.tools.runtime.seam.detector.feature_0.0.0.jar" id="org.jboss.tools.runtime.seam.detector.feature" version="0.0.0">
+                <category name="JBoss Tools seam Nightly Build Update Site"/>
+        </feature>
+
 	<!-- Sources -->
 	<feature url="features/org.jboss.tools.seam.feature.source_0.0.0.jar" id="org.jboss.tools.seam.feature.source" version="0.0.0">
 		<category name="JBoss Tools seam Nightly Build Update Site"/>
@@ -18,4 +22,8 @@
 	<feature url="features/org.jboss.tools.seam.test.feature.source_0.0.0.jar" id="org.jboss.tools.seam.test.feature.source" version="0.0.0">
 		<category name="JBoss Tools seam Nightly Build Update Site"/>
 	</feature>
+        <feature url="features/org.jboss.tools.runtime.seam.detector.feature.source_0.0.0.jar" id="org.jboss.tools.runtime.seam.detector.feature.source" version="0.0.0">
+                <category name="JBoss Tools seam Nightly Build Update Site"/>
+        </feature>
+
 </site>
Index: as/features/org.jboss.ide.eclipse.as.feature/feature.xml
===================================================================
--- as/features/org.jboss.ide.eclipse.as.feature/feature.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ as/features/org.jboss.ide.eclipse.as.feature/feature.xml	(working copy)
@@ -39,6 +39,9 @@
    <includes
          id="org.jboss.ide.eclipse.as.serverAdapter.wtp.feature"
          version="0.0.0"/>
+   <includes
+         id="org.jboss.tools.runtime.as.detector.feature"
+         version="0.0.0"/>
 
    <requires>
       <import plugin="org.eclipse.ui" version="3.7.0" match="greaterOrEqual"/>
@@ -78,6 +81,7 @@
       <import plugin="org.eclipse.jst.common.frameworks" version="1.1.500" match="greaterOrEqual"/>
       <import feature="org.jboss.ide.eclipse.archives.feature"/>
       <import feature="org.jboss.tools.jmx.feature"/>
+      <import feature="org.jboss.tools.runtime.core.feature"/>
    </requires>
 
    <plugin
Index: as/features/pom.xml
===================================================================
--- as/features/pom.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ as/features/pom.xml	(working copy)
@@ -19,7 +19,7 @@
 
 		<module>org.jboss.ide.eclipse.as.feature</module>
 		<module>org.jboss.ide.eclipse.as.test.feature</module>
-
+		<module>org.jboss.tools.runtime.as.detector.feature</module>
 	</modules>
 </project>
 	
Index: as/features/org.jboss.tools.runtime.as.detector.feature/.project
===================================================================
--- as/features/org.jboss.tools.runtime.as.detector.feature/.project	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ as/features/org.jboss.tools.runtime.as.detector.feature/.project	(working copy)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.jboss.tools.runtime.as.detector.feature</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.pde.FeatureBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.FeatureNature</nature>
+	</natures>
+</projectDescription>
Index: as/features/org.jboss.tools.runtime.as.detector.feature/license.html
===================================================================
--- as/features/org.jboss.tools.runtime.as.detector.feature/license.html	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ as/features/org.jboss.tools.runtime.as.detector.feature/license.html	(working copy)
@@ -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
Index: as/features/org.jboss.tools.runtime.as.detector.feature/feature.properties
===================================================================
--- as/features/org.jboss.tools.runtime.as.detector.feature/feature.properties	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ as/features/org.jboss.tools.runtime.as.detector.feature/feature.properties	(working copy)
@@ -0,0 +1,55 @@
+###############################################################################
+# Copyright (c) 2009-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 Runtime AS Detector
+
+# "providerName" property - name of the company that provides the feature
+providerName=JBoss by Red Hat
+
+# "updateSiteName" property - label for the update/discovery sites
+updateSiteName=JBoss Developer Studio Updates
+JBossToolsUpdatesSiteName=JBoss Tools Updates
+
+# "description" property - description of the feature
+description=JBoss Runtime AS Detector, provides detection of JBoss AS installations and configure them as part of JBoss 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 ##########################################
Index: as/features/org.jboss.tools.runtime.as.detector.feature/sourceTemplateFeature/.gitkeep
===================================================================
Index: as/features/org.jboss.tools.runtime.as.detector.feature/build.properties
===================================================================
--- as/features/org.jboss.tools.runtime.as.detector.feature/build.properties	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ as/features/org.jboss.tools.runtime.as.detector.feature/build.properties	(working copy)
@@ -0,0 +1,3 @@
+bin.includes = feature.xml,\
+               license.html,\
+               feature.properties
Index: as/features/org.jboss.tools.runtime.as.detector.feature/feature.xml
===================================================================
--- as/features/org.jboss.tools.runtime.as.detector.feature/feature.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ as/features/org.jboss.tools.runtime.as.detector.feature/feature.xml	(working copy)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+      id="org.jboss.tools.runtime.as.detector.feature"
+      label="%featureName"
+      version="2.4.0.qualifier"
+      provider-name="%providerName"
+      plugin="org.jboss.tools.runtime.as.detector">
+
+   <description>
+      %description
+   </description>
+
+   <copyright>
+      %copyright
+   </copyright>
+
+   <license url="%licenseURL">
+      %license
+   </license>
+
+   <plugin
+         id="org.jboss.tools.runtime.as.detector"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+</feature>
Index: as/features/org.jboss.tools.runtime.as.detector.feature/pom.xml
===================================================================
--- as/features/org.jboss.tools.runtime.as.detector.feature/pom.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ as/features/org.jboss.tools.runtime.as.detector.feature/pom.xml	(working copy)
@@ -0,0 +1,47 @@
+<?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.as</groupId>
+		<artifactId>features</artifactId>
+		<version>2.4.0-SNAPSHOT</version>
+	</parent>
+	<groupId>org.jboss.tools.as.features</groupId>
+	<artifactId>org.jboss.tools.runtime.as.detector.feature</artifactId>
+	
+	<packaging>eclipse-feature</packaging>
+	
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.eclipse.tycho.extras</groupId>
+				<artifactId>tycho-source-feature-plugin</artifactId>
+				<version>${tychoExtrasVersion}</version>
+				<executions>
+					<execution>
+						<id>source-feature</id>
+						<phase>package</phase>
+						<goals>
+							<goal>source-feature</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<groupId>org.eclipse.tycho</groupId>
+				<artifactId>tycho-p2-plugin</artifactId>
+				<version>${tychoVersion}</version>
+				<executions>
+					<execution>
+						<id>attached-p2-metadata</id>
+						<phase>package</phase>
+						<goals>
+							<goal>p2-metadata</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
+</project>
Index: as/plugins/pom.xml
===================================================================
--- as/plugins/pom.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ as/plugins/pom.xml	(working copy)
@@ -24,8 +24,9 @@
 		<module>org.jboss.ide.eclipse.as.rse.core</module>
 		<module>org.jboss.ide.eclipse.as.rse.ui</module>
 		<module>org.jboss.ide.eclipse.as.jmx.integration</module>
-        <module>org.jboss.ide.eclipse.as.management.core</module>
-        <module>org.jboss.ide.eclipse.as.management.as71</module>
+		<module>org.jboss.ide.eclipse.as.management.core</module>
+		<module>org.jboss.ide.eclipse.as.management.as71</module>
+		<module>org.jboss.tools.runtime.as.detector</module>
 	</modules>
 </project>
 	
Index: as/plugins/org.jboss.tools.runtime.as.detector/about.html
===================================================================
--- as/plugins/org.jboss.tools.runtime.as.detector/about.html	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ as/plugins/org.jboss.tools.runtime.as.detector/about.html	(working copy)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>JBoss Runtime Application Server Detection</title>
+<style type="text/css" media="screen">
+<!--
+  body {
+    font-family: Sans-serif, Arial, Helvetica;
+  }
+
+-->
+</style>
+</head>
+<body>
+<h1>JBoss Runtime AS Detector</h1>
+
+<p>
+This plugin is part of the JBoss Tools developed by the <a href="http://www.jboss.com">JBoss Inc.</a>
+</p>
+
+<p>Information about this plugin is available at <a href="http://www.jboss.org/tools">JBoss Tools project page</a></p>
+
+<p>
+This software is distributed under the terms of the Eclipse Public License - v 1.0
+(see <a href="www.eclipse.org/legal/epl-v10.html">Eclipse Public License - Version 1.0</a>).
+</p>
+</body>
+</html>
\ No newline at end of file
Index: as/plugins/org.jboss.tools.runtime.as.detector/jboss_about.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: as/plugins/org.jboss.tools.runtime.as.detector/jboss_about.png
===================================================================
--- as/plugins/org.jboss.tools.runtime.as.detector/jboss_about.png	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ as/plugins/org.jboss.tools.runtime.as.detector/jboss_about.png	(working copy)

Property changes on: as/plugins/org.jboss.tools.runtime.as.detector/jboss_about.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: as/plugins/org.jboss.tools.runtime.as.detector/plugin.xml
===================================================================
--- as/plugins/org.jboss.tools.runtime.as.detector/plugin.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ as/plugins/org.jboss.tools.runtime.as.detector/plugin.xml	(working copy)
@@ -0,0 +1,15 @@
+<?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.JBossASHandler"
+    		name="JBoss AS"
+       		class="org.jboss.tools.runtime.handlers.JBossASHandler"
+       		preferenceId="org.eclipse.wst.server.ui.runtime.preferencePage"
+       		priority="100"/>
+	</extension>
+	
+</plugin>
Index: as/plugins/org.jboss.tools.runtime.as.detector/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- as/plugins/org.jboss.tools.runtime.as.detector/.settings/org.eclipse.jdt.core.prefs	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ as/plugins/org.jboss.tools.runtime.as.detector/.settings/org.eclipse.jdt.core.prefs	(working copy)
@@ -0,0 +1,8 @@
+#Mon May 30 12:32:14 CEST 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
Index: as/plugins/org.jboss.tools.runtime.as.detector/.classpath
===================================================================
--- as/plugins/org.jboss.tools.runtime.as.detector/.classpath	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ as/plugins/org.jboss.tools.runtime.as.detector/.classpath	(working copy)
@@ -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>
Index: as/plugins/org.jboss.tools.runtime.as.detector/META-INF/MANIFEST.MF
===================================================================
--- as/plugins/org.jboss.tools.runtime.as.detector/META-INF/MANIFEST.MF	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ as/plugins/org.jboss.tools.runtime.as.detector/META-INF/MANIFEST.MF	(working copy)
@@ -0,0 +1,25 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %BundleName
+Bundle-SymbolicName: org.jboss.tools.runtime.as.detector;singleton:=true
+Bundle-Version: 2.4.0.qualifier
+Bundle-Activator: org.jboss.tools.runtime.as.detector.RuntimeAsActivator
+Require-Bundle: org.eclipse.ui;bundle-version="3.7.0",
+ org.eclipse.core.runtime;bundle-version="3.7.0",
+ org.eclipse.core.resources;bundle-version="3.7.0",
+ org.eclipse.wst.server.core;bundle-version="1.1.302",
+ org.eclipse.ui.navigator;bundle-version="3.5.100",
+ org.eclipse.debug.core;bundle-version="3.7.0",
+ org.eclipse.jdt.launching;bundle-version="3.6.0",
+ org.eclipse.ui.workbench;bundle-version="3.7.0",
+ org.eclipse.datatools.connectivity;bundle-version="1.2.2";visibility:=reexport,
+ org.eclipse.datatools.connectivity.db.generic;bundle-version="1.0.1",
+ org.jboss.tools.common,
+ org.jboss.tools.runtime.core,
+ org.jboss.ide.eclipse.as.core
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-Vendor: %BundleVendor
+Bundle-Localization: plugin
+Export-Package: org.jboss.tools.runtime.as.detector,
+ org.jboss.tools.runtime.handlers
Index: as/plugins/org.jboss.tools.runtime.as.detector/.project
===================================================================
--- as/plugins/org.jboss.tools.runtime.as.detector/.project	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ as/plugins/org.jboss.tools.runtime.as.detector/.project	(working copy)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.jboss.tools.runtime.as.detector</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
Index: as/plugins/org.jboss.tools.runtime.as.detector/about.properties
===================================================================
--- as/plugins/org.jboss.tools.runtime.as.detector/about.properties	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ as/plugins/org.jboss.tools.runtime.as.detector/about.properties	(working copy)
@@ -0,0 +1,2 @@
+blurb=JBoss Runtime AS Detector\n\nVersion\: {featureVersion}\n\n(c) Copyright (c) Red Hat, Inc., contributors and others 2004 - 2012.  All rights reserved.\nVisit http\://jboss.org/tools
+
Index: as/plugins/org.jboss.tools.runtime.as.detector/about.mappings
===================================================================
--- as/plugins/org.jboss.tools.runtime.as.detector/about.mappings	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ as/plugins/org.jboss.tools.runtime.as.detector/about.mappings	(working copy)
@@ -0,0 +1,5 @@
+# about.mappings
+# contains fill-ins for about.properties
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file does not need to be translated.
+
Index: as/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/handlers/JBossASHandler.java
===================================================================
--- as/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/handlers/JBossASHandler.java	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ as/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/handlers/JBossASHandler.java	(working copy)
@@ -0,0 +1,414 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ *     Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.runtime.handlers;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Properties;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.datatools.connectivity.ConnectionProfileConstants;
+import org.eclipse.datatools.connectivity.ConnectionProfileException;
+import org.eclipse.datatools.connectivity.ProfileManager;
+import org.eclipse.datatools.connectivity.db.generic.IDBConnectionProfileConstants;
+import org.eclipse.datatools.connectivity.db.generic.IDBDriverDefinitionConstants;
+import org.eclipse.datatools.connectivity.drivers.DriverInstance;
+import org.eclipse.datatools.connectivity.drivers.DriverManager;
+import org.eclipse.datatools.connectivity.drivers.IDriverMgmtConstants;
+import org.eclipse.datatools.connectivity.drivers.IPropertySet;
+import org.eclipse.datatools.connectivity.drivers.PropertySetImpl;
+import org.eclipse.datatools.connectivity.drivers.models.TemplateDescriptor;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IRuntimeType;
+import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerType;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.eclipse.wst.server.core.ServerCore;
+import org.eclipse.wst.server.core.ServerUtil;
+import org.eclipse.wst.server.core.model.ServerDelegate;
+import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
+import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
+import org.jboss.ide.eclipse.as.core.server.bean.JBossServerType;
+import org.jboss.ide.eclipse.as.core.server.bean.ServerBean;
+import org.jboss.ide.eclipse.as.core.server.bean.ServerBeanLoader;
+import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
+import org.jboss.tools.runtime.as.detector.IJBossRuntimePluginConstants;
+import org.jboss.tools.runtime.as.detector.Messages;
+import org.jboss.tools.runtime.as.detector.RuntimeAsActivator;
+import org.jboss.tools.runtime.core.JBossRuntimeLocator;
+import org.jboss.tools.runtime.core.RuntimeCoreActivator;
+import org.jboss.tools.runtime.core.model.AbstractRuntimeDetector;
+import org.jboss.tools.runtime.core.model.IRuntimeDetector;
+import org.jboss.tools.runtime.core.model.RuntimeDefinition;
+import org.osgi.framework.Bundle;
+
+public class JBossASHandler extends AbstractRuntimeDetector implements IJBossRuntimePluginConstants {
+	
+	private static String[] hasIncludedRuntimes = new String[] {SOA_P, EAP, EPP, EWP, SOA_P_STD};
+	private static final String DROOLS = "DROOLS"; // NON-NLS-1$
+	private static final String ESB = "ESB"; //$NON-NLS-1$
+	
+	// This constants are made to avoid dependency with org.jboss.ide.eclipse.as.core plugin
+	public static final String RUNTIME_TYPES[] = IJBossToolingConstants.ALL_JBOSS_RUNTIMES;
+	public static final String SERVER_TYPES[] = IJBossToolingConstants.ALL_JBOSS_SERVERS;
+	
+	public static final HashMap<String,String> SERVER_DEFAULT_NAME = new HashMap<String, String>();
+	static {
+		SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_AS_32, Messages.JBossRuntimeStartup_JBoss_Application_Server_3_2);
+		SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_AS_40, Messages.JBossRuntimeStartup_JBoss_Application_Server_4_0);
+		SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_AS_42, Messages.JBossRuntimeStartup_JBoss_Application_Server_4_2);
+		SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_AS_50, Messages.JBossRuntimeStartup_JBoss_Application_Server_5_0);
+		SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_AS_51, Messages.JBossRuntimeStartup_JBoss_Application_Server_5_1);
+		SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_AS_60, Messages.JBossRuntimeStartup_JBoss_Application_Server_6_0);
+		SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_EAP_43, Messages.JBossRuntimeStartup_JBoss_EAP_Server_4_3);
+		SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_EAP_50, Messages.JBossRuntimeStartup_JBoss_EAP_Server_5_0);
+		SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_AS_70, Messages.JBossRuntimeStartup_JBoss_Application_Server_7_0);
+		SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_AS_71, Messages.JBossRuntimeStartup_JBoss_Application_Server_7_1);
+		SERVER_DEFAULT_NAME.put(IJBossToolingConstants.SERVER_EAP_60, Messages.JBossRuntimeStartup_JBoss_EAP_Server_6_0);
+	}
+
+	public void initializeRuntimes(List<RuntimeDefinition> serverDefinitions) {
+		createJBossServerFromDefinitions(serverDefinitions);
+	}
+		
+	private static File getLocation(RuntimeDefinition serverDefinition) {
+		String type = serverDefinition.getType();
+		String version = serverDefinition.getVersion();
+		if (EAP.equals(type) && version != null && version.startsWith("6") ) {
+			return serverDefinition.getLocation();
+		}
+		if (SOA_P.equals(type) || EAP.equals(type) || EPP.equals(type)) {
+			return new File(serverDefinition.getLocation(), "jboss-as");
+		}
+		if (SOA_P_STD.equals(type)) {
+			return new File(serverDefinition.getLocation(),"jboss-esb"); //$NON-NLS-1$					
+		}
+		if(EWP.equals(type)) {
+				return new File(serverDefinition.getLocation(),"jboss-as-web"); //$NON-NLS-1$
+		}
+		if (AS.equals(type) || EAP_STD.equals(type)) {
+			return serverDefinition.getLocation();
+		}
+		return null;
+	}
+	
+	public static void createJBossServerFromDefinitions(List<RuntimeDefinition> serverDefinitions) {
+		for (RuntimeDefinition serverDefinition:serverDefinitions) {
+			if (serverDefinition.isEnabled()) {
+				File asLocation = getLocation(serverDefinition);
+				if (asLocation == null || !asLocation.isDirectory()) {
+					continue;
+				}
+				String type = serverDefinition.getType();
+				if (SOA_P.equals(type) || EAP.equals(type) || EPP.equals(type)
+						|| SOA_P_STD.equals(type) || EWP.equals(type)
+						|| EAP_STD.equals(type) || AS.equals(type)) {
+					String typeId = new ServerBeanLoader(asLocation).getServerAdapterId();
+					String name = serverDefinition.getName();
+					String runtimeName = name + " " + RUNTIME; //$NON-NLS-1$
+					createJBossServer(asLocation, typeId, name, runtimeName);
+				}
+			}
+			createJBossServerFromDefinitions(serverDefinition.getIncludedServerDefinitions());
+		}	
+	}
+
+	private static boolean serverExistsForPath(IPath locPath) {
+		IServer[] servers = ServerCore.getServers();
+		for (int i = 0; i < servers.length; i++) {
+			IRuntime runtime = servers[i].getRuntime();
+			if(runtime != null && runtime.getLocation() != null && runtime.getLocation().equals(locPath)) {
+				return true;
+			}
+		}
+		return false;
+	}
+	
+	private static IRuntime findRuntimeForPath(IPath locPath) {
+		IRuntime[] runtimes = ServerCore.getRuntimes();
+		for (int i = 0; i < runtimes.length; i++) {
+			if (runtimes[i] == null || runtimes[i].getLocation() == null) {
+				continue;
+			}
+			if (runtimes[i].getLocation().equals(locPath)) {
+				return runtimes[i];
+			}
+		}
+		return null;
+	}
+	
+	private static void createJBossServer(File asLocation, String serverTypeId, String name, String runtimeName) {
+		if (asLocation == null || !asLocation.isDirectory() || serverTypeId == null)
+			return;
+		IServerType serverType = ServerCore.findServerType(serverTypeId);
+		if( serverType == null )
+			return;
+		IRuntimeType rtType = serverType.getRuntimeType();
+		if( rtType == null )
+			return;
+		
+		IPath jbossAsLocationPath = new Path(asLocation.getAbsolutePath());
+		if( serverExistsForPath(jbossAsLocationPath))
+			return;
+		
+		IRuntime runtime = findRuntimeForPath(jbossAsLocationPath);
+		IProgressMonitor progressMonitor = new NullProgressMonitor();
+		try {
+			if (runtime == null) {
+				runtime = createRuntime(runtimeName, asLocation.getAbsolutePath(), progressMonitor, rtType);
+			}
+			if (runtime != null) {
+				createServer(progressMonitor, runtime, serverType, name);
+			}
+
+			new DriverUtility().createDriver(asLocation.getAbsolutePath(), serverType);
+		} catch (CoreException e) {
+			RuntimeAsActivator.log(e,Messages.JBossRuntimeStartup_Cannot_create_new_JBoss_Server);
+		} catch (ConnectionProfileException e) {
+			RuntimeAsActivator.log(e,Messages.JBossRuntimeStartup_Cannott_create_new_DTP_Connection_Profile);
+		}
+	}
+
+	/**
+	 * Creates new JBoss AS Runtime
+	 * @param jbossASLocation location of JBoss AS
+	 * @param progressMonitor
+	 * @return runtime working copy
+	 * @throws CoreException
+	 */
+	private static IRuntime createRuntime(String runtimeName, String jbossASLocation, 
+			IProgressMonitor progressMonitor, IRuntimeType rtType) throws CoreException {
+		IRuntimeWorkingCopy runtime = null;
+		IPath jbossAsLocationPath = new Path(jbossASLocation);
+		runtime = rtType.createRuntime(null, progressMonitor);
+		runtime.setLocation(jbossAsLocationPath);
+		if(runtimeName!=null) {
+			runtime.setName(runtimeName);				
+		}
+		return runtime.save(false, progressMonitor);
+	}
+
+	/**
+	 * Creates new JBoss Server
+	 * @param progressMonitor
+	 * @param runtime parent JBoss AS Runtime
+	 * @return server working copy
+	 * @throws CoreException
+	 */
+	private static void createServer(IProgressMonitor progressMonitor, IRuntime runtime,
+			IServerType serverType, String name) throws CoreException {
+		if (name == null)
+			name = SERVER_DEFAULT_NAME.get(serverType.getId());
+		if( !serverWithNameExists(name)) {
+			createServer2(runtime, serverType, name, LocalPublishMethod.LOCAL_PUBLISH_METHOD);
+		}
+	}
+	
+	private static boolean serverWithNameExists(String name) {
+		IServer[] servers = ServerCore.getServers();
+		for (IServer server:servers) {
+			if (name.equals(server.getName()) ) {
+				return true;
+			}
+		}
+		return false;
+	}
+	
+	public static IServer createServer2(IRuntime currentRuntime, IServerType serverType, String serverName, String mode) throws CoreException {
+		IServerWorkingCopy serverWC = serverType.createServer(null, null,
+				new NullProgressMonitor());
+		serverWC.setRuntime(currentRuntime);
+		serverWC.setName(serverName);
+		serverWC.setServerConfiguration(null);
+		serverWC.setAttribute(IDeployableServer.SERVER_MODE, mode); 
+		return serverWC.save(true, new NullProgressMonitor());
+	}
+
+	public RuntimeDefinition getServerDefinition(File root,
+			IProgressMonitor monitor) {
+		if (monitor.isCanceled() || root == null || !isEnabled()) {
+			return null;
+		}
+		ServerBeanLoader loader = new ServerBeanLoader(root);
+		ServerBean serverBean = loader.getServerBean();
+		
+		if (!JBossServerType.UNKNOWN.equals(serverBean.getType())) {
+			RuntimeDefinition serverDefinition = new RuntimeDefinition(serverBean.getName(), 
+					serverBean.getVersion(), serverBean.getType().getId(), new File(serverBean.getLocation()));
+			calculateIncludedServerDefinition(serverDefinition, monitor);
+			return serverDefinition;
+		}
+		return null;
+	}
+	
+	private void calculateIncludedServerDefinition(
+			RuntimeDefinition serverDefinition, IProgressMonitor monitor) {
+		if (serverDefinition == null || serverDefinition.getType() == null) {
+			return;
+		}
+		String type = serverDefinition.getType();
+		if (!hasIncludedRuntimes(type)) {
+			return;
+		}
+		serverDefinition.getIncludedServerDefinitions().clear();
+		List<RuntimeDefinition> serverDefinitions = serverDefinition
+				.getIncludedServerDefinitions();
+		JBossRuntimeLocator locator = new JBossRuntimeLocator();
+		final File location = getLocation(serverDefinition);
+		File[] directories = serverDefinition.getLocation().listFiles(
+				new FileFilter() {
+
+					@Override
+					public boolean accept(File file) {
+						if (!file.isDirectory() || file.equals(location)) {
+							return false;
+						}
+						return true;
+					}
+				});
+		boolean saved = isEnabled();
+		try {
+			setEnabled(false);
+			for (File directory : directories) {
+				List<RuntimeDefinition> definitions = new ArrayList<RuntimeDefinition>();
+				locator.searchDirectory(directory, definitions, 1, monitor);
+				for (RuntimeDefinition definition:definitions) {
+					definition.setParent(serverDefinition);
+				}
+				serverDefinitions.addAll(definitions);
+			}
+			if (SOA_P.equals(type) || SOA_P_STD.equals(type)) {
+				addDrools(serverDefinition);
+				addEsb(serverDefinition);
+			}
+		} finally {
+			setEnabled(saved);
+		}
+	}
+
+	private void addDrools(RuntimeDefinition serverDefinition) {
+		if (serverDefinition == null) {
+			return;
+		}
+		Bundle drools = Platform.getBundle("org.drools.eclipse");
+		Bundle droolsDetector = Platform
+				.getBundle("org.jboss.tools.runtime.drools.detector");
+		if (drools != null && droolsDetector != null) {
+			File droolsRoot = serverDefinition.getLocation();
+			if (droolsRoot.isDirectory()) {
+				String name = "Drools - " + serverDefinition.getName();
+				RuntimeDefinition droolsDefinition = new RuntimeDefinition(
+						name, serverDefinition.getVersion(), DROOLS,
+						droolsRoot);
+				droolsDefinition.setParent(serverDefinition);
+				serverDefinition.getIncludedServerDefinitions().add(
+						droolsDefinition);
+			}
+		}
+	}
+	
+	private void addEsb(RuntimeDefinition serverDefinition) {
+		if (serverDefinition == null) {
+			return;
+		}
+		Bundle esb = Platform.getBundle("org.jboss.tools.esb.project.core");
+		Bundle esbDetectorPlugin = Platform
+				.getBundle("org.jboss.tools.runtime.esb.detector");
+		if (esb != null && esbDetectorPlugin != null) {
+			String type = serverDefinition.getType();
+			File esbRoot;
+			if (SOA_P.equals(type)) {
+				esbRoot = serverDefinition.getLocation();
+			} else {
+				esbRoot = new File(serverDefinition.getLocation(), "jboss-esb"); //$NON-NLS-1$
+			}
+			if (esbRoot.isDirectory()) {
+				String name = "ESB - " + serverDefinition.getName();
+				String version="";
+				RuntimeDefinition esbDefinition = new RuntimeDefinition(
+						name, version, ESB,
+						esbRoot);
+				IRuntimeDetector esbDetector = RuntimeCoreActivator.getEsbDetector();
+				if (esbDetector != null) {
+					version = esbDetector.getVersion(esbDefinition);
+					esbDefinition.setVersion(version);
+				}
+				
+				esbDefinition.setParent(serverDefinition);
+				serverDefinition.getIncludedServerDefinitions().add(
+						esbDefinition);
+			}
+		}
+	}
+
+	private boolean hasIncludedRuntimes(String type) {
+		for (String t:hasIncludedRuntimes) {
+			if (t.equals(type)) {
+				return true;
+			}
+		}
+		return false;
+	}
+
+	@Override
+	public boolean exists(RuntimeDefinition serverDefinition) {
+		if (serverDefinition == null || serverDefinition.getLocation() == null) {
+			return false;
+		}
+		File location = getLocation(serverDefinition);
+		if (location == null || !location.isDirectory()) {
+			return false;
+		}
+		String path = location.getAbsolutePath();
+		if (path == null) {
+			return false;
+		}
+		IServer[] servers = ServerCore.getServers();
+		for (int i = 0; i < servers.length; i++) {
+			IRuntime runtime = servers[i].getRuntime();
+			if (runtime == null || runtime.getLocation() == null) {
+				continue;
+			}
+			if(path.equals(runtime.getLocation().toOSString())) {
+				return true;
+			}
+		}
+		return false;
+	}
+
+	@Override
+	public void computeIncludedServerDefinition(
+			RuntimeDefinition serverDefinition) {
+		if (serverDefinition == null) {
+			return;
+		}
+		String type = serverDefinition.getType();
+		if (AS.equals(type)) {
+			return;
+		}
+		calculateIncludedServerDefinition(serverDefinition, new NullProgressMonitor());
+	}
+	
+}
Index: as/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/handlers/DriverUtility.java
===================================================================
--- as/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/handlers/DriverUtility.java	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ as/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/handlers/DriverUtility.java	(working copy)
@@ -0,0 +1,209 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ *     Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.runtime.handlers;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Properties;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.datatools.connectivity.ConnectionProfileConstants;
+import org.eclipse.datatools.connectivity.ConnectionProfileException;
+import org.eclipse.datatools.connectivity.ProfileManager;
+import org.eclipse.datatools.connectivity.db.generic.IDBConnectionProfileConstants;
+import org.eclipse.datatools.connectivity.db.generic.IDBDriverDefinitionConstants;
+import org.eclipse.datatools.connectivity.drivers.DriverInstance;
+import org.eclipse.datatools.connectivity.drivers.DriverManager;
+import org.eclipse.datatools.connectivity.drivers.IDriverMgmtConstants;
+import org.eclipse.datatools.connectivity.drivers.IPropertySet;
+import org.eclipse.datatools.connectivity.drivers.PropertySetImpl;
+import org.eclipse.datatools.connectivity.drivers.models.TemplateDescriptor;
+import org.eclipse.wst.server.core.IServerType;
+import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
+import org.jboss.tools.runtime.as.detector.IJBossRuntimePluginConstants;
+import org.jboss.tools.runtime.as.detector.Messages;
+import org.jboss.tools.runtime.as.detector.RuntimeAsActivator;
+
+public class DriverUtility implements IJBossRuntimePluginConstants {
+	public static final HashMap<String,String> SERVER_DRIVER_LOCATION = new HashMap<String, String>();
+	static {
+		SERVER_DRIVER_LOCATION.put(IJBossToolingConstants.SERVER_AS_32, HSQLDB_DRIVER_3X_4X_LOCATION);
+		SERVER_DRIVER_LOCATION.put(IJBossToolingConstants.SERVER_AS_40, HSQLDB_DRIVER_3X_4X_LOCATION);
+		SERVER_DRIVER_LOCATION.put(IJBossToolingConstants.SERVER_AS_42, HSQLDB_DRIVER_3X_4X_LOCATION);
+		SERVER_DRIVER_LOCATION.put(IJBossToolingConstants.SERVER_AS_50, HSQLDB_DRIVER_5X_LOCATION);
+		SERVER_DRIVER_LOCATION.put(IJBossToolingConstants.SERVER_AS_51, HSQLDB_DRIVER_5X_LOCATION);
+		SERVER_DRIVER_LOCATION.put(IJBossToolingConstants.SERVER_AS_60, HSQLDB_DRIVER_5X_LOCATION);
+		SERVER_DRIVER_LOCATION.put(IJBossToolingConstants.SERVER_EAP_43, HSQLDB_DRIVER_3X_4X_LOCATION);
+		SERVER_DRIVER_LOCATION.put(IJBossToolingConstants.SERVER_EAP_50, HSQLDB_DRIVER_5X_LOCATION);
+	}
+
+	/**
+	 * Creates HSQL DB Driver
+	 * @param jbossASLocation location of JBoss AS
+	 * @param index 
+	 * @throws ConnectionProfileException
+	 * @return driver instance
+	 */
+	public void createDriver(String jbossASLocation, IServerType serverType) throws ConnectionProfileException {
+		if(ProfileManager.getInstance().getProfileByName(DEFAULT_DS) != null) {
+			// Don't create the driver a few times
+			return;
+		}
+		String driverPath;
+		try {
+			driverPath = getDriverPath(jbossASLocation, serverType);
+		} catch (IOException e) {
+			RuntimeAsActivator.getDefault().getLog().log(new Status(IStatus.ERROR,
+					RuntimeAsActivator.PLUGIN_ID, Messages.JBossRuntimeStartup_Cannott_create_new_HSQL_DB_Driver, e));
+			return;
+		}
+		if (driverPath == null) {
+			RuntimeAsActivator.getDefault().getLog().log(new Status(IStatus.ERROR,
+					RuntimeAsActivator.PLUGIN_ID, Messages.JBossRuntimeStartup_Cannot_create_new_DB_Driver));
+		}
+
+		DriverInstance driver = getDriver(serverType);
+		if (driver == null) {
+			TemplateDescriptor descr = getDriverTemplateDescriptor(serverType);
+			IPropertySet instance = new PropertySetImpl(getDriverName(serverType), getDriverDefinitionId(serverType));
+			instance.setName(getDriverName(serverType));
+			instance.setID(getDriverDefinitionId(serverType));
+			Properties props = new Properties();
+
+			IConfigurationElement[] template = descr.getProperties();
+			for (int i = 0; i < template.length; i++) {
+				IConfigurationElement prop = template[i];
+				String id = prop.getAttribute("id"); //$NON-NLS-1$
+
+				String value = prop.getAttribute("value"); //$NON-NLS-1$
+				props.setProperty(id, value == null ? "" : value); //$NON-NLS-1$
+			}
+			props.setProperty(DTP_DB_URL_PROPERTY_ID, getDriverUrl(serverType)); //$NON-NLS-1$
+			props.setProperty(IDriverMgmtConstants.PROP_DEFN_TYPE, descr.getId());
+			props.setProperty(IDriverMgmtConstants.PROP_DEFN_JARLIST, driverPath);
+			if( isAS7StyleServer(serverType)) {
+				props.setProperty(IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID, "org.h2.Driver");
+				props.setProperty(IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID, "H2 driver");
+				props.setProperty(IDBDriverDefinitionConstants.URL_PROP_ID, "jdbc:h2:mem");
+				props.setProperty(IDBDriverDefinitionConstants.USERNAME_PROP_ID, "sa");
+			}
+			
+			instance.setBaseProperties(props);
+			DriverManager.getInstance().removeDriverInstance(instance.getID());
+			System.gc();
+			DriverManager.getInstance().addDriverInstance(instance);
+		}
+
+		driver = DriverManager.getInstance().getDriverInstanceByName(getDriverName(serverType));
+		if (driver != null && ProfileManager.getInstance().getProfileByName(DEFAULT_DS) == null) { //$NON-NLS-1$
+			// create profile
+			Properties props = new Properties();
+			props.setProperty(ConnectionProfileConstants.PROP_DRIVER_DEFINITION_ID, 
+					getDriverDefinitionId(serverType));
+			props.setProperty(IDBConnectionProfileConstants.CONNECTION_PROPERTIES_PROP_ID, ""); //$NON-NLS-1$
+			props.setProperty(IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID));
+			props.setProperty(IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID,	driver.getProperty(IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID));
+			props.setProperty(IDBDriverDefinitionConstants.DATABASE_VERSION_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.DATABASE_VERSION_PROP_ID));
+			props.setProperty(IDBDriverDefinitionConstants.DATABASE_NAME_PROP_ID, "Default"); //$NON-NLS-1$
+			props.setProperty(IDBDriverDefinitionConstants.PASSWORD_PROP_ID, ""); //$NON-NLS-1$
+			props.setProperty(IDBConnectionProfileConstants.SAVE_PASSWORD_PROP_ID, "false"); //$NON-NLS-1$
+			props.setProperty(IDBDriverDefinitionConstants.USERNAME_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.USERNAME_PROP_ID));
+			props.setProperty(IDBDriverDefinitionConstants.URL_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.URL_PROP_ID));
+
+			if( isAS7StyleServer(serverType)) {
+				ProfileManager.getInstance().createProfile(DEFAULT_DS,	Messages.JBossRuntimeStartup_The_JBoss_AS_H2_embedded_database, H2_PROFILE_ID, props, "", false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+			} else {
+				ProfileManager.getInstance().createProfile(DEFAULT_DS,	Messages.JBossRuntimeStartup_The_JBoss_AS_Hypersonic_embedded_database, HSQL_PROFILE_ID, props, "", false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+			}
+		}
+		
+	}
+
+	protected static String getDriverUrl(IServerType serverType) {
+		if( isAS7StyleServer(serverType)) {
+			return "jdbc:h2:mem";
+		} else {
+			return "jdbc:hsqldb:.";
+		}
+	}
+
+	private static String getDriverDefinitionId(IServerType serverType) {
+		if( isAS7StyleServer(serverType)) {
+			return H2_DRIVER_DEFINITION_ID;
+		} else {
+			return HSQL_DRIVER_DEFINITION_ID;
+		}
+	}
+
+	private static String getDriverName(IServerType serverType) {
+		if( isAS7StyleServer(serverType)) {
+			return H2_DRIVER_NAME;
+		} else {
+			return HSQL_DRIVER_NAME;
+		}
+	}
+
+	protected static TemplateDescriptor getDriverTemplateDescriptor(IServerType serverType) {
+		if( isAS7StyleServer(serverType)) {
+			return TemplateDescriptor.getDriverTemplateDescriptor(H2_DRIVER_TEMPLATE_ID);
+		} else {
+			return TemplateDescriptor.getDriverTemplateDescriptor(HSQL_DRIVER_TEMPLATE_ID);
+		}
+	}
+
+	protected static DriverInstance getDriver(IServerType serverType) {
+		if( isAS7StyleServer(serverType)) {
+			return DriverManager.getInstance().getDriverInstanceByName(H2_DRIVER_NAME);
+		}
+		return DriverManager.getInstance().getDriverInstanceByName(HSQL_DRIVER_NAME);
+	}
+
+	private static String getDriverPath(String jbossASLocation, IServerType serverType)
+			throws IOException {
+		String driverPath;
+		if (isAS7StyleServer(serverType)) {
+			File file = new File(jbossASLocation + "/modules/com/h2database/h2/main").getCanonicalFile();
+			File[] fileList = file.listFiles(new FilenameFilter() {
+				
+				@Override
+				public boolean accept(File dir, String name) {
+					if (name.startsWith("h2") && name.endsWith(".jar")) {
+						return true;
+					}
+					return false;
+				}
+			});
+			if (fileList != null && fileList.length > 0) {
+				return fileList[0].getCanonicalPath();
+			}
+			return null;
+		} else {
+			String loc = SERVER_DRIVER_LOCATION.get(serverType.getId());
+			driverPath = new File(jbossASLocation + loc).getCanonicalPath(); //$NON-NLS-1$
+		}
+		return driverPath;
+	}
+
+	private static boolean isAS7StyleServer(IServerType type) {
+		if( type != null ) {
+			String id = type.getId();
+			return IJBossToolingConstants.SERVER_AS_70.equals(id) || 
+					IJBossToolingConstants.SERVER_AS_71.equals(id) ||
+					IJBossToolingConstants.SERVER_EAP_60.equals(id);
+		}
+		return false;
+	}
+
+}
Index: as/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/messages.properties
===================================================================
--- as/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/messages.properties	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ as/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/messages.properties	(working copy)
@@ -0,0 +1,18 @@
+JBossRuntimeStartup_Cannot_create_new_JBoss_Server=Can''t create new JBoss Server
+JBossRuntimeStartup_Cannott_create_new_DTP_Connection_Profile=Can''t create new DTP Connection Profile for JBoss AS Hypersonic embedded database
+JBossRuntimeStartup_Cannott_create_new_HSQL_DB_Driver=Can''t create new HSQL DB Driver.
+JBossRuntimeStartup_Cannot_create_new_DB_Driver=Can''t create new DB Driver.
+JBossRuntimeStartup_JBoss_Application_Server_3_2=JBoss Application Server 3.2
+JBossRuntimeStartup_JBoss_Application_Server_4_0=JBoss Application Server 4.0
+JBossRuntimeStartup_JBoss_Application_Server_4_2=JBoss Application Server 4.2
+JBossRuntimeStartup_JBoss_Application_Server_5_0=JBoss Application Server 5.0
+JBossRuntimeStartup_JBoss_Application_Server_5_1=JBoss Application Server 5.1
+JBossRuntimeStartup_JBoss_Application_Server_6_0=JBoss Application Server 6.0
+JBossRuntimeStartup_JBoss_Application_Server_7_0=JBoss Application Server 7.0
+JBossRuntimeStartup_JBoss_Application_Server_7_1=JBoss Application Server 7.1
+JBossRuntimeStartup_JBoss_EAP_Server_4_3=JBoss EAP Server 4.3
+JBossRuntimeStartup_JBoss_EAP_Server_5_0=JBoss EAP Server 5.0
+JBossRuntimeStartup_JBoss_EAP_Server_6_0=JBoss EAP Server 6.0
+JBossRuntimeStartup_Runtime=Runtime
+JBossRuntimeStartup_The_JBoss_AS_Hypersonic_embedded_database=The JBoss AS Hypersonic embedded database
+JBossRuntimeStartup_The_JBoss_AS_H2_embedded_database=The JBoss AS H2 embedded database
Index: as/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/RuntimeAsActivator.java
===================================================================
--- as/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/RuntimeAsActivator.java	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ as/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/RuntimeAsActivator.java	(working copy)
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ *     Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.runtime.as.detector;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class RuntimeAsActivator extends AbstractUIPlugin {
+
+	// The plug-in ID
+	public static final String PLUGIN_ID = "org.jboss.tools.runtime.as.detector"; //$NON-NLS-1$
+
+	// The shared instance
+	private static RuntimeAsActivator plugin;
+	
+	/**
+	 * The constructor
+	 */
+	public RuntimeAsActivator() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+		plugin = this;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		plugin = null;
+		super.stop(context);
+	}
+
+	/**
+	 * Returns the shared instance
+	 *
+	 * @return the shared instance
+	 */
+	public static RuntimeAsActivator getDefault() {
+		return plugin;
+	}
+	
+	public static void log(Throwable e) {
+		IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, e
+				.getLocalizedMessage(), e);
+		getDefault().getLog().log(status);
+	}
+	
+	public static void log(Throwable e, String message) {
+		IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, message, e);
+		getDefault().getLog().log(status);
+	}
+
+
+}
Index: as/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/Messages.java
===================================================================
--- as/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/Messages.java	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ as/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/Messages.java	(working copy)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ *     Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.runtime.as.detector;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+	private static final String BUNDLE_NAME = "org.jboss.tools.runtime.as.detector.messages"; //$NON-NLS-1$
+	public static String JBossRuntimeStartup_JBoss_Application_Server_6_0;
+	public static String JBossRuntimeStartup_JBoss_Application_Server_7_0;
+	public static String JBossRuntimeStartup_JBoss_Application_Server_7_1;
+	public static String JBossRuntimeStartup_Cannot_create_new_JBoss_Server;
+	public static String JBossRuntimeStartup_Cannott_create_new_DTP_Connection_Profile;
+	public static String JBossRuntimeStartup_Cannott_create_new_HSQL_DB_Driver;
+	public static String JBossRuntimeStartup_Cannot_create_new_DB_Driver;
+	public static String JBossRuntimeStartup_JBoss_Application_Server_3_2;
+	public static String JBossRuntimeStartup_JBoss_Application_Server_4_0;
+	public static String JBossRuntimeStartup_JBoss_Application_Server_4_2;
+	public static String JBossRuntimeStartup_JBoss_Application_Server_5_0;
+	public static String JBossRuntimeStartup_JBoss_Application_Server_5_1;
+	public static String JBossRuntimeStartup_JBoss_EAP_Server_4_3;
+	public static String JBossRuntimeStartup_JBoss_EAP_Server_5_0;
+	public static String JBossRuntimeStartup_JBoss_EAP_Server_6_0;
+	// NEW_SERVER_ADAPTER add logic for new adapter here
+	public static String JBossRuntimeStartup_Runtime;
+	public static String JBossRuntimeStartup_The_JBoss_AS_Hypersonic_embedded_database;
+	public static String JBossRuntimeStartup_The_JBoss_AS_H2_embedded_database;
+	static {
+		// initialize resource bundle
+		NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+	}
+
+	private Messages() {
+	}
+}
Index: as/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/IJBossRuntimePluginConstants.java
===================================================================
--- as/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/IJBossRuntimePluginConstants.java	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ as/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/as/detector/IJBossRuntimePluginConstants.java	(working copy)
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ *     Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.runtime.as.detector;
+
+
+public interface IJBossRuntimePluginConstants {
+	public static final String DEFAULT_DS = "DefaultDS";
+	public static final String RUNTIME = Messages.JBossRuntimeStartup_Runtime;
+	public static final String EAP = "EAP"; //$NON-NLS-1$
+	public static final String EAP_STD = "EAP_STD"; //$NON-NLS-1$
+	public static final String SOA_P = "SOA-P"; //$NON-NLS-1$
+	public static final String SOA_P_STD = "SOA-P-STD"; //$NON-NLS-1$
+	public static final String EPP = "EPP"; //$NON-NLS-1$
+	public static final String EWP = "EWP"; //$NON-NLS-1$
+	public static final String AS = "AS"; //$NON-NLS-1$
+	public static final String JBOSS_EAP_HOME = "../../../../jboss-eap/jboss-as"; 	// JBoss AS home directory (relative to plugin)- <RHDS_HOME>/jbossas. //$NON-NLS-1$
+	public static final String JBOSS_EAP_HOME_CONFIGURATION = "../../jboss-eap/jboss-as"; 	// JBoss AS home directory (relative to plugin)- <RHDS_HOME>/jbossas. //$NON-NLS-1$
+	public static final String SERVERS_FILE_NAME = "application_platforms.properties"; //$NON-NLS-1$
+	public static final String SERVERS_FILE = "../../../../studio/" + SERVERS_FILE_NAME; //$NON-NLS-1$
+	public static final String SERVERS_FILE_CONFIGURATION = "../../studio/" + SERVERS_FILE_NAME; //$NON-NLS-1$
+	public static String RUNTIME_CONFIG_FORMAT_VERSION = "1.0"; //$NON-NLS-1$
+	
+	public static final String HSQLDB_DRIVER_JAR_NAME = "hsqldb.jar"; //$NON-NLS-1$
+	
+	public static final String HSQLDB_DRIVER_3X_4X_LOCATION = "/server/default/lib/" + HSQLDB_DRIVER_JAR_NAME; //$NON-NLS-1$
+	
+	public static final String HSQLDB_DRIVER_5X_LOCATION = "/common/lib/" + HSQLDB_DRIVER_JAR_NAME; //$NON-NLS-1$
+		
+	public static final String JBOSS_AS_HOST = "localhost"; //$NON-NLS-1$
+
+	public static final String JBOSS_AS_DEFAULT_CONFIGURATION_NAME = "default"; //$NON-NLS-1$
+
+	//public static final String FIRST_START_PREFERENCE_NAME = "FIRST_START";
+
+	public static final String HSQL_DRIVER_DEFINITION_ID 
+												= "DriverDefn.Hypersonic DB"; //$NON-NLS-1$
+
+	public static final String H2_DRIVER_DEFINITION_ID 
+												= "DriverDefn.H2 DB"; //$NON-NLS-1$
+
+	public static final String HSQL_DRIVER_NAME = "Hypersonic DB"; //$NON-NLS-1$
+	
+	public static final String H2_DRIVER_NAME = "H2 Database"; //$NON-NLS-1$
+
+	public static final String HSQL_DRIVER_TEMPLATE_ID 
+						= "org.eclipse.datatools.enablement.hsqldb.1_8.driver"; //$NON-NLS-1$
+	
+	public static final String H2_DRIVER_TEMPLATE_ID 
+					= "org.eclipse.datatools.connectivity.db.generic.genericDriverTemplate"; //$NON-NLS-1$
+
+	public static final String DTP_DB_URL_PROPERTY_ID 
+								= "org.eclipse.datatools.connectivity.db.URL"; //$NON-NLS-1$
+
+	public static final String HSQL_PROFILE_ID = "org.eclipse.datatools.enablement.hsqldb.connectionProfile";
+	
+	public static final String H2_PROFILE_ID = "org.eclipse.datatools.connectivity.db.generic.connectionProfile";
+
+}
Index: as/plugins/org.jboss.tools.runtime.as.detector/about.ini
===================================================================
--- as/plugins/org.jboss.tools.runtime.as.detector/about.ini	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ as/plugins/org.jboss.tools.runtime.as.detector/about.ini	(working copy)
@@ -0,0 +1,27 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+# test
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%blurb
+
+# Property "windowImage" contains path to window icon (16x16)
+# needed for primary features only
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=jboss_about.png
+
+# Property "aboutImage" contains path to product image (500x330 or 115x164)
+# needed for primary features only
+
+# Property "appName" contains name of the application (not translated)
+# needed for primary features only
+
+# Property "welcomePerspective" contains the id of the perspective in which the
+# welcome page is to be opened.
+# optional
+
+
+
Index: as/plugins/org.jboss.tools.runtime.as.detector/plugin.properties
===================================================================
--- as/plugins/org.jboss.tools.runtime.as.detector/plugin.properties	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ as/plugins/org.jboss.tools.runtime.as.detector/plugin.properties	(working copy)
@@ -0,0 +1,3 @@
+#Properties file for org.jboss.tools.runtime
+BundleVendor = JBoss by Red Hat
+BundleName = JBoss Runtime AS Detector
Index: as/plugins/org.jboss.tools.runtime.as.detector/build.properties
===================================================================
--- as/plugins/org.jboss.tools.runtime.as.detector/build.properties	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ as/plugins/org.jboss.tools.runtime.as.detector/build.properties	(working copy)
@@ -0,0 +1,13 @@
+source.. = src/
+output.. = bin/
+src.includes = *
+src.excludes = src
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml,\
+               plugin.properties,\
+               about.html,\
+               about.ini,\
+               about.mappings,\
+               about.properties,\
+               jboss_about.png
Index: as/plugins/org.jboss.tools.runtime.as.detector/pom.xml
===================================================================
--- as/plugins/org.jboss.tools.runtime.as.detector/pom.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 0)
+++ as/plugins/org.jboss.tools.runtime.as.detector/pom.xml	(working copy)
@@ -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.as</groupId>
+		<artifactId>plugins</artifactId>
+		<version>2.4.0-SNAPSHOT</version>
+	</parent>
+	<groupId>org.jboss.tools.runtime.plugins</groupId>
+	<artifactId>org.jboss.tools.runtime.as.detector</artifactId>
+	
+	<packaging>eclipse-plugin</packaging>
+</project>
Index: as/site/category.xml
===================================================================
--- as/site/category.xml	(.../https://svn.jboss.org/repos/jbosstools/trunk)	(revision 43315)
+++ as/site/category.xml	(working copy)
@@ -11,6 +11,14 @@
 	<feature url="features/org.jboss.ide.eclipse.as.feature.source_0.0.0.jar" id="org.jboss.ide.eclipse.as.feature.source" version="0.0.0">
 		<category name="JBoss Tools as Nightly Build Update Site" />
 	</feature>
+
+	<feature url="features/org.jboss.tools.runtime.as.detector.feature_0.0.0.jar" id="org.jboss.tools.runtime.as.detector.feature" version="0.0.0">
+		<category name="JBoss Tools as Nightly Build Update Site" />
+	</feature>
+	<feature url="features/org.jboss.tools.runtime.as.detector.feature.source_0.0.0.jar" id="org.jboss.tools.runtime.as.detector.feature.source" version="0.0.0">
+		<category name="JBoss Tools as Nightly Build Update Site" />
+	</feature>
+
 	<feature url="features/org.jboss.ide.eclipse.as.test.feature_0.0.0.jar" id="org.jboss.ide.eclipse.as.test.feature" version="0.0.0">
 		<category name="JBoss Tools as Nightly Build Update Site" />
 	</feature>
