Bug 548026: Restore exception type and cause

Change-Id: I07b672cef6894c90b7c2b65582bacd89c6b1fe83
diff --git a/ecl/plugins/org.eclipse.rcptt.ecl.core/src/org/eclipse/rcptt/ecl/internal/core/ProcessStatusConverter.java b/ecl/plugins/org.eclipse.rcptt.ecl.core/src/org/eclipse/rcptt/ecl/internal/core/ProcessStatusConverter.java
index 7b8ea09..97df5aa 100644
--- a/ecl/plugins/org.eclipse.rcptt.ecl.core/src/org/eclipse/rcptt/ecl/internal/core/ProcessStatusConverter.java
+++ b/ecl/plugins/org.eclipse.rcptt.ecl.core/src/org/eclipse/rcptt/ecl/internal/core/ProcessStatusConverter.java
@@ -13,6 +13,7 @@
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
 import java.util.ArrayList;
+import java.util.Objects;
 
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IStatus;
@@ -66,10 +67,15 @@
 	}
 
 	public static Throwable getThrowable(EclException exception) {
+		if (exception == null)
+			return null;
 		Throwable th = null;
 		try {
 			// Try to restore stored exception.
 			th = exception.getThrowable();
+			if (!Objects.equals(th.getClass().getName(), exception.getClassName())) {
+				throw new IllegalStateException(String.format("Bad class, expected: %s, actual: %s ", exception.getClassName(), th.getClass().getName()));
+			}
 		} catch (Throwable ee) {
 			// Failed to restore exception, try to construct new one
 			try {
@@ -79,7 +85,7 @@
 					Constructor<?> constructor = forName.getConstructor(
 							String.class, Throwable.class);
 					Throwable newInstance = (Throwable) constructor
-							.newInstance(exception.getMessage(), null);
+							.newInstance(exception.getMessage(), getThrowable(exception.getCause()));
 					th = newInstance;
 				} catch (NoSuchMethodException  e) {
 					if (exception.getStatus() == null)
@@ -88,21 +94,21 @@
 					Throwable newInstance = (Throwable) constructor
 							.newInstance(toIStatus(exception.getStatus()), null);
 					th = newInstance;
+					th.addSuppressed(e);
 				}
+				th.addSuppressed(ee);
 			} catch (Exception eee) {
 				if (exception.getStatus() != null) {
 					th = new CoreException(toIStatus(exception.getStatus()));
 				} else {
-					th = new Exception(exception.getMessage(), null);
+					th = new Exception(exception.getMessage(), getThrowable(exception.getCause()));
 				}
+				th.addSuppressed(eee);
 			}
 		}
 		if (th != null) {
 			copyAttributesFromEObject(exception, th);
 		}
-		if (exception.getCause() != null) {
-			th.initCause(getThrowable(exception.getCause()));
-		}
 		return th;
 	}
 
diff --git a/ecl/plugins/org.eclipse.rcptt.ecl.server.tcp/META-INF/MANIFEST.MF b/ecl/plugins/org.eclipse.rcptt.ecl.server.tcp/META-INF/MANIFEST.MF
index 922a939..5b4549e 100644
--- a/ecl/plugins/org.eclipse.rcptt.ecl.server.tcp/META-INF/MANIFEST.MF
+++ b/ecl/plugins/org.eclipse.rcptt.ecl.server.tcp/META-INF/MANIFEST.MF
@@ -7,7 +7,7 @@
 Require-Bundle: org.eclipse.core.runtime,
  org.eclipse.rcptt.ecl.core;bundle-version="[2.5.0,3.0.0)"
 Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
 Export-Package: org.eclipse.rcptt.ecl.internal.server.tcp,
  org.eclipse.rcptt.ecl.server.tcp
 Bundle-Vendor: Eclipse RCP Testing Tool Project
diff --git a/ecl/plugins/org.eclipse.rcptt.ecl.server.tcp/src/org/eclipse/rcptt/ecl/server/tcp/EclTcpServer.java b/ecl/plugins/org.eclipse.rcptt.ecl.server.tcp/src/org/eclipse/rcptt/ecl/server/tcp/EclTcpServer.java
index d6ee8b4..a2512f7 100644
--- a/ecl/plugins/org.eclipse.rcptt.ecl.server.tcp/src/org/eclipse/rcptt/ecl/server/tcp/EclTcpServer.java
+++ b/ecl/plugins/org.eclipse.rcptt.ecl.server.tcp/src/org/eclipse/rcptt/ecl/server/tcp/EclTcpServer.java
@@ -10,6 +10,7 @@
  *******************************************************************************/
 package org.eclipse.rcptt.ecl.server.tcp;

 

+import java.io.Closeable;
 import java.io.IOException;

 import java.net.ServerSocket;

 import java.net.Socket;

@@ -36,21 +37,21 @@
 	@Override

 	public void run() {

 		starting = false;

-		try {

+		try (Closeable closeable = socket) {

 			while (!isInterrupted()) {

 				try {

 					Socket client = socket.accept();

 					//client.setKeepAlive(true);

 					client.setTcpNoDelay(true);

 					manager.acceptNewConnection(client);

-				} catch (Exception e) {

-					CorePlugin.log(CorePlugin.err(

-							"Failed to accept connection", e));

+				} catch (Exception e) {
+					if (!socket.isClosed()) {

+						CorePlugin.log(CorePlugin.err(

+								"Failed to accept connection", e));
+					}

 				}

 			}

-			if (socket != null) {

-				socket.close();

-			}

+			socket.close();

 		} catch (Exception e) {

 			CorePlugin.log(CorePlugin.err("Failed to start ECL TCP server", e));

 		}

@@ -58,5 +59,16 @@
 

 	public int getPort() {

 		return port;

+	}
+	
+	@Override
+	public void interrupt() {
+		try {
+			socket.close();
+		} catch (IOException e) {
+			throw new RuntimeException(e);
+		} finally {
+			super.interrupt();
+		}
 	}

 }

diff --git a/ecl/plugins/org.eclipse.rcptt.ecl.server.tcp/src/org/eclipse/rcptt/ecl/server/tcp/EclTcpServerManager.java b/ecl/plugins/org.eclipse.rcptt.ecl.server.tcp/src/org/eclipse/rcptt/ecl/server/tcp/EclTcpServerManager.java
index 2dd4307..81e83f5 100644
--- a/ecl/plugins/org.eclipse.rcptt.ecl.server.tcp/src/org/eclipse/rcptt/ecl/server/tcp/EclTcpServerManager.java
+++ b/ecl/plugins/org.eclipse.rcptt.ecl.server.tcp/src/org/eclipse/rcptt/ecl/server/tcp/EclTcpServerManager.java
@@ -48,7 +48,15 @@
 	public synchronized void stopServer(int port) throws IOException {

 		EclTcpServer server = servers.remove(port);

 		if (server != null) {

-			server.interrupt();

+			server.interrupt();
+			try {
+				server.join(10000);
+				if (server.isAlive())
+					throw new IOException("Failed to stop " + server);
+			} catch (InterruptedException e) {
+				Thread.currentThread().interrupt();
+				throw new IOException("Failed to stop server", e);
+			}

 		} else {

 			throw new IOException("No server found on port " + port);

 		}

@@ -59,12 +67,17 @@
 	}

 

 	public synchronized void terminateAll() {

-		HashSet<Integer> ports = new HashSet<Integer>(servers.keySet());

+		HashSet<Integer> ports = new HashSet<Integer>(servers.keySet());
+		IOException result = null;

 		for (int i : ports) {

 			try {

 				stopServer(i);

-			} catch (IOException e) {

-				e.printStackTrace();

+			} catch (IOException e) {
+				if (result == null) {
+					result = e;
+				} else {
+					result.addSuppressed(e);
+				}

 			}

 		}

 	}

diff --git a/ecl/plugins/org.eclipse.rcptt.ecl.server.tcp/src/org/eclipse/rcptt/ecl/server/tcp/SessionManager.java b/ecl/plugins/org.eclipse.rcptt.ecl.server.tcp/src/org/eclipse/rcptt/ecl/server/tcp/SessionManager.java
index bcc3dce..738f05d 100644
--- a/ecl/plugins/org.eclipse.rcptt.ecl.server.tcp/src/org/eclipse/rcptt/ecl/server/tcp/SessionManager.java
+++ b/ecl/plugins/org.eclipse.rcptt.ecl.server.tcp/src/org/eclipse/rcptt/ecl/server/tcp/SessionManager.java
@@ -31,18 +31,13 @@
 		this.useJobs = useJobs;

 	}

 

