Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Tiede2015-02-12 20:42:41 +0000
committerMarkus Tiede2015-02-12 20:42:41 +0000
commita14bea64a5ffbd6a8b4c06ce3826bf686043a20a (patch)
tree800ef977b4e63ff8cc92222f42795e3c05049888
parent4c72b84514213c5eac4d8d22c5d8f94f22d49554 (diff)
downloadorg.eclipse.jubula.core-a14bea64a5ffbd6a8b4c06ce3826bf686043a20a.tar.gz
org.eclipse.jubula.core-a14bea64a5ffbd6a8b4c06ce3826bf686043a20a.tar.xz
org.eclipse.jubula.core-a14bea64a5ffbd6a8b4c06ce3826bf686043a20a.zip
Non-sprint task - plug-in JUnit test launch configuration and target definition added - embedded AUT-Agent usage (experimental).
-rw-r--r--org.eclipse.jubula.autagent.api/src/org/eclipse/jubula/autagent/EmbeddedAUTAgent.java (renamed from org.eclipse.jubula.autagent.api/src/org/eclipse/jubula/autagent/AUTAgent.java)18
-rw-r--r--org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/.classpath7
-rw-r--r--org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/.gitignore3
-rw-r--r--org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/.project35
-rw-r--r--org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/META-INF/MANIFEST.MF12
-rw-r--r--org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/build.properties4
-rw-r--r--org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/launch/SimpleAdderEmbeddedAgent JUnit Plug-in Test - OSGi.launch45
-rw-r--r--org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/pom.xml15
-rw-r--r--org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/src/org/eclipse/jubula/examples/api/adder/rcp/SimpleAdderEmbeddedAgent.java22
-rw-r--r--org.eclipse.jubula.examples.api.adder.rcp.osgi/META-INF/MANIFEST.MF1
-rw-r--r--org.eclipse.jubula.examples.api.adder.rcp/shared/src/org/eclipse/jubula/examples/api/adder/rcp/SimpleAdder.java11
-rw-r--r--org.eclipse.jubula.examples.api.configuration/target/api-pde-eagent.target18
-rw-r--r--org.eclipse.jubula.examples.api.configuration/target/api-pde.target5
13 files changed, 179 insertions, 17 deletions
diff --git a/org.eclipse.jubula.autagent.api/src/org/eclipse/jubula/autagent/AUTAgent.java b/org.eclipse.jubula.autagent.api/src/org/eclipse/jubula/autagent/EmbeddedAUTAgent.java
index 88cac7f40..40bbe9829 100644
--- a/org.eclipse.jubula.autagent.api/src/org/eclipse/jubula/autagent/AUTAgent.java
+++ b/org.eclipse.jubula.autagent.api/src/org/eclipse/jubula/autagent/EmbeddedAUTAgent.java
@@ -13,6 +13,7 @@ package org.eclipse.jubula.autagent;
import java.io.IOException;
import org.eclipse.jubula.autagent.AutStarter.Verbosity;
+import org.eclipse.jubula.client.AUTAgent;
import org.eclipse.jubula.client.MakeR;
import org.eclipse.jubula.client.exceptions.CommunicationException;
import org.eclipse.jubula.tools.internal.constants.EnvConstants;
@@ -22,22 +23,20 @@ import org.eclipse.jubula.tools.internal.utils.NetUtil;
/**
* @author BREDEX GmbH
*/
-public class AUTAgent {
+public class EmbeddedAUTAgent {
/** the embedded AUT Agent instance */
private static AutStarter embedded = null;
/** Constructor */
- private AUTAgent() {
+ private EmbeddedAUTAgent() {
// hide
}
-
+
/**
- * @return a new and already connected (to an implicitly started embedded)
- * AUTAgent instance
+ * @return a sharable instance of an embedded AUTAgent
* @throws CommunicationException
*/
- public static org.eclipse.jubula.client.AUTAgent embedded()
- throws CommunicationException {
+ public static AUTAgent instance() throws CommunicationException {
int port = -1;
if (embedded == null) {
port = NetUtil.getFreePort();
@@ -50,9 +49,8 @@ public class AUTAgent {
} else {
port = embedded.getAgent().getPort();
}
- org.eclipse.jubula.client.AUTAgent agent = MakeR.createAUTAgent(
- EnvConstants.LOCALHOST_ALIAS, port);
- agent.connect();
+ AUTAgent agent = MakeR.createAUTAgent(EnvConstants.LOCALHOST_ALIAS,
+ port);
return agent;
}
} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/.classpath b/org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/.classpath
new file mode 100644
index 000000000..121e527a9
--- /dev/null
+++ b/org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <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="output" path="bin"/>
+</classpath>
diff --git a/org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/.gitignore b/org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/.gitignore
new file mode 100644
index 000000000..9d12075e6
--- /dev/null
+++ b/org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/.gitignore
@@ -0,0 +1,3 @@
+/bin
+/target
+/src-gen
diff --git a/org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/.project b/org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/.project
new file mode 100644
index 000000000..fdd156259
--- /dev/null
+++ b/org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/.project
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+ <linkedResources>
+ <link>
+ <name>.settings</name>
+ <type>2</type>
+ <locationURI>PARENT-1-PROJECT_LOC/org.eclipse.jubula.project.configuration/settings/1.6</locationURI>
+ </link>
+ </linkedResources>
+</projectDescription>
diff --git a/org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/META-INF/MANIFEST.MF b/org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..7eafead97
--- /dev/null
+++ b/org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/META-INF/MANIFEST.MF
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent
+Bundle-Version: 3.0.0.qualifier
+Bundle-Vendor: Eclipse Jubula
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Require-Bundle: org.junit;bundle-version="[4.0.0,5.0.0)",
+ org.eclipse.jubula.client.api;bundle-version="[3.0.0,3.1.0)",
+ org.eclipse.jubula.autagent.api;bundle-version="[3.0.0,3.1.0)",
+ org.eclipse.jubula.examples.api.adder.rcp.osgi;bundle-version="[3.0.0,3.1.0)"
+Bundle-ClassPath: .
+Bundle-Name: Examples - API - SimpleAdder - RCP - OSGi - embedded AUT-Agent
diff --git a/org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/build.properties b/org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/build.properties
new file mode 100644
index 000000000..5b359b5b7
--- /dev/null
+++ b/org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ . \ 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/SimpleAdderEmbeddedAgent JUnit Plug-in Test - OSGi.launch
new file mode 100644
index 000000000..8fa49ea32
--- /dev/null
+++ b/org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/launch/SimpleAdderEmbeddedAgent JUnit Plug-in Test - OSGi.launch
@@ -0,0 +1,45 @@
+<?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.rcp.osgi.eagent"/>
+</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.rcp.osgi.eagent"/>
+<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.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.rcp.osgi.eagent"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.equinox.p2.director.app.product"/>
+<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:default,javax.xml@default:default,org.apache.commons.beanutils@default:default,org.apache.commons.codec@default:default,org.apache.commons.lang@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.registry@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.rc.common.agent@default:default,org.eclipse.jubula.rc.common@default:default,org.eclipse.jubula.rc.javafx@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.rcp.api@default:default,org.eclipse.jubula.toolkit.swt.api@default:default,org.eclipse.jubula.tools@default:default,org.eclipse.jubula.version@default:default,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"/>
+<stringAttribute key="selected_workspace_plugins" value="org.eclipse.jubula.autagent.api@default:default,org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent@default:default,org.eclipse.jubula.examples.api.adder.rcp.osgi@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.rcp.osgi.eagent/pom.xml b/org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/pom.xml
new file mode 100644
index 000000000..8250e0f56
--- /dev/null
+++ b/org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.jubula.releng.client</artifactId>
+ <groupId>org.eclipse.jubula</groupId>
+ <version>3.0.0-SNAPSHOT</version>
+ <relativePath>../org.eclipse.jubula.releng.client</relativePath>
+ </parent>
+ <artifactId>org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent</artifactId>
+ <packaging>eclipse-plugin</packaging>
+
+</project>
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
new file mode 100644
index 000000000..5ec8222d5
--- /dev/null
+++ b/org.eclipse.jubula.examples.api.adder.rcp.osgi.eagent/src/org/eclipse/jubula/examples/api/adder/rcp/SimpleAdderEmbeddedAgent.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2015 BREDEX GmbH.
+ * 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:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.api.adder.rcp;
+
+import org.eclipse.jubula.autagent.EmbeddedAUTAgent;
+import org.eclipse.jubula.client.AUTAgent;
+
+/** @author BREDEX GmbH */
+public class SimpleAdderEmbeddedAgent extends SimpleAdder {
+ @Override
+ protected AUTAgent getAUTAgentInstance() {
+ return EmbeddedAUTAgent.instance();
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.api.adder.rcp.osgi/META-INF/MANIFEST.MF b/org.eclipse.jubula.examples.api.adder.rcp.osgi/META-INF/MANIFEST.MF
index 9381e2dd4..425897d17 100644
--- a/org.eclipse.jubula.examples.api.adder.rcp.osgi/META-INF/MANIFEST.MF
+++ b/org.eclipse.jubula.examples.api.adder.rcp.osgi/META-INF/MANIFEST.MF
@@ -20,3 +20,4 @@ Require-Bundle: org.junit;bundle-version="[4.0.0,5.0.0)",
Bundle-ClassPath: .,
shared/resources/
Bundle-Name: Examples - API - SimpleAdder - RCP - OSGi
+Export-Package: org.eclipse.jubula.examples.api.adder.rcp
diff --git a/org.eclipse.jubula.examples.api.adder.rcp/shared/src/org/eclipse/jubula/examples/api/adder/rcp/SimpleAdder.java b/org.eclipse.jubula.examples.api.adder.rcp/shared/src/org/eclipse/jubula/examples/api/adder/rcp/SimpleAdder.java
index ddf7790a6..d6547f028 100644
--- a/org.eclipse.jubula.examples.api.adder.rcp/shared/src/org/eclipse/jubula/examples/api/adder/rcp/SimpleAdder.java
+++ b/org.eclipse.jubula.examples.api.adder.rcp/shared/src/org/eclipse/jubula/examples/api/adder/rcp/SimpleAdder.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2014 BREDEX GmbH.
+ * Copyright (c) 2015 BREDEX GmbH.
* 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
@@ -85,7 +85,7 @@ public class SimpleAdder {
/** prepare */
@Before
public void setUp() throws Exception {
- m_agent = MakeR.createAUTAgent(AGENT_HOST, AGENT_PORT);
+ m_agent = getAUTAgentInstance();
m_agent.connect();
final String autID = "SimpleAdder_rcp"; //$NON-NLS-1$
@@ -104,6 +104,13 @@ public class SimpleAdder {
}
}
+ /**
+ * @return an AUT-Agent instance
+ */
+ protected AUTAgent getAUTAgentInstance() {
+ return MakeR.createAUTAgent(AGENT_HOST, AGENT_PORT);
+ }
+
/** cleanup */
@After
public void tearDown() throws Exception {
diff --git a/org.eclipse.jubula.examples.api.configuration/target/api-pde-eagent.target b/org.eclipse.jubula.examples.api.configuration/target/api-pde-eagent.target
new file mode 100644
index 000000000..0b250b3d4
--- /dev/null
+++ b/org.eclipse.jubula.examples.api.configuration/target/api-pde-eagent.target
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?pde version="3.8"?><target name="api-pde-eagent" sequenceNumber="1">
+<locations>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.jubula.feature.feature.group" version="0.0.0"/>
+<unit id="org.eclipse.jubula.feature.api.core.feature.group" version="0.0.0"/>
+<unit id="org.eclipse.jubula.feature.api.core.source.feature.group" version="0.0.0"/>
+<repository location="http://download.eclipse.org/jubula/development"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
+<unit id="org.junit" version="0.0.0"/>
+<unit id="org.hamcrest.core" version="0.0.0"/>
+<unit id="org.eclipse.platform.ide" version="0.0.0"/>
+<unit id="org.eclipse.pde.feature.group" version="0.0.0"/>
+<repository location="http://download.eclipse.org/releases/luna"/>
+</location>
+</locations>
+</target>
diff --git a/org.eclipse.jubula.examples.api.configuration/target/api-pde.target b/org.eclipse.jubula.examples.api.configuration/target/api-pde.target
index 6d59e851e..1b6135296 100644
--- a/org.eclipse.jubula.examples.api.configuration/target/api-pde.target
+++ b/org.eclipse.jubula.examples.api.configuration/target/api-pde.target
@@ -13,10 +13,5 @@
<unit id="org.eclipse.pde.feature.group" version="0.0.0"/>
<repository location="http://download.eclipse.org/releases/luna"/>
</location>
-<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
-<unit id="ch.qos.logback.classic" version="1.0.7.v20121108-1250"/>
-<unit id="ch.qos.logback.core" version="1.0.7.v20121108-1250"/>
-<repository id="eclipse-orbit-R20130827064939" location="http://download.eclipse.org/tools/orbit/downloads/drops/R20130827064939/repository"/>
-</location>
</locations>
</target>

Back to the top