Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAchim Loerke2011-01-13 05:16:50 -0500
committerAchim Loerke2011-01-13 05:16:50 -0500
commit702107c8fc1a74f2a14d31dd9e0ebd79d507c81c (patch)
treefc8aaeaee33dc187eeb2a6c93d176c2b66c533a9 /org.eclipse.jubula.examples.app.cmd.controller
parent6bc2028be904e0e1afc691025b1d540ffc694fd9 (diff)
downloadorg.eclipse.jubula.core-702107c8fc1a74f2a14d31dd9e0ebd79d507c81c.tar.gz
org.eclipse.jubula.core-702107c8fc1a74f2a14d31dd9e0ebd79d507c81c.tar.xz
org.eclipse.jubula.core-702107c8fc1a74f2a14d31dd9e0ebd79d507c81c.zip
Initial contribution
Diffstat (limited to 'org.eclipse.jubula.examples.app.cmd.controller')
-rw-r--r--org.eclipse.jubula.examples.app.cmd.controller/.checkstyle7
-rw-r--r--org.eclipse.jubula.examples.app.cmd.controller/.classpath7
-rw-r--r--org.eclipse.jubula.examples.app.cmd.controller/.gitignore2
-rw-r--r--org.eclipse.jubula.examples.app.cmd.controller/.project23
-rw-r--r--org.eclipse.jubula.examples.app.cmd.controller/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--org.eclipse.jubula.examples.app.cmd.controller/about.html28
-rw-r--r--org.eclipse.jubula.examples.app.cmd.controller/lib/.gitignore1
-rw-r--r--org.eclipse.jubula.examples.app.cmd.controller/lib/.keep0
-rw-r--r--org.eclipse.jubula.examples.app.cmd.controller/src/org/eclipse/jubula/examples/app/cmd/controller/CommandLineClientRemoteControl.java82
9 files changed, 162 insertions, 0 deletions
diff --git a/org.eclipse.jubula.examples.app.cmd.controller/.checkstyle b/org.eclipse.jubula.examples.app.cmd.controller/.checkstyle
new file mode 100644
index 000000000..37984e459
--- /dev/null
+++ b/org.eclipse.jubula.examples.app.cmd.controller/.checkstyle
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="true">
+ <fileset name="all" enabled="true" check-config-name="Jubula" local="false">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ </fileset>
+</fileset-config>
diff --git a/org.eclipse.jubula.examples.app.cmd.controller/.classpath b/org.eclipse.jubula.examples.app.cmd.controller/.classpath
new file mode 100644
index 000000000..c119a826c
--- /dev/null
+++ b/org.eclipse.jubula.examples.app.cmd.controller/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="lib" path="lib/org.eclipse.jubula.client.cmd.controller.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.eclipse.jubula.examples.app.cmd.controller/.gitignore b/org.eclipse.jubula.examples.app.cmd.controller/.gitignore
new file mode 100644
index 000000000..348c102af
--- /dev/null
+++ b/org.eclipse.jubula.examples.app.cmd.controller/.gitignore
@@ -0,0 +1,2 @@
+/build
+/bin
diff --git a/org.eclipse.jubula.examples.app.cmd.controller/.project b/org.eclipse.jubula.examples.app.cmd.controller/.project
new file mode 100644
index 000000000..6e0e9b57d
--- /dev/null
+++ b/org.eclipse.jubula.examples.app.cmd.controller/.project
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.jubula.examples.app.cmd.controller</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.jubula.examples.app.cmd.controller/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jubula.examples.app.cmd.controller/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..a17fc201b
--- /dev/null
+++ b/org.eclipse.jubula.examples.app.cmd.controller/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,12 @@
+#Mon Oct 25 13:18:37 CEST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/org.eclipse.jubula.examples.app.cmd.controller/about.html b/org.eclipse.jubula.examples.app.cmd.controller/about.html
new file mode 100644
index 000000000..8728d9a97
--- /dev/null
+++ b/org.eclipse.jubula.examples.app.cmd.controller/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 28, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.app.cmd.controller/lib/.gitignore b/org.eclipse.jubula.examples.app.cmd.controller/lib/.gitignore
new file mode 100644
index 000000000..0439bce07
--- /dev/null
+++ b/org.eclipse.jubula.examples.app.cmd.controller/lib/.gitignore
@@ -0,0 +1 @@
+/org.eclipse.jubula.client.cmd.controller.jar
diff --git a/org.eclipse.jubula.examples.app.cmd.controller/lib/.keep b/org.eclipse.jubula.examples.app.cmd.controller/lib/.keep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/org.eclipse.jubula.examples.app.cmd.controller/lib/.keep
diff --git a/org.eclipse.jubula.examples.app.cmd.controller/src/org/eclipse/jubula/examples/app/cmd/controller/CommandLineClientRemoteControl.java b/org.eclipse.jubula.examples.app.cmd.controller/src/org/eclipse/jubula/examples/app/cmd/controller/CommandLineClientRemoteControl.java
new file mode 100644
index 000000000..32da2ae45
--- /dev/null
+++ b/org.eclipse.jubula.examples.app.cmd.controller/src/org/eclipse/jubula/examples/app/cmd/controller/CommandLineClientRemoteControl.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 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.app.cmd.controller;
+import java.rmi.RemoteException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.jubula.client.cmd.controller.ClcServerFactory;
+import org.eclipse.jubula.client.cmd.controller.IClcServer;
+
+/**
+ * This snippet shows the remote control ability of the commandline client.
+ * Before running this code you should start the GUIdancerCMD with the option
+ * "-startserver <port_number> Wait on a port for receiving test execution data"
+ * . The same <port_numer> must be used in for the
+ * COMMANDLINE_CLIENT_SERVER_LISTENING_PORT
+ *
+ * @author BREDEX GmbH
+ */
+public class CommandLineClientRemoteControl {
+ /**
+ * This is the port for communication with the GUIdancer commandline client
+ */
+ private static final int COMMANDLINE_CLIENT_SERVER_LISTENING_PORT = -1;
+
+ /**
+ * Constructor
+ */
+ private CommandLineClientRemoteControl() {
+ // hide
+ }
+
+ /**
+ * @param args
+ * the main args
+ */
+ @SuppressWarnings("nls")
+ public static void main(String[] args) {
+ // This code must run on the same machine as the commandline client
+ // which is controlling the test execution (this does not necessarily
+ // need to be the machine on which the AUT-Agent is running)
+ IClcServer service = ClcServerFactory.getServer(
+ COMMANDLINE_CLIENT_SERVER_LISTENING_PORT);
+ // the maximum allowed time for the test suite in seconds
+ int timeout = 100;
+ // This is an optional map of variables which may be used during test execution
+ final HashMap<String, String> testVariables =
+ new HashMap<String, String>();
+ // This is the list of Testsuites to execute
+ List<String> testSuiteNames = new ArrayList<String>();
+ testSuiteNames.add("1.1_SIMPLE_ADDER_TEST_WITH_TEST_STEPS");
+ testSuiteNames.add("1.2_SIMPLE_ADDER_TEST_USING_LIBRARY");
+
+ try {
+ for (String testsuite : testSuiteNames) {
+ // this tells the connected commandline client to execute the given testsuite
+ int result = service
+ .runTestSuite(testsuite, timeout, testVariables);
+ // the result code of the test execution, 0 if everything is fine.
+ System.out.println("Testuite \"" + testsuite
+ + "\" executed with result: " + result);
+
+ Thread.sleep(2500);
+ }
+ // shuts the CLC server down
+ service.shutdown();
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+}

Back to the top