You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by se...@apache.org on 2009/06/02 18:53:42 UTC

svn commit: r781080 [2/3] - in /directory/studio/trunk: ./ aciitemeditor/ apacheds/ ldapbrowser-common/ repository/org/eclipse/swtbot/eclipse/finder/ repository/org/eclipse/swtbot/eclipse/finder/2.0.0.329-dev/ repository/org/eclipse/swtbot/swt/finder/ ...

Added: directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/JUNIT.XSL
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/JUNIT.XSL?rev=781080&view=auto
==============================================================================
--- directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/JUNIT.XSL (added)
+++ directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/JUNIT.XSL Tue Jun  2 16:53:39 2009
@@ -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>
+

Added: directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/LICENSE.EPL
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/LICENSE.EPL?rev=781080&view=auto
==============================================================================
--- directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/LICENSE.EPL (added)
+++ directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/LICENSE.EPL Tue Jun  2 16:53:39 2009
@@ -0,0 +1,70 @@
+Eclipse Public License - v 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
+b) in the case of each subsequent Contributor:
+i) changes to the Program, and
+ii) additions to the Program;
+where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
+b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
+c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
+d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
+
+a) it complies with the terms and conditions of this Agreement; and
+b) its license agreement:
+i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
+ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
+iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
+iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
+When the Program is made available in source code form:
+
+a) it must be made available under this Agreement; and
+b) a copy of this Agreement must be included with each copy of the Program.
+Contributors may not remove or alter any copyright notices contained within the Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claim
 s or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) a
 nd 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
\ No newline at end of file

Added: directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/META-INF/MANIFEST.MF?rev=781080&view=auto
==============================================================================
--- directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/META-INF/MANIFEST.MF (added)
+++ directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/META-INF/MANIFEST.MF Tue Jun  2 16:53:39 2009
@@ -0,0 +1,14 @@
+Manifest-Version: 1.0
+Bundle-Name: SWTBot Headless JUnit4 Launch Plug-in (incubation)
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: Eclipse.org
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.eclipse.swtbot.eclipse.junit4.headless;single
+ ton:=true
+Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.swtbot.eclipse.junit4.headless
+Require-Bundle: org.apache.ant,org.junit4,org.eclipse.ui,org.eclipse.c
+ ore.runtime,org.eclipse.equinox.app
+Bundle-Version: 2.0.0.329-dev
+
+

Added: directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/about.html
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/about.html?rev=781080&view=auto
==============================================================================
--- directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/about.html (added)
+++ directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/about.html Tue Jun  2 16:53:39 2009
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+ 
+<p>December 2nd, 2008</p>	
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;).  Unless otherwise 
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;).  A copy of the EPL is available 
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is 
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content.  Check the Redistributor's license that was 
+provided with the Content.  If no such license exists, contact the Redistributor.  Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
\ No newline at end of file

