Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Tiede2016-04-06 10:11:35 -0400
committerMarvin Mueller2017-09-06 05:26:24 -0400
commit7a18a7091030fef8a2131fcab18343353088cc1f (patch)
tree352074cfb46c19dcc23dcca52b967883fbfe0e42
parent04fa4ba30fc72ba5ad26fd90ec188ee318b487f2 (diff)
downloadorg.eclipse.jubula.core-7a18a7091030fef8a2131fcab18343353088cc1f.tar.gz
org.eclipse.jubula.core-7a18a7091030fef8a2131fcab18343353088cc1f.tar.xz
org.eclipse.jubula.core-7a18a7091030fef8a2131fcab18343353088cc1f.zip
Non-sprint task - add support for embedded AUT-Agent within OSGi-API context
-rw-r--r--org.eclipse.jubula.autagent.api/META-INF/MANIFEST.MF3
-rw-r--r--org.eclipse.jubula.autagent.api/src/org/eclipse/jubula/autagent/Embedded.java (renamed from org.eclipse.jubula.autagent.api/src/org/eclipse/jubula/autagent/EmbeddedAUTAgent.java)40
-rw-r--r--org.eclipse.jubula.autagent/META-INF/MANIFEST.MF4
-rw-r--r--org.eclipse.jubula.examples.api.adder.javafx.osgi/META-INF/MANIFEST.MF4
-rw-r--r--org.eclipse.jubula.examples.api.adder.javafx.osgi/launch/JavaFX - SimpleAdder JUnit Plug-in Test - OSGi.launch46
-rw-r--r--org.eclipse.jubula.examples.api.adder.javafx.osgi/launch/SimpleAdder JUnit Test - OSGi.launch18
-rw-r--r--org.eclipse.jubula.examples.api.adder.javafx.osgi/src/org/eclipse/jubula/examples/api/adder/javafx/SimpleAdder.java66
-rw-r--r--org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/launch/RCP - SimpleAdder JUnit Plug-in Test - embedded - OSGi.launch (renamed from org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/launch/SimpleAdderEmbeddedAgent JUnit Plug-in Test - OSGi.launch)0
-rw-r--r--org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/src/org/eclipse/jubula/examples/api/adder/rcp/SimpleAdderEmbeddedAgent.java4
-rw-r--r--org.eclipse.jubula.examples.api.adder.rcp.osgi/launch/RCP - SimpleAdder JUnit Plug-in Test - OSGi.launch (renamed from org.eclipse.jubula.examples.api.adder.rcp.osgi/launch/SimpleAdder JUnit Plug-in Test - OSGi.launch)0
-rw-r--r--org.eclipse.jubula.examples.api.adder.rcp.osgi/launch/RCP - SimpleAdder JUnit Test - OSGi.launch (renamed from org.eclipse.jubula.examples.api.adder.rcp.osgi/launch/SimpleAdder JUnit Test - OSGi.launch)0
-rw-r--r--org.eclipse.jubula.examples.api.adder.swing.osgi/META-INF/MANIFEST.MF4
-rw-r--r--org.eclipse.jubula.examples.api.adder.swing.osgi/launch/SimpleAdder JUnit Test - OSGi.launch18
-rw-r--r--org.eclipse.jubula.examples.api.adder.swing.osgi/launch/Swing - SimpleAdder JUnit Plug-in Test - OSGi.launch46
-rw-r--r--org.eclipse.jubula.examples.api.adder.swing.osgi/src/org/eclipse/jubula/examples/api/adder/swing/SimpleAdder.java53
-rw-r--r--org.eclipse.jubula.examples.api.adder/META-INF/MANIFEST.MF2
16 files changed, 183 insertions, 125 deletions
diff --git a/org.eclipse.jubula.autagent.api/META-INF/MANIFEST.MF b/org.eclipse.jubula.autagent.api/META-INF/MANIFEST.MF
index 58469961b..45510854e 100644
--- a/org.eclipse.jubula.autagent.api/META-INF/MANIFEST.MF
+++ b/org.eclipse.jubula.autagent.api/META-INF/MANIFEST.MF
@@ -5,8 +5,9 @@ Bundle-SymbolicName: org.eclipse.jubula.autagent.api
Bundle-Version: 4.0.0.qualifier
Bundle-Vendor: Eclipse Jubula
Require-Bundle: org.eclipse.jubula.autagent;bundle-version="[6.0.0,7.0.0)",
+ org.eclipse.jubula.tools;bundle-version="[4.0.0,4.1.0)",
org.eclipse.jubula.client.api;bundle-version="[3.1.0,4.0.0)",
- org.eclipse.jubula.tools;bundle-version="[4.0.0,5.0.0)"
+ org.eclipse.jubula.toolkit.api;bundle-version="[4.0.0,5.0.0)"
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
diff --git a/org.eclipse.jubula.autagent.api/src/org/eclipse/jubula/autagent/EmbeddedAUTAgent.java b/org.eclipse.jubula.autagent.api/src/org/eclipse/jubula/autagent/Embedded.java
index 40bbe9829..f618ab049 100644
--- a/org.eclipse.jubula.autagent.api/src/org/eclipse/jubula/autagent/EmbeddedAUTAgent.java
+++ b/org.eclipse.jubula.autagent.api/src/org/eclipse/jubula/autagent/Embedded.java
@@ -20,37 +20,31 @@ import org.eclipse.jubula.tools.internal.constants.EnvConstants;
import org.eclipse.jubula.tools.internal.exception.JBVersionException;
import org.eclipse.jubula.tools.internal.utils.NetUtil;
-/**
- * @author BREDEX GmbH
- */
-public class EmbeddedAUTAgent {
- /** the embedded AUT Agent instance */
- private static AutStarter embedded = null;
-
- /** Constructor */
- private EmbeddedAUTAgent() {
- // hide
- }
+/** @author BREDEX GmbH */
+public enum Embedded {
+ /** Singleton */
+ INSTANCE;
+ /** the agent */
+ private AUTAgent m_agent = null;
/**
- * @return a sharable instance of an embedded AUTAgent
+ * @return a sharable, already connected instance of an AUTAgent
* @throws CommunicationException
*/
- public static AUTAgent instance() throws CommunicationException {
- int port = -1;
- if (embedded == null) {
- port = NetUtil.getFreePort();
- embedded = AutStarter.getInstance();
+ public AUTAgent agent() throws CommunicationException {
+ if (m_agent == null) {
+ int port = NetUtil.getFreePort();
+ AutStarter starter = AutStarter.getInstance();
try {
- embedded.start(port, false, Verbosity.QUIET, false);
+ starter.start(port, false, Verbosity.QUIET, false);
+ m_agent = MakeR.createAUTAgent(EnvConstants.LOCALHOST_ALIAS,
+ port);
+ m_agent.connect();
} catch (JBVersionException | IOException e) {
throw new CommunicationException(e);
}
- } else {
- port = embedded.getAgent().getPort();
}
- AUTAgent agent = MakeR.createAUTAgent(EnvConstants.LOCALHOST_ALIAS,
- port);
- return agent;
+
+ return m_agent;
}
} \ No newline at end of file
diff --git a/org.eclipse.jubula.autagent/META-INF/MANIFEST.MF b/org.eclipse.jubula.autagent/META-INF/MANIFEST.MF
index 5bfd206d3..53eb2f228 100644
--- a/org.eclipse.jubula.autagent/META-INF/MANIFEST.MF
+++ b/org.eclipse.jubula.autagent/META-INF/MANIFEST.MF
@@ -21,9 +21,9 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.6.0,4.0.0)",
org.eclipse.jubula.version;bundle-version="[6.0.0,7.0.0)",
org.eclipse.jubula.tools;bundle-version="[4.0.0,5.0.0)",
org.eclipse.jubula.communication;bundle-version="[4.0.0,5.0.0)",
- org.eclipse.jubula.toolkit.common;bundle-version="[6.0.0,7.0.0)",
+ org.eclipse.jubula.toolkit.common;bundle-version="[6.0.0,7.0.0)";resolution:=optional,
org.eclipse.jubula.client.api;bundle-version="[3.0.0,5.0.0)",
- org.eclipse.jubula.client.core;bundle-version="[6.0.0,7.0.0)",
+ org.eclipse.jubula.client.core;bundle-version="[6.0.0,7.0.0)";resolution:=optional,
org.eclipse.jubula.rc.common;bundle-version="[6.0.0,7.0.0)"
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
diff --git a/org.eclipse.jubula.examples.api.adder.javafx.osgi/META-INF/MANIFEST.MF b/org.eclipse.jubula.examples.api.adder.javafx.osgi/META-INF/MANIFEST.MF
index 9b2b75b08..6babb721e 100644
--- a/org.eclipse.jubula.examples.api.adder.javafx.osgi/META-INF/MANIFEST.MF
+++ b/org.eclipse.jubula.examples.api.adder.javafx.osgi/META-INF/MANIFEST.MF
@@ -15,6 +15,8 @@ Require-Bundle: org.junit;bundle-version="[4.0.0,5.0.0)",
org.eclipse.jubula.toolkit.javafx.api;bundle-version="[5.0.0,6.0.0)",
org.slf4j.api;bundle-version="[1.7.2,2.0.0)",
org.apache.commons.codec;bundle-version="[1.4.0,2.0.0)",
- org.apache.commons.lang;bundle-version="[2.6.0,3.0.0)"
+ org.apache.commons.lang;bundle-version="[2.6.0,3.0.0)",
+ org.eclipse.jubula.rc.javafx;bundle-version="[5.0.0,7.0.0)",
+ org.eclipse.jubula.autagent.api;bundle-version="[4.0.0,5.0.0)"
Bundle-ClassPath: .
Bundle-Name: Examples - API - SimpleAdder - JavaFX - OSGi
diff --git a/org.eclipse.jubula.examples.api.adder.javafx.osgi/launch/JavaFX - SimpleAdder JUnit Plug-in Test - OSGi.launch b/org.eclipse.jubula.examples.api.adder.javafx.osgi/launch/JavaFX - SimpleAdder JUnit Plug-in Test - OSGi.launch
new file mode 100644
index 000000000..524b45dcf
--- /dev/null
+++ b/org.eclipse.jubula.examples.api.adder.javafx.osgi/launch/JavaFX - SimpleAdder JUnit Plug-in Test - OSGi.launch
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
+<booleanAttribute key="append.args" value="true"/>
+<stringAttribute key="application" value="org.eclipse.pde.junit.runtime.coretestapplication"/>
+<booleanAttribute key="askclear" value="false"/>
+<booleanAttribute key="automaticAdd" value="false"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="clearws" value="true"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
+<booleanAttribute key="default" value="false"/>
+<booleanAttribute key="includeOptional" value="false"/>
+<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.jubula.examples.api.adder.javafx.osgi"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="4"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.eclipse.jubula.examples.api.adder.javafx.osgi"/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
+<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -clean"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.jubula.examples.api.adder.javafx.osgi"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="/projects/guidancer/Workspace/hu_snapshot/current/platforms/lin.gtk.x86/jubula"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.platform.ide"/>
+<booleanAttribute key="run_in_ui_thread" value="false"/>
+<stringAttribute key="selected_target_plugins" value="ch.qos.logback.classic@default:default,ch.qos.logback.core@default:default,ch.qos.logback.slf4j@default:false,javax.xml@default:default,org.apache.commons.beanutils@default:default,org.apache.commons.codec*1.6.0.v201305230611@default:default,org.apache.commons.collections@default:default,org.apache.commons.lang*2.6.0.v201404270220@default:default,org.apache.oro@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime@default:true,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.region@default:false,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.transforms.hook@default:false,org.eclipse.equinox.weaving.hook@default:false,org.eclipse.osgi.compatibility.state@default:false,org.eclipse.osgi@-1:true,org.hamcrest.core@default:default,org.junit@default:default,org.slf4j.api@default:default,org.slf4j.jcl@default:default,org.slf4j.jul@default:default"/>
+<stringAttribute key="selected_workspace_plugins" value="com.bredexsw.guidancer.autagent@default:false,com.bredexsw.jubula.rc.common@default:default,com.bredexsw.jubula.version@default:false,org.eclipse.jubula.autagent.api@default:default,org.eclipse.jubula.autagent@default:default,org.eclipse.jubula.client.api.commands@default:default,org.eclipse.jubula.client.api@default:default,org.eclipse.jubula.communication@default:default,org.eclipse.jubula.examples.api.adder.javafx.osgi@default:default,org.eclipse.jubula.logging@default:default,org.eclipse.jubula.rc.common.agent@default:default,org.eclipse.jubula.rc.common@default:default,org.eclipse.jubula.rc.javafx.j8u40@default:false,org.eclipse.jubula.rc.javafx@default:default,org.eclipse.jubula.toolkit.api@default:default,org.eclipse.jubula.toolkit.base.api@default:default,org.eclipse.jubula.toolkit.concrete.api@default:default,org.eclipse.jubula.toolkit.javafx.api@default:default,org.eclipse.jubula.tools@default:default,org.eclipse.jubula.version@default:default"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="false"/>
+<booleanAttribute key="useProduct" value="false"/>
+</launchConfiguration>
diff --git a/org.eclipse.jubula.examples.api.adder.javafx.osgi/launch/SimpleAdder JUnit Test - OSGi.launch b/org.eclipse.jubula.examples.api.adder.javafx.osgi/launch/SimpleAdder JUnit Test - OSGi.launch
deleted file mode 100644
index b71fb8c35..000000000
--- a/org.eclipse.jubula.examples.api.adder.javafx.osgi/launch/SimpleAdder JUnit Test - OSGi.launch
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/org.eclipse.jubula.examples.api.adder.javafx.osgi/src"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="2"/>
-</listAttribute>
-<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
-<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.eclipse.jubula.examples.api.adder.javafx.osgi/src"/>
-<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
-<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
-<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
-<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
-<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.jubula.examples.api.adder.javafx.osgi"/>
-</launchConfiguration>
diff --git a/org.eclipse.jubula.examples.api.adder.javafx.osgi/src/org/eclipse/jubula/examples/api/adder/javafx/SimpleAdder.java b/org.eclipse.jubula.examples.api.adder.javafx.osgi/src/org/eclipse/jubula/examples/api/adder/javafx/SimpleAdder.java
index a0b218512..681967eac 100644
--- a/org.eclipse.jubula.examples.api.adder.javafx.osgi/src/org/eclipse/jubula/examples/api/adder/javafx/SimpleAdder.java
+++ b/org.eclipse.jubula.examples.api.adder.javafx.osgi/src/org/eclipse/jubula/examples/api/adder/javafx/SimpleAdder.java
@@ -10,12 +10,13 @@
*******************************************************************************/
package org.eclipse.jubula.examples.api.adder.javafx;
+import java.io.File;
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.jubula.autagent.Embedded;
import org.eclipse.jubula.client.AUT;
import org.eclipse.jubula.client.AUTAgent;
-import org.eclipse.jubula.client.MakeR;
import org.eclipse.jubula.client.Result;
import org.eclipse.jubula.client.exceptions.CheckFailedException;
import org.eclipse.jubula.client.launch.AUTConfiguration;
@@ -37,10 +38,6 @@ import org.junit.Test;
/** @author BREDEX GmbH */
public class SimpleAdder {
- /** AUT-Agent host name to use */
- public static final String AGENT_HOST = "localhost"; //$NON-NLS-1$
- /** AUT-Agent port to use */
- public static final int AGENT_PORT = 60000;
/** the value1 */
private static TextInputComponent value1;
/** the value2 */
@@ -49,8 +46,6 @@ public class SimpleAdder {
private static GraphicsComponent button;
/** the result */
private static TextComponent result;
- /** the AUT-Agent */
- private AUTAgent m_agent;
/** the AUT */
private AUT m_aut;
@@ -72,29 +67,44 @@ public class SimpleAdder {
/** prepare */
@Before
public void setUp() throws Exception {
- /* Connecting to external Jubula AUT Agent which
- must be started manually BEFORE test execution! */
- m_agent = getAUTAgentInstance();
- m_agent.connect();
+ AUTAgent agent = Embedded.INSTANCE.agent();
final String autID = "SimpleAdder_javafx"; //$NON-NLS-1$
- AUTConfiguration config = new JavaFXAUTConfiguration(
- "api.aut.conf.simple.adder.javafx", //$NON-NLS-1$
- autID,
- "..\\jre\\bin\\java.exe", //$NON-NLS-1$
- "..\\examples\\", //$NON-NLS-1$
- new String[]{"-jar", "AUTs\\SimpleAdder\\javafx\\SimpleAdder.jar"} //$NON-NLS-1$ //$NON-NLS-2$
- );
+ AUTConfiguration config = createAutConfiguration(autID);
- AUTIdentifier id = m_agent.startAUT(config);
+ AUTIdentifier id = agent.startAUT(config);
if (id != null) {
- m_aut = m_agent.getAUT(id, JavafxComponents.getToolkitInformation());
+ m_aut = agent.getAUT(id, JavafxComponents.getToolkitInformation());
m_aut.connect();
} else {
Assert.fail("AUT start has failed!"); //$NON-NLS-1$
}
}
+ /**
+ * @param autID the AUT-Id to use
+ * @return a configuration
+ */
+ private AUTConfiguration createAutConfiguration(final String autID) {
+ return new JavaFXAUTConfiguration(
+ "api.aut.conf.simple.adder.javafx", //$NON-NLS-1$
+ autID,
+ "..\\jre\\bin\\java.exe", //$NON-NLS-1$
+ new StringBuilder()
+ .append("..") //$NON-NLS-1$
+ .append(File.separatorChar)
+ .append("examples") //$NON-NLS-1$
+ .append(File.separatorChar)
+ .append("AUTs") //$NON-NLS-1$
+ .append(File.separatorChar)
+ .append("SimpleAdder") //$NON-NLS-1$
+ .append(File.separatorChar)
+ .append("javafx") //$NON-NLS-1$
+ .append(File.separatorChar)
+ .toString(),
+ new String[]{"-jar", "SimpleAdder.jar"}); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
/** the actual test method */
@Test(expected = CheckFailedException.class)
public void testTestFirstSimpleAdderSteps() throws Exception {
@@ -124,15 +134,11 @@ public class SimpleAdder {
/** cleanup */
@After
public void tearDown() throws Exception {
- m_aut.disconnect();
- m_agent.stopAUT(m_aut.getIdentifier());
- m_agent.disconnect();
- }
-
- /**
- * @return an AUT-Agent instance
- */
- protected AUTAgent getAUTAgentInstance() {
- return MakeR.createAUTAgent(AGENT_HOST, AGENT_PORT);
+ AUTAgent agent = Embedded.INSTANCE.agent();
+ if (m_aut != null) {
+ m_aut.disconnect();
+ agent.stopAUT(m_aut.getIdentifier());
+ }
+ agent.disconnect();
}
} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/launch/SimpleAdderEmbeddedAgent JUnit Plug-in Test - OSGi.launch b/org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/launch/RCP - SimpleAdder JUnit Plug-in Test - embedded - OSGi.launch
index e74c64599..e74c64599 100644
--- a/org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/launch/SimpleAdderEmbeddedAgent JUnit Plug-in Test - OSGi.launch
+++ b/org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/launch/RCP - SimpleAdder JUnit Plug-in Test - embedded - OSGi.launch
diff --git a/org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/src/org/eclipse/jubula/examples/api/adder/rcp/SimpleAdderEmbeddedAgent.java b/org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/src/org/eclipse/jubula/examples/api/adder/rcp/SimpleAdderEmbeddedAgent.java
index 5ec8222d5..6f26aa345 100644
--- a/org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/src/org/eclipse/jubula/examples/api/adder/rcp/SimpleAdderEmbeddedAgent.java
+++ b/org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/src/org/eclipse/jubula/examples/api/adder/rcp/SimpleAdderEmbeddedAgent.java
@@ -10,13 +10,13 @@
*******************************************************************************/
package org.eclipse.jubula.examples.api.adder.rcp;
-import org.eclipse.jubula.autagent.EmbeddedAUTAgent;
+import org.eclipse.jubula.autagent.Embedded;
import org.eclipse.jubula.client.AUTAgent;
/** @author BREDEX GmbH */
public class SimpleAdderEmbeddedAgent extends SimpleAdder {
@Override
protected AUTAgent getAUTAgentInstance() {
- return EmbeddedAUTAgent.instance();
+ return Embedded.INSTANCE.agent();
}
} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.api.adder.rcp.osgi/launch/SimpleAdder JUnit Plug-in Test - OSGi.launch b/org.eclipse.jubula.examples.api.adder.rcp.osgi/launch/RCP - SimpleAdder JUnit Plug-in Test - OSGi.launch
index 10b0487da..10b0487da 100644
--- a/org.eclipse.jubula.examples.api.adder.rcp.osgi/launch/SimpleAdder JUnit Plug-in Test - OSGi.launch
+++ b/org.eclipse.jubula.examples.api.adder.rcp.osgi/launch/RCP - SimpleAdder JUnit Plug-in Test - OSGi.launch
diff --git a/org.eclipse.jubula.examples.api.adder.rcp.osgi/launch/SimpleAdder JUnit Test - OSGi.launch b/org.eclipse.jubula.examples.api.adder.rcp.osgi/launch/RCP - SimpleAdder JUnit Test - OSGi.launch
index d67ffb935..d67ffb935 100644
--- a/org.eclipse.jubula.examples.api.adder.rcp.osgi/launch/SimpleAdder JUnit Test - OSGi.launch
+++ b/org.eclipse.jubula.examples.api.adder.rcp.osgi/launch/RCP - SimpleAdder JUnit Test - OSGi.launch
diff --git a/org.eclipse.jubula.examples.api.adder.swing.osgi/META-INF/MANIFEST.MF b/org.eclipse.jubula.examples.api.adder.swing.osgi/META-INF/MANIFEST.MF
index df202235e..f3bb1a0eb 100644
--- a/org.eclipse.jubula.examples.api.adder.swing.osgi/META-INF/MANIFEST.MF
+++ b/org.eclipse.jubula.examples.api.adder.swing.osgi/META-INF/MANIFEST.MF
@@ -15,6 +15,8 @@ Require-Bundle: org.junit;bundle-version="[4.0.0,5.0.0)",
org.eclipse.jubula.toolkit.swing.api;bundle-version="[5.0.0,6.0.0)",
org.slf4j.api;bundle-version="[1.7.2,2.0.0)",
org.apache.commons.codec;bundle-version="[1.4.0,2.0.0)",
- org.apache.commons.lang;bundle-version="[2.6.0,3.0.0)"
+ org.apache.commons.lang;bundle-version="[2.6.0,3.0.0)",
+ org.eclipse.jubula.autagent.api;bundle-version="[4.0.0,5.0.0)",
+ org.eclipse.jubula.rc.swing;bundle-version="[5.0.0,7.0.0)"
Bundle-ClassPath: .
Bundle-Name: Examples - API - SimpleAdder - Swing - OSGi
diff --git a/org.eclipse.jubula.examples.api.adder.swing.osgi/launch/SimpleAdder JUnit Test - OSGi.launch b/org.eclipse.jubula.examples.api.adder.swing.osgi/launch/SimpleAdder JUnit Test - OSGi.launch
deleted file mode 100644
index 8c18bad0d..000000000
--- a/org.eclipse.jubula.examples.api.adder.swing.osgi/launch/SimpleAdder JUnit Test - OSGi.launch
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/org.eclipse.jubula.examples.api.adder.swing.osgi/src"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="2"/>
-</listAttribute>
-<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
-<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.eclipse.jubula.examples.api.adder.swing.osgi/src"/>
-<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
-<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
-<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
-<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
-<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.jubula.examples.api.adder.swing.osgi"/>
-</launchConfiguration>
diff --git a/org.eclipse.jubula.examples.api.adder.swing.osgi/launch/Swing - SimpleAdder JUnit Plug-in Test - OSGi.launch b/org.eclipse.jubula.examples.api.adder.swing.osgi/launch/Swing - SimpleAdder JUnit Plug-in Test - OSGi.launch
new file mode 100644
index 000000000..6a2eb7f91
--- /dev/null
+++ b/org.eclipse.jubula.examples.api.adder.swing.osgi/launch/Swing - SimpleAdder JUnit Plug-in Test - OSGi.launch
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
+<booleanAttribute key="append.args" value="true"/>
+<stringAttribute key="application" value="org.eclipse.pde.junit.runtime.coretestapplication"/>
+<booleanAttribute key="askclear" value="false"/>
+<booleanAttribute key="automaticAdd" value="false"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="clearws" value="true"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
+<booleanAttribute key="default" value="false"/>
+<booleanAttribute key="includeOptional" value="false"/>
+<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.jubula.examples.api.adder.swing.osgi"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="4"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.eclipse.jubula.examples.api.adder.swing.osgi"/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
+<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -clean"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.jubula.examples.api.adder.swing.osgi"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="/projects/guidancer/Workspace/hu_snapshot/current/platforms/lin.gtk.x86/jubula"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.platform.ide"/>
+<booleanAttribute key="run_in_ui_thread" value="false"/>
+<stringAttribute key="selected_target_plugins" value="ch.qos.logback.classic@default:default,ch.qos.logback.core@default:default,ch.qos.logback.slf4j@default:false,javax.xml@default:default,org.apache.commons.beanutils@default:default,org.apache.commons.codec*1.6.0.v201305230611@default:default,org.apache.commons.collections@default:default,org.apache.commons.lang*2.6.0.v201404270220@default:default,org.apache.oro@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime@default:true,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.region@default:false,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.transforms.hook@default:false,org.eclipse.equinox.weaving.hook@default:false,org.eclipse.osgi.compatibility.state@default:false,org.eclipse.osgi@-1:true,org.hamcrest.core@default:default,org.junit@default:default,org.slf4j.api@default:default,org.slf4j.jcl@default:default,org.slf4j.jul@default:default"/>
+<stringAttribute key="selected_workspace_plugins" value="com.bredexsw.guidancer.autagent@default:false,com.bredexsw.jubula.rc.common@default:default,com.bredexsw.jubula.version@default:false,org.eclipse.jubula.autagent.api@default:default,org.eclipse.jubula.autagent@default:default,org.eclipse.jubula.client.api.commands@default:default,org.eclipse.jubula.client.api@default:default,org.eclipse.jubula.communication@default:default,org.eclipse.jubula.examples.api.adder.swing.osgi@default:default,org.eclipse.jubula.logging@default:default,org.eclipse.jubula.rc.common.agent@default:default,org.eclipse.jubula.rc.common@default:default,org.eclipse.jubula.rc.swing@default:default,org.eclipse.jubula.toolkit.api@default:default,org.eclipse.jubula.toolkit.base.api@default:default,org.eclipse.jubula.toolkit.concrete.api@default:default,org.eclipse.jubula.toolkit.swing.api@default:default,org.eclipse.jubula.tools@default:default,org.eclipse.jubula.version@default:default"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="false"/>
+<booleanAttribute key="useProduct" value="false"/>
+</launchConfiguration>
diff --git a/org.eclipse.jubula.examples.api.adder.swing.osgi/src/org/eclipse/jubula/examples/api/adder/swing/SimpleAdder.java b/org.eclipse.jubula.examples.api.adder.swing.osgi/src/org/eclipse/jubula/examples/api/adder/swing/SimpleAdder.java
index dd00687f4..b2f4c08ca 100644
--- a/org.eclipse.jubula.examples.api.adder.swing.osgi/src/org/eclipse/jubula/examples/api/adder/swing/SimpleAdder.java
+++ b/org.eclipse.jubula.examples.api.adder.swing.osgi/src/org/eclipse/jubula/examples/api/adder/swing/SimpleAdder.java
@@ -10,12 +10,13 @@
*******************************************************************************/
package org.eclipse.jubula.examples.api.adder.swing;
+import java.io.File;
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.jubula.autagent.Embedded;
import org.eclipse.jubula.client.AUT;
import org.eclipse.jubula.client.AUTAgent;
-import org.eclipse.jubula.client.MakeR;
import org.eclipse.jubula.client.Result;
import org.eclipse.jubula.client.exceptions.CheckFailedException;
import org.eclipse.jubula.client.launch.AUTConfiguration;
@@ -37,10 +38,6 @@ import org.junit.Test;
/** @author BREDEX GmbH */
public class SimpleAdder {
- /** AUT-Agent host name to use */
- public static final String AGENT_HOST = "localhost"; //$NON-NLS-1$
- /** AUT-Agent port to use */
- public static final int AGENT_PORT = 60000;
/** the value1 */
private static TextInputComponent value1;
/** the value2 */
@@ -49,8 +46,6 @@ public class SimpleAdder {
private static GraphicsComponent button;
/** the result */
private static TextComponent result;
- /** the AUT-Agent */
- private AUTAgent m_agent;
/** the AUT */
private AUT m_aut;
@@ -72,23 +67,29 @@ public class SimpleAdder {
/** prepare */
@Before
public void setUp() throws Exception {
- /* Connecting to external Jubula AUT Agent which
- must be started manually BEFORE test execution! */
- m_agent = getAUTAgentInstance();
- m_agent.connect();
-
+ AUTAgent agent = Embedded.INSTANCE.agent();
final String autID = "SimpleAdder_swing"; //$NON-NLS-1$
AUTConfiguration config = new SwingAUTConfiguration(
"api.aut.conf.simple.adder.swing", //$NON-NLS-1$
autID,
- "..\\jre\\bin\\java.exe", //$NON-NLS-1$
- "..\\examples\\AUTs\\SimpleAdder\\swing", //$NON-NLS-1$
- new String[]{"-jar", "SimpleAdder.jar"} //$NON-NLS-1$ //$NON-NLS-2$
- );
+ "java", //$NON-NLS-1$
+ new StringBuilder()
+ .append("..") //$NON-NLS-1$
+ .append(File.separatorChar)
+ .append("examples") //$NON-NLS-1$
+ .append(File.separatorChar)
+ .append("AUTs") //$NON-NLS-1$
+ .append(File.separatorChar)
+ .append("SimpleAdder") //$NON-NLS-1$
+ .append(File.separatorChar)
+ .append("swing") //$NON-NLS-1$
+ .append(File.separatorChar)
+ .toString(),
+ new String[]{"-jar", "SimpleAdder.jar"}); //$NON-NLS-1$ //$NON-NLS-2$
- AUTIdentifier id = m_agent.startAUT(config);
+ AUTIdentifier id = agent.startAUT(config);
if (id != null) {
- m_aut = m_agent.getAUT(id, SwingComponents.getToolkitInformation());
+ m_aut = agent.getAUT(id, SwingComponents.getToolkitInformation());
m_aut.connect();
} else {
Assert.fail("AUT start has failed!"); //$NON-NLS-1$
@@ -124,15 +125,11 @@ public class SimpleAdder {
/** cleanup */
@After
public void tearDown() throws Exception {
- m_aut.disconnect();
- m_agent.stopAUT(m_aut.getIdentifier());
- m_agent.disconnect();
- }
-
- /**
- * @return an AUT-Agent instance
- */
- protected AUTAgent getAUTAgentInstance() {
- return MakeR.createAUTAgent(AGENT_HOST, AGENT_PORT);
+ AUTAgent agent = Embedded.INSTANCE.agent();
+ if (m_aut != null) {
+ m_aut.disconnect();
+ agent.stopAUT(m_aut.getIdentifier());
+ }
+ agent.disconnect();
}
} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.api.adder/META-INF/MANIFEST.MF b/org.eclipse.jubula.examples.api.adder/META-INF/MANIFEST.MF
index 24d35accb..dbdf01aea 100644
--- a/org.eclipse.jubula.examples.api.adder/META-INF/MANIFEST.MF
+++ b/org.eclipse.jubula.examples.api.adder/META-INF/MANIFEST.MF
@@ -8,7 +8,7 @@ Bundle-ActivationPolicy: lazy
Bundle-Vendor: Eclipse Jubula
Bundle-ClassPath: .
Bundle-Localization: plugin
-Require-Bundle: org.junit;bundle-version="[4.0.0,5.0.0)",
+Require-Bundle: org.junit;bundle-version="[4.0.0,5.0.0)",
org.eclipse.jubula.communication;bundle-version="[4.0.0,5.0.0)",
org.eclipse.jubula.toolkit.api;bundle-version="[4.0.0,5.0.0)",
org.eclipse.jubula.toolkit.base.api;bundle-version="[5.0.0,6.0.0)",

Back to the top