Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'FROMCVS/org.eclipse.test')
-rwxr-xr-xFROMCVS/org.eclipse.test/.classpath7
-rwxr-xr-xFROMCVS/org.eclipse.test/.cvsignore1
-rwxr-xr-xFROMCVS/org.eclipse.test/.project40
-rw-r--r--FROMCVS/org.eclipse.test/.settings/CVS/Entries2
-rw-r--r--FROMCVS/org.eclipse.test/.settings/CVS/Repository1
-rw-r--r--FROMCVS/org.eclipse.test/.settings/CVS/Root1
-rw-r--r--FROMCVS/org.eclipse.test/.settings/CVS/Tag1
-rwxr-xr-xFROMCVS/org.eclipse.test/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--FROMCVS/org.eclipse.test/CVS/Entries16
-rw-r--r--FROMCVS/org.eclipse.test/CVS/Repository1
-rw-r--r--FROMCVS/org.eclipse.test/CVS/Root1
-rw-r--r--FROMCVS/org.eclipse.test/CVS/Tag1
-rwxr-xr-xFROMCVS/org.eclipse.test/JUNIT.XSL455
-rw-r--r--FROMCVS/org.eclipse.test/META-INF/CVS/Entries2
-rw-r--r--FROMCVS/org.eclipse.test/META-INF/CVS/Repository1
-rw-r--r--FROMCVS/org.eclipse.test/META-INF/CVS/Root1
-rw-r--r--FROMCVS/org.eclipse.test/META-INF/CVS/Tag1
-rwxr-xr-xFROMCVS/org.eclipse.test/META-INF/MANIFEST.MF17
-rwxr-xr-xFROMCVS/org.eclipse.test/about.html28
-rw-r--r--FROMCVS/org.eclipse.test/automated.jarbin0 -> 20758 bytes
-rwxr-xr-xFROMCVS/org.eclipse.test/build.properties21
-rwxr-xr-xFROMCVS/org.eclipse.test/easymock.psf6
-rw-r--r--FROMCVS/org.eclipse.test/lib/CVS/Entries3
-rw-r--r--FROMCVS/org.eclipse.test/lib/CVS/Repository1
-rw-r--r--FROMCVS/org.eclipse.test/lib/CVS/Root1
-rw-r--r--FROMCVS/org.eclipse.test/lib/CVS/Tag1
-rwxr-xr-xFROMCVS/org.eclipse.test/lib/jacocoagent.jarbin0 -> 146690 bytes
-rwxr-xr-xFROMCVS/org.eclipse.test/lib/jacocoant.jarbin0 -> 421440 bytes
-rwxr-xr-xFROMCVS/org.eclipse.test/library.xml179
-rwxr-xr-xFROMCVS/org.eclipse.test/plugin.properties12
-rwxr-xr-xFROMCVS/org.eclipse.test/plugin.xml27
-rw-r--r--FROMCVS/org.eclipse.test/pom.xml18
-rw-r--r--FROMCVS/org.eclipse.test/src/CVS/Entries1
-rw-r--r--FROMCVS/org.eclipse.test/src/CVS/Repository1
-rw-r--r--FROMCVS/org.eclipse.test/src/CVS/Root1
-rw-r--r--FROMCVS/org.eclipse.test/src/CVS/Tag1
-rw-r--r--FROMCVS/org.eclipse.test/src/org/CVS/Entries1
-rw-r--r--FROMCVS/org.eclipse.test/src/org/CVS/Repository1
-rw-r--r--FROMCVS/org.eclipse.test/src/org/CVS/Root1
-rw-r--r--FROMCVS/org.eclipse.test/src/org/CVS/Tag1
-rw-r--r--FROMCVS/org.eclipse.test/src/org/eclipse/CVS/Entries1
-rw-r--r--FROMCVS/org.eclipse.test/src/org/eclipse/CVS/Repository1
-rw-r--r--FROMCVS/org.eclipse.test/src/org/eclipse/CVS/Root1
-rw-r--r--FROMCVS/org.eclipse.test/src/org/eclipse/CVS/Tag1
-rw-r--r--FROMCVS/org.eclipse.test/src/org/eclipse/test/CVS/Entries5
-rw-r--r--FROMCVS/org.eclipse.test/src/org/eclipse/test/CVS/Repository1
-rw-r--r--FROMCVS/org.eclipse.test/src/org/eclipse/test/CVS/Root1
-rw-r--r--FROMCVS/org.eclipse.test/src/org/eclipse/test/CVS/Tag1
-rwxr-xr-xFROMCVS/org.eclipse.test/src/org/eclipse/test/CoreTestApplication.java87
-rwxr-xr-xFROMCVS/org.eclipse.test/src/org/eclipse/test/EclipseTestRunner.java697
-rwxr-xr-xFROMCVS/org.eclipse.test/src/org/eclipse/test/RegressionTest.java187
-rwxr-xr-xFROMCVS/org.eclipse.test/src/org/eclipse/test/UITestApplication.java222
-rwxr-xr-xFROMCVS/org.eclipse.test/testframework.html279
53 files changed, 2350 insertions, 0 deletions
diff --git a/FROMCVS/org.eclipse.test/.classpath b/FROMCVS/org.eclipse.test/.classpath
new file mode 100755
index 000000000..472ee29b1
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/FROMCVS/org.eclipse.test/.cvsignore b/FROMCVS/org.eclipse.test/.cvsignore
new file mode 100755
index 000000000..ba077a403
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/.cvsignore
@@ -0,0 +1 @@
+bin
diff --git a/FROMCVS/org.eclipse.test/.project b/FROMCVS/org.eclipse.test/.project
new file mode 100755
index 000000000..e6b7a26e7
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/.project
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.test</name>
+ <comment></comment>
+ <projects>
+ <project>org.apache.ant</project>
+ <project>org.eclipse.ant.core</project>
+ <project>org.eclipse.core.boot</project>
+ <project>org.eclipse.core.resources</project>
+ <project>org.eclipse.core.runtime</project>
+ <project>org.eclipse.help</project>
+ <project>org.eclipse.jface</project>
+ <project>org.eclipse.jface.text</project>
+ <project>org.eclipse.swt</project>
+ <project>org.eclipse.ui.workbench</project>
+ <project>org.eclipse.update.core</project>
+ <project>org.junit</project>
+ </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.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/FROMCVS/org.eclipse.test/.settings/CVS/Entries b/FROMCVS/org.eclipse.test/.settings/CVS/Entries
new file mode 100644
index 000000000..5230c8eba
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/.settings/CVS/Entries
@@ -0,0 +1,2 @@
+/org.eclipse.jdt.core.prefs/1.16/Wed Sep 29 12:58:00 2010//Tv20110511
+D
diff --git a/FROMCVS/org.eclipse.test/.settings/CVS/Repository b/FROMCVS/org.eclipse.test/.settings/CVS/Repository
new file mode 100644
index 000000000..3c3ba4e55
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/.settings/CVS/Repository
@@ -0,0 +1 @@
+org.eclipse.test/.settings
diff --git a/FROMCVS/org.eclipse.test/.settings/CVS/Root b/FROMCVS/org.eclipse.test/.settings/CVS/Root
new file mode 100644
index 000000000..2d37d165b
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/.settings/CVS/Root
@@ -0,0 +1 @@
+:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse
diff --git a/FROMCVS/org.eclipse.test/.settings/CVS/Tag b/FROMCVS/org.eclipse.test/.settings/CVS/Tag
new file mode 100644
index 000000000..4badce0da
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/.settings/CVS/Tag
@@ -0,0 +1 @@
+Nv20110511
diff --git a/FROMCVS/org.eclipse.test/.settings/org.eclipse.jdt.core.prefs b/FROMCVS/org.eclipse.test/.settings/org.eclipse.jdt.core.prefs
new file mode 100755
index 000000000..2f52607ce
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,12 @@
+#Wed Sep 29 12:54:17 CEST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/FROMCVS/org.eclipse.test/CVS/Entries b/FROMCVS/org.eclipse.test/CVS/Entries
new file mode 100644
index 000000000..a4bb982ec
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/CVS/Entries
@@ -0,0 +1,16 @@
+D/.settings////
+D/META-INF////
+D/bin////
+D/lib////
+D/src////
+/.classpath/1.9/Wed Sep 29 12:58:00 2010/-ko/Tv20110511
+/.cvsignore/1.1/Tue Oct 15 17:47:58 2002/-ko/Tv20110511
+/.project/1.5/Wed Sep 29 12:58:00 2010/-ko/Tv20110511
+/JUNIT.XSL/1.6/Tue Sep 29 11:32:36 2009/-ko/Tv20110511
+/about.html/1.5/Mon Jun 5 15:05:48 2006/-ko/Tv20110511
+/build.properties/1.28/Fri Mar 4 12:54:32 2011/-ko/Tv20110511
+/easymock.psf/1.1/Thu Oct 2 18:20:29 2008//Tv20110511
+/library.xml/1.64/Mon Apr 18 14:37:16 2011/-ko/Tv20110511
+/plugin.properties/1.5/Wed Jun 6 18:13:19 2007/-ko/Tv20110511
+/plugin.xml/1.31/Mon Mar 2 19:31:58 2009/-ko/Tv20110511
+/testframework.html/1.7/Thu Oct 7 12:54:56 2010/-ko/Tv20110511
diff --git a/FROMCVS/org.eclipse.test/CVS/Repository b/FROMCVS/org.eclipse.test/CVS/Repository
new file mode 100644
index 000000000..5b4d4f689
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/CVS/Repository
@@ -0,0 +1 @@
+org.eclipse.test
diff --git a/FROMCVS/org.eclipse.test/CVS/Root b/FROMCVS/org.eclipse.test/CVS/Root
new file mode 100644
index 000000000..2d37d165b
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/CVS/Root
@@ -0,0 +1 @@
+:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse
diff --git a/FROMCVS/org.eclipse.test/CVS/Tag b/FROMCVS/org.eclipse.test/CVS/Tag
new file mode 100644
index 000000000..4badce0da
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/CVS/Tag
@@ -0,0 +1 @@
+Nv20110511
diff --git a/FROMCVS/org.eclipse.test/JUNIT.XSL b/FROMCVS/org.eclipse.test/JUNIT.XSL
new file mode 100755
index 000000000..b42657235
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/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/FROMCVS/org.eclipse.test/META-INF/CVS/Entries b/FROMCVS/org.eclipse.test/META-INF/CVS/Entries
new file mode 100644
index 000000000..f25799296
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/META-INF/CVS/Entries
@@ -0,0 +1,2 @@
+/MANIFEST.MF/1.25/Wed Sep 29 12:58:00 2010//Tv20110511
+D
diff --git a/FROMCVS/org.eclipse.test/META-INF/CVS/Repository b/FROMCVS/org.eclipse.test/META-INF/CVS/Repository
new file mode 100644
index 000000000..97627c5cc
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/META-INF/CVS/Repository
@@ -0,0 +1 @@
+org.eclipse.test/META-INF
diff --git a/FROMCVS/org.eclipse.test/META-INF/CVS/Root b/FROMCVS/org.eclipse.test/META-INF/CVS/Root
new file mode 100644
index 000000000..2d37d165b
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/META-INF/CVS/Root
@@ -0,0 +1 @@
+:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse
diff --git a/FROMCVS/org.eclipse.test/META-INF/CVS/Tag b/FROMCVS/org.eclipse.test/META-INF/CVS/Tag
new file mode 100644
index 000000000..4badce0da
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/META-INF/CVS/Tag
@@ -0,0 +1 @@
+Nv20110511
diff --git a/FROMCVS/org.eclipse.test/META-INF/MANIFEST.MF b/FROMCVS/org.eclipse.test/META-INF/MANIFEST.MF
new file mode 100755
index 000000000..9340ae42d
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/META-INF/MANIFEST.MF
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.test; singleton:=true
+Bundle-Version: 3.3.100.qualifier
+Bundle-ClassPath: automated.jar
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Require-Bundle: org.apache.ant,
+ org.junit,
+ org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.ui.ide.application,
+ org.eclipse.equinox.app
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.eclipse.test
diff --git a/FROMCVS/org.eclipse.test/about.html b/FROMCVS/org.eclipse.test/about.html
new file mode 100755
index 000000000..460233046
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 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">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/FROMCVS/org.eclipse.test/automated.jar b/FROMCVS/org.eclipse.test/automated.jar
new file mode 100644
index 000000000..f05176b3b
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/automated.jar
Binary files differ
diff --git a/FROMCVS/org.eclipse.test/build.properties b/FROMCVS/org.eclipse.test/build.properties
new file mode 100755
index 000000000..12440abbc
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/build.properties
@@ -0,0 +1,21 @@
+###############################################################################
+# 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
+###############################################################################
+
+source.automated.jar =src/
+bin.includes = plugin.properties,\
+ lib/,\
+ *.jar,\
+ *.XSL,\
+ library.xml,\
+ plugin.xml,\
+ runtests*,\
+ *.html,\
+ META-INF/
diff --git a/FROMCVS/org.eclipse.test/easymock.psf b/FROMCVS/org.eclipse.test/easymock.psf
new file mode 100755
index 000000000..e3005d553
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/easymock.psf
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<psf version="2.0">
+<provider id="org.eclipse.team.cvs.core.cvsnature">
+<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/tools,org.eclipse.orbit/org.easymock,org.easymock,v2_4"/>
+</provider>
+</psf> \ No newline at end of file
diff --git a/FROMCVS/org.eclipse.test/lib/CVS/Entries b/FROMCVS/org.eclipse.test/lib/CVS/Entries
new file mode 100644
index 000000000..67249d812
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/lib/CVS/Entries
@@ -0,0 +1,3 @@
+/jacocoagent.jar/1.3/Fri Mar 4 12:54:31 2011/-kb/Tv20110511
+/jacocoant.jar/1.3/Fri Mar 4 12:54:31 2011/-kb/Tv20110511
+D
diff --git a/FROMCVS/org.eclipse.test/lib/CVS/Repository b/FROMCVS/org.eclipse.test/lib/CVS/Repository
new file mode 100644
index 000000000..2ee0433be
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/lib/CVS/Repository
@@ -0,0 +1 @@
+org.eclipse.test/lib
diff --git a/FROMCVS/org.eclipse.test/lib/CVS/Root b/FROMCVS/org.eclipse.test/lib/CVS/Root
new file mode 100644
index 000000000..2d37d165b
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/lib/CVS/Root
@@ -0,0 +1 @@
+:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse
diff --git a/FROMCVS/org.eclipse.test/lib/CVS/Tag b/FROMCVS/org.eclipse.test/lib/CVS/Tag
new file mode 100644
index 000000000..4badce0da
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/lib/CVS/Tag
@@ -0,0 +1 @@
+Nv20110511
diff --git a/FROMCVS/org.eclipse.test/lib/jacocoagent.jar b/FROMCVS/org.eclipse.test/lib/jacocoagent.jar
new file mode 100755
index 000000000..4cc2ec64f
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/lib/jacocoagent.jar
Binary files differ
diff --git a/FROMCVS/org.eclipse.test/lib/jacocoant.jar b/FROMCVS/org.eclipse.test/lib/jacocoant.jar
new file mode 100755
index 000000000..da06897d1
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/lib/jacocoant.jar
Binary files differ
diff --git a/FROMCVS/org.eclipse.test/library.xml b/FROMCVS/org.eclipse.test/library.xml
new file mode 100755
index 000000000..9cdc72598
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/library.xml
@@ -0,0 +1,179 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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 -Xmx512M -XX:MaxPermSize=500m">
+ <equals arg1="${test.target}" arg2="performance" />
+ </condition>
+ <tstamp prefix="NOW" />
+ <property name="coverage-output" value="${eclipse-home}/coverage" />
+ <property file="${basedir}/finalPluginsVersions.properties" />
+ <echo message="basedir = ${basedir}" />
+ <condition property="extraVMargs" value="-javaagent:${basedir}/plugins/org.eclipse.test_${org.eclipse.test}/lib/jacocoagent.jar=destfile=${coverage-output}/jacoco${classname}${NOW.DSTAMP}_${NOW.TSTAMP}.exec">
+ <not>
+ <equals arg1="${test.target}" arg2="performance" />
+ </not>
+ </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}" />
+ <property name="junit-stylesheet" value="${eclipse-home}/dropins/eclipse/plugins/org.eclipse.test/JUNIT.XSL" />
+ </target>
+
+ <target name="core-test" description="Eclipse application used to launch HEADLESS plugin tests." depends="init">
+ <antcall target="${launchTarget}">
+ <param name="application" value="org.eclipse.test.coretestapplication" />
+ </antcall>
+ </target>
+
+ <target name="ui-test" description="Eclipse application used to launch UI plugin tests." depends="init">
+ <antcall target="${launchTarget}">
+ <param name="application" value="org.eclipse.test.uitestapplication" />
+ </antcall>
+ </target>
+
+ <target name="java-test">
+ <!--default vm args-->
+ <condition property="vmargs" value=" -Xms40m -Xmx384m -XX:MaxPermSize=256m">
+ <os family="windows" />
+ </condition>
+ <property name="vmargs" value=" -Xms40m -Xmx384m -XX:MaxPermSize=256m" />
+
+ <!--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="-timeout ${timeout}" />
+ <jvmarg line="${vmargs} ${extraVMargs}" />
+ <sysproperty key="PLUGIN_PATH" value="${plugin-path}" />
+ </java>
+ <antcall target="collect-results" />
+ </target>
+
+ <target name="eclipse-test" description="Runs the specified classname as a plug-in test.">
+ <property name="vmargs" value="-Xms256m -Xmx512m -XX:MaxPermSize=256m" />
+
+ <!--use -consolelog if launching a headless test-->
+ <condition property="consolelog" value="-consolelog">
+ <equals arg1="${application}" arg2="org.eclipse.test.coretestapplication" />
+ </condition>
+ <property name="consolelog" value="" />
+
+ <!--
+ vm selection priority:
+ 1. user-specified java executable via outer Ant property setting of "jvm".
+ 2. java executable on path.
+ -->
+ <condition property="test-vm" value="-vm ${jvm}">
+ <isset property="jvm" />
+ </condition>
+ <property name="test-vm" value="" />
+
+ <!--ensure executable has execute permission-->
+ <chmod file="${eclipse-home}/eclipse" perm="ugo+rx" />
+
+
+ <echo message="Running ${classname}. Result file: ${junit-report-output}/${classname}.xml." />
+
+ <exec executable="${eclipse-home}/eclipse" dir="${eclipse-home}" timeout="${timeout}" logError="true" failonerror="false" output="${junit-report-output}/${classname}.txt">
+ <arg line="-data ${data-dir}" />
+ <arg line="${test-vm}" />
+ <arg line="-application ${application}" />
+ <arg line="formatter=${formatter},${test-output}" />
+ <arg line="-testPluginName ${plugin-name}" />
+ <arg line="-className ${classname}" />
+ <arg line="-nosplash" />
+ <arg line="--launcher.suppressErrors" />
+ <arg line="${consolelog}" />
+ <arg line="-vmargs ${vmargs} ${extraVMargs} -DPLUGIN_PATH=${plugin-path}" />
+ </exec>
+ <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>
+
+ <xslt style="${junit-stylesheet}" 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/FROMCVS/org.eclipse.test/plugin.properties b/FROMCVS/org.eclipse.test/plugin.properties
new file mode 100755
index 000000000..16a13b9ea
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/plugin.properties
@@ -0,0 +1,12 @@
+###############################################################################
+# Copyright (c) 2000, 2005 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
+###############################################################################
+pluginName = Eclipse Automated Testing
+providerName = Eclipse.org
diff --git a/FROMCVS/org.eclipse.test/plugin.xml b/FROMCVS/org.eclipse.test/plugin.xml
new file mode 100755
index 000000000..4a148197c
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/plugin.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+ <extension
+ id="coretestapplication"
+ point="org.eclipse.core.runtime.applications">
+ <application>
+ <run
+ class="org.eclipse.test.CoreTestApplication">
+ </run>
+ </application>
+ </extension>
+ <extension
+ id="uitestapplication"
+ point="org.eclipse.core.runtime.applications">
+ <application>
+ <run
+ class="org.eclipse.test.UITestApplication">
+ <parameter
+ name="productInfo"
+ value="product.ini">
+ </parameter>
+ </run>
+ </application>
+ </extension>
+
+</plugin>
diff --git a/FROMCVS/org.eclipse.test/pom.xml b/FROMCVS/org.eclipse.test/pom.xml
new file mode 100644
index 000000000..540201b19
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/pom.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>fromcvs</groupId>
+ <artifactId>FROMCVS</artifactId>
+ <version>3.8.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.eclipse.test</groupId>
+ <artifactId>org.eclipse.test</artifactId>
+ <version>3.3.100-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+
+</project>
diff --git a/FROMCVS/org.eclipse.test/src/CVS/Entries b/FROMCVS/org.eclipse.test/src/CVS/Entries
new file mode 100644
index 000000000..381094d5a
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/src/CVS/Entries
@@ -0,0 +1 @@
+D/org////
diff --git a/FROMCVS/org.eclipse.test/src/CVS/Repository b/FROMCVS/org.eclipse.test/src/CVS/Repository
new file mode 100644
index 000000000..71137dd81
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/src/CVS/Repository
@@ -0,0 +1 @@
+org.eclipse.test/src
diff --git a/FROMCVS/org.eclipse.test/src/CVS/Root b/FROMCVS/org.eclipse.test/src/CVS/Root
new file mode 100644
index 000000000..2d37d165b
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/src/CVS/Root
@@ -0,0 +1 @@
+:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse
diff --git a/FROMCVS/org.eclipse.test/src/CVS/Tag b/FROMCVS/org.eclipse.test/src/CVS/Tag
new file mode 100644
index 000000000..eef882d97
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/src/CVS/Tag
@@ -0,0 +1 @@
+Tv20110511
diff --git a/FROMCVS/org.eclipse.test/src/org/CVS/Entries b/FROMCVS/org.eclipse.test/src/org/CVS/Entries
new file mode 100644
index 000000000..0f148f81c
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/src/org/CVS/Entries
@@ -0,0 +1 @@
+D/eclipse////
diff --git a/FROMCVS/org.eclipse.test/src/org/CVS/Repository b/FROMCVS/org.eclipse.test/src/org/CVS/Repository
new file mode 100644
index 000000000..559ddf1d6
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/src/org/CVS/Repository
@@ -0,0 +1 @@
+org.eclipse.test/src/org
diff --git a/FROMCVS/org.eclipse.test/src/org/CVS/Root b/FROMCVS/org.eclipse.test/src/org/CVS/Root
new file mode 100644
index 000000000..2d37d165b
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/src/org/CVS/Root
@@ -0,0 +1 @@
+:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse
diff --git a/FROMCVS/org.eclipse.test/src/org/CVS/Tag b/FROMCVS/org.eclipse.test/src/org/CVS/Tag
new file mode 100644
index 000000000..eef882d97
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/src/org/CVS/Tag
@@ -0,0 +1 @@
+Tv20110511
diff --git a/FROMCVS/org.eclipse.test/src/org/eclipse/CVS/Entries b/FROMCVS/org.eclipse.test/src/org/eclipse/CVS/Entries
new file mode 100644
index 000000000..2bde73d53
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/src/org/eclipse/CVS/Entries
@@ -0,0 +1 @@
+D/test////
diff --git a/FROMCVS/org.eclipse.test/src/org/eclipse/CVS/Repository b/FROMCVS/org.eclipse.test/src/org/eclipse/CVS/Repository
new file mode 100644
index 000000000..c390a2857
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/src/org/eclipse/CVS/Repository
@@ -0,0 +1 @@
+org.eclipse.test/src/org/eclipse
diff --git a/FROMCVS/org.eclipse.test/src/org/eclipse/CVS/Root b/FROMCVS/org.eclipse.test/src/org/eclipse/CVS/Root
new file mode 100644
index 000000000..2d37d165b
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/src/org/eclipse/CVS/Root
@@ -0,0 +1 @@
+:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse
diff --git a/FROMCVS/org.eclipse.test/src/org/eclipse/CVS/Tag b/FROMCVS/org.eclipse.test/src/org/eclipse/CVS/Tag
new file mode 100644
index 000000000..eef882d97
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/src/org/eclipse/CVS/Tag
@@ -0,0 +1 @@
+Tv20110511
diff --git a/FROMCVS/org.eclipse.test/src/org/eclipse/test/CVS/Entries b/FROMCVS/org.eclipse.test/src/org/eclipse/test/CVS/Entries
new file mode 100644
index 000000000..87e44c067
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/src/org/eclipse/test/CVS/Entries
@@ -0,0 +1,5 @@
+/CoreTestApplication.java/1.25/Wed Sep 29 12:58:00 2010/-ko/Tv20110511
+/EclipseTestRunner.java/1.39/Wed May 11 13:25:14 2011/-ko/Tv20110511
+/RegressionTest.java/1.7/Wed Jun 6 18:13:19 2007/-ko/Tv20110511
+/UITestApplication.java/1.27/Wed Sep 29 12:58:00 2010/-ko/Tv20110511
+D
diff --git a/FROMCVS/org.eclipse.test/src/org/eclipse/test/CVS/Repository b/FROMCVS/org.eclipse.test/src/org/eclipse/test/CVS/Repository
new file mode 100644
index 000000000..fc4894fce
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/src/org/eclipse/test/CVS/Repository
@@ -0,0 +1 @@
+org.eclipse.test/src/org/eclipse/test
diff --git a/FROMCVS/org.eclipse.test/src/org/eclipse/test/CVS/Root b/FROMCVS/org.eclipse.test/src/org/eclipse/test/CVS/Root
new file mode 100644
index 000000000..2d37d165b
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/src/org/eclipse/test/CVS/Root
@@ -0,0 +1 @@
+:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse
diff --git a/FROMCVS/org.eclipse.test/src/org/eclipse/test/CVS/Tag b/FROMCVS/org.eclipse.test/src/org/eclipse/test/CVS/Tag
new file mode 100644
index 000000000..4badce0da
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/src/org/eclipse/test/CVS/Tag
@@ -0,0 +1 @@
+Nv20110511
diff --git a/FROMCVS/org.eclipse.test/src/org/eclipse/test/CoreTestApplication.java b/FROMCVS/org.eclipse.test/src/org/eclipse/test/CoreTestApplication.java
new file mode 100755
index 000000000..25fb39a8b
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/src/org/eclipse/test/CoreTestApplication.java
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 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
+ *******************************************************************************/
+package org.eclipse.test;
+
+import java.io.IOException;
+import org.eclipse.core.runtime.IPlatformRunnable;
+import org.eclipse.core.runtime.Platform;
+
+/**
+ * A an application that launches tests once it is started.
+ * @deprecated As using deprecated materials
+ */
+public class CoreTestApplication implements IPlatformRunnable {
+ /** true if workspace tests should log their deltas */
+ private static boolean deltas= false;
+
+ /**
+ * Runs a set of tests as defined by the given command line args.
+ * This is the platform application entry point.
+ * @see IPlatformRunnable
+ */
+ public Object run(Object arguments) throws Exception {
+ String[] args= Platform.getCommandLineArgs();//getCommand//processCommandLine((String[]) arguments);
+ return new Integer(runTests(args));
+ }
+
+ protected int runTests(String[] args) throws IOException {
+ return EclipseTestRunner.run(args);
+ }
+
+ public static boolean deltasEnabled() {
+ return deltas;
+ }
+
+ protected String[] processCommandLine(String[] args) {
+ int[] configArgs = new int[100];
+ configArgs[0] = -1; // need to initialize the first element to something that could not be an index.
+ int configArgIndex = 0;
+ for (int i = 0; i < args.length; i++) {
+ boolean found = false;
+ // check for args without parameters (i.e., a flag arg)
+ // see if we should be logging deltas
+ if (args[i].equalsIgnoreCase("-deltas")) {
+ found = true;
+ deltas = true;
+ }
+ if (found) {
+ configArgs[configArgIndex++] = i;
+ continue;
+ }
+
+ // check for args with parameters
+ if (i == args.length - 1 || args[i + 1].startsWith("-")) {
+ continue;
+ }
+ ++i;
+
+ // done checking for args. Remember where an arg was found
+ if (found) {
+ configArgs[configArgIndex++] = i - 1;
+ configArgs[configArgIndex++] = i;
+ }
+ }
+
+ //remove all the arguments consumed by this argument parsing
+ if (configArgIndex == 0)
+ return args;
+ String[] passThruArgs = new String[args.length - configArgIndex];
+ configArgIndex = 0;
+ int j = 0;
+ for (int i = 0; i < args.length; i++) {
+ if (i == configArgs[configArgIndex])
+ configArgIndex++;
+ else
+ passThruArgs[j++] = args[i];
+ }
+ return passThruArgs;
+ }
+}
diff --git a/FROMCVS/org.eclipse.test/src/org/eclipse/test/EclipseTestRunner.java b/FROMCVS/org.eclipse.test/src/org/eclipse/test/EclipseTestRunner.java
new file mode 100755
index 000000000..12f133aa0
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/src/org/eclipse/test/EclipseTestRunner.java
@@ -0,0 +1,697 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2011 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
+ * Anthony Dahanne <anthony.dahanne@compuware.com> - enhance ETF to be able to launch several tests in several bundles - https://bugs.eclipse.org/330613
+ *******************************************************************************/
+package org.eclipse.test;
+
+import java.io.ByteArrayOutputStream;
+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.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Properties;
+import java.util.Timer;
+import java.util.TimerTask;
+import java.util.Vector;
+
+import junit.framework.AssertionFailedError;
+import junit.framework.Test;
+import junit.framework.TestListener;
+import junit.framework.TestResult;
+import junit.framework.TestSuite;
+
+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.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
+
+/**
+ * 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";
+ /**
+ * The current test result
+ */
+ private TestResult fTestResult;
+ /**
+ * The name of the plugin containing the test
+ */
+ private String fTestPluginName;
+ /**
+ * The corresponding testsuite.
+ */
+ private Test fSuite;
+ /**
+ * Formatters from the command line.
+ */
+ private static Vector<JUnitResultFormatter> fgFromCmdLine= new Vector<JUnitResultFormatter>();
+ /**
+ * Holds the registered formatters.
+ */
+ private Vector<JUnitResultFormatter> formatters= new Vector<JUnitResultFormatter>();
+ /**
+ * 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 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 classesNames = null;
+ String testPluginName = null;
+ String testPluginsNames = null;
+ String formatterString =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("-")) {
+ className= args[0];
+ startArgs++;
+ }
+ }
+ for (int i= startArgs; i < args.length; i++) {
+ if (args[i].toLowerCase().equals("-classname")) {
+ if (i < args.length-1)
+ className= args[i+1];
+ i++;
+ } else if (args[i].toLowerCase().equals("-classesnames")) {
+ if (i < args.length-1)
+ classesNames= args[i+1];
+ i++;
+ } else if (args[i].toLowerCase().equals("-testpluginname")) {
+ if (i < args.length-1)
+ testPluginName= args[i+1];
+ i++;
+ } else if (args[i].toLowerCase().equals("-testpluginsnames")) {
+ if (i < args.length-1)
+ testPluginsNames= args[i+1];
+ i++;
+ } else if (args[i].startsWith("haltOnError=")) {
+ haltError= Project.toBoolean(args[i].substring(12));
+ } else if (args[i].startsWith("haltOnFailure=")) {
+ haltFail = Project.toBoolean(args[i].substring(14));
+ } else if (args[i].startsWith("formatter=")) {
+ formatterString = args[i].substring(10);
+ } else if (args[i].startsWith("propsfile=")) {
+ FileInputStream in = new FileInputStream(args[i].substring(10));
+ props.load(in);
+ in.close();
+ } else if (args[i].equals("-testlistener")) {
+ System.err.println("The -testlistener option is no longer supported\nuse the formatter= option instead");
+ return ERRORS;
+ } else if (args[i].equals("-timeout")) {
+ if (i < args.length-1)
+ startStackDumpTimoutTimer(args[i+1]);
+ i++;
+ }
+ }
+ // Add/overlay system properties on the properties from the Ant project
+ Hashtable<Object, Object> p= System.getProperties();
+ for (Enumeration<Object> _enum = p.keys(); _enum.hasMoreElements(); ) {
+ Object key = _enum.nextElement();
+ props.put(key, p.get(key));
+ }
+ if (testPluginsNames != null && classesNames != null) {
+ // we have several plugins to look tests for, let's parse their
+ // names
+ String[] testPlugins = testPluginsNames.split(",");
+ String[] suiteClasses = classesNames.split(",");
+ try {
+ createAndStoreFormatter(formatterString,suiteClasses);
+ } catch (BuildException be) {
+ System.err.println(be.getMessage());
+ return ERRORS;
+ }
+ int returnCode=0;
+ int j=0;
+ for (String oneClassName : suiteClasses) {
+ JUnitTest t = new JUnitTest(oneClassName);
+ t.setProperties(props);
+ EclipseTestRunner runner = new EclipseTestRunner(t, testPlugins[j],
+ haltError, haltFail);
+ transferFormatters(runner,j);
+ runner.run();
+ j++;
+ if(runner.getRetCode()!=0){
+ returnCode=runner.getRetCode();
+ }
+ }
+ return returnCode;
+ }
+ try {
+ createAndStoreFormatter(formatterString);
+ } catch (BuildException be) {
+ System.err.println(be.getMessage());
+ return ERRORS;
+ }
+ if (className == null)
+ throw new IllegalArgumentException("Test class name not specified");
+
+ JUnitTest t= new JUnitTest(className);
+
+ t.setProperties(props);
+
+ EclipseTestRunner runner= new EclipseTestRunner(t, testPluginName, haltError, haltFail);
+ transferFormatters(runner);
+ runner.run();
+ return runner.getRetCode();
+ }
+
+ /**
+ * Starts a timer that dumps all stack traces shortly before the given timeout expires.
+ *
+ * @param timeoutArg the -timeout argument from the command line
+ */
+ private static void startStackDumpTimoutTimer(final String timeoutArg) {
+ try {
+ /* The delay (in ms) is the sum of
+ * - the expected time it took for launching the current VM and reaching this method
+ * - the time it will take to dump all threads
+ */
+ int delay= 30000;
+
+ int timeout= Integer.parseInt(timeoutArg) - delay;
+ if (timeout > 0) {
+ new Timer("EclipseTestRunnerTimer", true).schedule(new TimerTask() {
+ @Override
+ public void run() {
+ dump();
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ // continue
+ }
+ dump();
+ }
+
+ private void dump() {
+ System.err.println("EclipseTestRunner almost reached timeout '" + timeoutArg + "'.");
+ System.err.println("totalMemory: " + Runtime.getRuntime().totalMemory());
+ System.err.println("freeMemory (before GC): " + Runtime.getRuntime().freeMemory());
+ System.gc();
+ System.err.println("freeMemory (after GC): " + Runtime.getRuntime().freeMemory());
+ String time= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z").format(new Date());
+ System.err.println("Thread dump at " + time + ":");
+ Map<Thread, StackTraceElement[]> stackTraces = Thread.getAllStackTraces();
+ for (Entry<Thread, StackTraceElement[]> entry : stackTraces.entrySet()) {
+ String name= entry.getKey().getName();
+ StackTraceElement[] stack= entry.getValue();
+ Exception exception= new Exception(name);
+ exception.setStackTrace(stack);
+ exception.printStackTrace();
+ }
+
+ final Display display= Display.getDefault();
+ display.syncExec(new Runnable() {
+ public void run() {
+ Control focusControl= display.getFocusControl();
+ if (focusControl != null) {
+ System.err.println("FocusControl: ");
+ StringBuilder indent= new StringBuilder(" ");
+ do {
+ System.err.println(indent.toString() + focusControl);
+ focusControl= focusControl.getParent();
+ indent.append(" ");
+ } while (focusControl != null);
+ }
+ Shell[] shells= display.getShells();
+ if (shells.length > 0) {
+ System.err.println("Shells: ");
+ for (int i= 0; i < shells.length; i++) {
+ Shell shell= shells[i];
+ System.err.println((shell.isVisible() ? " visible: " : " invisible: ") + shell);
+ }
+ }
+ }
+ });
+ }
+ }, timeout);
+ }
+ } catch (NumberFormatException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ *
+ */
+ public EclipseTestRunner(JUnitTest test, String testPluginName, boolean haltOnError, boolean haltOnFailure) {
+ fJunitTest= test;
+ fTestPluginName= testPluginName;
+ fHaltOnError= haltOnError;
+ fHaltOnFailure= haltOnFailure;
+
+ try {
+ fSuite= getTest(test.getName());
+ } catch(Exception e) {
+ fRetCode = ERRORS;
+ fException = e;
+ }
+ }
+
+ /**
+ * Returns the Test corresponding to the given suite.
+ */
+ protected Test 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+"\"");
+ return null;
+ } catch(Exception e) {
+ runFailed(e);
+ return null;
+ }
+ Method suiteMethod= null;
+ try {
+ suiteMethod= testClass.getMethod(SUITE_METHODNAME, new Class[0]);
+ } catch(Exception e) {
+ // try to extract a test suite automatically
+ clearStatus();
+
+ Class<?> jUnit4TestAdapterClass= null;
+ try {
+ jUnit4TestAdapterClass= loadSuiteClass("junit.framework.JUnit4TestAdapter");
+ } catch (ClassNotFoundException e1) {
+ // JUnit4 is not available
+ } catch (UnsupportedClassVersionError e1) {
+ // running with a VM < 1.5
+ }
+ if (jUnit4TestAdapterClass != null) {
+ try {
+ Constructor<?> jUnit4TestAdapterCtor= jUnit4TestAdapterClass.getConstructor(new Class[] { Class.class });
+ return (Test) jUnit4TestAdapterCtor.newInstance(new Object[] { testClass });
+ } catch (Exception e1) {
+ runFailed(new InvocationTargetException(e1, "Failed to create a JUnit4TestAdapter for \"" + suiteClassName + "\":"));
+ return null;
+ }
+ } else { // the JUnit 3 way
+ return new TestSuite(testClass);
+ }
+ }
+ if (!Modifier.isStatic(suiteMethod.getModifiers())) {
+ runFailed("suite() method must be static");
+ return null;
+ }
+ Test test= null;
+ try {
+ test= (Test)suiteMethod.invoke(null, (Object[])new Class[0]); // static method
+ if (test == null)
+ return test;
+ }
+ catch (InvocationTargetException e) {
+ runFailed("Failed to invoke suite():" + e.getTargetException().toString());
+ return null;
+ }
+ catch (IllegalAccessException e) {
+ runFailed("Failed to invoke suite():" + e.toString());
+ return null;
+ }
+ clearStatus();
+ return test;
+ }
+
+ 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 + "\""));
+ }
+
+ //is the plugin a fragment?
+ Dictionary<String, String> headers = bundle.getHeaders();
+ String hostHeader = 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);
+ }
+ 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);
+
+ 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++) {
+ formatters.elementAt(i).startTestSuite(fJunitTest);
+ }
+ }
+
+ private void fireEndTestSuite() {
+ for (int i= 0; i < formatters.size(); i++) {
+ 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));
+ }
+
+ /**
+ * Line format is: formatter=<pathname>
+ */
+ private static void createAndStoreFormatter(String line, String...suiteClassesNames )
+ throws BuildException {
+ String formatterClassName = null;
+ File formatterFile = null;
+
+ int pos = line.indexOf(',');
+ if (pos == -1) {
+ formatterClassName = line;
+ } else {
+ formatterClassName = line.substring(0, pos);
+ }
+ File outputDirectory = new File(line.substring(pos + 1));
+ outputDirectory.mkdir();
+ for (String suiteClassName : suiteClassesNames) {
+
+ String pathname = "TEST-"+suiteClassName+".xml";
+ if(outputDirectory!=null && outputDirectory.exists()){
+ pathname = outputDirectory.getAbsolutePath() +"/"+pathname;
+ }
+ formatterFile = new File(pathname);
+ fgFromCmdLine.addElement(createFormatter(formatterClassName,
+ formatterFile));
+
+ }
+
+ }
+
+ private static void transferFormatters(EclipseTestRunner runner, int j) {
+ runner.addFormatter(fgFromCmdLine.elementAt(j));
+ }
+
+ private static void transferFormatters(EclipseTestRunner runner) {
+ for (int i= 0; i < fgFromCmdLine.size(); i++) {
+ runner.addFormatter(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");
+ }
+ 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");
+ }
+
+ 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 =
+ 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/FROMCVS/org.eclipse.test/src/org/eclipse/test/RegressionTest.java b/FROMCVS/org.eclipse.test/src/org/eclipse/test/RegressionTest.java
new file mode 100755
index 000000000..487db1c1e
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/src/org/eclipse/test/RegressionTest.java
@@ -0,0 +1,187 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 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
+ *******************************************************************************/
+package org.eclipse.test;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.StringTokenizer;
+import java.io.ByteArrayOutputStream;
+
+/**
+ * Check the output of several tests for regressions.
+ */
+public class RegressionTest {
+
+ PrintStream output;
+ String oldFilename, newFilename, outFilename;
+ public static final String NOTHING_CHANGED_MSG
+ = "All tests unchanged.";
+ /**
+ * Constructor for RegressionTest
+ */
+ public RegressionTest( String oldFilename,
+ String newFilename,
+ String outFilename) {
+ this.oldFilename = oldFilename;
+ this.newFilename = newFilename;
+ this.outFilename = outFilename;
+ }
+
+ public static void main(String[] argv) {
+ if (argv.length < 3) {
+ System.err.println("Error: too few arguments");
+ System.err.println("Usage: (progname) oldfile newfile outfile");
+ } else {
+ // ASSERT: The program has at least the correct number of arguments
+ RegressionTest rt = new RegressionTest(argv[0], argv[1], argv[2]);
+ rt.testRegressions();
+ }
+ }
+
+ /**
+ * Test for regressions in the test suite.
+ */
+ public void testRegressions() {
+ // Read the old and new files
+ String oldPass = "";
+ String newPass = "";
+ try {
+ oldPass = readFile(oldFilename);
+ newPass = readFile(newFilename);
+ } catch (Exception e) {
+ System.err.println("Error opening input file");
+ System.err.println(e.getMessage());
+ System.exit(-1);
+ }
+
+ try {
+ output = new PrintStream(
+ new BufferedOutputStream(
+ new FileOutputStream(
+ new File(outFilename))));
+ } catch (Exception e) {
+ System.err.println("Error opening output file");
+ System.err.println(e.getMessage());
+ System.exit(-1);
+ }
+ // Establish their relationship
+ StringTokenizer oldst = new StringTokenizer(oldPass);
+ StringTokenizer newst = new StringTokenizer(newPass);
+
+ String[] oldTest = nextTest(oldst);
+ String[] newTest = nextTest(newst);
+
+ boolean nothingChanged = true;
+ while (oldTest != null && newTest != null) {
+
+ // Compare the two test names
+ int compareName = oldTest[0].compareTo(newTest[0]);
+ if (compareName == 0) {
+ int compareStatus = oldTest[1].compareTo(newTest[1]);
+ if (compareStatus != 0) {
+ nothingChanged = false;
+ output.println(testChanged(newTest));
+ }
+ oldTest = nextTest(oldst);
+ newTest = nextTest(newst);
+ } else if (compareName < 0) {
+ // oldTestName comes first
+ output.println(testNotRun(oldTest));
+ oldTest = nextTest(oldst);
+ nothingChanged = false;
+ } else {
+ // newTestName comes first
+ output.println(testAdded(newTest));
+ newTest = nextTest(newst);
+ nothingChanged = false;
+ }
+ }
+ // Make sure all tests are parsed
+ while (oldTest != null) {
+ // oldTestName comes first
+ output.println(testNotRun(oldTest));
+ oldTest = nextTest(oldst);
+ nothingChanged = false;
+ }
+ while (newTest != null) {
+ // newTestName comes first
+ output.println(testAdded(newTest));
+ newTest = nextTest(newst);
+ nothingChanged = false;
+ }
+ // Make sure that there is always some output.
+ if (nothingChanged) {
+ output.println(NOTHING_CHANGED_MSG);
+ }
+ output.close();
+ }
+
+ /**
+ * Get the message for when a test is not run.
+ */
+ static String testNotRun(String[] test) {
+ return "Not run: " + test[0];
+ }
+
+ /**
+ * Get the message for when a test's status changes.
+ */
+ static String testChanged(String[] test) {
+ return "Changed: " + test[0] + ", " + test[1];
+ }
+
+ /**
+ * Get the message for when a test is added.
+ */
+ static String testAdded(String[] test) {
+ return "New test: " + test[0] + ", Status: " + test[1];
+ }
+
+ /**
+ * Read the file given by s, and return its contents.
+ */
+ static String readFile(String s) throws IOException {
+ byte[] buf = new byte[8192];
+ FileInputStream r = new FileInputStream(s);
+ ByteArrayOutputStream aStream = new ByteArrayOutputStream();
+ int n;
+ while ((n = r.read(buf)) != -1) {
+ aStream.write(buf, 0, n);
+ }
+ r.close();
+ return aStream.toString();
+ }
+
+
+ /**
+ * Returns the next 2 tokens in st, if they exist.
+ * Returns null if they do not.
+ */
+ static String[] nextTest(StringTokenizer st) {
+ String[] test = new String[2];
+ if (st.hasMoreTokens()) {
+ test[0] = st.nextToken();
+ } else {
+ return null;
+ }
+ if (st.hasMoreTokens()) {
+ test[1] = st.nextToken();
+ } else {
+ return null;
+ }
+ return test;
+ }
+}
+
diff --git a/FROMCVS/org.eclipse.test/src/org/eclipse/test/UITestApplication.java b/FROMCVS/org.eclipse.test/src/org/eclipse/test/UITestApplication.java
new file mode 100755
index 000000000..ec713fd66
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/src/org/eclipse/test/UITestApplication.java
@@ -0,0 +1,222 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2010 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
+ *******************************************************************************/
+package org.eclipse.test;
+
+import java.io.IOException;
+
+import junit.framework.Assert;
+
+import org.eclipse.equinox.app.IApplication;
+import org.eclipse.equinox.app.IApplicationContext;
+
+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.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;
+
+/**
+ * A Workbench that runs a test suite specified in the command line arguments.
+ *
+ * @deprecated As using deprecated materials
+ */
+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;
+ 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);
+ }
+ 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();
+ fTestableObject.runTest(new Runnable() {
+ public void run() {
+ try {
+ fTestRunnerResult = EclipseTestRunner.run(Platform.getCommandLineArgs());
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ });
+ fTestableObject.testingFinished();
+ }
+
+
+ public Object start(IApplicationContext context) throws Exception {
+ this.appContext = context;
+ String[] args = (String[]) appContext.getArguments().get("application.args");
+ if (args == null)
+ args = new String[0];
+ return run(args);
+ }
+
+
+ public void stop() {
+ // TODO Auto-generated method stub
+
+ }
+
+}
+
diff --git a/FROMCVS/org.eclipse.test/testframework.html b/FROMCVS/org.eclipse.test/testframework.html
new file mode 100755
index 000000000..878cf0bd2
--- /dev/null
+++ b/FROMCVS/org.eclipse.test/testframework.html
@@ -0,0 +1,279 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Eclipse Testing Instructions</title>
+</head>
+
+<body>
+<h1>The Eclipse Test Framework</h1><p>Last Modified: June 13, 2007</p><p><font size="+1"><br>
+ Introduction</font></p><p>The testing framework is comprised of the org.eclipse.test plugin and the org.eclipse.ant.optional.junit
+ fragment. </p><p>These two projects are available from the dev.eclipse.org repository and are
+ included in the eclipse-test-framework-&lt;buildId&gt;.zip from the eclipse.org
+ downloads page.</p><p><font size="+1">Building and Installation</font></p><p>Since the org.eclipse.test plugin is stored in the repository in source-code
+ form, it needs to be compiled before it can be used. The org.eclipse.ant.optional.junit
+ fragment does not contain any source and can be used as is from the repository.</p><ol>
+ <li>Turn of automatic builds. Window->Preferences->Workbench and uncheck "Perform
+ build automatically on resource modification"</li><li>Load org.eclipse.test into your workspace.</li><li>Right-click on the org.eclipse.test project in either the Navigator or Packages
+ view. Select 'Rebuild Project' from the context menu. This will compile the
+ entire org.eclipse.test plugin.</li><li>Finally, copy the org.eclipse.test plugin into your target Eclipse.</li>
+ <li>The org.eclipse.ant.optional.junit fragment only needs to be present in
+ the environment of the Eclipse that is overseeing the test process. If you
+ are running the test script from within the Workbench, this means that the
+ fragments need to be present withinn your development Eclipse. If you are
+ running the tests from the command line, then the fragments will need to be
+ present in your target Eclipse.</li></ol>
+ <p><font size="+1">Setup</font></p>
+ <p>Follow the steps given above to build and install all of the neccessary plugins
+ and fragments. Please note that the current version of the test framework is
+ not compatible with the PDE notion of self-hosting. If you want to run the tests,
+ you will need to setup a full target Eclipse so that the testing framework can
+ detect everything that is needed.</p>
+<p>If you are writing tests for one or more Eclipse plugins, then you should
+create a separate plugin for tests. The test plugin will contain all of the
+tests that will be run on your development plugins, as well as defining how
+those tests get run.</p>
+
+<p>If you are not writing tests for an Eclipse plugin, then you should look into
+ using JUnit on its own to test your work. JUnit is designed for testing Java
+ code, and by default has no knowledge of Eclipse. There are separate mechanisms
+ for using JUnit on Java code in Eclipse. See the documentation provided here:</p>
+<p> <a href="http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/jdt-ui-home/plugins/org.eclipse.jdt.junit/index.html">
+JUnit Support in Eclipse</a><br>
+ <a href="http://dev.eclipse.org:8080/help/content/help:/org.eclipse.jdt.doc.user/tasks/tasks-207.htm?resultof=%6a%75%6e%69%74%20&toc=%2Forg.eclipse.jdt.doc.user%2Ftoc.xml">
+ Using JUnit</a></p>
+
+ <p>Once a test plugin has been created, you must then create an Ant script that
+ will run all of the tests. Create a file called 'test.xml' in the root of your plug-in or bundle.
+ This is an Ant file that defines how each test is going to be run. The 'test.xml'
+ file is like a DOS batch file that scripts the entire testing process. Typically,
+ the 'test.xml' file will contain targets for setting up the test run, executing
+ the tests, cleaning up afterwards, and running the entire process.</p>
+
+ <p><font size="+1">Converting existing Test Suites</font></p>
+
+ <p>If you are converting an existing set of tests to use the new framework, the
+actual tests that have been written should not need much change.</p>
+ <p>If you have tests in multiple plugins, move these to a single test plug-in for your component.</p>
+
+ <p>Make sure that the tests are defined in a plug-in. This is probably the most
+ common cause of confusion in the entire test process. Your tests need to be
+ in a plug-in so that Eclipse can find them when it tries to load them.</p>
+
+ <p><font size="+1">Creating new Test Suites</font></p>
+
+ <p>Creating new JUnit tests for an Eclipse plugin should be no more difficult
+ than writing standard JUnit tests. Since the framework allows tests to be run
+ inside of a working Eclipse, any tests that you write have available to them
+ any of the methods supplied by the Eclipse platform, provided that you add the
+ appropriate dependencies to your tests' manifest.</p>
+
+ <p><font size="+1">Performance Issues</font></p>
+ <p>You should keep in mind the number of times that Eclipse needs to be
+started. Launching Eclipse has a substantial cost in terms of runtime. To
+minimize the number of times the platform is started, you should consider
+writing a TestSuite called AllTests for each of your test plugins. AllTests
+should invoke each of the tests that you want to run for a particular plugin.
+The 'test.xml' file can then run the AllTests class, which will run all of your
+tests, but the platform will only ever be started once for each of your test
+plugins.</p><p>Note: Sometimes tests involve shutting down, restarting, and testing the state
+ of metadata that was written to disk. These session tests will require Eclipse
+ to be launched several times in sequence, which will increase the runtime of
+ your tests. This cannot be avoided.</p><p>&nbsp;</p>
+
+ <p><font size="+1">Running the Test Suite from the UI</font></p><p>Right click on the test.xml file and select 'Run Ant...' from the pull-down
+ menu. The Running Ant dialog box pops up. From the list of targets, select the
+ one that runs all of your tests. If you are using the example file provided
+ below, this target is called 'Run', and will be selected by default. Hit the
+ 'Finish' button to start the test process.</p>
+
+ <p><font size="+1">Running the Test Suite from the command line</font></p>
+ <p>When the test suites are invoked automatically, they are run from command
+line. From the ${eclipse-home} directory, the command to use is:</p>
+<code>java -jar plugins\org.eclipse.equinox.launcher_&lt;version&gt;.jar -application org.eclipse.ant.core.antRunner -buildfile ${test-plugin-path}\test.xml
+-Declipse-home=${eclipse-home} -Dos=&lt;operating system&gt; -Dws=&lt;windowing system&gt; -Darch=&lt;architecture&gt;</code>
+
+<p>Individual tests can also be invoked directly. From the ${eclipse-home}
+directory, use the command:</p><code>java -jar plugins\org.eclipse.equinox.launcher_&lt;version&gt;.jar
+ -application ${launcher} -os &lt;operating system&gt; -ws &lt;windowing system&gt; -arch &lt;architecture&gt; -dev bin -testpluginname ${plugin-name}
+-classname ${test-classname} formattter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,&lt;path to output file with .xml extension&gt;</code>
+<p>where ${launcher} is one of: <i>org.eclipse.test.uitestapplication</i> or <i>org.eclipse.test.coretestapplication</i>
+ depending on whether or not you want to run your tests within an active Workbench.</p><p><font size="+1">Output</font></p><p>By default, output from each test run is logged as XML. For each test that
+ is run, the output is logged into the file called ${classname}.xml. The individual
+ XML files are located in the ${eclipse-home} directory. When the test run is
+ finished, you can call the <b>&quot;collect&quot;</b> target in the library
+ file, which will collect the XML into a single file. See below for an example
+ of how to use this target correctly.</p>
+
+<h3>Other issues</h3><h4>Headless Testing vs. UI testing</h4><p>Many plugin tests will not need the Workbench active in order to run. Indeed,
+ only the minimum number of plugins needed to run the plugin being tested need
+ to be present when testing in a target Eclipse. There are two different Ant
+ targets provided for running Eclipse plugin tests. One target starts the entire
+ Workbench. The other starts Eclipse with the minimum number of plugins needed.
+ It is up to you to decide which target is most appropriate. For examples, look
+ at the <b>&quot;ui-test&quot;</b> and <b>&quot;core-test&quot;</b> targets below.</p>
+
+<h4>Disposing the Display</h4><p>Some low-level tests for the Eclipse platform take actions that are not
+normally possible inside of Eclipse. An example of this behaviour would be
+disposing the display. While this action can be performed while running the UI,
+it will also kill the UI for the copy of Eclipse that is running, and cause
+errors when the Workbench tries to shutdown. If you need to test disposing the
+display, or other similar actions, your tests should be running without a UI. </p>
+
+<h4>Tests that are not plugins</h4><p>It is very easy to forget to define your tests inside of a plugin. If your
+ tests will not load properly, make sure that a plug-in manifest exists in your
+ test project, and also that the plugin is being loaded by the platform. Make
+ sure that all of the dependencies are satisfied for your test plugin.</p>
+
+<p><font size="+1">Interface</font></p><p>The org.eclipse.test plugin defines many useful Ant tasks/targets to aid developers
+ in writing their test.xml scripts. Currently, there is only Ant targets defined,
+ which can be called using Ant's built-in &lt;ant&gt; task. To use these targets,
+ add the following line to the top of your script, and reference the ${library-file}
+ property when calling &lt;ant&gt;:</p><code>&lt;property name=&quot;library-file&quot;
+value=&quot;${eclipse-home}/fragments/org.eclipse.test/library.xml&quot;/&gt; </code>
+
+<p>The targets that are defined are: </p><ul>
+ <li><b>ui-test</b> - This target runs a JUnit test suite inside of an Eclipse
+ Workbench. This target is mainly for testing plugins that use the Eclipse
+ UI and JFace. The output of the test pass is automatically logged in an XML
+ file called ${classname}.xml. It takes four arguments: </li><ul>
+ <li><i>data-dir</i> - The
+ data directory of the Eclipse that gets run</li><li><i>plugin-name</i> -
+ The name of the plugin that the test suite is defined in</li><li><i>classname</i> -
+ The name of the class that the test suite is defined in</li><li><i>vmargs</i> - An
+ optional argument string to pass to the VM running the tests</li></ul><p>For example, the following code will run the test
+org.eclipse.foo.bar.MyTest in the plugin org.eclipse.foo in a new Eclipse
+workbench. It passes the string &quot;-Dbaz=true&quot; to the VM. The Eclipse
+stores its metadata in the directory &quot;data-folder&quot;.
+
+<code><pre>
+&lt;ant target=&quot;ui-test&quot; antfile=&quot;${library-file}&quot; dir=&quot;${eclipse-home}&quot;&gt;
+ &lt;property name=&quot;data-dir&quot; value=&quot;data-folder&quot;/&gt;
+ &lt;property name=&quot;plugin-name&quot; value=&quot;org.eclipse.foo&quot;/&gt;
+ &lt;property name=&quot;classname&quot; value=&quot;org.eclipse.foo.bar.MyTest&quot;/&gt;
+ &lt;property name=&quot;vmargs&quot; value=&quot;-Dbaz=true&quot;/&gt;
+&lt;/ant&gt;
+</pre></code>
+
+ <li><b>core-test</b> - This target runs a JUnit test suite inside of an IPlatformRunnable.
+ This target is for testing plugins that use the Eclipse platform, but do not
+ require a UI to be running. The output of the test pass is automatically logged
+ in an XML file called ${classname}.xml. It takes four arguments: </li><ul>
+ <li><i>data-dir</i> - The
+ data directory of the Eclipse that gets run</li><li><i>plugin-name</i> -
+ The name of the plugin that the test suite is defined in</li><li><i>classname</i> -
+ The name of the class that the test suite is defined in</li><li><i>vmargs</i> - An
+ optional argument string to pass to the VM running the tests</li></ul><p>For example, the following code will run the test
+org.eclipse.foo.bar.MyTest in the plugin org.eclipse.foo in a headless Eclipse.
+It passes the string &quot;-Dbaz=true&quot; to the VM. The Eclipse stores its
+metadata in the directory &quot;data-folder&quot;.
+
+<code><pre>
+&lt;ant target=&quot;core-test&quot; antfile=&quot;${library-file}&quot; dir=&quot;${eclipse-home}&quot;&gt;
+ &lt;property name=&quot;data-dir&quot; value=&quot;data-folder&quot;/&gt;
+ &lt;property name=&quot;plugin-name&quot; value=&quot;org.eclipse.foo&quot;/&gt;
+ &lt;property name=&quot;classname&quot; value=&quot;org.eclipse.foo.bar.MyTest&quot;/&gt;
+ &lt;property name=&quot;vmargs&quot; value=&quot;-Dbaz=true&quot;/&gt;
+&lt;/ant&gt;
+</pre></code>
+
+ <li><b>collect</b> - This
+ target collects the XML files that are produced over the course of the
+ test script. It takes two arguments: </li><ul>
+ <li><i>includes</i> - A
+ pattern matching all XML files to be included in the test report. This
+ argument is typically &quot;org*.xml&quot;</li><li><i>output-file</i> -
+ The filename where the output of the test gets stored. For the automated
+ build process, this file should be ${pluginname}.xml, and be located in
+ the ECLIPSE_HOME directory.</li></ul><p>For example, the following code collects all of the files
+matching the pattern &quot;org*.xml&quot; in the directory ${eclipse-home},
+into the file named &quot;logfile.xml&quot;.
+
+<code><pre>
+&lt;ant target=&quot;collect&quot; antfile=&quot;${library-file}&quot; dir=&quot;${eclipse-home}&quot;&gt;
+ &lt;property name=&quot;includes&quot; value=&quot;org*.xml&quot;/&gt;
+ &lt;property name=&quot;output-file&quot; value=&quot;logfile.xml&quot;/&gt;
+&lt;/ant&gt;
+</pre></code>
+
+
+</ul><h2>Examples:</h2><p>Included is the 'test.xml' file from the org.eclipse.jdt.ui.tests.refactoring plugin. This
+file controls all of the automated testing that is done for the org.eclipse.jdt.ui.tests.refactoring
+plugin. It can be run from inside of Eclipse or from the command line. It is
+intended to serve as a template file for testing any other plugin.</p><p>Notice that the structure of the file roughly mirrors that of a JUnit test.
+Targets are defined for setting up the tests, defining what needs to be done,
+cleaning up after the tests, and running everything in the right order.</p>
+<code><pre>
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+
+&lt;project name="testsuite" default="run" basedir="."&gt;
+ &lt;!-- The property ${eclipse-home} should be passed into this script --&gt;
+ &lt;!-- Set a meaningful default value for when it is not. --&gt;
+ &lt;property name="eclipse-home" value="${basedir}\..\.."/&gt;
+
+ &lt;!-- sets the properties eclipse-home, and library-file --&gt;
+ &lt;property name="plugin-name" value="org.eclipse.jdt.ui.tests.refactoring"/&gt;
+ &lt;property name="library-file"
+ value="${eclipse-home}/plugins/org.eclipse.test/library.xml"/&gt;
+
+ &lt;!-- This target holds all initialization code that needs to be done for --&gt;
+ &lt;!-- all tests that are to be run. Initialization for individual tests --&gt;
+ &lt;!-- should be done within the body of the suite target. --&gt;
+ &lt;target name="init"&gt;
+ &lt;tstamp/&gt;
+ &lt;delete&gt;
+ &lt;fileset dir="${eclipse-home}" includes="org*.xml"/&gt;
+ &lt;/delete&gt;
+ &lt;/target&gt;
+
+ &lt;!-- This target defines the tests that need to be run. --&gt;
+ &lt;target name="suite"&gt;
+ &lt;property name="refactoring-folder"
+ value="${eclipse-home}/refactoring_folder"/&gt;
+ &lt;delete dir="${refactoring-folder}" quiet="true"/&gt;
+ &lt;ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}"&gt;
+ &lt;property name="data-dir" value="${refactoring-folder}"/&gt;
+ &lt;property name="plugin-name" value="${plugin-name}"/&gt;
+ &lt;property name="classname"
+ value="org.eclipse.jdt.ui.tests.refactoring.all.AllAllRefactoringTests"/&gt;
+ &lt;/ant&gt;
+ &lt;/target&gt;
+
+ &lt;!-- This target holds code to cleanup the testing environment after --&gt;
+ &lt;!-- after all of the tests have been run. You can use this target to --&gt;
+ &lt;!-- delete temporary files that have been created. --&gt;
+ &lt;target name="cleanup"&gt;
+ &lt;/target&gt;
+
+ &lt;!-- This target runs the test suite. Any actions that need to happen --&gt;
+ &lt;!-- after all the tests have been run should go here. --&gt;
+ &lt;target name="run" depends="init,suite,cleanup"&gt;
+ &lt;ant target="collect" antfile="${library-file}" dir="${eclipse-home}"&gt;
+ &lt;property name="includes" value="org*.xml"/&gt;
+ &lt;property name="output-file" value="${plugin-name}.xml"/&gt;
+ &lt;/ant&gt;
+ &lt;/target&gt;
+ &lt;/project&gt;
+</pre></code>
+
+<h2>Known Issues:</h2><h4>Problem 1: Issues with Ant 1.3</h4><p>Ant 1.3 has some issues when used with the &lt;style&gt; tag and absolute
+paths. Also, any tests that use the <code>System.exit()</code> call will not
+log their output properly when using Ant 1.3.</p><h4>Problem 2: ECLIPSE_HOME</h4><p>The test suites need to know where the root of the eclipse install is on the
+file system (the ECLIPSE_HOME variable). However, this variable is only defined
+in JDT. The ${eclipse-home} property can be set to a reasonable default inside
+of the test.xml script. Then tests can be run from the standard Ant window,
+without having to specify -Declipse-home=%ECLIPSE_HOME%. If a value for
+${eclipse-home} does get passed in, the default (specified in test.xml) gets
+overridden. The parameter is passed in by the build mechanism. For most cases,
+the value &quot;${basedir}/../..&quot; is a reasonable default.</p><h4>Problem 3: Ugly reference to library.xml</h4><p>org.eclipse.test should provide Ant tasks, not template scripts.</p><h4>Problem 4: No console output</h4><p>When you run a TestSuite using the standard JUnit, it normally outputs a
+series of dots to the console so that you can track the TestSuite's progress.
+It is not possible to add this feature to the automated testing process at this
+point in time.</p><h4>Problem 5: Ant java task on Linux</h4><p>Ant expects there to be a java executable on the system path. Furthermore, the executable
+must be a real file, not a symbolic link. If the test framework is throwing an exception
+<code>java.io.IOException: java: not found</code>, ensure that the java executable is on
+your system path.</p><h4>Problem 6: PDE</h4><p>The testing framework currently has no knowledge of PDE. In order to run the automated
+you must be running a self hosting environment with a full development and target Eclipse.</p>
+
+</body>
+
+</html>

Back to the top