Added: directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/library.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/library.xml?rev=781080&view=auto
==============================================================================
--- directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/library.xml (added)
+++ directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/library.xml Tue Jun  2 16:53:39 2009
@@ -0,0 +1,142 @@
+<?xml version="1.0"?>
+<!-- 
+
+
+======================================================================
+this has been copied from o.e.test plugin with some targets for SWTBot 
+======================================================================
+
+
+-->
+
+<project name="Library" default="usage" basedir=".">
+
+	<target name="usage">
+		<echo message="Please refer to the testframework.html in org.eclipse.test for instructions on usage." />
+	</target>
+
+	<target name="init">
+		<!-- 
+			Parameters:
+				(Mandatory)
+				data-dir		- the directory for Eclipse to write its data
+				plugin-name		- the name of the plugin to test
+				classname		- the name of the test class
+				
+				(Optional - overrides defaults set in script)
+				vmargs			- a string containing arguments to pass to the VM.
+				extraVMargs		- allows separate setting of VM args from separate caller.
+				timeout			- overrides default test timeout value (in milliseconds).
+				test-output		- overrides default output file produced from test run.
+				plugin-path		- path to root of plug-in
+				useEclipseExe	- property setting forces test to launch via eclipse executable.
+				junit-report-output - output directory for junit reports produced for specified classname.
+		-->
+
+		<tstamp>
+			<format property="TIMENOW" pattern="HHmmssSSSS" />
+		</tstamp>
+		<!--property setting useEclipseExe launches tests using the eclipse executable-->
+		<condition property="launchTarget" value="eclipse-test">
+			<isset property="useEclipseExe" />
+		</condition>
+		<!--default launch target for launching tests-->
+		<property name="launchTarget" value="java-test" />
+		<property name="formatter" value="org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter" />
+
+		<!--default heap sizes when running performance tests-->
+		<condition property="vmargs" value=" -Xms256M -Xmx256M">
+			<equals arg1="${test.target}" arg2="performance" />
+		</condition>
+		<property name="extraVMargs" value="" />
+		<property name="plugin-path" value="" />
+		<property name="timeout" value="7200000" />
+		<property name="test-output" value="${eclipse-home}/${classname}.xml" />
+		<property name="junit-report-output" value="${eclipse-home}/results" />
+		<mkdir dir="${junit-report-output}" />
+	</target>
+
+	<target name="swtbot-test" description="Eclipse application used to launch UI plugin tests." depends="init">
+		<antcall target="${launchTarget}">
+			<!--param name="application" value="org.eclipse.test.uitestapplication"/-->
+			<param name="application" value="org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplication" />
+		</antcall>
+	</target>
+
+	<target name="java-test">
+		<!--default vm args-->
+		<property name="vmargs" value=" -Xms40m -Xmx256m" />
+
+		<!-- this argument is needed for macosx -->
+		<condition property="jvmOption" value="-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts">
+			<os family="mac" />
+		</condition>
+
+		<property name="jvmOption" value="" />
+
+		<!--set default jvm to use for testing-->
+		<property name="jvm" value="${java.home}/bin/java" />
+
+		<echo message="Running ${classname}. Result file: ${junit-report-output}/${classname}.xml." />
+
+		<java fork="true" dir="." timeout="${timeout}" jvm="${jvm}" logError="true"
+			classname="org.eclipse.core.launcher.Main" output="${junit-report-output}/${classname}.txt">
+			<classpath>
+				<fileset dir="${eclipse-home}/plugins">
+					<include name="org.eclipse.equinox.launcher_*.jar" />
+				</fileset>
+			</classpath>
+			<arg line="-application ${application}" />
+			<arg line="-data ${data-dir}" />
+		    <arg line="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test-output} formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter"/>
+			<arg line="-testPluginName ${plugin-name}" />
+			<arg line="-className ${classname}" />
+			<arg line="-os ${os}" />
+			<arg line="-ws ${ws}" />
+			<arg line="-arch ${arch}" />
+			<arg line="-consoleLog" />
+			<arg line="-debug" />
+			<jvmarg line="${vmargs} ${extraVMargs} ${jvmOption}" />
+			<sysproperty key="PLUGIN_PATH" value="${plugin-path}" />
+		</java>
+		<antcall target="collect-results" />
+	</target>
+
+	<target name="collect-results">
+		<dirname property="output-dir" file="${test-output}" />
+		<basename property="output-file-name" file="${test-output}" />
+		<junitreport todir="${junit-report-output}" tofile="${classname}.xml">
+			<fileset dir="${output-dir}">
+				<include name="${output-file-name}" />
+			</fileset>
+		</junitreport>
+
+		<style style="${eclipse-home}/plugins/org.eclipse.test/JUNIT.XSL"
+			basedir="${junit-report-output}"
+			includes="${classname}.result.xml"
+			destdir="${junit-report-output}" />
+
+		<!--save .log content and *.log content from configuration directory-->
+		<concat destfile="${junit-report-output}/${classname}.log">
+			<fileset dir="${eclipse-home}" includes="${data-dir}/.metadata/*.log" />
+			<fileset dir="${eclipse-home}" includes="configuration/*.log" />
+		</concat>
+	</target>
+
+	<target name="collect">
+		<!--
+			This target can be used to aggragate test runs from multiple test suites into a single report.
+		
+			Parameters to this target:
+			includes		- the names of the files to include
+			output-file		- the name of the output file to produce
+		-->
+		<junitreport todir="." tofile="${output-file}">
+			<fileset dir=".">
+				<include name="${includes}" />
+			</fileset>
+		</junitreport>
+	</target>
+
+</project>
+

Added: directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/org/eclipse/swtbot/eclipse/junit4/headless/EclipseTestRunner$TestFailedException.class
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/org/eclipse/swtbot/eclipse/junit4/headless/EclipseTestRunner%24TestFailedException.class?rev=781080&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/org/eclipse/swtbot/eclipse/junit4/headless/EclipseTestRunner$TestFailedException.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/org/eclipse/swtbot/eclipse/junit4/headless/EclipseTestRunner.class
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/org/eclipse/swtbot/eclipse/junit4/headless/EclipseTestRunner.class?rev=781080&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/org/eclipse/swtbot/eclipse/junit4/headless/EclipseTestRunner.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/org/eclipse/swtbot/eclipse/junit4/headless/UITestApplication$1$1.class
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/org/eclipse/swtbot/eclipse/junit4/headless/UITestApplication%241%241.class?rev=781080&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/org/eclipse/swtbot/eclipse/junit4/headless/UITestApplication$1$1.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/org/eclipse/swtbot/eclipse/junit4/headless/UITestApplication$1.class
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/org/eclipse/swtbot/eclipse/junit4/headless/UITestApplication%241.class?rev=781080&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/org/eclipse/swtbot/eclipse/junit4/headless/UITestApplication$1.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/org/eclipse/swtbot/eclipse/junit4/headless/UITestApplication.class
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/org/eclipse/swtbot/eclipse/junit4/headless/UITestApplication.class?rev=781080&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/org/eclipse/swtbot/eclipse/junit4/headless/UITestApplication.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/plugin.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/plugin.xml?rev=781080&view=auto
==============================================================================
--- directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/plugin.xml (added)
+++ directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/plugin.xml Tue Jun  2 16:53:39 2009
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+   <extension
+         id="swtbottestapplication"
+         point="org.eclipse.core.runtime.applications">
+      <application
+            visible="false">
+         <run
+               class="org.eclipse.swtbot.eclipse.junit4.headless.UITestApplication">
+            <parameter
+                  name="productInfo"
+                  value="product.ini">
+            </parameter>
+         </run>
+      </application>
+   </extension>
+
+</plugin>

