Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKetan Padegaonkar2009-01-29 18:40:41 +0000
committerKetan Padegaonkar2009-01-29 18:40:41 +0000
commita10d159daa01f4d958cd242913754d3e0a0e0e6b (patch)
tree0e4ceb6a1e8aedb75c528479ab36569ce3ea8133
parent5dc28bde348b648823673b74353cf5074073ed92 (diff)
downloadorg.eclipse.swtbot-a10d159daa01f4d958cd242913754d3e0a0e0e6b.tar.gz
org.eclipse.swtbot-a10d159daa01f4d958cd242913754d3e0a0e0e6b.tar.xz
org.eclipse.swtbot-a10d159daa01f4d958cd242913754d3e0a0e0e6b.zip
moved to using junit4
-rw-r--r--examples/rcp/org.rcpmail.test/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.swtbot.ant.optional.junit4/.project11
-rwxr-xr-xorg.eclipse.swtbot.ant.optional.junit4/META-INF/MANIFEST.MF10
-rwxr-xr-xorg.eclipse.swtbot.ant.optional.junit4/about.html28
-rwxr-xr-xorg.eclipse.swtbot.ant.optional.junit4/build.properties12
-rw-r--r--org.eclipse.swtbot.eclipse.core/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.swtbot.eclipse.dsl.test/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.swtbot.eclipse.finder.test/META-INF/MANIFEST.MF4
-rw-r--r--org.eclipse.swtbot.eclipse.finder.test/src/org/eclipse/swtbot/eclipse/finder/AllTests.java29
-rw-r--r--org.eclipse.swtbot.eclipse.finder/META-INF/MANIFEST.MF4
-rw-r--r--org.eclipse.swtbot.eclipse.junit3.headless/.classpath (renamed from org.eclipse.swtbot.eclipse.headless/.classpath)0
-rw-r--r--org.eclipse.swtbot.eclipse.junit3.headless/.project (renamed from org.eclipse.swtbot.eclipse.headless/.project)2
-rw-r--r--org.eclipse.swtbot.eclipse.junit3.headless/.settings/org.eclipse.jdt.core.prefs (renamed from org.eclipse.swtbot.eclipse.headless/.settings/org.eclipse.jdt.core.prefs)0
-rwxr-xr-xorg.eclipse.swtbot.eclipse.junit3.headless/JUNIT.XSL455
-rw-r--r--org.eclipse.swtbot.eclipse.junit3.headless/LICENSE.EPL (renamed from org.eclipse.swtbot.eclipse.headless/LICENSE.EPL)0
-rw-r--r--org.eclipse.swtbot.eclipse.junit3.headless/META-INF/MANIFEST.MF (renamed from org.eclipse.swtbot.eclipse.headless/META-INF/MANIFEST.MF)6
-rw-r--r--org.eclipse.swtbot.eclipse.junit3.headless/about.html (renamed from org.eclipse.swtbot.eclipse.headless/about.html)0
-rw-r--r--org.eclipse.swtbot.eclipse.junit3.headless/build.properties (renamed from org.eclipse.swtbot.eclipse.headless/build.properties)0
-rw-r--r--org.eclipse.swtbot.eclipse.junit3.headless/library.xml (renamed from org.eclipse.swtbot.eclipse.headless/library.xml)2
-rw-r--r--org.eclipse.swtbot.eclipse.junit3.headless/plugin.xml (renamed from org.eclipse.swtbot.eclipse.headless/plugin.xml)2
-rw-r--r--org.eclipse.swtbot.eclipse.junit3.headless/src/org/eclipse/swtbot/eclipse/junit3/headless/EclipseTestRunner.java (renamed from org.eclipse.swtbot.eclipse.headless/src/org/eclipse/swtbot/eclipse/headless/EclipseTestRunner.java)2
-rw-r--r--org.eclipse.swtbot.eclipse.junit3.headless/src/org/eclipse/swtbot/eclipse/junit3/headless/UITestApplication.java (renamed from org.eclipse.swtbot.eclipse.headless/src/org/eclipse/swtbot/eclipse/headless/UITestApplication.java)2
-rw-r--r--org.eclipse.swtbot.eclipse.junit4.headless/.classpath7
-rw-r--r--org.eclipse.swtbot.eclipse.junit4.headless/.project28
-rw-r--r--org.eclipse.swtbot.eclipse.junit4.headless/.settings/org.eclipse.jdt.core.prefs8
-rwxr-xr-xorg.eclipse.swtbot.eclipse.junit4.headless/JUNIT.XSL455
-rw-r--r--org.eclipse.swtbot.eclipse.junit4.headless/LICENSE.EPL70
-rw-r--r--org.eclipse.swtbot.eclipse.junit4.headless/META-INF/MANIFEST.MF14
-rw-r--r--org.eclipse.swtbot.eclipse.junit4.headless/about.html28
-rw-r--r--org.eclipse.swtbot.eclipse.junit4.headless/build.properties28
-rw-r--r--org.eclipse.swtbot.eclipse.junit4.headless/library.xml142
-rw-r--r--org.eclipse.swtbot.eclipse.junit4.headless/plugin.xml18
-rw-r--r--org.eclipse.swtbot.eclipse.junit4.headless/src/org/eclipse/swtbot/eclipse/junit4/headless/EclipseTestRunner.java468
-rw-r--r--org.eclipse.swtbot.eclipse.junit4.headless/src/org/eclipse/swtbot/eclipse/junit4/headless/UITestApplication.java212
-rw-r--r--org.eclipse.swtbot.eclipse.junit4.headless/src/org/eclipse/swtbot/eclipse/junit4/headless/XMLJUnitResultFormatter.java52
-rw-r--r--org.eclipse.swtbot.eclipse.spy/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.swtbot.eclipse.test/feature.xml21
-rw-r--r--org.eclipse.swtbot.eclipse.ui.test/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.swtbot.eclipse.ui/META-INF/MANIFEST.MF4
-rw-r--r--org.eclipse.swtbot.eclipse/feature.xml4
-rw-r--r--org.eclipse.swtbot.generator.test/META-INF/MANIFEST.MF4
-rw-r--r--org.eclipse.swtbot.generator/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.swtbot.recording/feature.xml1
-rw-r--r--org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.eclipse.finder.test.xml8
-rw-r--r--org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.eclipse.ui.test.xml10
-rw-r--r--org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.generator.test.xml2
-rw-r--r--org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.swt.finder.test.xml2
-rw-r--r--org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.swt.recorder.test.xml2
-rw-r--r--org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.swt.recorder.ui.test.xml2
-rw-r--r--org.eclipse.swtbot.swt.finder.test/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.swtbot.swt.finder.test/src/org/eclipse/swtbot/swt/finder/SWTBotTest.java2
-rw-r--r--org.eclipse.swtbot.swt.finder/META-INF/MANIFEST.MF4
-rw-r--r--org.eclipse.swtbot.swt.recorder.test/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.swtbot.swt.recorder.ui.test/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.swtbot.swt.spy/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.swtbot.test/feature.xml101
-rw-r--r--org.eclipse.swtbot/feature.xml11
57 files changed, 2154 insertions, 143 deletions
diff --git a/examples/rcp/org.rcpmail.test/META-INF/MANIFEST.MF b/examples/rcp/org.rcpmail.test/META-INF/MANIFEST.MF
index 246fc5a6..a549f87b 100644
--- a/examples/rcp/org.rcpmail.test/META-INF/MANIFEST.MF
+++ b/examples/rcp/org.rcpmail.test/META-INF/MANIFEST.MF
@@ -8,7 +8,7 @@ Require-Bundle: org.eclipse.ui,
org.rcpmail,
org.eclipse.swtbot.eclipse.finder,
org.eclipse.swtbot.swt.finder,
- org.junit,
+ org.junit4;bundle-version="4.5.0",
org.hamcrest
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: Eclipse.org
diff --git a/org.eclipse.swtbot.ant.optional.junit4/.project b/org.eclipse.swtbot.ant.optional.junit4/.project
new file mode 100644
index 00000000..68534e81
--- /dev/null
+++ b/org.eclipse.swtbot.ant.optional.junit4/.project
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.swtbot.ant.optional.junit4</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.swtbot.ant.optional.junit4/META-INF/MANIFEST.MF b/org.eclipse.swtbot.ant.optional.junit4/META-INF/MANIFEST.MF
new file mode 100755
index 00000000..c2537cf0
--- /dev/null
+++ b/org.eclipse.swtbot.ant.optional.junit4/META-INF/MANIFEST.MF
@@ -0,0 +1,10 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.swtbot.ant.optional.junit4
+Bundle-Version: 2.0.0.qualifier
+Fragment-Host: org.apache.ant;bundle-version="[1.6.5,2.0.0)"
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.core.runtime.compatibility,
+ org.junit4;bundle-version="4.5.0"
+Bundle-Vendor: %providerName
diff --git a/org.eclipse.swtbot.ant.optional.junit4/about.html b/org.eclipse.swtbot.ant.optional.junit4/about.html
new file mode 100755
index 00000000..5d03fd4c
--- /dev/null
+++ b/org.eclipse.swtbot.ant.optional.junit4/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>May 2, 2006</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</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/org.eclipse.swtbot.ant.optional.junit4/build.properties b/org.eclipse.swtbot.ant.optional.junit4/build.properties
new file mode 100755
index 00000000..ddcdb5e3
--- /dev/null
+++ b/org.eclipse.swtbot.ant.optional.junit4/build.properties
@@ -0,0 +1,12 @@
+###############################################################################
+# Copyright (c) 2000, 2007 IBM Corporation 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:
+# IBM Corporation - initial API and implementation
+###############################################################################
+bin.includes = about.html,\
+ META-INF/
diff --git a/org.eclipse.swtbot.eclipse.core/META-INF/MANIFEST.MF b/org.eclipse.swtbot.eclipse.core/META-INF/MANIFEST.MF
index 5592567c..dd967410 100644
--- a/org.eclipse.swtbot.eclipse.core/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.eclipse.core/META-INF/MANIFEST.MF
@@ -7,5 +7,5 @@ Bundle-Vendor: Eclipse.org
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.ui,
- org.junit,
+ org.junit4;bundle-version="4.5.0",
org.eclipse.jdt.junit.runtime
diff --git a/org.eclipse.swtbot.eclipse.dsl.test/META-INF/MANIFEST.MF b/org.eclipse.swtbot.eclipse.dsl.test/META-INF/MANIFEST.MF
index 106f40c3..3c7fa480 100644
--- a/org.eclipse.swtbot.eclipse.dsl.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.eclipse.dsl.test/META-INF/MANIFEST.MF
@@ -7,6 +7,6 @@ Bundle-Vendor: Eclipse.org
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.swtbot.eclipse.dsl,
- org.junit
+ org.junit4;bundle-version="4.5.0"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
diff --git a/org.eclipse.swtbot.eclipse.finder.test/META-INF/MANIFEST.MF b/org.eclipse.swtbot.eclipse.finder.test/META-INF/MANIFEST.MF
index 696783f7..42354ae1 100644
--- a/org.eclipse.swtbot.eclipse.finder.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.eclipse.finder.test/META-INF/MANIFEST.MF
@@ -11,8 +11,8 @@ Require-Bundle: org.eclipse.jface.text,
org.eclipse.core.runtime,
org.eclipse.swtbot.swt.finder,
org.eclipse.swtbot.eclipse.finder,
- org.junit,
- org.hamcrest,
+ org.hamcrest;bundle-version="1.1.0",
+ org.junit4;bundle-version="4.5.0",
org.apache.log4j
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: Eclipse.org
diff --git a/org.eclipse.swtbot.eclipse.finder.test/src/org/eclipse/swtbot/eclipse/finder/AllTests.java b/org.eclipse.swtbot.eclipse.finder.test/src/org/eclipse/swtbot/eclipse/finder/AllTests.java
index 79001b5a..4f383925 100644
--- a/org.eclipse.swtbot.eclipse.finder.test/src/org/eclipse/swtbot/eclipse/finder/AllTests.java
+++ b/org.eclipse.swtbot.eclipse.finder.test/src/org/eclipse/swtbot/eclipse/finder/AllTests.java
@@ -10,37 +10,22 @@
*******************************************************************************/
package org.eclipse.swtbot.eclipse.finder;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
import org.eclipse.swtbot.eclipse.finder.exceptions.QuickFixNotFoundExceptionTest;
import org.eclipse.swtbot.eclipse.finder.finders.CommandFinderTest;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditorTest;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotViewTest;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
/**
* @author Ketan Padegaonkar &lt;KetanPadegaonkar [at] gmail [dot] com&gt;
* @version $Id$
*/
+@RunWith(Suite.class)
+@SuiteClasses( { QuickFixNotFoundExceptionTest.class, CommandFinderTest.class, SWTBotViewTest.class, SWTBotEclipseEditorTest.class })
public class AllTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite("Test for org.eclipse.swtbot.eclipse.finder");
- //$JUnit-BEGIN$
-
- // Exception
- suite.addTestSuite(QuickFixNotFoundExceptionTest.class);
-
- // Finder
- suite.addTestSuite(CommandFinderTest.class);
-
- // Widgets
- suite.addTestSuite(SWTBotViewTest.class);
- suite.addTestSuite(SWTBotEclipseEditorTest.class);
-
- //$JUnit-END$
-
- return suite;
+ static{
+ System.out.println("Loaded AllTests");
}
-
}
diff --git a/org.eclipse.swtbot.eclipse.finder/META-INF/MANIFEST.MF b/org.eclipse.swtbot.eclipse.finder/META-INF/MANIFEST.MF
index bd0aecad..5801b8ca 100644
--- a/org.eclipse.swtbot.eclipse.finder/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.eclipse.finder/META-INF/MANIFEST.MF
@@ -7,8 +7,8 @@ Bundle-Activator: org.eclipse.swtbot.eclipse.finder.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.swtbot.swt.finder,
- org.junit,
- org.hamcrest,
+ org.hamcrest;bundle-version="1.1.0",
+ org.junit4;bundle-version="4.5.0",
org.apache.log4j,
org.apache.commons.collections
Bundle-ActivationPolicy: lazy
diff --git a/org.eclipse.swtbot.eclipse.headless/.classpath b/org.eclipse.swtbot.eclipse.junit3.headless/.classpath
index 64c5e31b..64c5e31b 100644
--- a/org.eclipse.swtbot.eclipse.headless/.classpath
+++ b/org.eclipse.swtbot.eclipse.junit3.headless/.classpath
diff --git a/org.eclipse.swtbot.eclipse.headless/.project b/org.eclipse.swtbot.eclipse.junit3.headless/.project
index 3eb07017..79498b8a 100644
--- a/org.eclipse.swtbot.eclipse.headless/.project
+++ b/org.eclipse.swtbot.eclipse.junit3.headless/.project
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>org.eclipse.swtbot.eclipse.headless</name>
+ <name>org.eclipse.swtbot.eclipse.junit3.headless</name>
<comment></comment>
<projects>
</projects>
diff --git a/org.eclipse.swtbot.eclipse.headless/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.swtbot.eclipse.junit3.headless/.settings/org.eclipse.jdt.core.prefs
index c7ff7f4e..c7ff7f4e 100644
--- a/org.eclipse.swtbot.eclipse.headless/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.swtbot.eclipse.junit3.headless/.settings/org.eclipse.jdt.core.prefs
diff --git a/org.eclipse.swtbot.eclipse.junit3.headless/JUNIT.XSL b/org.eclipse.swtbot.eclipse.junit3.headless/JUNIT.XSL
new file mode 100755
index 00000000..b4265723
--- /dev/null
+++ b/org.eclipse.swtbot.eclipse.junit3.headless/JUNIT.XSL
@@ -0,0 +1,455 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<xsl:output method="html" indent="yes"/>
+<xsl:decimal-format decimal-separator="." grouping-separator="," />
+
+<xsl:template match="testsuites">
+ <HTML>
+ <HEAD>
+ <style type="text/css">
+ body {
+ font:normal 68% verdana,arial,helvetica;
+ color:#000000;
+ }
+ table tr td, table tr th {
+ font-size: 68%;
+ }
+ table.details tr th{
+ font-weight: bold;
+ text-align:left;
+ background:#a6caf0;
+ }
+ table.details tr td{
+ background:#eeeee0;
+ }
+
+ p {
+ line-height:1.5em;
+ margin-top:0.5em; margin-bottom:1.0em;
+ }
+ h1 {
+ margin: 0px 0px 5px; font: 165% verdana,arial,helvetica
+ }
+ h2 {
+ margin-top: 1em; margin-bottom: 0.5em; font: bold 125% verdana,arial,helvetica
+ }
+ h3 {
+ margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica
+ }
+ h4 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+ }
+ h5 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+ }
+ h6 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+ }
+ .Error {
+ font-weight:bold; color:red;
+ }
+ .Failure {
+ font-weight:bold; color:purple;
+ }
+ .Properties {
+ text-align:right;
+ }
+ </style>
+ <script language="JavaScript">
+ var TestCases = new Array();
+ var cur;
+ <xsl:for-each select="./testsuite">
+ <xsl:apply-templates select="properties"/>
+ </xsl:for-each>
+
+ </script>
+ <script language="JavaScript"><![CDATA[
+ function displayProperties (name) {
+ var win = window.open('','JUnitSystemProperties','scrollbars=1,resizable=1');
+ var doc = win.document.open();
+ doc.write("<html><head><title>Properties of " + name + "</title>");
+ doc.write("<style>")
+ doc.write("body {font:normal 68% verdana,arial,helvetica; color:#000000; }");
+ doc.write("table tr td, table tr th { font-size: 68%; }");
+ doc.write("table.properties { border-collapse:collapse; border-left:solid 1 #cccccc; border-top:solid 1 #cccccc; padding:5px; }");
+ doc.write("table.properties th { text-align:left; border-right:solid 1 #cccccc; border-bottom:solid 1 #cccccc; background-color:#eeeeee; }");
+ doc.write("table.properties td { font:normal; text-align:left; border-right:solid 1 #cccccc; border-bottom:solid 1 #cccccc; background-color:#fffffff; }");
+ doc.write("h3 { margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica }");
+ doc.write("</style>");
+ doc.write("</head><body>");
+ doc.write("<h3>Properties of " + name + "</h3>");
+ doc.write("<div align=\"right\"><a href=\"javascript:window.close();\">Close</a></div>");
+ doc.write("<table class='properties'>");
+ doc.write("<tr><th>Name</th><th>Value</th></tr>");
+ for (prop in TestCases[name]) {
+ doc.write("<tr><th>" + prop + "</th><td>" + TestCases[name][prop] + "</td></tr>");
+ }
+ doc.write("</table>");
+ doc.write("</body></html>");
+ doc.close();
+ win.focus();
+ }
+ ]]>
+ </script>
+ </HEAD>
+ <body>
+ <a name="top"></a>
+ <xsl:call-template name="pageHeader"/>
+
+ <!-- Summary part -->
+ <xsl:call-template name="summary"/>
+ <hr size="1" width="95%" align="left"/>
+
+ <!-- Package List part -->
+ <xsl:call-template name="packagelist"/>
+ <hr size="1" width="95%" align="left"/>
+
+ <!-- For each package create its part -->
+ <xsl:call-template name="packages"/>
+ <hr size="1" width="95%" align="left"/>
+
+ <!-- For each class create the part -->
+ <xsl:call-template name="classes"/>
+
+ </body>
+ </HTML>
+</xsl:template>
+
+
+
+ <!-- ================================================================== -->
+ <!-- Write a list of all packages with an hyperlink to the anchor of -->
+ <!-- of the package name. -->
+ <!-- ================================================================== -->
+ <xsl:template name="packagelist">
+ <h2>Packages</h2>
+ Note: package statistics are not computed recursively, they only sum up all of its testsuites numbers.
+ <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
+ <xsl:call-template name="testsuite.test.header"/>
+ <!-- list all packages recursively -->
+ <xsl:for-each select="./testsuite[not(./@package = preceding-sibling::testsuite/@package)]">
+ <xsl:sort select="@package"/>
+ <xsl:variable name="testsuites-in-package" select="/testsuites/testsuite[./@package = current()/@package]"/>
+ <xsl:variable name="testCount" select="sum($testsuites-in-package/@tests)"/>
+ <xsl:variable name="errorCount" select="sum($testsuites-in-package/@errors)"/>
+ <xsl:variable name="failureCount" select="sum($testsuites-in-package/@failures)"/>
+ <xsl:variable name="timeCount" select="sum($testsuites-in-package/@time)"/>
+
+ <!-- write a summary for the package -->
+ <tr valign="top">
+ <!-- set a nice color depending if there is an error/failure -->
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="$failureCount &gt; 0">Failure</xsl:when>
+ <xsl:when test="$errorCount &gt; 0">Error</xsl:when>
+ </xsl:choose>
+ </xsl:attribute>
+ <td><a href="#{@package}"><xsl:value-of select="@package"/></a></td>
+ <td><xsl:value-of select="$testCount"/></td>
+ <td><xsl:value-of select="$errorCount"/></td>
+ <td><xsl:value-of select="$failureCount"/></td>
+ <td>
+ <xsl:call-template name="display-time">
+ <xsl:with-param name="value" select="$timeCount"/>
+ </xsl:call-template>
+ </td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ </xsl:template>
+
+
+ <!-- ================================================================== -->
+ <!-- Write a package level report -->
+ <!-- It creates a table with values from the document: -->
+ <!-- Name | Tests | Errors | Failures | Time -->
+ <!-- ================================================================== -->
+ <xsl:template name="packages">
+ <!-- create an anchor to this package name -->
+ <xsl:for-each select="/testsuites/testsuite[not(./@package = preceding-sibling::testsuite/@package)]">
+ <xsl:sort select="@package"/>
+ <a name="{@package}"></a>
+ <h3>Package <xsl:value-of select="@package"/></h3>
+
+ <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
+ <xsl:call-template name="testsuite.test.header"/>
+
+ <!-- match the testsuites of this package -->
+ <xsl:apply-templates select="/testsuites/testsuite[./@package = current()/@package]" mode="print.test"/>
+ </table>
+ <a href="#top">Back to top</a>
+ <p/>
+ <p/>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="classes">
+ <xsl:for-each select="testsuite">
+ <xsl:sort select="@name"/>
+ <!-- create an anchor to this class name -->
+ <a name="{@name}"></a>
+ <h3>TestCase <xsl:value-of select="@name"/></h3>
+
+ <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
+ <xsl:call-template name="testcase.test.header"/>
+ <!--
+ test can even not be started at all (failure to load the class)
+ so report the error directly
+ -->
+ <xsl:if test="./error">
+ <tr class="Error">
+ <td colspan="4"><xsl:apply-templates select="./error"/></td>
+ </tr>
+ </xsl:if>
+ <xsl:apply-templates select="./testcase" mode="print.test"/>
+ </table>
+ <div class="Properties">
+ <a>
+ <xsl:attribute name="href">javascript:displayProperties('<xsl:value-of select="@package"/>.<xsl:value-of select="@name"/>');</xsl:attribute>
+ Properties &gt;&gt;
+ </a>
+ </div>
+ <p/>
+
+ <a href="#top">Back to top</a>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="summary">
+ <h2>Summary</h2>
+ <xsl:variable name="testCount" select="sum(testsuite/@tests)"/>
+ <xsl:variable name="errorCount" select="sum(testsuite/@errors)"/>
+ <xsl:variable name="failureCount" select="sum(testsuite/@failures)"/>
+ <xsl:variable name="timeCount" select="sum(testsuite/@time)"/>
+ <xsl:variable name="successRate" select="($testCount - $failureCount - $errorCount) div $testCount"/>
+ <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
+ <tr valign="top">
+ <th>Tests</th>
+ <th>Failures</th>
+ <th>Errors</th>
+ <th>Success rate</th>
+ <th>Time</th>
+ </tr>
+ <tr valign="top">
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="$failureCount &gt; 0">Failure</xsl:when>
+ <xsl:when test="$errorCount &gt; 0">Error</xsl:when>
+ </xsl:choose>
+ </xsl:attribute>
+ <td><xsl:value-of select="$testCount"/></td>
+ <td><xsl:value-of select="$failureCount"/></td>
+ <td><xsl:value-of select="$errorCount"/></td>
+ <td>
+ <xsl:call-template name="display-percent">
+ <xsl:with-param name="value" select="$successRate"/>
+ </xsl:call-template>
+ </td>
+ <td>
+ <xsl:call-template name="display-time">
+ <xsl:with-param name="value" select="$timeCount"/>
+ </xsl:call-template>
+ </td>
+
+ </tr>
+ </table>
+ <table border="0" width="95%">
+ <tr>
+ <td style="text-align: justify;">
+ Note: <i>failures</i> are anticipated and checked for with assertions while <i>errors</i> are unanticipated.
+ </td>
+ </tr>
+ </table>
+ </xsl:template>
+
+ <!--
+ Write properties into a JavaScript data structure.
+ This is based on the original idea by Erik Hatcher (erik@hatcher.net)
+ -->
+ <xsl:template match="properties">
+ cur = TestCases['<xsl:value-of select="../@package"/>.<xsl:value-of select="../@name"/>'] = new Array();
+ <xsl:for-each select="property">
+ <xsl:sort select="@name"/>
+ cur['<xsl:value-of select="@name"/>'] = '<xsl:call-template name="JS-escape"><xsl:with-param name="string" select="@value"/></xsl:call-template>';
+ </xsl:for-each>
+ </xsl:template>
+
+<!-- Page HEADER -->
+<xsl:template name="pageHeader">
+ <h1>Unit Test Results</h1>
+ <table width="100%">
+ <tr>
+ <td align="left"></td>
+ <td align="right">Designed for use with <a href='http://www.junit.org'>JUnit</a> and <a href='http://ant.apache.org'>Ant</a>.</td>
+ </tr>
+ </table>
+ <hr size="1"/>
+</xsl:template>
+
+<xsl:template match="testsuite" mode="header">
+ <tr valign="top">
+ <th width="80%">Name</th>
+ <th>Tests</th>
+ <th>Errors</th>
+ <th>Failures</th>
+ <th nowrap="nowrap">Time(s)</th>
+ </tr>
+</xsl:template>
+
+<!-- class header -->
+<xsl:template name="testsuite.test.header">
+ <tr valign="top">
+ <th width="80%">Name</th>
+ <th>Tests</th>
+ <th>Errors</th>
+ <th>Failures</th>
+ <th nowrap="nowrap">Time(s)</th>
+ </tr>
+</xsl:template>
+
+<!-- method header -->
+<xsl:template name="testcase.test.header">
+ <tr valign="top">
+ <th>Name</th>
+ <th>Status</th>
+ <th width="80%">Type</th>
+ <th nowrap="nowrap">Time(s)</th>
+ </tr>
+</xsl:template>
+
+
+<!-- class information -->
+<xsl:template match="testsuite" mode="print.test">
+ <tr valign="top">
+ <!-- set a nice color depending if there is an error/failure -->
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="@failures[.&gt; 0]">Failure</xsl:when>
+ <xsl:when test="@errors[.&gt; 0]">Error</xsl:when>
+ </xsl:choose>
+ </xsl:attribute>
+
+ <!-- print testsuite information -->
+ <td><a href="#{@name}"><xsl:value-of select="@name"/></a></td>
+ <td><xsl:value-of select="@tests"/></td>
+ <td><xsl:value-of select="@errors"/></td>
+ <td><xsl:value-of select="@failures"/></td>
+ <td>
+ <xsl:call-template name="display-time">
+ <xsl:with-param name="value" select="@time"/>
+ </xsl:call-template>
+ </td>
+ </tr>
+</xsl:template>
+
+<xsl:template match="testcase" mode="print.test">
+ <tr valign="top">
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="failure | error">Error</xsl:when>
+ </xsl:choose>
+ </xsl:attribute>
+ <td><xsl:value-of select="@name"/></td>
+ <xsl:choose>
+ <xsl:when test="failure">
+ <td>Failure</td>
+ <td><xsl:apply-templates select="failure"/></td>
+ </xsl:when>
+ <xsl:when test="error">
+ <td>Error</td>
+ <td><xsl:apply-templates select="error"/></td>
+ </xsl:when>
+ <xsl:otherwise>
+ <td>Success</td>
+ <td></td>
+ </xsl:otherwise>
+ </xsl:choose>
+ <td>
+ <xsl:call-template name="display-time">
+ <xsl:with-param name="value" select="@time"/>
+ </xsl:call-template>
+ </td>
+ </tr>
+</xsl:template>
+
+
+<xsl:template match="failure">
+ <xsl:call-template name="display-failures"/>
+</xsl:template>
+
+<xsl:template match="error">
+ <xsl:call-template name="display-failures"/>
+</xsl:template>
+
+<!-- Style for the error and failure in the tescase template -->
+<xsl:template name="display-failures">
+ <xsl:choose>
+ <xsl:when test="not(@message)">N/A</xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@message"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <!-- display the stacktrace -->
+ <code>
+ <p/>
+ <xsl:call-template name="br-replace">
+ <xsl:with-param name="word" select="."/>
+ </xsl:call-template>
+ </code>
+ <!-- the later is better but might be problematic for non-21" monitors... -->
+ <!--pre><xsl:value-of select="."/></pre-->
+</xsl:template>
+
+<xsl:template name="JS-escape">
+ <xsl:param name="string"/>
+ <xsl:choose><!-- something isn't right here, basically all single quotes need to be replaced with backslash-single-quote
+ <xsl:when test="contains($string,'&apos;')">
+ <xsl:value-of select="substring-before($string,'&apos;')"/>
+ \&apos;
+ <xsl:call-template name="JS-escape">
+ <xsl:with-param name="string" select="substring-after($string,'&apos;')"/>
+ </xsl:call-template>
+ </xsl:when> -->
+ <xsl:when test="contains($string,'\')">
+ <xsl:value-of select="substring-before($string,'\')"/>\\<xsl:call-template name="JS-escape">
+ <xsl:with-param name="string" select="substring-after($string,'\')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$string"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+
+<!--
+ template that will convert a carriage return into a br tag
+ @param word the text from which to convert CR to BR tag
+-->
+<xsl:template name="br-replace">
+ <xsl:param name="word"/>
+ <xsl:choose>
+ <xsl:when test="contains($word,'&#xA;')">
+ <xsl:value-of select="substring-before($word,'&#xA;')"/>
+ <br/>
+ <xsl:call-template name="br-replace">
+ <xsl:with-param name="word" select="substring-after($word,'&#xA;')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$word"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template name="display-time">
+ <xsl:param name="value"/>
+ <xsl:value-of select="format-number($value,'0.000')"/>
+</xsl:template>
+
+<xsl:template name="display-percent">
+ <xsl:param name="value"/>
+ <xsl:value-of select="format-number($value,'0.00%')"/>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/org.eclipse.swtbot.eclipse.headless/LICENSE.EPL b/org.eclipse.swtbot.eclipse.junit3.headless/LICENSE.EPL
index 3d967aee..3d967aee 100644
--- a/org.eclipse.swtbot.eclipse.headless/LICENSE.EPL
+++ b/org.eclipse.swtbot.eclipse.junit3.headless/LICENSE.EPL
diff --git a/org.eclipse.swtbot.eclipse.headless/META-INF/MANIFEST.MF b/org.eclipse.swtbot.eclipse.junit3.headless/META-INF/MANIFEST.MF
index 1894022b..6dbc3bca 100644
--- a/org.eclipse.swtbot.eclipse.headless/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.eclipse.junit3.headless/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
-Bundle-Name: SWTBot Headless Launch Plug-in (incubation)
-Bundle-SymbolicName: org.eclipse.swtbot.eclipse.headless;singleton:=true
+Bundle-Name: SWTBot Headless JUnit3 Launch Plug-in (incubation)
+Bundle-SymbolicName: org.eclipse.swtbot.eclipse.junit3.headless;singleton:=true
Bundle-Version: 2.0.0.qualifier
Bundle-Vendor: Eclipse.org
Require-Bundle: org.apache.ant,
@@ -11,4 +11,4 @@ Require-Bundle: org.apache.ant,
org.eclipse.equinox.app
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.eclipse.swtbot.eclipse.headless
+Export-Package: org.eclipse.swtbot.eclipse.junit3.headless
diff --git a/org.eclipse.swtbot.eclipse.headless/about.html b/org.eclipse.swtbot.eclipse.junit3.headless/about.html
index 88cfbc91..88cfbc91 100644
--- a/org.eclipse.swtbot.eclipse.headless/about.html
+++ b/org.eclipse.swtbot.eclipse.junit3.headless/about.html
diff --git a/org.eclipse.swtbot.eclipse.headless/build.properties b/org.eclipse.swtbot.eclipse.junit3.headless/build.properties
index e7467a44..e7467a44 100644
--- a/org.eclipse.swtbot.eclipse.headless/build.properties
+++ b/org.eclipse.swtbot.eclipse.junit3.headless/build.properties
diff --git a/org.eclipse.swtbot.eclipse.headless/library.xml b/org.eclipse.swtbot.eclipse.junit3.headless/library.xml
index 57961aae..047c2279 100644
--- a/org.eclipse.swtbot.eclipse.headless/library.xml
+++ b/org.eclipse.swtbot.eclipse.junit3.headless/library.xml
@@ -59,7 +59,7 @@ this has been copied from o.e.test plugin with some targets for SWTBot
<target name="swtbot-test" description="Eclipse application used to launch UI plugin tests." depends="init">
<antcall target="${launchTarget}">
<!--param name="application" value="org.eclipse.test.uitestapplication"/-->
- <param name="application" value="org.eclipse.swtbot.eclipse.headless.swtbottestapplication"/>
+ <param name="application" value="org.eclipse.swtbot.eclipse.junit3.headless.swtbottestapplication"/>
</antcall>
</target>
diff --git a/org.eclipse.swtbot.eclipse.headless/plugin.xml b/org.eclipse.swtbot.eclipse.junit3.headless/plugin.xml
index 401cc80b..87f51e16 100644
--- a/org.eclipse.swtbot.eclipse.headless/plugin.xml
+++ b/org.eclipse.swtbot.eclipse.junit3.headless/plugin.xml
@@ -6,7 +6,7 @@
point="org.eclipse.core.runtime.applications">
<application>
<run
- class="org.eclipse.swtbot.eclipse.headless.UITestApplication">
+ class="org.eclipse.swtbot.eclipse.junit3.headless.UITestApplication">
<parameter
name="productInfo"
value="product.ini">
diff --git a/org.eclipse.swtbot.eclipse.headless/src/org/eclipse/swtbot/eclipse/headless/EclipseTestRunner.java b/org.eclipse.swtbot.eclipse.junit3.headless/src/org/eclipse/swtbot/eclipse/junit3/headless/EclipseTestRunner.java
index 98cc9f19..a81ca295 100644
--- a/org.eclipse.swtbot.eclipse.headless/src/org/eclipse/swtbot/eclipse/headless/EclipseTestRunner.java
+++ b/org.eclipse.swtbot.eclipse.junit3.headless/src/org/eclipse/swtbot/eclipse/junit3/headless/EclipseTestRunner.java
@@ -8,7 +8,7 @@
* Contributors:
* Ketan Padegaonkar - initial API and implementation
*******************************************************************************/
-package org.eclipse.swtbot.eclipse.headless;
+package org.eclipse.swtbot.eclipse.junit3.headless;
import java.io.ByteArrayOutputStream;
import java.io.File;
diff --git a/org.eclipse.swtbot.eclipse.headless/src/org/eclipse/swtbot/eclipse/headless/UITestApplication.java b/org.eclipse.swtbot.eclipse.junit3.headless/src/org/eclipse/swtbot/eclipse/junit3/headless/UITestApplication.java
index bd5a4fc9..5cae919f 100644
--- a/org.eclipse.swtbot.eclipse.headless/src/org/eclipse/swtbot/eclipse/headless/UITestApplication.java
+++ b/org.eclipse.swtbot.eclipse.junit3.headless/src/org/eclipse/swtbot/eclipse/junit3/headless/UITestApplication.java
@@ -8,7 +8,7 @@
* Contributors:
* Ketan Padegaonkar - initial API and implementation
*******************************************************************************/
-package org.eclipse.swtbot.eclipse.headless;
+package org.eclipse.swtbot.eclipse.junit3.headless;
import java.io.IOException;
diff --git a/org.eclipse.swtbot.eclipse.junit4.headless/.classpath b/org.eclipse.swtbot.eclipse.junit4.headless/.classpath
new file mode 100644
index 00000000..64c5e31b
--- /dev/null
+++ b/org.eclipse.swtbot.eclipse.junit4.headless/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.eclipse.swtbot.eclipse.junit4.headless/.project b/org.eclipse.swtbot.eclipse.junit4.headless/.project
new file mode 100644
index 00000000..867b3f44
--- /dev/null
+++ b/org.eclipse.swtbot.eclipse.junit4.headless/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.swtbot.eclipse.junit4.headless</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.swtbot.eclipse.junit4.headless/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.swtbot.eclipse.junit4.headless/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000..c7ff7f4e
--- /dev/null
+++ b/org.eclipse.swtbot.eclipse.junit4.headless/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Tue Dec 16 23:22:49 IST 2008
+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.compliance=1.5
+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.swtbot.eclipse.junit4.headless/JUNIT.XSL b/org.eclipse.swtbot.eclipse.junit4.headless/JUNIT.XSL
new file mode 100755
index 00000000..b4265723
--- /dev/null
+++ b/org.eclipse.swtbot.eclipse.junit4.headless/JUNIT.XSL
@@ -0,0 +1,455 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<xsl:output method="html" indent="yes"/>
+<xsl:decimal-format decimal-separator="." grouping-separator="," />
+
+<xsl:template match="testsuites">
+ <HTML>
+ <HEAD>
+ <style type="text/css">
+ body {
+ font:normal 68% verdana,arial,helvetica;
+ color:#000000;
+ }
+ table tr td, table tr th {
+ font-size: 68%;
+ }
+ table.details tr th{
+ font-weight: bold;
+ text-align:left;
+ background:#a6caf0;
+ }
+ table.details tr td{
+ background:#eeeee0;
+ }
+
+ p {
+ line-height:1.5em;
+ margin-top:0.5em; margin-bottom:1.0em;
+ }
+ h1 {
+ margin: 0px 0px 5px; font: 165% verdana,arial,helvetica
+ }
+ h2 {
+ margin-top: 1em; margin-bottom: 0.5em; font: bold 125% verdana,arial,helvetica
+ }
+ h3 {
+ margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica
+ }
+ h4 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+ }
+ h5 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+ }
+ h6 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+ }
+ .Error {
+ font-weight:bold; color:red;
+ }
+ .Failure {
+ font-weight:bold; color:purple;
+ }
+ .Properties {
+ text-align:right;
+ }
+ </style>
+ <script language="JavaScript">
+ var TestCases = new Array();
+ var cur;
+ <xsl:for-each select="./testsuite">
+ <xsl:apply-templates select="properties"/>
+ </xsl:for-each>
+
+ </script>
+ <script language="JavaScript"><![CDATA[
+ function displayProperties (name) {
+ var win = window.open('','JUnitSystemProperties','scrollbars=1,resizable=1');
+ var doc = win.document.open();
+ doc.write("<html><head><title>Properties of " + name + "</title>");
+ doc.write("<style>")
+ doc.write("body {font:normal 68% verdana,arial,helvetica; color:#000000; }");
+ doc.write("table tr td, table tr th { font-size: 68%; }");
+ doc.write("table.properties { border-collapse:collapse; border-left:solid 1 #cccccc; border-top:solid 1 #cccccc; padding:5px; }");
+ doc.write("table.properties th { text-align:left; border-right:solid 1 #cccccc; border-bottom:solid 1 #cccccc; background-color:#eeeeee; }");
+ doc.write("table.properties td { font:normal; text-align:left; border-right:solid 1 #cccccc; border-bottom:solid 1 #cccccc; background-color:#fffffff; }");
+ doc.write("h3 { margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica }");
+ doc.write("</style>");
+ doc.write("</head><body>");
+ doc.write("<h3>Properties of " + name + "</h3>");
+ doc.write("<div align=\"right\"><a href=\"javascript:window.close();\">Close</a></div>");
+ doc.write("<table class='properties'>");
+ doc.write("<tr><th>Name</th><th>Value</th></tr>");
+ for (prop in TestCases[name]) {
+ doc.write("<tr><th>" + prop + "</th><td>" + TestCases[name][prop] + "</td></tr>");
+ }
+ doc.write("</table>");
+ doc.write("</body></html>");
+ doc.close();
+ win.focus();
+ }
+ ]]>
+ </script>
+ </HEAD>
+ <body>
+ <a name="top"></a>
+ <xsl:call-template name="pageHeader"/>
+
+ <!-- Summary part -->
+ <xsl:call-template name="summary"/>
+ <hr size="1" width="95%" align="left"/>
+
+ <!-- Package List part -->
+ <xsl:call-template name="packagelist"/>
+ <hr size="1" width="95%" align="left"/>
+
+ <!-- For each package create its part -->
+ <xsl:call-template name="packages"/>
+ <hr size="1" width="95%" align="left"/>
+
+ <!-- For each class create the part -->
+ <xsl:call-template name="classes"/>
+
+ </body>
+ </HTML>
+</xsl:template>
+
+
+
+ <!-- ================================================================== -->
+ <!-- Write a list of all packages with an hyperlink to the anchor of -->
+ <!-- of the package name. -->
+ <!-- ================================================================== -->
+ <xsl:template name="packagelist">
+ <h2>Packages</h2>
+ Note: package statistics are not computed recursively, they only sum up all of its testsuites numbers.
+ <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
+ <xsl:call-template name="testsuite.test.header"/>
+ <!-- list all packages recursively -->
+ <xsl:for-each select="./testsuite[not(./@package = preceding-sibling::testsuite/@package)]">
+ <xsl:sort select="@package"/>
+ <xsl:variable name="testsuites-in-package" select="/testsuites/testsuite[./@package = current()/@package]"/>
+ <xsl:variable name="testCount" select="sum($testsuites-in-package/@tests)"/>
+ <xsl:variable name="errorCount" select="sum($testsuites-in-package/@errors)"/>
+ <xsl:variable name="failureCount" select="sum($testsuites-in-package/@failures)"/>
+ <xsl:variable name="timeCount" select="sum($testsuites-in-package/@time)"/>
+
+ <!-- write a summary for the package -->
+ <tr valign="top">
+ <!-- set a nice color depending if there is an error/failure -->
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="$failureCount &gt; 0">Failure</xsl:when>
+ <xsl:when test="$errorCount &gt; 0">Error</xsl:when>
+ </xsl:choose>
+ </xsl:attribute>
+ <td><a href="#{@package}"><xsl:value-of select="@package"/></a></td>
+ <td><xsl:value-of select="$testCount"/></td>
+ <td><xsl:value-of select="$errorCount"/></td>
+ <td><xsl:value-of select="$failureCount"/></td>
+ <td>
+ <xsl:call-template name="display-time">
+ <xsl:with-param name="value" select="$timeCount"/>
+ </xsl:call-template>
+ </td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ </xsl:template>
+
+
+ <!-- ================================================================== -->
+ <!-- Write a package level report -->
+ <!-- It creates a table with values from the document: -->
+ <!-- Name | Tests | Errors | Failures | Time -->
+ <!-- ================================================================== -->
+ <xsl:template name="packages">
+ <!-- create an anchor to this package name -->
+ <xsl:for-each select="/testsuites/testsuite[not(./@package = preceding-sibling::testsuite/@package)]">
+ <xsl:sort select="@package"/>
+ <a name="{@package}"></a>
+ <h3>Package <xsl:value-of select="@package"/></h3>
+
+ <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
+ <xsl:call-template name="testsuite.test.header"/>
+
+ <!-- match the testsuites of this package -->
+ <xsl:apply-templates select="/testsuites/testsuite[./@package = current()/@package]" mode="print.test"/>
+ </table>
+ <a href="#top">Back to top</a>
+ <p/>
+ <p/>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="classes">
+ <xsl:for-each select="testsuite">
+ <xsl:sort select="@name"/>
+ <!-- create an anchor to this class name -->
+ <a name="{@name}"></a>
+ <h3>TestCase <xsl:value-of select="@name"/></h3>
+
+ <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
+ <xsl:call-template name="testcase.test.header"/>
+ <!--
+ test can even not be started at all (failure to load the class)
+ so report the error directly
+ -->
+ <xsl:if test="./error">
+ <tr class="Error">
+ <td colspan="4"><xsl:apply-templates select="./error"/></td>
+ </tr>
+ </xsl:if>
+ <xsl:apply-templates select="./testcase" mode="print.test"/>
+ </table>
+ <div class="Properties">
+ <a>
+ <xsl:attribute name="href">javascript:displayProperties('<xsl:value-of select="@package"/>.<xsl:value-of select="@name"/>');</xsl:attribute>
+ Properties &gt;&gt;
+ </a>
+ </div>
+ <p/>
+
+ <a href="#top">Back to top</a>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="summary">
+ <h2>Summary</h2>
+ <xsl:variable name="testCount" select="sum(testsuite/@tests)"/>
+ <xsl:variable name="errorCount" select="sum(testsuite/@errors)"/>
+ <xsl:variable name="failureCount" select="sum(testsuite/@failures)"/>
+ <xsl:variable name="timeCount" select="sum(testsuite/@time)"/>
+ <xsl:variable name="successRate" select="($testCount - $failureCount - $errorCount) div $testCount"/>
+ <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
+ <tr valign="top">
+ <th>Tests</th>
+ <th>Failures</th>
+ <th>Errors</th>
+ <th>Success rate</th>
+ <th>Time</th>
+ </tr>
+ <tr valign="top">
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="$failureCount &gt; 0">Failure</xsl:when>
+ <xsl:when test="$errorCount &gt; 0">Error</xsl:when>
+ </xsl:choose>
+ </xsl:attribute>
+ <td><xsl:value-of select="$testCount"/></td>
+ <td><xsl:value-of select="$failureCount"/></td>
+ <td><xsl:value-of select="$errorCount"/></td>
+ <td>
+ <xsl:call-template name="display-percent">
+ <xsl:with-param name="value" select="$successRate"/>
+ </xsl:call-template>
+ </td>
+ <td>
+ <xsl:call-template name="display-time">
+ <xsl:with-param name="value" select="$timeCount"/>
+ </xsl:call-template>
+ </td>
+
+ </tr>
+ </table>
+ <table border="0" width="95%">
+ <tr>
+ <td style="text-align: justify;">
+ Note: <i>failures</i> are anticipated and checked for with assertions while <i>errors</i> are unanticipated.
+ </td>
+ </tr>
+ </table>
+ </xsl:template>
+
+ <!--
+ Write properties into a JavaScript data structure.
+ This is based on the original idea by Erik Hatcher (erik@hatcher.net)
+ -->
+ <xsl:template match="properties">
+ cur = TestCases['<xsl:value-of select="../@package"/>.<xsl:value-of select="../@name"/>'] = new Array();
+ <xsl:for-each select="property">
+ <xsl:sort select="@name"/>
+ cur['<xsl:value-of select="@name"/>'] = '<xsl:call-template name="JS-escape"><xsl:with-param name="string" select="@value"/></xsl:call-template>';
+ </xsl:for-each>
+ </xsl:template>
+
+<!-- Page HEADER -->
+<xsl:template name="pageHeader">
+ <h1>Unit Test Results</h1>
+ <table width="100%">
+ <tr>
+ <td align="left"></td>
+ <td align="right">Designed for use with <a href='http://www.junit.org'>JUnit</a> and <a href='http://ant.apache.org'>Ant</a>.</td>
+ </tr>
+ </table>
+ <hr size="1"/>
+</xsl:template>
+
+<xsl:template match="testsuite" mode="header">
+ <tr valign="top">
+ <th width="80%">Name</th>
+ <th>Tests</th>
+ <th>Errors</th>
+ <th>Failures</th>
+ <th nowrap="nowrap">Time(s)</th>
+ </tr>
+</xsl:template>
+
+<!-- class header -->
+<xsl:template name="testsuite.test.header">
+ <tr valign="top">
+ <th width="80%">Name</th>
+ <th>Tests</th>
+ <th>Errors</th>
+ <th>Failures</th>
+ <th nowrap="nowrap">Time(s)</th>
+ </tr>
+</xsl:template>
+
+<!-- method header -->
+<xsl:template name="testcase.test.header">
+ <tr valign="top">
+ <th>Name</th>
+ <th>Status</th>
+ <th width="80%">Type</th>
+ <th nowrap="nowrap">Time(s)</th>
+ </tr>
+</xsl:template>
+
+
+<!-- class information -->
+<xsl:template match="testsuite" mode="print.test">
+ <tr valign="top">
+ <!-- set a nice color depending if there is an error/failure -->
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="@failures[.&gt; 0]">Failure</xsl:when>
+ <xsl:when test="@errors[.&gt; 0]">Error</xsl:when>
+ </xsl:choose>
+ </xsl:attribute>
+
+ <!-- print testsuite information -->
+ <td><a href="#{@name}"><xsl:value-of select="@name"/></a></td>
+ <td><xsl:value-of select="@tests"/></td>
+ <td><xsl:value-of select="@errors"/></td>
+ <td><xsl:value-of select="@failures"/></td>
+ <td>
+ <xsl:call-template name="display-time">
+ <xsl:with-param name="value" select="@time"/>
+ </xsl:call-template>
+ </td>
+ </tr>
+</xsl:template>
+
+<xsl:template match="testcase" mode="print.test">
+ <tr valign="top">
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="failure | error">Error</xsl:when>
+ </xsl:choose>
+ </xsl:attribute>
+ <td><xsl:value-of select="@name"/></td>
+ <xsl:choose>
+ <xsl:when test="failure">
+ <td>Failure</td>
+ <td><xsl:apply-templates select="failure"/></td>
+ </xsl:when>
+ <xsl:when test="error">
+ <td>Error</td>
+ <td><xsl:apply-templates select="error"/></td>
+ </xsl:when>
+ <xsl:otherwise>
+ <td>Success</td>
+ <td></td>
+ </xsl:otherwise>
+ </xsl:choose>
+ <td>
+ <xsl:call-template name="display-time">
+ <xsl:with-param name="value" select="@time"/>
+ </xsl:call-template>
+ </td>
+ </tr>
+</xsl:template>
+
+
+<xsl:template match="failure">
+ <xsl:call-template name="display-failures"/>
+</xsl:template>
+
+<xsl:template match="error">
+ <xsl:call-template name="display-failures"/>
+</xsl:template>
+
+<!-- Style for the error and failure in the tescase template -->
+<xsl:template name="display-failures">
+ <xsl:choose>
+ <xsl:when test="not(@message)">N/A</xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@message"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <!-- display the stacktrace -->
+ <code>
+ <p/>
+ <xsl:call-template name="br-replace">
+ <xsl:with-param name="word" select="."/>
+ </xsl:call-template>
+ </code>
+ <!-- the later is better but might be problematic for non-21" monitors... -->
+ <!--pre><xsl:value-of select="."/></pre-->
+</xsl:template>
+
+<xsl:template name="JS-escape">
+ <xsl:param name="string"/>
+ <xsl:choose><!-- something isn't right here, basically all single quotes need to be replaced with backslash-single-quote
+ <xsl:when test="contains($string,'&apos;')">
+ <xsl:value-of select="substring-before($string,'&apos;')"/>
+ \&apos;
+ <xsl:call-template name="JS-escape">
+ <xsl:with-param name="string" select="substring-after($string,'&apos;')"/>
+ </xsl:call-template>
+ </xsl:when> -->
+ <xsl:when test="contains($string,'\')">
+ <xsl:value-of select="substring-before($string,'\')"/>\\<xsl:call-template name="JS-escape">
+ <xsl:with-param name="string" select="substring-after($string,'\')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$string"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+
+<!--
+ template that will convert a carriage return into a br tag
+ @param word the text from which to convert CR to BR tag
+-->
+<xsl:template name="br-replace">
+ <xsl:param name="word"/>
+ <xsl:choose>
+ <xsl:when test="contains($word,'&#xA;')">
+ <xsl:value-of select="substring-before($word,'&#xA;')"/>
+ <br/>
+ <xsl:call-template name="br-replace">
+ <xsl:with-param name="word" select="substring-after($word,'&#xA;')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$word"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template name="display-time">
+ <xsl:param name="value"/>
+ <xsl:value-of select="format-number($value,'0.000')"/>
+</xsl:template>
+
+<xsl:template name="display-percent">
+ <xsl:param name="value"/>
+ <xsl:value-of select="format-number($value,'0.00%')"/>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/org.eclipse.swtbot.eclipse.junit4.headless/LICENSE.EPL b/org.eclipse.swtbot.eclipse.junit4.headless/LICENSE.EPL
new file mode 100644
index 00000000..3d967aee
--- /dev/null
+++ b/org.eclipse.swtbot.eclipse.junit4.headless/LICENSE.EPL
@@ -0,0 +1,70 @@
+Eclipse Public License - v 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
+b) in the case of each subsequent Contributor:
+i) changes to the Program, and
+ii) additions to the Program;
+where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
+b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
+c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
+d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
+
+a) it complies with the terms and conditions of this Agreement; and
+b) its license agreement:
+i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
+ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
+iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
+iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
+When the Program is made available in source code form:
+
+a) it must be made available under this Agreement; and
+b) a copy of this Agreement must be included with each copy of the Program.
+Contributors may not remove or alter any copyright notices contained within the Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. \ No newline at end of file
diff --git a/org.eclipse.swtbot.eclipse.junit4.headless/META-INF/MANIFEST.MF b/org.eclipse.swtbot.eclipse.junit4.headless/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..9fbd5c34
--- /dev/null
+++ b/org.eclipse.swtbot.eclipse.junit4.headless/META-INF/MANIFEST.MF
@@ -0,0 +1,14 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: SWTBot Headless JUnit4 Launch Plug-in (incubation)
+Bundle-SymbolicName: org.eclipse.swtbot.eclipse.junit4.headless;singleton:=true
+Bundle-Version: 2.0.0.qualifier
+Bundle-Vendor: Eclipse.org
+Require-Bundle: org.apache.ant,
+ org.junit4;bundle-version="4.5.0",
+ org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.equinox.app
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.eclipse.swtbot.eclipse.junit4.headless
diff --git a/org.eclipse.swtbot.eclipse.junit4.headless/about.html b/org.eclipse.swtbot.eclipse.junit4.headless/about.html
new file mode 100644
index 00000000..88cfbc91
--- /dev/null
+++ b/org.eclipse.swtbot.eclipse.junit4.headless/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>December 2nd, 2008</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.swtbot.eclipse.junit4.headless/build.properties b/org.eclipse.swtbot.eclipse.junit4.headless/build.properties
new file mode 100644
index 00000000..e7467a44
--- /dev/null
+++ b/org.eclipse.swtbot.eclipse.junit4.headless/build.properties
@@ -0,0 +1,28 @@
+###############################################################################
+# Copyright (c) 2008 Ketan Padegaonkar 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:
+# Ketan Padegaonkar - initial API and implementation
+###############################################################################
+bin.includes = META-INF/,\
+ plugin.xml,\
+ library.xml,\
+ about.html,\
+ LICENSE.EPL,\
+ src/,\
+ .
+src.includes = src/,\
+ plugin.xml,\
+ library.xml,\
+ build.properties,\
+ .project,\
+ .classpath,\
+ LICENSE.EPL,\
+ META-INF/,\
+ about.html,\
+ .settings/
+source.. = src/
diff --git a/org.eclipse.swtbot.eclipse.junit4.headless/library.xml b/org.eclipse.swtbot.eclipse.junit4.headless/library.xml
new file mode 100644
index 00000000..0d81a6a9
--- /dev/null
+++ b/org.eclipse.swtbot.eclipse.junit4.headless/library.xml
@@ -0,0 +1,142 @@
+<?xml version="1.0"?>
+<!--
+
+
+======================================================================
+this has been copied from o.e.test plugin with some targets for SWTBot
+======================================================================
+
+
+-->
+
+<project name="Library" default="usage" basedir=".">
+
+ <target name="usage">
+ <echo message="Please refer to the testframework.html in org.eclipse.test for instructions on usage." />
+ </target>
+
+ <target name="init">
+ <!--
+ Parameters:
+ (Mandatory)
+ data-dir - the directory for Eclipse to write its data
+ plugin-name - the name of the plugin to test
+ classname - the name of the test class
+
+ (Optional - overrides defaults set in script)
+ vmargs - a string containing arguments to pass to the VM.
+ extraVMargs - allows separate setting of VM args from separate caller.
+ timeout - overrides default test timeout value (in milliseconds).
+ test-output - overrides default output file produced from test run.
+ plugin-path - path to root of plug-in
+ useEclipseExe - property setting forces test to launch via eclipse executable.
+ junit-report-output - output directory for junit reports produced for specified classname.
+ -->
+
+ <tstamp>
+ <format property="TIMENOW" pattern="HHmmssSSSS" />
+ </tstamp>
+ <!--property setting useEclipseExe launches tests using the eclipse executable-->
+ <condition property="launchTarget" value="eclipse-test">
+ <isset property="useEclipseExe" />
+ </condition>
+ <!--default launch target for launching tests-->
+ <property name="launchTarget" value="java-test" />
+ <property name="formatter" value="org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter" />
+
+ <!--default heap sizes when running performance tests-->
+ <condition property="vmargs" value=" -Xms256M -Xmx256M">
+ <equals arg1="${test.target}" arg2="performance" />
+ </condition>
+ <property name="extraVMargs" value="" />
+ <property name="plugin-path" value="" />
+ <property name="timeout" value="7200000" />
+ <property name="test-output" value="${eclipse-home}/${classname}.xml" />
+ <property name="junit-report-output" value="${eclipse-home}/results" />
+ <mkdir dir="${junit-report-output}" />
+ </target>
+
+ <target name="swtbot-test" description="Eclipse application used to launch UI plugin tests." depends="init">
+ <antcall target="${launchTarget}">
+ <!--param name="application" value="org.eclipse.test.uitestapplication"/-->
+ <param name="application" value="org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplication" />
+ </antcall>
+ </target>
+
+ <target name="java-test">
+ <!--default vm args-->
+ <property name="vmargs" value=" -Xms40m -Xmx256m" />
+
+ <!-- this argument is needed for macosx -->
+ <condition property="jvmOption" value="-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts">
+ <os family="mac" />
+ </condition>
+
+ <property name="jvmOption" value="" />
+
+ <!--set default jvm to use for testing-->
+ <property name="jvm" value="${java.home}/bin/java" />
+
+ <echo message="Running ${classname}. Result file: ${junit-report-output}/${classname}.xml." />
+
+ <java fork="true" dir="." timeout="${timeout}" jvm="${jvm}" logError="true"
+ classname="org.eclipse.core.launcher.Main" output="${junit-report-output}/${classname}.txt">
+ <classpath>
+ <fileset dir="${eclipse-home}/plugins">
+ <include name="org.eclipse.equinox.launcher_*.jar" />
+ </fileset>
+ </classpath>
+ <arg line="-application ${application}" />
+ <arg line="-data ${data-dir}" />
+ <arg line="formatter=${formatter},${test-output}" />
+ <arg line="-testPluginName ${plugin-name}" />
+ <arg line="-className ${classname}" />
+ <arg line="-os ${os}" />
+ <arg line="-ws ${ws}" />
+ <arg line="-arch ${arch}" />
+ <arg line="-consoleLog" />
+ <arg line="-debug" />
+ <jvmarg line="${vmargs} ${extraVMargs} ${jvmOption}" />
+ <sysproperty key="PLUGIN_PATH" value="${plugin-path}" />
+ </java>
+ <antcall target="collect-results" />
+ </target>
+
+ <target name="collect-results">
+ <dirname property="output-dir" file="${test-output}" />
+ <basename property="output-file-name" file="${test-output}" />
+ <junitreport todir="${junit-report-output}" tofile="${classname}.xml">
+ <fileset dir="${output-dir}">
+ <include name="${output-file-name}" />
+ </fileset>
+ </junitreport>
+
+ <style style="${eclipse-home}/plugins/org.eclipse.test/JUNIT.XSL"
+ basedir="${junit-report-output}"
+ includes="${classname}.result.xml"
+ destdir="${junit-report-output}" />
+
+ <!--save .log content and *.log content from configuration directory-->
+ <concat destfile="${junit-report-output}/${classname}.log">
+ <fileset dir="${eclipse-home}" includes="${data-dir}/.metadata/*.log" />
+ <fileset dir="${eclipse-home}" includes="configuration/*.log" />
+ </concat>
+ </target>
+
+ <target name="collect">
+ <!--
+ This target can be used to aggragate test runs from multiple test suites into a single report.
+
+ Parameters to this target:
+ includes - the names of the files to include
+ output-file - the name of the output file to produce
+ -->
+ <junitreport todir="." tofile="${output-file}">
+ <fileset dir=".">
+ <include name="${includes}" />
+ </fileset>
+ </junitreport>
+ </target>
+
+</project>
+
diff --git a/org.eclipse.swtbot.eclipse.junit4.headless/plugin.xml b/org.eclipse.swtbot.eclipse.junit4.headless/plugin.xml
new file mode 100644
index 00000000..e261b9ff
--- /dev/null
+++ b/org.eclipse.swtbot.eclipse.junit4.headless/plugin.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+ <extension
+ id="swtbottestapplication"
+ point="org.eclipse.core.runtime.applications">
+ <application>
+ <run
+ class="org.eclipse.swtbot.eclipse.junit4.headless.UITestApplication">
+ <parameter
+ name="productInfo"
+ value="product.ini">
+ </parameter>
+ </run>
+ </application>
+ </extension>
+
+</plugin>
diff --git a/org.eclipse.swtbot.eclipse.junit4.headless/src/org/eclipse/swtbot/eclipse/junit4/headless/EclipseTestRunner.java b/org.eclipse.swtbot.eclipse.junit4.headless/src/org/eclipse/swtbot/eclipse/junit4/headless/EclipseTestRunner.java
new file mode 100644
index 00000000..cea47797
--- /dev/null
+++ b/org.eclipse.swtbot.eclipse.junit4.headless/src/org/eclipse/swtbot/eclipse/junit4/headless/EclipseTestRunner.java
@@ -0,0 +1,468 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Ketan Padegaonkar 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:
+ * Ketan Padegaonkar - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swtbot.eclipse.junit4.headless;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Properties;
+import java.util.Vector;
+
+import junit.framework.AssertionFailedError;
+import junit.framework.Test;
+import junit.framework.TestListener;
+import junit.framework.TestResult;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.taskdefs.optional.junit.JUnitResultFormatter;
+import org.apache.tools.ant.taskdefs.optional.junit.JUnitTest;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.osgi.util.ManifestElement;
+import org.junit.runner.JUnitCore;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
+
+/**
+ * An exact copy of {@link org.eclipse.test.EclipseTestRunner}. A TestRunner for JUnit that supports Ant
+ * JUnitResultFormatters and running tests inside Eclipse. Example call: EclipseTestRunner -classname
+ * junit.samples.SimpleTest formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter
+ */
+public class EclipseTestRunner implements TestListener {
+ class TestFailedException extends Exception {
+
+ private static final long serialVersionUID = 6009335074727417445L;
+
+ TestFailedException(String message) {
+ super(message);
+ }
+
+ TestFailedException(Throwable e) {
+ super(e);
+ }
+ }
+
+ /**
+ * No problems with this test.
+ */
+ public static final int SUCCESS = 0;
+ /**
+ * Some tests failed.
+ */
+ public static final int FAILURES = 1;
+ /**
+ * An error occured.
+ */
+ public static final int ERRORS = 2;
+
+ private static final String SUITE_METHODNAME = "suite"; //$NON-NLS-1$
+ /**
+ * The current test result
+ */
+ private TestResult fTestResult;
+ /**
+ * The name of the plugin containing the test
+ */
+ private final String fTestPluginName;
+ /**
+ * Formatters from the command line.
+ */
+ private static Vector fgFromCmdLine = new Vector();
+ /**
+ * Holds the registered formatters.
+ */
+ private final Vector<TestListener> formatters = new Vector<TestListener>();
+ /**
+ * Do we stop on errors.
+ */
+ private boolean fHaltOnError = false;
+ /**
+ * Do we stop on test failures.
+ */
+ private boolean fHaltOnFailure = false;
+ /**
+ * The TestSuite we are currently running.
+ */
+ private final JUnitTest fJunitTest;
+ /**
+ * output written during the test
+ */
+ private PrintStream fSystemError;
+ /**
+ * Error output during the test
+ */
+ private PrintStream fSystemOut;
+ /**
+ * Exception caught in constructor.
+ */
+ private Exception fException;
+ /**
+ * Returncode
+ */
+ private int fRetCode = SUCCESS;
+
+ /**
+ * The main entry point (the parameters are not yet consistent with the Ant JUnitTestRunner, but eventually they
+ * should be). Parameters
+ *
+ * <pre>
+ * -className: the name of the testSuite
+ * -testPluginName: the name of the containing plugin
+ * haltOnError: halt test on errors?
+ * haltOnFailure: halt test on failures?
+ * -testlistener listenerClass: deprecated
+ * print a warning that this option is deprecated
+ * formatter: a JUnitResultFormatter given as classname,filename.
+ * If filename is ommitted, System.out is assumed.
+ * </pre>
+ */
+ public static void main(String[] args) throws IOException {
+ System.exit(run(args));
+ }
+
+ public static int run(String[] args) throws IOException {
+ String className = null;
+ String testPluginName = null;
+
+ boolean haltError = false;
+ boolean haltFail = false;
+
+ Properties props = new Properties();
+
+ int startArgs = 0;
+ if (args.length > 0)
+ // support the JUnit task commandline syntax where
+ // the first argument is the name of the test class
+ if (!args[0].startsWith("-")) { //$NON-NLS-1$
+ className = args[0];
+ startArgs++;
+ }
+ for (int i = startArgs; i < args.length; i++)
+ if (args[i].toLowerCase().equals("-classname")) { //$NON-NLS-1$
+ if (i < args.length - 1)
+ className = args[i + 1];
+ i++;
+ } else if (args[i].toLowerCase().equals("-testpluginname")) { //$NON-NLS-1$
+ if (i < args.length - 1)
+ testPluginName = args[i + 1];
+ i++;
+ } else if (args[i].startsWith("haltOnError=")) //$NON-NLS-1$
+ haltError = Project.toBoolean(args[i].substring(12));
+ else if (args[i].startsWith("haltOnFailure=")) //$NON-NLS-1$
+ haltFail = Project.toBoolean(args[i].substring(14));
+ else if (args[i].startsWith("formatter=")) //$NON-NLS-1$
+ try {
+ createAndStoreFormatter(args[i].substring(10));
+ } catch (BuildException be) {
+ System.err.println(be.getMessage());
+ return ERRORS;
+ }
+ else if (args[i].startsWith("propsfile=")) { //$NON-NLS-1$
+ FileInputStream in = new FileInputStream(args[i].substring(10));
+ props.load(in);
+ in.close();
+ } else if (args[i].equals("-testlistener")) { //$NON-NLS-1$
+ System.err.println("The -testlistener option is no longer supported\nuse the formatter= option instead"); //$NON-NLS-1$
+ return ERRORS;
+ }
+
+ if (className == null)
+ throw new IllegalArgumentException("Test class name not specified"); //$NON-NLS-1$
+
+ JUnitTest t = new JUnitTest(className);
+
+ // Add/overlay system properties on the properties from the Ant project
+ Hashtable p = System.getProperties();
+ for (Enumeration _enum = p.keys(); _enum.hasMoreElements();) {
+ Object key = _enum.nextElement();
+ props.put(key, p.get(key));
+ }
+ t.setProperties(props);
+
+ EclipseTestRunner runner = new EclipseTestRunner(t, testPluginName, haltError, haltFail);
+ transferFormatters(runner);
+ runner.run();
+ return runner.getRetCode();
+ }
+
+ /**
+ *
+ */
+ public EclipseTestRunner(JUnitTest test, String testPluginName, boolean haltOnError, boolean haltOnFailure) {
+ fJunitTest = test;
+ fTestPluginName = testPluginName;
+ fHaltOnError = haltOnError;
+ fHaltOnFailure = haltOnFailure;
+ }
+
+ /**
+ * Returns the Test corresponding to the given suite.
+ */
+ protected Class getTest(String suiteClassName) throws TestFailedException {
+ if (suiteClassName.length() <= 0) {
+ clearStatus();
+ return null;
+ }
+ Class testClass = null;
+ try {
+ testClass = loadSuiteClass(suiteClassName);
+ } catch (ClassNotFoundException e) {
+ if (e.getCause() != null)
+ runFailed(e.getCause());
+ String clazz = e.getMessage();
+ if (clazz == null)
+ clazz = suiteClassName;
+ runFailed("Class not found \"" + clazz + "\""); //$NON-NLS-1$ //$NON-NLS-2$
+ return null;
+ } catch (Exception e) {
+ runFailed(e);
+ return null;
+ }
+
+ return testClass;
+ }
+
+ protected void runFailed(String message) throws TestFailedException {
+ System.err.println(message);
+ throw new TestFailedException(message);
+ }
+
+ protected void runFailed(Throwable e) throws TestFailedException {
+ e.printStackTrace();
+ throw new TestFailedException(e);
+ }
+
+ protected void clearStatus() {
+ }
+
+ /**
+ * Loads the class either with the system class loader or a plugin class loader if a plugin name was specified
+ */
+ protected Class loadSuiteClass(String suiteClassName) throws ClassNotFoundException {
+ if (fTestPluginName == null)
+ return Class.forName(suiteClassName);
+ Bundle bundle = Platform.getBundle(fTestPluginName);
+ if (bundle == null)
+ throw new ClassNotFoundException(suiteClassName, new Exception("Could not find plugin \"" + fTestPluginName + "\"")); //$NON-NLS-1$ //$NON-NLS-2$
+
+ // is the plugin a fragment?
+ Dictionary headers = bundle.getHeaders();
+ String hostHeader = (String) headers.get(Constants.FRAGMENT_HOST);
+ if (hostHeader != null) {
+ // we are a fragment for sure
+ // we need to find which is our host
+ ManifestElement[] hostElement = null;
+ try {
+ hostElement = ManifestElement.parseHeader(Constants.FRAGMENT_HOST, hostHeader);
+ } catch (BundleException e) {
+ throw new RuntimeException("Could not find host for fragment:" + fTestPluginName, e); //$NON-NLS-1$
+ }
+ Bundle host = Platform.getBundle(hostElement[0].getValue());
+ // we really want to get the host not the fragment
+ bundle = host;
+ }
+
+ return bundle.loadClass(suiteClassName);
+ }
+
+ public void run() {
+ // IPerformanceMonitor pm = PerfMsrCorePlugin.getPerformanceMonitor(true);
+
+ JUnitCore jUnitCore = new JUnitCore();
+ jUnitCore.addListener(new XMLJUnitResultFormatter());
+ try {
+ jUnitCore.run(getTest("org.eclipse.swtbot.eclipse.finder.AllTests"));
+ } catch (TestFailedException e) {
+ throw new RuntimeException(e);
+ }
+
+ // fTestResult = new TestResult();
+ // fTestResult.addListener(this);
+ // for (int i = 0; i < formatters.size(); i++)
+ // fTestResult.addListener(formatters.elementAt(i));
+ //
+ // long start = System.currentTimeMillis();
+ // fireStartTestSuite();
+ //
+ // if (fException != null) { // had an exception in the constructor
+ // for (int i = 0; i < formatters.size(); i++)
+ // formatters.elementAt(i).addError(null, fException);
+ // fJunitTest.setCounts(1, 0, 1);
+ // fJunitTest.setRunTime(0);
+ // } else {
+ // ByteArrayOutputStream errStrm = new ByteArrayOutputStream();
+ // fSystemError = new PrintStream(errStrm);
+ //
+ // ByteArrayOutputStream outStrm = new ByteArrayOutputStream();
+ // fSystemOut = new PrintStream(outStrm);
+ //
+ // try {
+ // // pm.snapshot(1); // before
+ // fSuite.run(fTestResult);
+ // } finally {
+ // // pm.snapshot(2); // after
+ // fSystemError.close();
+ // fSystemError = null;
+ // fSystemOut.close();
+ // fSystemOut = null;
+ // sendOutAndErr(new String(outStrm.toByteArray()), new String(errStrm.toByteArray()));
+ // fJunitTest.setCounts(fTestResult.runCount(), fTestResult.failureCount(), fTestResult.errorCount());
+ // fJunitTest.setRunTime(System.currentTimeMillis() - start);
+ // }
+ // }
+ // fireEndTestSuite();
+ //
+ // if ((fRetCode != SUCCESS) || (fTestResult.errorCount() != 0))
+ // fRetCode = ERRORS;
+ // else if (fTestResult.failureCount() != 0)
+ // fRetCode = FAILURES;
+
+ // pm.upload(getClass().getName());
+ }
+
+ /**
+ * Returns what System.exit() would return in the standalone version.
+ *
+ * @return 2 if errors occurred, 1 if tests failed else 0.
+ */
+ public int getRetCode() {
+ return fRetCode;
+ }
+
+ /*
+ * @see TestListener.addFailure
+ */
+ public void startTest(Test t) {
+ }
+
+ /*
+ * @see TestListener.addFailure
+ */
+ public void endTest(Test test) {
+ }
+
+ /*
+ * @see TestListener.addFailure
+ */
+ public void addFailure(Test test, AssertionFailedError t) {
+ if (fHaltOnFailure)
+ fTestResult.stop();
+ }
+
+ /*
+ * @see TestListener.addError
+ */
+ public void addError(Test test, Throwable t) {
+ if (fHaltOnError)
+ fTestResult.stop();
+ }
+
+ private void fireStartTestSuite() {
+ for (int i = 0; i < formatters.size(); i++)
+ ((JUnitResultFormatter) formatters.elementAt(i)).startTestSuite(fJunitTest);
+ }
+
+ private void fireEndTestSuite() {
+ for (int i = 0; i < formatters.size(); i++)
+ ((JUnitResultFormatter) formatters.elementAt(i)).endTestSuite(fJunitTest);
+ }
+
+ public void addFormatter(JUnitResultFormatter f) {
+ formatters.addElement(f);
+ }
+
+ /**
+ * Line format is: formatter=<classname>(,<pathname>)?
+ */
+ private static void createAndStoreFormatter(String line) throws BuildException {
+// String formatterClassName = null;
+// File formatterFile = null;
+//
+// int pos = line.indexOf(',');
+// if (pos == -1)
+// formatterClassName = line;
+// else {
+// formatterClassName = line.substring(0, pos);
+// formatterFile = new File(line.substring(pos + 1)); // the method is package visible
+// }
+// fgFromCmdLine.addElement(createFormatter(formatterClassName, formatterFile));
+ }
+
+ private static void transferFormatters(EclipseTestRunner runner) {
+ for (int i = 0; i < fgFromCmdLine.size(); i++)
+ runner.addFormatter((JUnitResultFormatter) fgFromCmdLine.elementAt(i));
+ }
+
+ /*
+ * DUPLICATED from FormatterElement, since it is package visible only
+ */
+ private static JUnitResultFormatter createFormatter(String classname, File outfile) throws BuildException {
+ OutputStream out = System.out;
+
+ if (classname == null)
+ throw new BuildException("you must specify type or classname"); //$NON-NLS-1$
+ Class f = null;
+ try {
+ f = EclipseTestRunner.class.getClassLoader().loadClass(classname);
+ } catch (ClassNotFoundException e) {
+ throw new BuildException(e);
+ }
+
+ Object o = null;
+ try {
+ o = f.newInstance();
+ } catch (InstantiationException e) {
+ throw new BuildException(e);
+ } catch (IllegalAccessException e) {
+ throw new BuildException(e);
+ }
+
+ if (!(o instanceof JUnitResultFormatter))
+ throw new BuildException(classname + " is not a JUnitResultFormatter"); //$NON-NLS-1$
+
+ JUnitResultFormatter r = (JUnitResultFormatter) o;
+
+ if (outfile != null)
+ try {
+ out = new FileOutputStream(outfile);
+ } catch (java.io.IOException e) {
+ throw new BuildException(e);
+ }
+ r.setOutput(out);
+ return r;
+ }
+
+ private void sendOutAndErr(String out, String err) {
+ for (int i = 0; i < formatters.size(); i++) {
+ JUnitResultFormatter formatter = ((JUnitResultFormatter) formatters.elementAt(i));
+
+ formatter.setSystemOutput(out);
+ formatter.setSystemError(err);
+ }
+ }
+
+ protected void handleOutput(String line) {
+ if (fSystemOut != null)
+ fSystemOut.println(line);
+ }
+
+ protected void handleErrorOutput(String line) {
+ if (fSystemError != null)
+ fSystemError.println(line);
+ }
+}
diff --git a/org.eclipse.swtbot.eclipse.junit4.headless/src/org/eclipse/swtbot/eclipse/junit4/headless/UITestApplication.java b/org.eclipse.swtbot.eclipse.junit4.headless/src/org/eclipse/swtbot/eclipse/junit4/headless/UITestApplication.java
new file mode 100644
index 00000000..84c70398
--- /dev/null
+++ b/org.eclipse.swtbot.eclipse.junit4.headless/src/org/eclipse/swtbot/eclipse/junit4/headless/UITestApplication.java
@@ -0,0 +1,212 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Ketan Padegaonkar 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:
+ * Ketan Padegaonkar - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swtbot.eclipse.junit4.headless;
+
+import java.io.IOException;
+
+import junit.framework.Assert;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IPlatformRunnable;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.equinox.app.IApplication;
+import org.eclipse.equinox.app.IApplicationContext;
+import org.eclipse.ui.IWindowListener;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.testing.ITestHarness;
+import org.eclipse.ui.testing.TestableObject;
+
+/**
+ * This is just a copy of org.eclipse.test.UITestApplication from the eclipse test plugin, with {@link #runTests()}
+ * overridden to return a custom {@link EclipseTestRunner} that runs in a non-UI thread.
+ *
+ * A Workbench that runs a test suite specified in the
+ * command line arguments.
+ */
+public class UITestApplication implements IPlatformRunnable, ITestHarness, IApplication {
+
+ private static final String DEFAULT_APP_3_0 = "org.eclipse.ui.ide.workbench"; //$NON-NLS-1$
+ private static final String DEFAULT_APP_PRE_3_0 = "org.eclipse.ui.workbench"; //$NON-NLS-1$
+
+ private boolean fInDeprecatedMode = false;
+ private TestableObject fTestableObject;
+ private int fTestRunnerResult = -1;
+ private IApplicationContext appContext;
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.boot.IPlatformRunnable
+ */
+ public Object run(final Object args) throws Exception {
+ // Get the application to test
+ Object application = getApplication((String[])args);
+ Assert.assertNotNull(application);
+
+ Object result;
+ if (fInDeprecatedMode && (application instanceof IPlatformRunnable))
+ result = runDeprecatedApplication((IPlatformRunnable)application, args);
+ else
+ result = runApplication(application, args);
+ if (!IPlatformRunnable.EXIT_OK.equals(result))
+ System.err.println("UITestRunner: Unexpected result from running application " + application + ": " + result); //$NON-NLS-1$ //$NON-NLS-2$
+ return new Integer(fTestRunnerResult);
+ }
+
+
+ /*
+ * return the application to run, or null if not even the default application
+ * is found.
+ */
+ private Object getApplication(String[] args) throws CoreException {
+ // Assume we are in 3.0 mode.
+ // Find the name of the application as specified by the PDE JUnit launcher.
+ // If no application is specified, the 3.0 default workbench application
+ // is returned.
+ IExtension extension =
+ Platform.getExtensionRegistry().getExtension(
+ Platform.PI_RUNTIME,
+ Platform.PT_APPLICATIONS,
+ getApplicationToRun(args));
+
+ // If no 3.0 extension can be found, search the registry
+ // for the pre-3.0 default workbench application, i.e. org.eclipse ui.workbench
+ // Set the deprecated flag to true
+ if (extension == null) {
+ extension = Platform.getExtensionRegistry().getExtension(
+ Platform.PI_RUNTIME,
+ Platform.PT_APPLICATIONS,
+ DEFAULT_APP_PRE_3_0);
+ fInDeprecatedMode = true;
+ }
+
+ Assert.assertNotNull(extension);
+
+ // If the extension does not have the correct grammar, return null.
+ // Otherwise, return the application object.
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+ if (elements.length > 0) {
+ IConfigurationElement[] runs = elements[0].getChildren("run"); //$NON-NLS-1$
+ if (runs.length > 0) {
+ Object runnable = runs[0].createExecutableExtension("class"); //$NON-NLS-1$
+ if (runnable instanceof IPlatformRunnable)
+ return runnable;
+ if (runnable instanceof IApplication)
+ return runnable;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * The -testApplication argument specifies the application to be run.
+ * If the PDE JUnit launcher did not set this argument, then return
+ * the name of the default application.
+ * In 3.0, the default is the "org.eclipse.ui.ide.worbench" application.
+ *
+ */
+ private String getApplicationToRun(String[] args) {
+ for (int i = 0; i < args.length; i++)
+ if (args[i].equals("-testApplication") && (i < args.length -1)) //$NON-NLS-1$
+ return args[i+1];
+ return DEFAULT_APP_3_0;
+ }
+
+ /**
+ * In 3.0 mode
+ *
+ */
+ private Object runApplication(Object application, Object args) throws Exception {
+ fTestableObject = PlatformUI.getTestableObject();
+ fTestableObject.setTestHarness(this);
+ if (application instanceof IPlatformRunnable)
+ return ((IPlatformRunnable) application).run(args);
+ return ((IApplication) application).start(appContext);
+
+ }
+
+ /*
+ * If we are in pre-3.0 mode, then the application to run is
+ * "org.eclipse.ui.workbench" Therefore, we safely cast the runnable object
+ * to IWorkbenchWindow. We add a listener to it, so that we know when the
+ * window opens so that we can start running the tests. When the tests are
+ * done, we explicitly call close() on the workbench.
+ */
+ private Object runDeprecatedApplication(
+ IPlatformRunnable object,
+ final Object args)
+ throws Exception {
+
+ Assert.assertTrue(object instanceof IWorkbench);
+
+ final IWorkbench workbench = (IWorkbench) object;
+ // the 'started' flag is used so that we only run tests when the window
+ // is opened
+ // for the first time only.
+ final boolean[] started = { false };
+ workbench.addWindowListener(new IWindowListener() {
+ public void windowOpened(IWorkbenchWindow w) {
+ if (started[0])
+ return;
+ w.getShell().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ started[0] = true;
+ try {
+ fTestRunnerResult = EclipseTestRunner.run((String[]) args);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ workbench.close();
+ }
+ });
+ }
+ public void windowActivated(IWorkbenchWindow window) {
+ }
+ public void windowDeactivated(IWorkbenchWindow window) {
+ }
+ public void windowClosed(IWorkbenchWindow window) {
+ }
+ });
+ return ((IPlatformRunnable) workbench).run(args);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.testing.ITestHarness#runTests()
+ */
+ public void runTests() {
+ fTestableObject.testingStarting();
+ try {
+ fTestRunnerResult = EclipseTestRunner.run(Platform.getCommandLineArgs());
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ fTestableObject.testingFinished();
+ }
+
+
+ public Object start(IApplicationContext context) throws Exception {
+ appContext = context;
+ String[] args = (String[]) appContext.getArguments().get("application.args"); //$NON-NLS-1$
+ if (args == null)
+ args = new String[0];
+ return run(args);
+ }
+
+
+ public void stop() {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/org.eclipse.swtbot.eclipse.junit4.headless/src/org/eclipse/swtbot/eclipse/junit4/headless/XMLJUnitResultFormatter.java b/org.eclipse.swtbot.eclipse.junit4.headless/src/org/eclipse/swtbot/eclipse/junit4/headless/XMLJUnitResultFormatter.java
new file mode 100644
index 00000000..595f1d0a
--- /dev/null
+++ b/org.eclipse.swtbot.eclipse.junit4.headless/src/org/eclipse/swtbot/eclipse/junit4/headless/XMLJUnitResultFormatter.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2009 SWTBot Committers 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:
+ * Ketan Padegaonkar - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swtbot.eclipse.junit4.headless;
+
+import org.junit.runner.Description;
+import org.junit.runner.Result;
+import org.junit.runner.notification.Failure;
+import org.junit.runner.notification.RunListener;
+
+/**
+ * @author Ketan Padegaonkar &lt;KetanPadegaonkar [at] gmail [dot] com&gt;
+ * @version $Id$
+ */
+public class XMLJUnitResultFormatter extends RunListener {
+
+ public void testAssumptionFailure(Failure failure) {
+ System.out.println("XMLJUnitResultFormatter.testAssumptionFailure()");
+ }
+
+ public void testFailure(Failure failure) throws Exception {
+ System.out.println("XMLJUnitResultFormatter.testFailure()");
+ }
+
+ public void testFinished(Description description) throws Exception {
+ System.out.println("XMLJUnitResultFormatter.testFinished()");
+ }
+
+ public void testIgnored(Description description) throws Exception {
+ System.out.println("XMLJUnitResultFormatter.testIgnored()");
+ }
+
+ public void testRunFinished(Result result) throws Exception {
+ System.out.println("XMLJUnitResultFormatter.testRunFinished()");
+ }
+
+ public void testRunStarted(Description description) throws Exception {
+ System.out.println("XMLJUnitResultFormatter.testRunStarted()");
+ }
+
+ public void testStarted(Description description) throws Exception {
+ System.out.println("XMLJUnitResultFormatter.testStarted()");
+ }
+
+}
diff --git a/org.eclipse.swtbot.eclipse.spy/META-INF/MANIFEST.MF b/org.eclipse.swtbot.eclipse.spy/META-INF/MANIFEST.MF
index 9fa02fcc..87e7681d 100644
--- a/org.eclipse.swtbot.eclipse.spy/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.eclipse.spy/META-INF/MANIFEST.MF
@@ -6,7 +6,7 @@ Bundle-Version: 2.0.0.qualifier
Bundle-Activator: org.eclipse.swtbot.eclipse.spy.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
- org.junit,
+ org.junit4;bundle-version="4.5.0",
org.eclipse.swtbot.swt.finder,
org.eclipse.swtbot.eclipse.finder,
org.apache.log4j
diff --git a/org.eclipse.swtbot.eclipse.test/feature.xml b/org.eclipse.swtbot.eclipse.test/feature.xml
index 5c0bc530..83596fa0 100644
--- a/org.eclipse.swtbot.eclipse.test/feature.xml
+++ b/org.eclipse.swtbot.eclipse.test/feature.xml
@@ -90,14 +90,31 @@ Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in t
<requires>
<import plugin="org.apache.ant"/>
- <import plugin="org.junit"/>
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.core.runtime"/>
<import plugin="org.eclipse.equinox.app"/>
+ <import plugin="org.junit"/>
+ <import plugin="org.junit4" version="4.5.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.core.runtime.compatibility"/>
+ <import plugin="org.apache.ant" version="1.6.5" match="compatible"/>
</requires>
<plugin
- id="org.eclipse.swtbot.eclipse.headless"
+ id="org.eclipse.swtbot.eclipse.junit4.headless"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.eclipse.swtbot.ant.optional.junit4"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ fragment="true"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.swtbot.eclipse.junit3.headless"
download-size="0"
install-size="0"
version="0.0.0"/>
diff --git a/org.eclipse.swtbot.eclipse.ui.test/META-INF/MANIFEST.MF b/org.eclipse.swtbot.eclipse.ui.test/META-INF/MANIFEST.MF
index e7b0c60a..ede63a67 100644
--- a/org.eclipse.swtbot.eclipse.ui.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.eclipse.ui.test/META-INF/MANIFEST.MF
@@ -5,6 +5,6 @@ Bundle-SymbolicName: org.eclipse.swtbot.eclipse.ui.test
Bundle-Version: 2.0.0.qualifier
Bundle-Vendor: Eclipse.org
Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.junit,
+Require-Bundle: org.junit4;bundle-version="4.5.0",
org.eclipse.swtbot.eclipse.ui,
org.eclipse.ui
diff --git a/org.eclipse.swtbot.eclipse.ui/META-INF/MANIFEST.MF b/org.eclipse.swtbot.eclipse.ui/META-INF/MANIFEST.MF
index 61961739..a2fd2dc2 100644
--- a/org.eclipse.swtbot.eclipse.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.eclipse.ui/META-INF/MANIFEST.MF
@@ -16,8 +16,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.jdt.ui,
org.eclipse.swtbot.swt.finder,
org.eclipse.swtbot.eclipse.finder,
- org.junit,
- org.hamcrest,
+ org.hamcrest;bundle-version="1.1.0",
+ org.junit4;bundle-version="4.5.0",
org.eclipse.ui.intro,
org.eclipse.ui.intro.universal
Bundle-ActivationPolicy: lazy
diff --git a/org.eclipse.swtbot.eclipse/feature.xml b/org.eclipse.swtbot.eclipse/feature.xml
index cd825b41..2e143415 100644
--- a/org.eclipse.swtbot.eclipse/feature.xml
+++ b/org.eclipse.swtbot.eclipse/feature.xml
@@ -101,8 +101,6 @@ Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in t
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.core.runtime"/>
<import plugin="org.eclipse.swtbot.swt.finder"/>
- <import plugin="org.junit"/>
- <import plugin="org.hamcrest"/>
<import plugin="org.apache.log4j"/>
<import plugin="org.apache.commons.collections"/>
<import plugin="org.eclipse.pde.junit.runtime"/>
@@ -115,6 +113,8 @@ Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in t
<import plugin="org.eclipse.jdt.ui"/>
<import plugin="org.eclipse.ui.intro"/>
<import plugin="org.eclipse.ui.intro.universal"/>
+ <import plugin="org.hamcrest" version="1.1.0" match="greaterOrEqual"/>
+ <import plugin="org.junit4" version="4.5.0" match="greaterOrEqual"/>
</requires>
<plugin
diff --git a/org.eclipse.swtbot.generator.test/META-INF/MANIFEST.MF b/org.eclipse.swtbot.generator.test/META-INF/MANIFEST.MF
index 08b5037b..f89660c6 100644
--- a/org.eclipse.swtbot.generator.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.generator.test/META-INF/MANIFEST.MF
@@ -5,7 +5,7 @@ Bundle-SymbolicName: org.eclipse.swtbot.generator.test
Bundle-Version: 2.0.0.qualifier
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.swtbot.swt.finder,
- org.junit4,
- org.hamcrest,
+ org.hamcrest;bundle-version="1.1.0",
+ org.junit4;bundle-version="4.5.0",
org.eclipse.swtbot.generator,
org.eclipse.ui
diff --git a/org.eclipse.swtbot.generator/META-INF/MANIFEST.MF b/org.eclipse.swtbot.generator/META-INF/MANIFEST.MF
index 566fa884..5e1a0273 100644
--- a/org.eclipse.swtbot.generator/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.generator/META-INF/MANIFEST.MF
@@ -7,7 +7,7 @@ Bundle-Vendor: Eclipse.org
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.swtbot.swt.finder,
org.eclipse.ui,
- org.hamcrest,
+ org.hamcrest;bundle-version="1.1.0",
org.eclipse.swtbot.eclipse.finder
Bundle-ClassPath: .
Export-Package: org.eclipse.swtbot.generator
diff --git a/org.eclipse.swtbot.recording/feature.xml b/org.eclipse.swtbot.recording/feature.xml
index 10a58e2a..04382864 100644
--- a/org.eclipse.swtbot.recording/feature.xml
+++ b/org.eclipse.swtbot.recording/feature.xml
@@ -100,7 +100,6 @@ Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in t
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.swtbot.swt.finder"/>
<import plugin="org.apache.commons.collections"/>
- <import plugin="org.eclipse.core.runtime"/>
<import plugin="org.apache.log4j"/>
<import plugin="org.hamcrest"/>
</requires>
diff --git a/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.eclipse.finder.test.xml b/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.eclipse.finder.test.xml
index 132c22a7..b4d4bd96 100644
--- a/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.eclipse.finder.test.xml
+++ b/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.eclipse.finder.test.xml
@@ -3,8 +3,7 @@
<property name="eclipse-home" value="${basedir}\..\.." />
<property name="plugin-name" value="org.eclipse.swtbot.eclipse.finder.test" />
<!--property name="library-file" value="../../library.xml" /-->
- <!--property name="library-file" value="${eclipse-home}/plugins/org.eclipse.swtbot.eclipse.headless_${all.buildId}/library.xml"/-->
- <property name="library-file" value="${eclipse-home}/plugins/org.eclipse.test_3.2.0/library.xml"/>
+ <property name="library-file" value="${eclipse-home}/plugins/org.eclipse.swtbot.eclipse.junit4.headless_${all.buildId}/library.xml"/>
<target name="init">
<tstamp />
@@ -23,6 +22,11 @@
<property name="temp-workspace" value="workspace" />
<delete dir="${temp-workspace}" quiet="true" />
+
+ <!-- remove junit3 fragment -->
+ <delete dir="${eclipse-home}/plugins/org.eclipse.swtbot.eclipse.junit3.headless_${all.buildId}" />
+ <delete dir="${eclipse-home}/plugins" includes="org.eclipse.swtbot.ant.optional.junit3_${all.buildId}.jar"/>
+
<ant target="swtbot-test" antfile="${library-file}" dir="${eclipse-home}">
<property name="data-dir" value="${temp-workspace}" />
<property name="plugin-name" value="${plugin-name}" />
diff --git a/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.eclipse.ui.test.xml b/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.eclipse.ui.test.xml
index b4c00d0f..301f440b 100644
--- a/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.eclipse.ui.test.xml
+++ b/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.eclipse.ui.test.xml
@@ -3,7 +3,6 @@
<property name="eclipse-home" value="${basedir}\..\.." />
<property name="plugin-name" value="org.eclipse.swtbot.eclipse.ui.test" />
<!--property name="library-file" value="../../library.xml" /-->
- <!--property name="library-file" value="${eclipse-home}/plugins/org.eclipse.swtbot.eclipse.headless_${all.buildId}/library.xml"/-->
<property name="library-file" value="${eclipse-home}/plugins/org.eclipse.test_3.2.0/library.xml"/>
<target name="init">
@@ -20,10 +19,15 @@
</condition>
<property name="jvmOption" value=""></property>
-
+
<property name="temp-workspace" value="workspace" />
<delete dir="${temp-workspace}" quiet="true" />
- <ant target="swtbot-test" antfile="${library-file}" dir="${eclipse-home}">
+
+ <!-- remove junit4 fragment -->
+ <delete dir="${eclipse-home}/plugins/org.eclipse.swtbot.eclipse.junit4.headless_${all.buildId}" />
+ <delete dir="${eclipse-home}/plugins" includes="org.eclipse.swtbot.ant.optional.junit4_${all.buildId}.jar"/>
+
+ <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
<property name="data-dir" value="${temp-workspace}" />
<property name="plugin-name" value="${plugin-name}" />
<property name="classname" value="org.eclipse.swtbot.eclipse.ui.test.AllTests" />
diff --git a/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.generator.test.xml b/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.generator.test.xml
index e79a6a54..08a60569 100644
--- a/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.generator.test.xml
+++ b/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.generator.test.xml
@@ -30,7 +30,7 @@
<include name="org.eclipse.equinox.common_*.jar" />
<include name="org.eclipse.jface_*.jar" />
<include name="org.eclipse.core.commands_*.jar" />
- <include name="org.junit_*/junit*.jar" />
+ <include name="org.junit4_4.5*/junit*.jar" />
<include name="org.eclipse.swtbot*" />
<include name="org.apache.commons.collections_3.2.0*.jar" />
<include name="org.apache.log4j_1.2.*.jar" />
diff --git a/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.swt.finder.test.xml b/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.swt.finder.test.xml
index 2741539d..1aa96daa 100644
--- a/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.swt.finder.test.xml
+++ b/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.swt.finder.test.xml
@@ -30,7 +30,7 @@
<include name="org.eclipse.equinox.common_*.jar" />
<include name="org.eclipse.jface_*.jar" />
<include name="org.eclipse.core.commands_*.jar" />
- <include name="org.junit_*/junit*.jar" />
+ <include name="org.junit4_4.5*/junit*.jar" />
<include name="org.eclipse.swtbot*" />
<include name="org.apache.commons.collections_3.2.0*.jar" />
<include name="org.apache.log4j_1.2.*.jar" />
diff --git a/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.swt.recorder.test.xml b/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.swt.recorder.test.xml
index 722c0fc1..fbc3afcc 100644
--- a/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.swt.recorder.test.xml
+++ b/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.swt.recorder.test.xml
@@ -30,7 +30,7 @@
<include name="org.eclipse.equinox.common_*.jar" />
<include name="org.eclipse.jface_*.jar" />
<include name="org.eclipse.core.commands_*.jar" />
- <include name="org.junit_*/junit*.jar" />
+ <include name="org.junit4_4.5*/junit*.jar" />
<include name="org.eclipse.swtbot*" />
<include name="org.apache.commons.collections_3.2.0*.jar" />
<include name="org.apache.log4j_1.2.*.jar" />
diff --git a/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.swt.recorder.ui.test.xml b/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.swt.recorder.ui.test.xml
index dd727e75..841e9b41 100644
--- a/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.swt.recorder.ui.test.xml
+++ b/org.eclipse.swtbot.releng/test-sandbox/org.eclipse.swtbot.swt.recorder.ui.test.xml
@@ -30,7 +30,7 @@
<include name="org.eclipse.equinox.common_*.jar" />
<include name="org.eclipse.jface_*.jar" />
<include name="org.eclipse.core.commands_*.jar" />
- <include name="org.junit_*/junit*.jar" />
+ <include name="org.junit4_4.5*/junit*.jar" />
<include name="org.eclipse.swtbot*" />
<include name="org.apache.commons.collections_3.2.0*.jar" />
<include name="org.apache.log4j_1.2.*.jar" />
diff --git a/org.eclipse.swtbot.swt.finder.test/META-INF/MANIFEST.MF b/org.eclipse.swtbot.swt.finder.test/META-INF/MANIFEST.MF
index 8c22f547..da1524de 100644
--- a/org.eclipse.swtbot.swt.finder.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.swt.finder.test/META-INF/MANIFEST.MF
@@ -7,7 +7,7 @@ Require-Bundle: org.eclipse.swt,
org.eclipse.swt.examples,
org.eclipse.swtbot.swt.finder,
org.apache.log4j,
- org.junit4,
+ org.junit4;bundle-version="4.5.0",
org.hamcrest
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
diff --git a/org.eclipse.swtbot.swt.finder.test/src/org/eclipse/swtbot/swt/finder/SWTBotTest.java b/org.eclipse.swtbot.swt.finder.test/src/org/eclipse/swtbot/swt/finder/SWTBotTest.java
index e3ea13ec..be14363c 100644
--- a/org.eclipse.swtbot.swt.finder.test/src/org/eclipse/swtbot/swt/finder/SWTBotTest.java
+++ b/org.eclipse.swtbot.swt.finder.test/src/org/eclipse/swtbot/swt/finder/SWTBotTest.java
@@ -17,6 +17,7 @@ import org.eclipse.swtbot.swt.finder.results.VoidResult;
import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.TimeoutException;
+import org.junit.Test;
/**
* @author Ketan Padegaonkar &lt;KetanPadegaonkar [at] gmail [dot] com&gt;
@@ -27,6 +28,7 @@ public class SWTBotTest extends AbstractMenuExampleTest {
private SWTBot bot;
+ @Test
public void testWaits5SecondsAndFailsForFailingCondition() throws Exception {
final long begin = System.currentTimeMillis();
try {
diff --git a/org.eclipse.swtbot.swt.finder/META-INF/MANIFEST.MF b/org.eclipse.swtbot.swt.finder/META-INF/MANIFEST.MF
index a4059a41..2a656c70 100644
--- a/org.eclipse.swtbot.swt.finder/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.swt.finder/META-INF/MANIFEST.MF
@@ -4,10 +4,10 @@ Bundle-Name: SWTBot SWT Control Finder plugin (incubation)
Bundle-SymbolicName: org.eclipse.swtbot.swt.finder;singleton:=true
Bundle-Version: 2.0.0.qualifier
Require-Bundle: org.eclipse.swt,
+ org.hamcrest;bundle-version="1.1.0",
org.junit4;bundle-version="4.5.0",
org.apache.commons.collections,
- org.apache.log4j,
- org.hamcrest
+ org.apache.log4j
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Export-Package: org.eclipse.swtbot.swt.finder,
diff --git a/org.eclipse.swtbot.swt.recorder.test/META-INF/MANIFEST.MF b/org.eclipse.swtbot.swt.recorder.test/META-INF/MANIFEST.MF
index 7fea7377..b35b0681 100644
--- a/org.eclipse.swtbot.swt.recorder.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.swt.recorder.test/META-INF/MANIFEST.MF
@@ -7,7 +7,7 @@ Bundle-Vendor: Eclipse.org
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.ui,
org.eclipse.swtbot.swt.finder,
- org.junit,
+ org.junit4;bundle-version="4.5.0",
org.eclipse.swtbot.swt.recorder,
org.eclipse.swtbot.swt.finder.test,
org.apache.log4j,
diff --git a/org.eclipse.swtbot.swt.recorder.ui.test/META-INF/MANIFEST.MF b/org.eclipse.swtbot.swt.recorder.ui.test/META-INF/MANIFEST.MF
index 95a3c167..54913422 100644
--- a/org.eclipse.swtbot.swt.recorder.ui.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.swt.recorder.ui.test/META-INF/MANIFEST.MF
@@ -4,7 +4,7 @@ Bundle-Name: SWTBot Recorder UI Test Plug-in (incubation)
Bundle-SymbolicName: org.eclipse.swtbot.swt.recorder.ui.test;singleton:=true
Bundle-Version: 2.0.0.qualifier
Require-Bundle: org.eclipse.ui,
- org.junit,
+ org.junit4;bundle-version="4.5.0",
org.eclipse.swtbot.swt.recorder.ui
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/org.eclipse.swtbot.swt.spy/META-INF/MANIFEST.MF b/org.eclipse.swtbot.swt.spy/META-INF/MANIFEST.MF
index 4389f59f..f4f108b4 100644
--- a/org.eclipse.swtbot.swt.spy/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.swt.spy/META-INF/MANIFEST.MF
@@ -6,7 +6,7 @@ Bundle-Version: 2.0.0.qualifier
Require-Bundle: org.eclipse.ui,
org.eclipse.swtbot.swt.finder,
org.eclipse.swt.examples,
- org.junit
+ org.junit4;bundle-version="4.5.0"
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Bundle-Vendor: Eclipse.org
diff --git a/org.eclipse.swtbot.test/feature.xml b/org.eclipse.swtbot.test/feature.xml
index 57b55865..49ee526b 100644
--- a/org.eclipse.swtbot.test/feature.xml
+++ b/org.eclipse.swtbot.test/feature.xml
@@ -101,29 +101,33 @@ Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in t
version="0.0.0"/>
<includes
+ id="org.eclipse.swtbot.eclipse.test"
+ version="0.0.0"/>
+
+ <includes
id="org.eclipse.swtbot.recording"
version="0.0.0"/>
<requires>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.junit4"/>
+ <import plugin="org.eclipse.swt"/>
+ <import plugin="org.junit4" version="4.5.0" match="greaterOrEqual"/>
<import plugin="org.hamcrest"/>
- <import plugin="org.junit"/>
+ <import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.jface.text"/>
<import plugin="org.eclipse.core.resources"/>
<import plugin="org.eclipse.ui.editors"/>
<import plugin="org.eclipse.ui.ide"/>
- <import plugin="org.apache.ant"/>
- <import plugin="org.eclipse.equinox.app"/>
- <import plugin="org.eclipse.pde.junit.runtime"/>
- <import plugin="org.eclipse.jdt.junit"/>
- <import plugin="org.eclipse.pde.ui"/>
- <import plugin="org.eclipse.jdt.core"/>
- <import plugin="org.eclipse.jdt.launching"/>
- <import plugin="org.eclipse.debug.ui"/>
- <import plugin="org.eclipse.jdt.junit.runtime"/>
- <import plugin="org.eclipse.jdt.ui"/>
+ <import plugin="org.eclipse.core.runtime"/>
+ <import plugin="org.eclipse.swtbot.swt.finder"/>
+ <import plugin="org.apache.log4j"/>
+ <import plugin="org.eclipse.swtbot.swt.recorder"/>
+ <import plugin="org.eclipse.swtbot.eclipse.finder"/>
+ <import plugin="org.hamcrest" version="1.1.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.swtbot.swt.recorder.ui"/>
+ <import plugin="org.eclipse.swtbot.generator"/>
+ <import plugin="org.eclipse.swtbot.eclipse.ui"/>
+ <import plugin="org.eclipse.core.runtime.compatibility"/>
+ <import plugin="org.apache.ant" version="1.6.5" match="compatible"/>
</requires>
<plugin
@@ -152,54 +156,6 @@ Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in t
unpack="false"/>
<plugin
- id="org.eclipse.swtbot.eclipse.finder"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.swtbot.eclipse.headless"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.swtbot.eclipse.spy"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.swtbot.eclipse.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.swtbot.swt.finder"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.swtbot.swt.recorder"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.swtbot.swt.recorder.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
id="org.eclipse.swtbot.swt.recorder.ui.test"
download-size="0"
install-size="0"
@@ -213,34 +169,27 @@ Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in t
unpack="false"/>
<plugin
- id="org.apache.commons.collections"
+ id="org.eclipse.swtbot.generator.test"
download-size="0"
install-size="0"
- version="0.0.0"
- unpack="false"/>
+ version="0.0.0"/>
<plugin
- id="org.apache.log4j"
+ id="org.eclipse.swtbot.eclipse.ui.test"
download-size="0"
install-size="0"
- version="0.0.0"
- unpack="false"/>
+ version="0.0.0"/>
<plugin
- id="org.eclipse.swtbot.generator"
+ id="org.eclipse.swtbot.ant.optional.junit4"
download-size="0"
install-size="0"
version="0.0.0"
+ fragment="true"
unpack="false"/>
<plugin
- id="org.eclipse.swtbot.generator.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.swtbot.eclipse.ui.test"
+ id="org.eclipse.swtbot.generator"
download-size="0"
install-size="0"
version="0.0.0"
diff --git a/org.eclipse.swtbot/feature.xml b/org.eclipse.swtbot/feature.xml
index 5bedfdac..094666c8 100644
--- a/org.eclipse.swtbot/feature.xml
+++ b/org.eclipse.swtbot/feature.xml
@@ -94,9 +94,8 @@ Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in t
</url>
<requires>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.junit"/>
+ <import plugin="org.eclipse.swt"/>
+ <import plugin="org.junit4" version="4.5.0" match="greaterOrEqual"/>
</requires>
<plugin
@@ -127,4 +126,10 @@ Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in t
version="0.0.0"
unpack="false"/>
+ <plugin
+ id="org.junit4"
+ download-size="0"
+ install-size="0"
+ version="4.5.0.v20080911"/>
+
</feature>

Back to the top