-	public void acceptNewConnection(Socket client) {

-		try {

-			count++;

-			String uuid = initRecover(client);

-			if (uuid != null) {

-				executor.execute(new SessionRequestHandler(client, useJobs));

-			} else {

-				client.close();

-			}

-

-		} catch (Throwable e) {

-			CorePlugin.log(e);

+	public void acceptNewConnection(Socket client) throws IOException {

+		count++;

+		String uuid = initRecover(client);

+		if (uuid != null) {

+			executor.execute(new SessionRequestHandler(client, useJobs));

+		} else {

+			client.close();

 		}

 	}

 

diff --git a/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/.classpath b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/.classpath
index ad32c83..0c22b5d 100644
--- a/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/.classpath
+++ b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/.classpath
@@ -3,5 +3,6 @@
 	<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="src" path="src-gen"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
diff --git a/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/.project b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/.project
index b6f7b92..2015498 100644
--- a/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/.project
+++ b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/.project
@@ -25,4 +25,15 @@
 		<nature>org.eclipse.pde.PluginNature</nature>
 		<nature>org.eclipse.jdt.core.javanature</nature>
 	</natures>
+	<filteredResources>
+		<filter>
+			<id>1559806763699</id>
+			<name></name>
+			<type>10</type>
+			<matcher>
+				<id>org.eclipse.ui.ide.multiFilter</id>
+				<arguments>1.0-name-matches-true-false-target</arguments>
+			</matcher>
+		</filter>
+	</filteredResources>
 </projectDescription>
diff --git a/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/META-INF/MANIFEST.MF b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/META-INF/MANIFEST.MF
index ad6d7dd..f466fed 100644
--- a/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/META-INF/MANIFEST.MF
+++ b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/META-INF/MANIFEST.MF
@@ -1,16 +1,20 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
-Bundle-Name: ECL TCP Client Tests
-Bundle-SymbolicName: org.eclipse.rcptt.ecl.client.tcp.tests
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.rcptt.ecl.client.tcp.tests;singleton:=true
+Automatic-Module-Name: org.eclipse.rcptt.ecl.client.tcp.tests
 Bundle-Version: 2.5.0.qualifier
+Bundle-ClassPath: .
 Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.emf.ecore;visibility:=reexport,
  org.junit;bundle-version="3.8.2",
+ com.google.guava,
  org.eclipse.rcptt.ecl.client.tcp;bundle-version="[2.5.0,3.0.0)",
  org.eclipse.rcptt.ecl.core;bundle-version="[2.5.0,3.0.0)",
  org.eclipse.rcptt.ecl.core.tests;bundle-version="[2.5.0,3.0.0)",
  org.eclipse.rcptt.ecl.server.tcp;bundle-version="[2.5.0,3.0.0)",
  org.eclipse.rcptt.ecl.platform;bundle-version="[2.5.0,3.0.0)"
 Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Export-Package: org.eclipse.rcptt.ecl.internal.client.tcp.tests
-Bundle-Vendor: Eclipse RCP Testing Tool Project
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
diff --git a/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/build.properties b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/build.properties
index 4b047e9..86f0d1a 100644
--- a/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/build.properties
+++ b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/build.properties
@@ -8,9 +8,10 @@
 # Contributors:
 #     Xored Software Inc - initial API and implementation and/or initial documentation
 ###############################################################################
-source.. = src/
+source.. = src/,\
+           src-gen/
 output.. = bin/
 bin.includes = META-INF/,\
                .,\
-               test.xml,\
-               about.html
+               about.html,\
+               plugin.xml
diff --git a/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/model/commands.ecore b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/model/commands.ecore
new file mode 100644
index 0000000..c63ee14
--- /dev/null
+++ b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/model/commands.ecore
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="tests" nsURI="http://www.eclipse.org/ecl/testcommands.ecore"
+    nsPrefix="org.eclipse.rcptt.ecl.client.tcp.tests">
+  <eClassifiers xsi:type="ecore:EClass" name="EclInjectedCommand" eSuperTypes="../../org.eclipse.rcptt.ecl.core/model/ecl.ecore#//Command"/>
+</ecore:EPackage>
diff --git a/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/model/commands.genmodel b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/model/commands.genmodel
new file mode 100644
index 0000000..b6f79bf
--- /dev/null
+++ b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/model/commands.genmodel
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel"
+    modelDirectory="/org.eclipse.rcptt.ecl.client.tcp.tests/src-gen"
+    modelPluginID="org.eclipse.rcptt.ecl.client.tcp.tests" modelName="Commands" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container"
+    importerID="org.eclipse.emf.importer.ecore" complianceLevel="8.0" copyrightFields="false"
+    usedGenPackages="../../org.eclipse.rcptt.ecl.core/model/ecl.genmodel#//core platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore"
+    operationReflection="true" importOrganizing="true">
+  <foreignModel>commands.ecore</foreignModel>
+  <genPackages prefix="Tests" basePackage="org.eclipse.rcptt.ecl.client.tcp" disposableProviderFactory="true"
+      literalsInterface="false" ecorePackage="commands.ecore#/">
+    <genClasses ecoreClass="commands.ecore#//EclInjectedCommand"/>
+  </genPackages>
+</genmodel:GenModel>
diff --git a/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/plugin.properties b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/plugin.properties
new file mode 100644
index 0000000..cd61e7a
--- /dev/null
+++ b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/plugin.properties
@@ -0,0 +1,4 @@
+#
+
+pluginName = ECL TCP Client Tests
+providerName = Eclipse RCP Testing Tool Project
diff --git a/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/plugin.xml b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/plugin.xml
new file mode 100644
index 0000000..f50ba57
--- /dev/null
+++ b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/plugin.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension
+         point="org.eclipse.rcptt.ecl.core.scriptlet">
+      <scriptlet
+            class="org.eclipse.rcptt.ecl.client.tcp.tests.EclInjectedCommandService"
+            name="EclInjectedCommand"
+            namespace="http://www.eclipse.org/ecl/testcommands.ecore">
+      </scriptlet>
+   </extension>
+null
+   <extension point="org.eclipse.emf.ecore.generated_package">
+      <!-- @generated commands -->
+      <package
+            uri="http://www.eclipse.org/ecl/testcommands.ecore"
+            class="org.eclipse.rcptt.ecl.client.tcp.tests.TestsPackage"
+            genModel="model/commands.genmodel"/>
+   </extension>
+
+</plugin>
diff --git a/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/pom.xml b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/pom.xml
index b2324ef..b4d19c4 100644
--- a/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/pom.xml
+++ b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/pom.xml
@@ -1,14 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!--
-    Copyright (c) 2009, 2019 Xored Software 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:
-    	Xored Software Inc - initial API and implementation and/or initial documentation
- -->
+<!-- Copyright (c) 2009, 2019 Xored Software 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: 
+	Xored Software Inc - initial API and implementation and/or initial documentation -->
 
 <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
diff --git a/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src-gen/org/eclipse/rcptt/ecl/client/tcp/tests/EclInjectedCommand.java b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src-gen/org/eclipse/rcptt/ecl/client/tcp/tests/EclInjectedCommand.java
new file mode 100644
index 0000000..03b6342
--- /dev/null
+++ b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src-gen/org/eclipse/rcptt/ecl/client/tcp/tests/EclInjectedCommand.java
@@ -0,0 +1,18 @@
+/**
+ */
+package org.eclipse.rcptt.ecl.client.tcp.tests;
+
+import org.eclipse.rcptt.ecl.core.Command;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Ecl Injected Command</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ *
+ * @see org.eclipse.rcptt.ecl.client.tcp.tests.TestsPackage#getEclInjectedCommand()
+ * @model
+ * @generated
+ */
+public interface EclInjectedCommand extends Command {
+} // EclInjectedCommand
diff --git a/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src-gen/org/eclipse/rcptt/ecl/client/tcp/tests/TestsFactory.java b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src-gen/org/eclipse/rcptt/ecl/client/tcp/tests/TestsFactory.java
new file mode 100644
index 0000000..8deb788
--- /dev/null
+++ b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src-gen/org/eclipse/rcptt/ecl/client/tcp/tests/TestsFactory.java
@@ -0,0 +1,42 @@
+/**
+ */
+package org.eclipse.rcptt.ecl.client.tcp.tests;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.rcptt.ecl.client.tcp.tests.TestsPackage
+ * @generated
+ */
+public interface TestsFactory extends EFactory {
+	/**
+	 * The singleton instance of the factory.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	TestsFactory eINSTANCE = org.eclipse.rcptt.ecl.client.tcp.tests.impl.TestsFactoryImpl.init();
+
+	/**
+	 * Returns a new object of class '<em>Ecl Injected Command</em>'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return a new object of class '<em>Ecl Injected Command</em>'.
+	 * @generated
+	 */
+	EclInjectedCommand createEclInjectedCommand();
+
+	/**
+	 * Returns the package supported by this factory.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return the package supported by this factory.
+	 * @generated
+	 */
+	TestsPackage getTestsPackage();
+
+} //TestsFactory
diff --git a/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src-gen/org/eclipse/rcptt/ecl/client/tcp/tests/TestsPackage.java b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src-gen/org/eclipse/rcptt/ecl/client/tcp/tests/TestsPackage.java
new file mode 100644
index 0000000..46b3a95
--- /dev/null
+++ b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src-gen/org/eclipse/rcptt/ecl/client/tcp/tests/TestsPackage.java
@@ -0,0 +1,116 @@
+/**
+ */
+package org.eclipse.rcptt.ecl.client.tcp.tests;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.rcptt.ecl.core.CorePackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Package</b> for the model.
+ * It contains accessors for the meta objects to represent
+ * <ul>
+ *   <li>each class,</li>
+ *   <li>each feature of each class,</li>
+ *   <li>each operation of each class,</li>
+ *   <li>each enum,</li>
+ *   <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @see org.eclipse.rcptt.ecl.client.tcp.tests.TestsFactory
+ * @model kind="package"
+ * @generated
+ */
+public interface TestsPackage extends EPackage {
+	/**
+	 * The package name.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	String eNAME = "tests";
+
+	/**
+	 * The package namespace URI.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	String eNS_URI = "http://www.eclipse.org/ecl/testcommands.ecore";
+
+	/**
+	 * The package namespace name.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	String eNS_PREFIX = "org.eclipse.rcptt.ecl.client.tcp.tests";
+
+	/**
+	 * The singleton instance of the package.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	TestsPackage eINSTANCE = org.eclipse.rcptt.ecl.client.tcp.tests.impl.TestsPackageImpl.init();
+
+	/**
+	 * The meta object id for the '{@link org.eclipse.rcptt.ecl.client.tcp.tests.impl.EclInjectedCommandImpl <em>Ecl Injected Command</em>}' class.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see org.eclipse.rcptt.ecl.client.tcp.tests.impl.EclInjectedCommandImpl
+	 * @see org.eclipse.rcptt.ecl.client.tcp.tests.impl.TestsPackageImpl#getEclInjectedCommand()
+	 * @generated
+	 */
+	int ECL_INJECTED_COMMAND = 0;
+
+	/**
+	 * The feature id for the '<em><b>Host</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int ECL_INJECTED_COMMAND__HOST = CorePackage.COMMAND__HOST;
+
+	/**
+	 * The feature id for the '<em><b>Bindings</b></em>' containment reference list.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int ECL_INJECTED_COMMAND__BINDINGS = CorePackage.COMMAND__BINDINGS;
+
+	/**
+	 * The number of structural features of the '<em>Ecl Injected Command</em>' class.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int ECL_INJECTED_COMMAND_FEATURE_COUNT = CorePackage.COMMAND_FEATURE_COUNT + 0;
+
+
+	/**
+	 * Returns the meta object for class '{@link org.eclipse.rcptt.ecl.client.tcp.tests.EclInjectedCommand <em>Ecl Injected Command</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return the meta object for class '<em>Ecl Injected Command</em>'.
+	 * @see org.eclipse.rcptt.ecl.client.tcp.tests.EclInjectedCommand
+	 * @generated
+	 */
+	EClass getEclInjectedCommand();
+
+	/**
+	 * Returns the factory that creates the instances of the model.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return the factory that creates the instances of the model.
+	 * @generated
+	 */
+	TestsFactory getTestsFactory();
+
+} //TestsPackage
diff --git a/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src-gen/org/eclipse/rcptt/ecl/client/tcp/tests/impl/EclInjectedCommandImpl.java b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src-gen/org/eclipse/rcptt/ecl/client/tcp/tests/impl/EclInjectedCommandImpl.java
new file mode 100644
index 0000000..1df4c30
--- /dev/null
+++ b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src-gen/org/eclipse/rcptt/ecl/client/tcp/tests/impl/EclInjectedCommandImpl.java
@@ -0,0 +1,39 @@
+/**
+ */
+package org.eclipse.rcptt.ecl.client.tcp.tests.impl;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.rcptt.ecl.client.tcp.tests.EclInjectedCommand;
+import org.eclipse.rcptt.ecl.client.tcp.tests.TestsPackage;
+
+import org.eclipse.rcptt.ecl.core.impl.CommandImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Ecl Injected Command</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class EclInjectedCommandImpl extends CommandImpl implements EclInjectedCommand {
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected EclInjectedCommandImpl() {
+		super();
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	protected EClass eStaticClass() {
+		return TestsPackage.eINSTANCE.getEclInjectedCommand();
+	}
+
+} //EclInjectedCommandImpl
diff --git a/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src-gen/org/eclipse/rcptt/ecl/client/tcp/tests/impl/TestsFactoryImpl.java b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src-gen/org/eclipse/rcptt/ecl/client/tcp/tests/impl/TestsFactoryImpl.java
new file mode 100644
index 0000000..06b314d
--- /dev/null
+++ b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src-gen/org/eclipse/rcptt/ecl/client/tcp/tests/impl/TestsFactoryImpl.java
@@ -0,0 +1,97 @@
+/**
+ */
+package org.eclipse.rcptt.ecl.client.tcp.tests.impl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+
+import org.eclipse.rcptt.ecl.client.tcp.tests.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class TestsFactoryImpl extends EFactoryImpl implements TestsFactory {
+	/**
+	 * Creates the default factory implementation.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public static TestsFactory init() {
+		try {
+			TestsFactory theTestsFactory = (TestsFactory)EPackage.Registry.INSTANCE.getEFactory(TestsPackage.eNS_URI);
+			if (theTestsFactory != null) {
+				return theTestsFactory;
+			}
+		}
+		catch (Exception exception) {
+			EcorePlugin.INSTANCE.log(exception);
+		}
+		return new TestsFactoryImpl();
+	}
+
+	/**
+	 * Creates an instance of the factory.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public TestsFactoryImpl() {
+		super();
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public EObject create(EClass eClass) {
+		switch (eClass.getClassifierID()) {
+			case TestsPackage.ECL_INJECTED_COMMAND: return createEclInjectedCommand();
+			default:
+				throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+		}
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public EclInjectedCommand createEclInjectedCommand() {
+		EclInjectedCommandImpl eclInjectedCommand = new EclInjectedCommandImpl();
+		return eclInjectedCommand;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public TestsPackage getTestsPackage() {
+		return (TestsPackage)getEPackage();
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @deprecated
+	 * @generated
+	 */
+	@Deprecated
+	public static TestsPackage getPackage() {
+		return TestsPackage.eINSTANCE;
+	}
+
+} //TestsFactoryImpl
diff --git a/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src-gen/org/eclipse/rcptt/ecl/client/tcp/tests/impl/TestsPackageImpl.java b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src-gen/org/eclipse/rcptt/ecl/client/tcp/tests/impl/TestsPackageImpl.java
new file mode 100644
index 0000000..6d53763
--- /dev/null
+++ b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src-gen/org/eclipse/rcptt/ecl/client/tcp/tests/impl/TestsPackageImpl.java
@@ -0,0 +1,178 @@
+/**
+ */
+package org.eclipse.rcptt.ecl.client.tcp.tests.impl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EcorePackage;
+
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+import org.eclipse.rcptt.ecl.client.tcp.tests.EclInjectedCommand;
+import org.eclipse.rcptt.ecl.client.tcp.tests.TestsFactory;
+import org.eclipse.rcptt.ecl.client.tcp.tests.TestsPackage;
+
+import org.eclipse.rcptt.ecl.core.CorePackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Package</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class TestsPackageImpl extends EPackageImpl implements TestsPackage {
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	private EClass eclInjectedCommandEClass = null;
+
+	/**
+	 * Creates an instance of the model <b>Package</b>, registered with
+	 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
+	 * package URI value.
+	 * <p>Note: the correct way to create the package is via the static
+	 * factory method {@link #init init()}, which also performs
+	 * initialization of the package, or returns the registered package,
+	 * if one already exists.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see org.eclipse.emf.ecore.EPackage.Registry
+	 * @see org.eclipse.rcptt.ecl.client.tcp.tests.TestsPackage#eNS_URI
+	 * @see #init()
+	 * @generated
+	 */
+	private TestsPackageImpl() {
+		super(eNS_URI, TestsFactory.eINSTANCE);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	private static boolean isInited = false;
+
+	/**
+	 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
+	 *
+	 * <p>This method is used to initialize {@link TestsPackage#eINSTANCE} when that field is accessed.
+	 * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #eNS_URI
+	 * @see #createPackageContents()
+	 * @see #initializePackageContents()
+	 * @generated
+	 */
+	public static TestsPackage init() {
+		if (isInited) return (TestsPackage)EPackage.Registry.INSTANCE.getEPackage(TestsPackage.eNS_URI);
+
+		// Obtain or create and register package
+		Object registeredTestsPackage = EPackage.Registry.INSTANCE.get(eNS_URI);
+		TestsPackageImpl theTestsPackage = registeredTestsPackage instanceof TestsPackageImpl ? (TestsPackageImpl)registeredTestsPackage : new TestsPackageImpl();
+
+		isInited = true;
+
+		// Initialize simple dependencies
+		CorePackage.eINSTANCE.eClass();
+		EcorePackage.eINSTANCE.eClass();
+
+		// Create package meta-data objects
+		theTestsPackage.createPackageContents();
+
+		// Initialize created meta-data
+		theTestsPackage.initializePackageContents();
+
+		// Mark meta-data to indicate it can't be changed
+		theTestsPackage.freeze();
+
+		// Update the registry and return the package
+		EPackage.Registry.INSTANCE.put(TestsPackage.eNS_URI, theTestsPackage);
+		return theTestsPackage;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public EClass getEclInjectedCommand() {
+		return eclInjectedCommandEClass;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public TestsFactory getTestsFactory() {
+		return (TestsFactory)getEFactoryInstance();
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	private boolean isCreated = false;
+
+	/**
+	 * Creates the meta-model objects for the package.  This method is
+	 * guarded to have no affect on any invocation but its first.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void createPackageContents() {
+		if (isCreated) return;
+		isCreated = true;
+
+		// Create classes and their features
+		eclInjectedCommandEClass = createEClass(ECL_INJECTED_COMMAND);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	private boolean isInitialized = false;
+
+	/**
+	 * Complete the initialization of the package and its meta-model.  This
+	 * method is guarded to have no affect on any invocation but its first.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void initializePackageContents() {
+		if (isInitialized) return;
+		isInitialized = true;
+
+		// Initialize package
+		setName(eNAME);
+		setNsPrefix(eNS_PREFIX);
+		setNsURI(eNS_URI);
+
+		// Obtain other dependent packages
+		CorePackage theCorePackage = (CorePackage)EPackage.Registry.INSTANCE.getEPackage(CorePackage.eNS_URI);
+
+		// Create type parameters
+
+		// Set bounds for type parameters
+
+		// Add supertypes to classes
+		eclInjectedCommandEClass.getESuperTypes().add(theCorePackage.getCommand());
+
+		// Initialize classes, features, and operations; add parameters
+		initEClass(eclInjectedCommandEClass, EclInjectedCommand.class, "EclInjectedCommand", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+
+		// Create resource
+		createResource(eNS_URI);
+	}
+
+} //TestsPackageImpl
diff --git a/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src-gen/org/eclipse/rcptt/ecl/client/tcp/tests/util/TestsAdapterFactory.java b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src-gen/org/eclipse/rcptt/ecl/client/tcp/tests/util/TestsAdapterFactory.java
new file mode 100644
index 0000000..567e021
--- /dev/null
+++ b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src-gen/org/eclipse/rcptt/ecl/client/tcp/tests/util/TestsAdapterFactory.java
@@ -0,0 +1,140 @@
+/**
+ */
+package org.eclipse.rcptt.ecl.client.tcp.tests.util;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.rcptt.ecl.client.tcp.tests.*;
+
+import org.eclipse.rcptt.ecl.core.Command;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Adapter Factory</b> for the model.
+ * It provides an adapter <code>createXXX</code> method for each class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.rcptt.ecl.client.tcp.tests.TestsPackage
+ * @generated
+ */
+public class TestsAdapterFactory extends AdapterFactoryImpl {
+	/**
+	 * The cached model package.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected static TestsPackage modelPackage;
+
+	/**
+	 * Creates an instance of the adapter factory.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public TestsAdapterFactory() {
+		if (modelPackage == null) {
+			modelPackage = TestsPackage.eINSTANCE;
+		}
+	}
+
+	/**
+	 * Returns whether this factory is applicable for the type of the object.
+	 * <!-- begin-user-doc -->
+	 * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
+	 * <!-- end-user-doc -->
+	 * @return whether this factory is applicable for the type of the object.
+	 * @generated
+	 */
+	@Override
+	public boolean isFactoryForType(Object object) {
+		if (object == modelPackage) {
+			return true;
+		}
+		if (object instanceof EObject) {
+			return ((EObject)object).eClass().getEPackage() == modelPackage;
+		}
+		return false;
+	}
+
+	/**
+	 * The switch that delegates to the <code>createXXX</code> methods.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected TestsSwitch<Adapter> modelSwitch =
+		new TestsSwitch<Adapter>() {
+			@Override
+			public Adapter caseEclInjectedCommand(EclInjectedCommand object) {
+				return createEclInjectedCommandAdapter();
+			}
+			@Override
+			public Adapter caseCommand(Command object) {
+				return createCommandAdapter();
+			}
+			@Override
+			public Adapter defaultCase(EObject object) {
+				return createEObjectAdapter();
+			}
+		};
+
+	/**
+	 * Creates an adapter for the <code>target</code>.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @param target the object to adapt.
+	 * @return the adapter for the <code>target</code>.
+	 * @generated
+	 */
+	@Override
+	public Adapter createAdapter(Notifier target) {
+		return modelSwitch.doSwitch((EObject)target);
+	}
+
+
+	/**
+	 * Creates a new adapter for an object of class '{@link org.eclipse.rcptt.ecl.client.tcp.tests.EclInjectedCommand <em>Ecl Injected Command</em>}'.
+	 * <!-- begin-user-doc -->
+	 * This default implementation returns null so that we can easily ignore cases;
+	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
+	 * <!-- end-user-doc -->
+	 * @return the new adapter.
+	 * @see org.eclipse.rcptt.ecl.client.tcp.tests.EclInjectedCommand
+	 * @generated
+	 */
+	public Adapter createEclInjectedCommandAdapter() {
+		return null;
+	}
+
+	/**
+	 * Creates a new adapter for an object of class '{@link org.eclipse.rcptt.ecl.core.Command <em>Command</em>}'.
+	 * <!-- begin-user-doc -->
+	 * This default implementation returns null so that we can easily ignore cases;
+	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
+	 * <!-- end-user-doc -->
+	 * @return the new adapter.
+	 * @see org.eclipse.rcptt.ecl.core.Command
+	 * @generated
+	 */
+	public Adapter createCommandAdapter() {
+		return null;
+	}
+
+	/**
+	 * Creates a new adapter for the default case.
+	 * <!-- begin-user-doc -->
+	 * This default implementation returns null.
+	 * <!-- end-user-doc -->
+	 * @return the new adapter.
+	 * @generated
+	 */
+	public Adapter createEObjectAdapter() {
+		return null;
+	}
+
+} //TestsAdapterFactory
diff --git a/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src-gen/org/eclipse/rcptt/ecl/client/tcp/tests/util/TestsSwitch.java b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src-gen/org/eclipse/rcptt/ecl/client/tcp/tests/util/TestsSwitch.java
new file mode 100644
index 0000000..087249c
--- /dev/null
+++ b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src-gen/org/eclipse/rcptt/ecl/client/tcp/tests/util/TestsSwitch.java
@@ -0,0 +1,128 @@
+/**
+ */
+package org.eclipse.rcptt.ecl.client.tcp.tests.util;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.util.Switch;
+
+import org.eclipse.rcptt.ecl.client.tcp.tests.*;
+
+import org.eclipse.rcptt.ecl.core.Command;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Switch</b> for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the <code>caseXXX</code> method for each class of the model,
+ * starting with the actual class of the object
+ * and proceeding up the inheritance hierarchy
+ * until a non-null result is returned,
+ * which is the result of the switch.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.rcptt.ecl.client.tcp.tests.TestsPackage
+ * @generated
+ */
+public class TestsSwitch<T> extends Switch<T> {
+	/**
+	 * The cached model package
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected static TestsPackage modelPackage;
+
+	/**
+	 * Creates an instance of the switch.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public TestsSwitch() {
+		if (modelPackage == null) {
+			modelPackage = TestsPackage.eINSTANCE;
+		}
+	}
+
+	/**
+	 * Checks whether this is a switch for the given package.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @param ePackage the package in question.
+	 * @return whether this is a switch for the given package.
+	 * @generated
+	 */
+	@Override
+	protected boolean isSwitchFor(EPackage ePackage) {
+		return ePackage == modelPackage;
+	}
+
+	/**
+	 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return the first non-null result returned by a <code>caseXXX</code> call.
+	 * @generated
+	 */
+	@Override
+	protected T doSwitch(int classifierID, EObject theEObject) {
+		switch (classifierID) {
+			case TestsPackage.ECL_INJECTED_COMMAND: {
+				EclInjectedCommand eclInjectedCommand = (EclInjectedCommand)theEObject;
+				T result = caseEclInjectedCommand(eclInjectedCommand);
+				if (result == null) result = caseCommand(eclInjectedCommand);
+				if (result == null) result = defaultCase(theEObject);
+				return result;
+			}
+			default: return defaultCase(theEObject);
+		}
+	}
+
+	/**
+	 * Returns the result of interpreting the object as an instance of '<em>Ecl Injected Command</em>'.
+	 * <!-- begin-user-doc -->
+	 * This implementation returns null;
+	 * returning a non-null result will terminate the switch.
+	 * <!-- end-user-doc -->
+	 * @param object the target of the switch.
+	 * @return the result of interpreting the object as an instance of '<em>Ecl Injected Command</em>'.
+	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+	 * @generated
+	 */
+	public T caseEclInjectedCommand(EclInjectedCommand object) {
+		return null;
+	}
+
+	/**
+	 * Returns the result of interpreting the object as an instance of '<em>Command</em>'.
+	 * <!-- begin-user-doc -->
+	 * This implementation returns null;
+	 * returning a non-null result will terminate the switch.
+	 * <!-- end-user-doc -->
+	 * @param object the target of the switch.
+	 * @return the result of interpreting the object as an instance of '<em>Command</em>'.
+	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+	 * @generated
+	 */
+	public T caseCommand(Command object) {
+		return null;
+	}
+
+	/**
+	 * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
+	 * <!-- begin-user-doc -->
+	 * This implementation returns null;
+	 * returning a non-null result will terminate the switch, but this is the last case anyway.
+	 * <!-- end-user-doc -->
+	 * @param object the target of the switch.
+	 * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
+	 * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+	 * @generated
+	 */
+	@Override
+	public T defaultCase(EObject object) {
+		return null;
+	}
+
+} //TestsSwitch
diff --git a/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src/org/eclipse/rcptt/ecl/client/tcp/tests/EclInjectedCommandService.java b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src/org/eclipse/rcptt/ecl/client/tcp/tests/EclInjectedCommandService.java
new file mode 100644
index 0000000..80cf8ac
--- /dev/null
+++ b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src/org/eclipse/rcptt/ecl/client/tcp/tests/EclInjectedCommandService.java
@@ -0,0 +1,29 @@
+package org.eclipse.rcptt.ecl.client.tcp.tests;
+
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.rcptt.ecl.core.Command;
+import org.eclipse.rcptt.ecl.runtime.ICommandService;
+import org.eclipse.rcptt.ecl.runtime.IProcess;
+
+import com.google.common.base.Function;
+
+public class EclInjectedCommandService implements ICommandService {
+	public static Function<Command, IStatus> delegate = new Function<Command, IStatus>() {
+		@Override
+		public IStatus apply(Command ignored) {
+			return Status.OK_STATUS;
+		}
+	};
+
+	public EclInjectedCommandService() {
+	}
+
+	@Override
+	public IStatus service(Command command, IProcess context) throws InterruptedException, CoreException {
+		return delegate.apply(command);
+	}
+
+}
diff --git a/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src/org/eclipse/rcptt/ecl/internal/client/tcp/tests/TestTcpSession.java b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src/org/eclipse/rcptt/ecl/internal/client/tcp/tests/TestTcpSession.java
index 6637522..ea1054b 100644
--- a/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src/org/eclipse/rcptt/ecl/internal/client/tcp/tests/TestTcpSession.java
+++ b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/src/org/eclipse/rcptt/ecl/internal/client/tcp/tests/TestTcpSession.java
@@ -10,42 +10,145 @@
  *******************************************************************************/
 package org.eclipse.rcptt.ecl.internal.client.tcp.tests;
 
+import com.google.common.base.Function;
+import com.google.common.io.Closer;
+
+import java.io.Closeable;
 import java.io.IOException;
 import java.net.InetAddress;
 
+import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.rcptt.ecl.client.tcp.EclTcpClientManager;
-import org.eclipse.rcptt.ecl.core.tests.AbstractCoreTest;
+import org.eclipse.rcptt.ecl.client.tcp.tests.EclInjectedCommandService;
+import org.eclipse.rcptt.ecl.core.Command;
 import org.eclipse.rcptt.ecl.platform.commands.CommandsFactory;
 import org.eclipse.rcptt.ecl.platform.commands.ListPlugins;
 import org.eclipse.rcptt.ecl.runtime.IPipe;
 import org.eclipse.rcptt.ecl.runtime.IProcess;
 import org.eclipse.rcptt.ecl.runtime.ISession;
 import org.eclipse.rcptt.ecl.server.tcp.EclTcpServerManager;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
 
 import junit.framework.TestCase;
 
-public class TestTcpSession extends AbstractCoreTest {
+public class TestTcpSession {
+
+	private static final int PORT = EclTcpClientManager.DEFAULT_PORT + 1;
 
 	private static final String LOCALHOST = "127.0.0.1";
 
-	// @Override
-	protected ISession createSession() throws Exception {
-		return EclTcpClientManager.Instance.startClientSession(
-				// InetAddress.getLocalHost(),
-				InetAddress.getByName(LOCALHOST),
-				EclTcpClientManager.DEFAULT_PORT + 1);
+	private final Closer closer = Closer.create();
+
+	private ISession session;
+
+	@Before
+	public void before() throws IOException {
+		EclTcpServerManager.Instance.startServer(PORT);
+		closer.register(new Closeable() {
+			@Override
+			public void close() throws IOException {
+				EclTcpServerManager.Instance.stopServer(PORT);
+			}
+		});
+		session = EclTcpClientManager.Instance.startClientSession(InetAddress.getByName(LOCALHOST), PORT);
+		closer.register(new Closeable() {
+			@Override
+			public void close() throws IOException {
+				try {
+					session.close();
+				} catch (CoreException e) {
+					throw new IOException(e);
+				}
+			}
+		});
+		EclInjectedCommandService.delegate = new Function<Command, IStatus>() {
+			@Override
+			public IStatus apply(Command ignored) {
+				return Status.OK_STATUS;
+			}
+		};
 	}
 
-	static {
-		try {
-			EclTcpServerManager.Instance
-					.startServer(EclTcpClientManager.DEFAULT_PORT + 1);
-		} catch (IOException e) {
-			e.printStackTrace();
+	@After
+	public void closeServer() throws CoreException, IOException {
+		closer.close();
+	}
+
+	@Test
+	public void simpleExecution() throws CoreException, InterruptedException {
+		EclInjectedCommandService.delegate = new Function<Command, IStatus>() {
+			@Override
+			public IStatus apply(Command ignored) {
+				return new Status(IStatus.INFO, "id", "message");
+			}
+		};
+		IStatus status = executeCommand();
+		Assert.assertFalse(status.getMessage(), status.matches(IStatus.ERROR | IStatus.WARNING | IStatus.CANCEL));
+		Assert.assertTrue(status.matches(IStatus.INFO));
+		Assert.assertEquals("message", status.getMessage());
+	}
+
+	private IStatus executeCommand() throws CoreException, InterruptedException {
+		IProcess process = session
+				.execute(org.eclipse.rcptt.ecl.client.tcp.tests.TestsFactory.eINSTANCE.createEclInjectedCommand());
+		IStatus status = process.waitFor();
+		return status;
+	}
+
+	@Test
+	public void errorIsReported() throws CoreException, InterruptedException {
+		EclInjectedCommandService.delegate = new Function<Command, IStatus>() {
+			@Override
+			public IStatus apply(Command ignored) {
+				return new Status(IStatus.ERROR, "id", "message");
+			}
+		};
+		IStatus status = executeCommand();
+		Assert.assertTrue(status.matches(IStatus.ERROR));
+		Assert.assertEquals("message", status.getMessage());
+	}
+
+	private static void absurdFunctionThatThrows() {
+		IStatus status = new Status(IStatus.ERROR, "id", "message2", new IllegalStateException("message3"));
+		CoreException coreException = new CoreException(status);
+		throw new RuntimeException(coreException);
+	}
+
+	@Test
+	public void istatusPropagatesTraces() throws CoreException, InterruptedException {
+		EclInjectedCommandService.delegate = new Function<Command, IStatus>() {
+			@Override
+			public IStatus apply(Command ignored) {
+				absurdFunctionThatThrows();
+				return Status.OK_STATUS;
+			}
+		};
+		IStatus status = executeCommand();
+		Throwable e = status.getException();
+		while (! (e instanceof CoreException)) {
+			if (e == null)
+				Assert.fail("CoreException is not found");
+			e = e.getCause();
 		}
+		CoreException coreException = (CoreException) e;
+		IllegalStateException illegalStateException = (IllegalStateException) coreException.getCause();
+		Assert.assertEquals("message3", illegalStateException.getMessage());
+		boolean found = false;
+		for (StackTraceElement element: illegalStateException.getStackTrace()) {
+			if (element.getMethodName().endsWith("absurdFunctionThatThrows")) {
+				found = true;
+				break; 
+			}
+		}
+		Assert.assertTrue(found);
 	}
 
+	@Test
 	public void testCommandExecution001() throws Throwable {
 		ListPlugins listPlugins = CommandsFactory.eINSTANCE.createListPlugins();
 		IProcess process = session.execute(listPlugins);
diff --git a/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/test.xml b/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/test.xml
deleted file mode 100644
index 682c6ac..0000000
--- a/ecl/tests/org.eclipse.rcptt.ecl.client.tcp.tests/test.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
-    Copyright (c) 2009, 2016 Xored Software 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:
-    	Xored Software Inc - initial API and implementation and/or initial documentation
- -->
-
-<project name="testsuite" default="run" basedir=".">
-	<!-- The property ${eclipse-home} should be passed into this script -->
-	<!-- Set a meaningful default value for when it is not. -->
-	<property name="eclipse-home" value="${basedir}\..\.." />
-
-	<!-- sets the properties eclipse-home, and library-file -->
-	<property name="plugin-name" value="org.eclipse.rcptt.ecl.client.tcp.tests" />
-	<property name="library-file" value="${eclipse-home}/plugins/org.eclipse.test_3.2.0/library.xml" />
-
-	<property name="workspace" value="${basedir}/${plugin-name}/workspace" />
-
-	<!-- This target holds all initialization code that needs to be done for -->
-	<!-- all tests that are to be run. Initialization for individual tests -->
-	<!-- should be done within the body of the suite target. -->
-	<target name="init">
-		<tstamp />
-		<delete>
-			<fileset dir="${eclipse-home}" includes="org*.xml" />
-		</delete>
-	</target>
-
-	<!-- This target defines the tests that need to be run. -->
-	<target name="suite">
-		<delete dir="${workspace}" quiet="true" />
-		<ant target="core-test" antfile="${library-file}" dir="${eclipse-home}">
-			<property name="data-dir" value="${workspace}" />
-			<property name="plugin-name" value="${plugin-name}" />
-			<property name="classname" value="org.eclipse.rcptt.ecl.internal.client.tcp.tests.AllTests" />
-		</ant>
-	</target>
-
-	<!-- This target holds code to cleanup the testing environment after -->
-	<!-- after all of the tests have been run. You can use this target to -->
-	<!-- delete temporary files that have been created. -->
-	<target name="cleanup">
-		<delete dir="${workspace}" quiet="true" />
-	</target>
-
-	<!-- This target runs the test suite. Any actions that need to happen -->
-	<!-- after all the tests have been run should go here. -->
-	<target name="run" depends="init,suite,cleanup">
-		<ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
-			<property name="includes" value="org*.xml" />
-			<property name="output-file" value="${plugin-name}.xml" />
-		</ant>
-	</target>
-
-</project>
diff --git a/rcp/org.eclipse.rcptt.ui/.project b/rcp/org.eclipse.rcptt.ui/.project
index bf94eda..7f59192 100644
--- a/rcp/org.eclipse.rcptt.ui/.project
+++ b/rcp/org.eclipse.rcptt.ui/.project
@@ -25,4 +25,15 @@
 		<nature>org.eclipse.pde.PluginNature</nature>
 		<nature>org.eclipse.jdt.core.javanature</nature>
 	</natures>
+	<filteredResources>
+		<filter>
+			<id>1559905485550</id>
+			<name></name>
+			<type>10</type>
+			<matcher>
+				<id>org.eclipse.ui.ide.multiFilter</id>
+				<arguments>1.0-name-matches-true-false-target</arguments>
+			</matcher>
+		</filter>
+	</filteredResources>
 </projectDescription>
diff --git a/rcpttTests/ECL_IDE_module/selfAUTTests/SuperContext/LaunchCheck_Wb_SuperContext.test b/rcpttTests/ECL_IDE_module/selfAUTTests/SuperContext/LaunchCheck_Wb_SuperContext.test
index fb74873..17e10f2 100644
--- a/rcpttTests/ECL_IDE_module/selfAUTTests/SuperContext/LaunchCheck_Wb_SuperContext.test
+++ b/rcpttTests/ECL_IDE_module/selfAUTTests/SuperContext/LaunchCheck_Wb_SuperContext.test
@@ -6,8 +6,8 @@
 Element-Version: 3.0
 External-Reference: 
 Id: _PumK4RkUEeOt9MVDSr4v5A
-Runtime-Version: 1.5.0.qualifier
-Save-Time: 8/11/14 2:20 PM
+Runtime-Version: 2.4.3.201905310008
+Save-Time: 6/7/19 3:30 PM
 Tags: selfAUT
 Testcase-Type: ecl
 
@@ -35,7 +35,7 @@
 get-editor "Test_SuperWb" | get-button Replay | click
 
 with [get-view "Execution View"] {
-    try -delay 1000 -times 14 -command {    
+    try -delay 3000 -times 10 -command {    
     	get-label "4/4"
     }
     get-label 2 | get-property caption | equals 2 | verify-true
diff --git a/rcpttTests/ECL_IDE_module/selfAUTTests/q7commands/ListFeatures.test b/rcpttTests/ECL_IDE_module/selfAUTTests/q7commands/ListFeatures.test
index 243b966..4194f71 100644
--- a/rcpttTests/ECL_IDE_module/selfAUTTests/q7commands/ListFeatures.test
+++ b/rcpttTests/ECL_IDE_module/selfAUTTests/q7commands/ListFeatures.test
@@ -1,14 +1,13 @@
 --- RCPTT testcase ---
 Format-Version: 1.0
-Q7-vendor: www.xored.com/q7
 Contexts: _4zI9AWpgEeCzId1Gnkds9A,_bbpo0a2vEeCqpoE1MJ1fFQ,_2rRwEa6lEeCKALiC9hLN7A
 Element-Name: ListFeatures
 Element-Type: testcase
 Element-Version: 3.0
 External-Reference: 
 Id: _nZDtgIGUEeKRQ-O0Mh9igg
-Q7-Runtime-Version: 1.5.0.201406131029
-Save-Time: 6/13/14 7:10 PM
+Runtime-Version: 2.4.3.201906070001
+Save-Time: 6/7/19 6:10 PM
 Tags: selfAUT, q7commands
 Testcase-Type: ecl
 
@@ -56,6 +55,9 @@
     }
     get-button Replay | click
 }
+try -times 30 -delay 1000 -command{
+	get-view "Execution View" | get-label "1/1" -after [get-label "Runs:"]
+}
 get-view "Execution View" | get-button "Details..." | click
 get-window "Execution details" | get-editbox | get-property text | contains "list-features" | verify-true
 get-window "Execution details" | get-editbox | get-property text | contains "org.eclipse.rcptt.tesla.ecl" | verify-true
diff --git a/rcpttTests/platform_tests/selfAUTTests/executionView/DisplayingDetailsCheckDecorators.test b/rcpttTests/platform_tests/selfAUTTests/executionView/DisplayingDetailsCheckDecorators.test
index cc0dcae..9854f4f 100644
--- a/rcpttTests/platform_tests/selfAUTTests/executionView/DisplayingDetailsCheckDecorators.test
+++ b/rcpttTests/platform_tests/selfAUTTests/executionView/DisplayingDetailsCheckDecorators.test
@@ -6,8 +6,8 @@
 Element-Version: 3.0
 External-Reference: 
 Id: _xofzcC84EeS6jLApChUV4Q
-Runtime-Version: 1.5.2.201408180747
-Save-Time: 9/10/14 3:21 PM
+Runtime-Version: 2.4.3.201906070001
+Save-Time: 6/7/19 6:08 PM
 Testcase-Type: ecl
 
 ------=_.description-216f885c-d591-38ce-8ea2-e4f8cb4d6ffa
@@ -39,8 +39,10 @@
 // Decorator exists
 get-view "Test Explorer" | get-tree | select "q7project/failedWithDecorators" | double-click
 get-editor failedWithDecorators | get-button Replay | click
-try -times 50 -delay 100 -command{
-get-view "Execution View" | get-button "Details..." | click}
+try -times 30 -delay 1000 -command{
+	get-label "1/1" -after [get-label "Runs:"]
+	get-view "Execution View" | get-button "Details..." | click
+}
 get-window "Execution details" | get-tab-folder | get-tab-item Description | click
 get-window "Execution details" | get-editbox | get-property text | contains "ControlDecoration(Name must be non-blank string.)" | verify-true
 get-window "Execution details" | get-button OK | click
@@ -48,8 +50,10 @@
 // No decorators
 get-view "Test Explorer" | get-tree | select "q7project/failedWithoutDecorators" | double-click
 get-editor failedWithoutDecorators | get-button Replay | click
-try -times 50 -delay 100 -command{
-get-view "Execution View" | get-button "Details..." | click}
+try -times 30 -delay 1000 -command {
+	get-label "1/1" -after [get-label "Runs:"]
+	get-view "Execution View" | get-button "Details..." | click
+}
 get-window "Execution details" | get-tab-folder | get-tab-item Description | click
 get-window "Execution details" | get-editbox | get-property text | contains "ControlDecoration(Name must be non-blank string.)" | verify-false
 
diff --git a/rcpttTests/platform_tests/selfAUTTests/executionView/DisplayingDetailsForFailedTest.test b/rcpttTests/platform_tests/selfAUTTests/executionView/DisplayingDetailsForFailedTest.test
index 2e7fd9b..d44a15a 100644
--- a/rcpttTests/platform_tests/selfAUTTests/executionView/DisplayingDetailsForFailedTest.test
+++ b/rcpttTests/platform_tests/selfAUTTests/executionView/DisplayingDetailsForFailedTest.test
@@ -1,14 +1,13 @@
 --- RCPTT testcase ---
 Format-Version: 1.0
-Q7-vendor: www.xored.com/q7
 Contexts: _ymiyse5IEeCU6db9MgIBkA,_bbpo0a2vEeCqpoE1MJ1fFQ,_18rr8K25EeCZfrGRg7GXDg
 Element-Name: DisplayingDetailsForFailedTest
 Element-Type: testcase
 Element-Version: 3.0
 External-Reference: 
 Id: _UFtloVebEeGwW6ZL2iq1MA
-Q7-Runtime-Version: 1.5.0.201406131029
-Save-Time: 6/13/14 7:10 PM
+Runtime-Version: 2.4.3.201906070001
+Save-Time: 6/7/19 6:09 PM
 Tags: Runtime, selfAUT
 Testcase-Type: ecl
 
@@ -35,6 +34,9 @@
 Entry-Name: .content
 
 get-view "Test Explorer" | get-tree | select "q7project/simpleTest2" | get-menu "Run As/.* Test Cases" | click
+try -times 30 -delay 1000 -command{
+	get-view "Execution View" | get-label "1/1" -after [get-label "Runs:"]
+}
 with [get-view "Execution View"] {
     get-tree | select "simpleTest2.*"
     get-button "Details..." | click