Added: directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/src/org/eclipse/swtbot/eclipse/junit4/headless/EclipseTestRunner.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/src/org/eclipse/swtbot/eclipse/junit4/headless/EclipseTestRunner.java?rev=781080&view=auto
==============================================================================
--- directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/src/org/eclipse/swtbot/eclipse/junit4/headless/EclipseTestRunner.java (added)
+++ directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/src/org/eclipse/swtbot/eclipse/junit4/headless/EclipseTestRunner.java Tue Jun  2 16:53:39 2009
@@ -0,0 +1,502 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Ketan Padegaonkar and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     Ketan Padegaonkar - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swtbot.eclipse.junit4.headless;
+
+import java.io.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.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Properties;
+import java.util.Vector;
+
+import junit.framework.AssertionFailedError;
+import junit.framework.JUnit4TestAdapter;
+import junit.framework.Test;
+import junit.framework.TestListener;
+import junit.framework.TestResult;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.taskdefs.optional.junit.JUnitResultFormatter;
+import org.apache.tools.ant.taskdefs.optional.junit.JUnitTest;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.osgi.util.ManifestElement;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
+
+/**
+ * An exact copy of {@link org.eclipse.test.EclipseTestRunner}. A TestRunner for JUnit that supports Ant
+ * JUnitResultFormatters and running tests inside Eclipse. Example call: EclipseTestRunner -classname
+ * junit.samples.SimpleTest formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter
+ */
+@SuppressWarnings("all")
+public class EclipseTestRunner implements TestListener {
+	class TestFailedException extends Exception {
+
+		private static final long	serialVersionUID	= 6009335074727417445L;
+
+		TestFailedException(String message) {
+			super(message);
+		}
+
+		TestFailedException(Throwable e) {
+			super(e);
+		}
+	}
+
+	/**
+	 * No problems with this test.
+	 */
+	public static final int		SUCCESS				= 0;
+	/**
+	 * Some tests failed.
+	 */
+	public static final int		FAILURES			= 1;
+	/**
+	 * An error occured.
+	 */
+	public static final int		ERRORS				= 2;
+
+	private static final String	SUITE_METHODNAME	= "suite";		//$NON-NLS-1$
+	/**
+	 * The current test result
+	 */
+	private TestResult			fTestResult;
+	/**
+	 * The name of the plugin containing the test
+	 */
+	private final String		fTestPluginName;
+	/**
+	 * The corresponding testsuite.
+	 */
+	private Test				fSuite;
+	/**
+	 * Formatters from the command line.
+	 */
+	private static Vector		fgFromCmdLine		= new Vector();
+	/**
+	 * Holds the registered formatters.
+	 */
+	private final Vector		formatters			= new Vector();
+	/**
+	 * Do we stop on errors.
+	 */
+	private boolean				fHaltOnError		= false;
+	/**
+	 * Do we stop on test failures.
+	 */
+	private boolean				fHaltOnFailure		= false;
+	/**
+	 * The TestSuite we are currently running.
+	 */
+	private final JUnitTest		fJunitTest;
+	/**
+	 * output written during the test
+	 */
+	private PrintStream			fSystemError;
+	/**
+	 * Error output during the test
+	 */
+	private PrintStream			fSystemOut;
+	/**
+	 * Exception caught in constructor.
+	 */
+	private Exception			fException;
+	/**
+	 * Returncode
+	 */
+	private int					fRetCode			= SUCCESS;
+
+	/**
+	 * The main entry point (the parameters are not yet consistent with the Ant JUnitTestRunner, but eventually they
+	 * should be). Parameters
+	 * 
+	 * <pre>
+	 * -className: the name of the testSuite
+	 * -testPluginName: the name of the containing plugin
+	 * haltOnError: halt test on errors?
+	 * haltOnFailure: halt test on failures?
+	 * -testlistener listenerClass: deprecated
+	 * 		print a warning that this option is deprecated
+	 * formatter: a JUnitResultFormatter given as classname,filename.
+	 *  	If filename is ommitted, System.out is assumed.
+	 * </pre>
+	 */
+	public static void main(String[] args) throws IOException {
+		System.exit(run(args));
+	}
+
+	public static int run(String[] args) throws IOException {
+		String className = null;
+		String testPluginName = null;
+
+		boolean haltError = false;
+		boolean haltFail = false;
+
+		Properties props = new Properties();
+
+		int startArgs = 0;
+		if (args.length > 0)
+			// support the JUnit task commandline syntax where
+			// the first argument is the name of the test class
+			if (!args[0].startsWith("-")) { //$NON-NLS-1$
+				className = args[0];
+				startArgs++;
+			}
+		for (int i = startArgs; i < args.length; i++)
+			if (args[i].toLowerCase().equals("-classname")) { //$NON-NLS-1$
+				if (i < args.length - 1)
+					className = args[i + 1];
+				i++;
+			} else if (args[i].toLowerCase().equals("-testpluginname")) { //$NON-NLS-1$
+				if (i < args.length - 1)
+					testPluginName = args[i + 1];
+				i++;
+			} else if (args[i].startsWith("haltOnError=")) //$NON-NLS-1$
+				haltError = Project.toBoolean(args[i].substring(12));
+			else if (args[i].startsWith("haltOnFailure=")) //$NON-NLS-1$
+				haltFail = Project.toBoolean(args[i].substring(14));
+			else if (args[i].startsWith("formatter=")) //$NON-NLS-1$
+				try {
+					createAndStoreFormatter(args[i].substring(10));
+				} catch (BuildException be) {
+					System.err.println(be.getMessage());
+					return ERRORS;
+				}
+			else if (args[i].startsWith("propsfile=")) { //$NON-NLS-1$
+				FileInputStream in = new FileInputStream(args[i].substring(10));
+				props.load(in);
+				in.close();
+			} else if (args[i].equals("-testlistener")) { //$NON-NLS-1$
+				System.err.println("The -testlistener option is no longer supported\nuse the formatter= option instead"); //$NON-NLS-1$
+				return ERRORS;
+			}
+
+		if (className == null)
+			throw new IllegalArgumentException("Test class name not specified"); //$NON-NLS-1$
+
+		JUnitTest t = new JUnitTest(className);
+
+		// Add/overlay system properties on the properties from the Ant project
+		Hashtable p = System.getProperties();
+		for (Enumeration _enum = p.keys(); _enum.hasMoreElements();) {
+			Object key = _enum.nextElement();
+			props.put(key, p.get(key));
+		}
+		t.setProperties(props);
+
+		EclipseTestRunner runner = new EclipseTestRunner(t, testPluginName, haltError, haltFail);
+		transferFormatters(runner);
+		runner.run();
+		return runner.getRetCode();
+	}
+
+	/**
+	 *
+	 */
+	public EclipseTestRunner(JUnitTest test, String testPluginName, boolean haltOnError, boolean haltOnFailure) {
+		fJunitTest = test;
+		fTestPluginName = testPluginName;
+		fHaltOnError = haltOnError;
+		fHaltOnFailure = haltOnFailure;
+
+		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 + "\""); //$NON-NLS-1$ //$NON-NLS-2$
+			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();
+			// perhaps the test is annotated with @RunWith and @SuiteClasses
+			return new JUnit4TestAdapter(testClass);
+		}
+		
+		if (!Modifier.isStatic(suiteMethod.getModifiers())) {
+			runFailed("suite() method must be static"); //$NON-NLS-1$
+			return null;
+		}
+		Test test = null;
+		try {
+			test = (Test) suiteMethod.invoke(null, new Class[0]); // static method
+			if (test == null)
+				return test;
+		} catch (InvocationTargetException e) {
+			runFailed("Failed to invoke suite():" + e.getTargetException().toString()); //$NON-NLS-1$
+			return null;
+		} catch (IllegalAccessException e) {
+			runFailed("Failed to invoke suite():" + e.toString()); //$NON-NLS-1$
+			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 + "\"")); //$NON-NLS-1$ //$NON-NLS-2$
+
+		// is the plugin a fragment?
+		Dictionary headers = bundle.getHeaders();
+		String hostHeader = (String) headers.get(Constants.FRAGMENT_HOST);
+		if (hostHeader != null) {
+			// we are a fragment for sure
+			// we need to find which is our host
+			ManifestElement[] hostElement = null;
+			try {
+				hostElement = ManifestElement.parseHeader(Constants.FRAGMENT_HOST, hostHeader);
+			} catch (BundleException e) {
+				throw new RuntimeException("Could not find host for fragment:" + fTestPluginName, e); //$NON-NLS-1$
+			}
+			Bundle host = Platform.getBundle(hostElement[0].getValue());
+			// we really want to get the host not the fragment
+			bundle = host;
+		}
+
+		return bundle.loadClass(suiteClassName);
+	}
+
+	public void run() {
+		// IPerformanceMonitor pm = PerfMsrCorePlugin.getPerformanceMonitor(true);
+
+		fTestResult = new TestResult();
+		fTestResult.addListener(this);
+		for (int i = 0; i < formatters.size(); i++)
+			fTestResult.addListener((TestListener) 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++)
+				((TestListener) formatters.elementAt(i)).addError(null, fException);
+			fJunitTest.setCounts(1, 0, 1);
+			fJunitTest.setRunTime(0);
+		} else {
+			ByteArrayOutputStream errStrm = new ByteArrayOutputStream();
+			fSystemError = new PrintStream(errStrm);
+
+			ByteArrayOutputStream outStrm = new ByteArrayOutputStream();
+			fSystemOut = new PrintStream(outStrm);
+
+			try {
+				// pm.snapshot(1); // before
+				fSuite.run(fTestResult);
+			} finally {
+				// pm.snapshot(2); // after
+				fSystemError.close();
+				fSystemError = null;
+				fSystemOut.close();
+				fSystemOut = null;
+				sendOutAndErr(new String(outStrm.toByteArray()), new String(errStrm.toByteArray()));
+				fJunitTest.setCounts(fTestResult.runCount(), fTestResult.failureCount(), fTestResult.errorCount());
+				fJunitTest.setRunTime(System.currentTimeMillis() - start);
+			}
+		}
+		fireEndTestSuite();
+
+		if ((fRetCode != SUCCESS) || (fTestResult.errorCount() != 0))
+			fRetCode = ERRORS;
+		else if (fTestResult.failureCount() != 0)
+			fRetCode = FAILURES;
+
+		// pm.upload(getClass().getName());
+	}
+
+	/**
+	 * Returns what System.exit() would return in the standalone version.
+	 * 
+	 * @return 2 if errors occurred, 1 if tests failed else 0.
+	 */
+	public int getRetCode() {
+		return fRetCode;
+	}
+
+	/*
+	 * @see TestListener.addFailure
+	 */
+	public void startTest(Test t) {
+	}
+
+	/*
+	 * @see TestListener.addFailure
+	 */
+	public void endTest(Test test) {
+	}
+
+	/*
+	 * @see TestListener.addFailure
+	 */
+	public void addFailure(Test test, AssertionFailedError t) {
+		if (fHaltOnFailure)
+			fTestResult.stop();
+	}
+
+	/*
+	 * @see TestListener.addError
+	 */
+	public void addError(Test test, Throwable t) {
+		if (fHaltOnError)
+			fTestResult.stop();
+	}
+
+	private void fireStartTestSuite() {
+		for (int i = 0; i < formatters.size(); i++)
+			((JUnitResultFormatter) formatters.elementAt(i)).startTestSuite(fJunitTest);
+	}
+
+	private void fireEndTestSuite() {
+		for (int i = 0; i < formatters.size(); i++)
+			((JUnitResultFormatter) formatters.elementAt(i)).endTestSuite(fJunitTest);
+	}
+
+	public void addFormatter(JUnitResultFormatter f) {
+		formatters.addElement(f);
+	}
+
+	/**
+	 * Line format is: formatter=<classname>(,<pathname>)?
+	 */
+	private static void createAndStoreFormatter(String line) throws BuildException {
+		String formatterClassName = null;
+		File formatterFile = null;
+
+		int pos = line.indexOf(',');
+		if (pos == -1)
+			formatterClassName = line;
+		else {
+			formatterClassName = line.substring(0, pos);
+			formatterFile = new File(line.substring(pos + 1)); // the method is package visible
+		}
+		fgFromCmdLine.addElement(createFormatter(formatterClassName, formatterFile));
+	}
+
+	private static void transferFormatters(EclipseTestRunner runner) {
+		for (int i = 0; i < fgFromCmdLine.size(); i++)
+			runner.addFormatter((JUnitResultFormatter) fgFromCmdLine.elementAt(i));
+	}
+
+	/*
+	 * DUPLICATED from FormatterElement, since it is package visible only
+	 */
+	private static JUnitResultFormatter createFormatter(String classname, File outfile) throws BuildException {
+		OutputStream out = System.out;
+
+		if (classname == null)
+			throw new BuildException("you must specify type or classname"); //$NON-NLS-1$
+		Class f = null;
+		try {
+			f = EclipseTestRunner.class.getClassLoader().loadClass(classname);
+		} catch (ClassNotFoundException e) {
+			throw new BuildException(e);
+		}
+
+		Object o = null;
+		try {
+			o = f.newInstance();
+		} catch (InstantiationException e) {
+			throw new BuildException(e);
+		} catch (IllegalAccessException e) {
+			throw new BuildException(e);
+		}
+
+		if (!(o instanceof JUnitResultFormatter))
+			throw new BuildException(classname + " is not a JUnitResultFormatter"); //$NON-NLS-1$
+
+		JUnitResultFormatter r = (JUnitResultFormatter) o;
+
+		if (outfile != null)
+			try {
+				out = new FileOutputStream(outfile);
+			} catch (java.io.IOException e) {
+				throw new BuildException(e);
+			}
+		r.setOutput(out);
+		return r;
+	}
+
+	private void sendOutAndErr(String out, String err) {
+		for (int i = 0; i < formatters.size(); i++) {
+			JUnitResultFormatter formatter = ((JUnitResultFormatter) formatters.elementAt(i));
+
+			formatter.setSystemOutput(out);
+			formatter.setSystemError(err);
+		}
+	}
+
+	protected void handleOutput(String line) {
+		if (fSystemOut != null)
+			fSystemOut.println(line);
+	}
+
+	protected void handleErrorOutput(String line) {
+		if (fSystemError != null)
+			fSystemError.println(line);
+	}
+}

Added: directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/src/org/eclipse/swtbot/eclipse/junit4/headless/UITestApplication.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/src/org/eclipse/swtbot/eclipse/junit4/headless/UITestApplication.java?rev=781080&view=auto
==============================================================================
--- directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/src/org/eclipse/swtbot/eclipse/junit4/headless/UITestApplication.java (added)
+++ directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.329-dev/src/org/eclipse/swtbot/eclipse/junit4/headless/UITestApplication.java Tue Jun  2 16:53:39 2009
@@ -0,0 +1,212 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Ketan Padegaonkar and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     Ketan Padegaonkar - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swtbot.eclipse.junit4.headless;
+
+import java.io.IOException;
+
+import junit.framework.Assert;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IPlatformRunnable;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.equinox.app.IApplication;
+import org.eclipse.equinox.app.IApplicationContext;
+import org.eclipse.ui.IWindowListener;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.testing.ITestHarness;
+import org.eclipse.ui.testing.TestableObject;
+
+/**
+ * This is just a copy of org.eclipse.test.UITestApplication from the eclipse test plugin, with {@link #runTests()}
+ * overridden to return a custom {@link EclipseTestRunner} that runs in a non-UI thread.
+ * 
+ * A Workbench that runs a test suite specified in the
+ * command line arguments.
+ */
+public class UITestApplication  implements IPlatformRunnable, ITestHarness, IApplication {
+
+	private static final String DEFAULT_APP_3_0 = "org.eclipse.ui.ide.workbench"; //$NON-NLS-1$
+	private static final String DEFAULT_APP_PRE_3_0 = "org.eclipse.ui.workbench"; //$NON-NLS-1$
+
+	private boolean fInDeprecatedMode = false;
+	private TestableObject fTestableObject;
+	private int fTestRunnerResult = -1;
+	private IApplicationContext appContext;
+
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.boot.IPlatformRunnable
+	 */
+	public Object run(final Object args) throws Exception {
+		// Get the application to test
+		Object application = getApplication((String[])args);
+		Assert.assertNotNull(application);
+
+		Object result;
+		if (fInDeprecatedMode && (application instanceof IPlatformRunnable))
+			result = runDeprecatedApplication((IPlatformRunnable)application, args);
+		else
+			result = runApplication(application, args);
+		if (!IPlatformRunnable.EXIT_OK.equals(result))
+			System.err.println("UITestRunner: Unexpected result from running application " + application + ": " + result); //$NON-NLS-1$ //$NON-NLS-2$
+		return new Integer(fTestRunnerResult);
+	}
+
+
+	/*
+	 * return the application to run, or null if not even the default application
+	 * is found.
+	 */
+	private Object getApplication(String[] args) throws CoreException {
+		// Assume we are in 3.0 mode.
+		// Find the name of the application as specified by the PDE JUnit launcher.
+		// If no application is specified, the 3.0 default workbench application
+		// is returned.
+		IExtension extension =
+			Platform.getExtensionRegistry().getExtension(
+					Platform.PI_RUNTIME,
+					Platform.PT_APPLICATIONS,
+					getApplicationToRun(args));
+
+		// If no 3.0 extension can be found, search the registry
+		// for the pre-3.0 default workbench application, i.e. org.eclipse ui.workbench
+		// Set the deprecated flag to true
+		if (extension == null) {
+			extension = Platform.getExtensionRegistry().getExtension(
+					Platform.PI_RUNTIME,
+					Platform.PT_APPLICATIONS,
+					DEFAULT_APP_PRE_3_0);
+			fInDeprecatedMode = true;
+		}
+
+		Assert.assertNotNull(extension);
+
+		// If the extension does not have the correct grammar, return null.
+		// Otherwise, return the application object.
+		IConfigurationElement[] elements = extension.getConfigurationElements();
+		if (elements.length > 0) {
+			IConfigurationElement[] runs = elements[0].getChildren("run"); //$NON-NLS-1$
+			if (runs.length > 0) {
+				Object runnable = runs[0].createExecutableExtension("class"); //$NON-NLS-1$
+				if (runnable instanceof IPlatformRunnable)
+					return runnable;
+				if (runnable instanceof IApplication)
+					return runnable;
+			}
+		}
+		return null;
+	}
+
+	/**
+	 * The -testApplication argument specifies the application to be run.
+	 * If the PDE JUnit launcher did not set this argument, then return
+	 * the name of the default application.
+	 * In 3.0, the default is the "org.eclipse.ui.ide.worbench" application.
+	 * 
+	 */
+	private String getApplicationToRun(String[] args) {
+		for (int i = 0; i < args.length; i++)
+			if (args[i].equals("-testApplication") && (i < args.length -1)) //$NON-NLS-1$
+				return args[i+1];
+		return DEFAULT_APP_3_0;
+	}
+
+	/**
+	 * In 3.0 mode
+	 * 
+	 */
+	private Object runApplication(Object application, Object args) throws Exception {
+		fTestableObject = PlatformUI.getTestableObject();
+		fTestableObject.setTestHarness(this);
+		if (application instanceof IPlatformRunnable)
+			return ((IPlatformRunnable) application).run(args);
+		return ((IApplication) application).start(appContext);
+
+	}
+
+	/*
+	 * If we are in pre-3.0 mode, then the application to run is
+	 * "org.eclipse.ui.workbench" Therefore, we safely cast the runnable object
+	 * to IWorkbenchWindow. We add a listener to it, so that we know when the
+	 * window opens so that we can start running the tests. When the tests are
+	 * done, we explicitly call close() on the workbench.
+	 */
+	private Object runDeprecatedApplication(
+			IPlatformRunnable object,
+			final Object args)
+	throws Exception {
+
+		Assert.assertTrue(object instanceof IWorkbench);
+
+		final IWorkbench workbench = (IWorkbench) object;
+		// the 'started' flag is used so that we only run tests when the window
+		// is opened
+		// for the first time only.
+		final boolean[] started = { false };
+		workbench.addWindowListener(new IWindowListener() {
+			public void windowOpened(IWorkbenchWindow w) {
+				if (started[0])
+					return;
+				w.getShell().getDisplay().asyncExec(new Runnable() {
+					public void run() {
+						started[0] = true;
+						try {
+							fTestRunnerResult = EclipseTestRunner.run((String[]) args);
+						} catch (IOException e) {
+							e.printStackTrace();
+						}
+						workbench.close();
+					}
+				});
+			}
+			public void windowActivated(IWorkbenchWindow window) {
+			}
+			public void windowDeactivated(IWorkbenchWindow window) {
+			}
+			public void windowClosed(IWorkbenchWindow window) {
+			}
+		});
+		return ((IPlatformRunnable) workbench).run(args);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.testing.ITestHarness#runTests()
+	 */
+	public void runTests() {
+		fTestableObject.testingStarting();
+		try {
+			fTestRunnerResult = EclipseTestRunner.run(Platform.getCommandLineArgs());
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+		fTestableObject.testingFinished();
+	}
+
+
+	public Object start(IApplicationContext context) throws Exception {
+		appContext = context;
+		String[] args = (String[]) appContext.getArguments().get("application.args"); //$NON-NLS-1$
+		if (args == null)
+			args = new String[0];
+		return run(args);
+	}
+
+
+	public void stop() {
+		// TODO Auto-generated method stub
+
+	}
+
+}

Added: directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.swt.finder_2.0.0.329-dev.jar
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.swt.finder_2.0.0.329-dev.jar?rev=781080&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/studio/trunk/test-integration-ui/resources/test-plugins/org.eclipse.swtbot.swt.finder_2.0.0.329-dev.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/studio/trunk/test-integration-ui/resources/test-plugins/org.hamcrest_1.1.0.v20090122-0023.jar
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/resources/test-plugins/org.hamcrest_1.1.0.v20090122-0023.jar?rev=781080&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/studio/trunk/test-integration-ui/resources/test-plugins/org.hamcrest_1.1.0.v20090122-0023.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/AutomatedSuite.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/AutomatedSuite.java?rev=781080&r1=781079&r2=781080&view=diff
==============================================================================
--- directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/AutomatedSuite.java (original)
+++ directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/AutomatedSuite.java Tue Jun  2 16:53:39 2009
@@ -17,61 +17,30 @@
  *  under the License. 
  *  
  */
-
 package org.apache.directory.studio.test.integration.ui;
 
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.swtbot.eclipse.finder.SWTEclipseBot;
+import org.apache.directory.server.core.integ.Level;
+import org.apache.directory.server.core.integ.SetupMode;
+import org.apache.directory.server.core.integ.annotations.CleanupLevel;
+import org.apache.directory.server.core.integ.annotations.Mode;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
 
 
 /**
- * Test suite to run all tests.
+ * Test suite.
  * 
- * @author <a href="mailto:dev@directory.apache.org">Apache DirectoryProject</a>
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class AutomatedSuite extends TestSuite
+@RunWith(Suite.class)
+@Suite.SuiteClasses(
+    { BrowserTest.class, EntryEditorTest.class, ImportExportTest.class, NewConnectionWizardTest.class,
+        NewEntryWizardTest.class, ReferralDialogTest.class, RenameEntryDialogTest.class, SearchTest.class })
+@CleanupLevel(Level.SUITE)
+@Mode(SetupMode.ROLLBACK)
+public class AutomatedSuite
 {
 
-    public static Test suite()
-    {
-        return new AutomatedSuite();
-    }
-
-
-    public AutomatedSuite()
-    {
-        // Test Preparation: close welcome view
-        try
-        {
-            SWTEclipseBot bot = new SWTEclipseBot();
-            bot.view( "Welcome" ).close();
-        }
-        catch ( Exception e )
-        {
-        }
-
-        // Test Connections view
-        addTest( new TestSuite( NewConnectionWizardTest.class ) );
-
-        // Test Import/Export
-        addTest( new TestSuite( ImportExportTest.class ) );
-
-        // Test Browser view
-        addTest( new TestSuite( BrowserTest.class ) );
-        addTest( new TestSuite( NewEntryWizardTest.class ) );
-        addTest( new TestSuite( RenameEntryDialogTest.class ) );
-        addTest( new TestSuite( ReferralDialogTest.class ) );
-        addTest( new TestSuite( SearchTest.class ) );
-
-        // Test Entry editor
-        addTest( new TestSuite( EntryEditorTest.class ) );
-
-        // Test allocated resources
-        // addTest( new TestSuite( SwtResourcesTest.class ) );
-    }
-
-}
\ No newline at end of file
+}

Modified: directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/BrowserTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/BrowserTest.java?rev=781080&r1=781079&r2=781080&view=diff
==============================================================================
--- directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/BrowserTest.java (original)
+++ directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/BrowserTest.java Tue Jun  2 16:53:39 2009
@@ -21,11 +21,20 @@
 package org.apache.directory.studio.test.integration.ui;
 
 
+import static junit.framework.Assert.assertEquals;
+
 import org.apache.commons.lang.StringUtils;
-import org.apache.directory.server.unit.AbstractServerTest;
-import org.eclipse.swtbot.eclipse.finder.SWTEclipseBot;
+import org.apache.directory.server.core.integ.Level;
+import org.apache.directory.server.core.integ.annotations.CleanupLevel;
+import org.apache.directory.server.integ.SiRunner;
+import org.apache.directory.server.ldap.LdapService;
+import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotStyledText;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 
 /**
@@ -34,25 +43,29 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class BrowserTest extends AbstractServerTest
+@RunWith(SiRunner.class)
+@CleanupLevel(Level.SUITE)
+public class BrowserTest
 {
-    private SWTEclipseBot bot;
+    public static LdapService ldapService;
+
+    private SWTWorkbenchBot bot;
 
 
-    protected void setUp() throws Exception
+    @Before
+    public void setUp() throws Exception
     {
-        super.setUp();
-        bot = new SWTEclipseBot();
+        bot = new SWTWorkbenchBot();
         SWTBotUtils.openLdapPerspective( bot );
         SWTBotUtils.createTestConnection( bot, "BrowserTest", ldapService.getPort() );
     }
 
 
-    protected void tearDown() throws Exception
+    @After
+    public void tearDown() throws Exception
     {
         SWTBotUtils.deleteTestConnections();
         bot = null;
-        super.tearDown();
     }
 
 
@@ -64,6 +77,7 @@
      *
      * @throws Exception
      */
+    @Test
     public void testOnlyOneSearchRequestWhenExpandingEntry() throws Exception
     {
         SWTBotTree browserTree = SWTBotUtils.getLdapBrowserTree( bot );

Added: directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/ContextMenuHelper.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/ContextMenuHelper.java?rev=781080&view=auto
==============================================================================
--- directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/ContextMenuHelper.java (added)
+++ directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/ContextMenuHelper.java Tue Jun  2 16:53:39 2009
@@ -0,0 +1,152 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.studio.test.integration.ui;
+
+
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withMnemonic;
+import static org.hamcrest.Matchers.allOf;
+import static org.hamcrest.Matchers.instanceOf;
+
+import java.util.Arrays;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
+import org.eclipse.swtbot.swt.finder.results.VoidResult;
+import org.eclipse.swtbot.swt.finder.results.WidgetResult;
+import org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot;
+import org.hamcrest.Matcher;
+
+
+/**
+ * A helper to click context menus
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class ContextMenuHelper
+{
+
+    /**
+     * Clicks the context menu matching the text.
+     * 
+     * @param text
+     *          the text on the context menu.
+     * @throws WidgetNotFoundException
+     *           if the widget is not found.
+     */
+    public static void clickContextMenu( final AbstractSWTBot<?> bot, final String... texts )
+    {
+
+        // show
+        final MenuItem menuItem = UIThreadRunnable.syncExec( new WidgetResult<MenuItem>()
+        {
+            public MenuItem run()
+            {
+                MenuItem menuItem = null;
+                Control control = ( Control ) bot.widget;
+                Menu menu = control.getMenu();
+                for ( String text : texts )
+                {
+                    Matcher<?> matcher = allOf( instanceOf( MenuItem.class ), withMnemonic( text ) );
+                    menuItem = show( menu, matcher );
+                    if ( menuItem != null )
+                    {
+                        menu = menuItem.getMenu();
+                    }
+                    else
+                    {
+                        hide( menu );
+                        break;
+                    }
+                }
+
+                return menuItem;
+            }
+        } );
+        if ( menuItem == null )
+        {
+            throw new WidgetNotFoundException( "Could not find menu: " + Arrays.asList( texts ) );
+        }
+
+        // click
+        click( menuItem );
+
+        // hide
+        UIThreadRunnable.syncExec( new VoidResult()
+        {
+            public void run()
+            {
+                hide( menuItem.getParent() );
+            }
+        } );
+    }
+
+
+    private static MenuItem show( final Menu menu, final Matcher<?> matcher )
+    {
+        if ( menu != null )
+        {
+            menu.notifyListeners( SWT.Show, new Event() );
+            MenuItem[] items = menu.getItems();
+            for ( final MenuItem menuItem : items )
+            {
+                if ( matcher.matches( menuItem ) )
+                {
+                    return menuItem;
+                }
+            }
+            menu.notifyListeners( SWT.Hide, new Event() );
+        }
+        return null;
+    }
+
+
+    private static void click( final MenuItem menuItem )
+    {
+        final Event event = new Event();
+        event.time = ( int ) System.currentTimeMillis();
+        event.widget = menuItem;
+        event.display = menuItem.getDisplay();
+        event.type = SWT.Selection;
+
+        UIThreadRunnable.asyncExec( menuItem.getDisplay(), new VoidResult()
+        {
+            public void run()
+            {
+                menuItem.notifyListeners( SWT.Selection, event );
+            }
+        } );
+    }
+
+
+    private static void hide( final Menu menu )
+    {
+        menu.notifyListeners( SWT.Hide, new Event() );
+        if ( menu.getParentMenu() != null )
+        {
+            hide( menu.getParentMenu() );
+        }
+    }
+}

Modified: directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/EntryEditorTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/EntryEditorTest.java?rev=781080&r1=781079&r2=781080&view=diff
==============================================================================
--- directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/EntryEditorTest.java (original)
+++ directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/EntryEditorTest.java Tue Jun  2 16:53:39 2009
@@ -21,10 +21,20 @@
 package org.apache.directory.studio.test.integration.ui;
 
 
-import org.apache.directory.server.unit.AbstractServerTest;
-import org.eclipse.swtbot.eclipse.finder.SWTEclipseBot;
+import static junit.framework.Assert.assertEquals;
+
+import org.apache.directory.server.core.integ.Level;
+import org.apache.directory.server.core.integ.annotations.ApplyLdifFiles;
+import org.apache.directory.server.core.integ.annotations.CleanupLevel;
+import org.apache.directory.server.integ.SiRunner;
+import org.apache.directory.server.ldap.LdapService;
+import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
 import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 
 /**
@@ -33,26 +43,31 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class EntryEditorTest extends AbstractServerTest
+@RunWith(SiRunner.class)
+@CleanupLevel(Level.SUITE)
+@ApplyLdifFiles(
+    { "EntryEditorTest.ldif" })
+public class EntryEditorTest
 {
-    private SWTEclipseBot bot;
+    public static LdapService ldapService;
+
+    private SWTWorkbenchBot bot;
 
 
-    protected void setUp() throws Exception
+    @Before
+    public void setUp() throws Exception
     {
-        super.setUp();
-        super.loadTestLdif( false );
-        bot = new SWTEclipseBot();
+        bot = new SWTWorkbenchBot();
         SWTBotUtils.openLdapPerspective( bot );
         SWTBotUtils.createTestConnection( bot, "EntryEditorTest", ldapService.getPort() );
     }
 
 
-    protected void tearDown() throws Exception
+    @After
+    public void tearDown() throws Exception
     {
         SWTBotUtils.deleteTestConnections();
         bot = null;
-        super.tearDown();
     }
 
 
@@ -62,6 +77,7 @@
      * @throws Exception
      *             the exception
      */
+    @Test
     public void testAddEditDeleteAttribute() throws Exception
     {
         final SWTBotTree browserTree = SWTBotUtils.getLdapBrowserTree( bot );
@@ -239,6 +255,7 @@
      * @throws Exception
      *             the exception
      */
+    @Test
     public void testDnValueEditor() throws Exception
     {
         SWTBotTree browserTree = SWTBotUtils.getLdapBrowserTree( bot );
@@ -273,6 +290,7 @@
 
         // assert value after saved and reloaded from server
         entryEditorTree.select( 3 );
+        entryEditorTree.getTreeItem( "member" ).doubleClick();
         assertEquals( "Unexpected value", "cn=\\#\\\\\\+\\, \\\"\u00F6\u00E9\\\",ou=users,ou=system", bot.comboBox()
             .getText() );
         bot.button( "Cancel" ).click();