svn commit: r750342 - in /ofbiz/trunk: build.xml framework/testtools/src/org/ofbiz/testtools/TestListContainer.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r750342 - in /ofbiz/trunk: build.xml framework/testtools/src/org/ofbiz/testtools/TestListContainer.java

doogie-3
Author: doogie
Date: Thu Mar  5 06:54:41 2009
New Revision: 750342

URL: http://svn.apache.org/viewvc?rev=750342&view=rev
Log:
Change implementation to be based on suite-name.

Modified:
    ofbiz/trunk/build.xml
    ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/TestListContainer.java

Modified: ofbiz/trunk/build.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/build.xml?rev=750342&r1=750341&r2=750342&view=diff
==============================================================================
--- ofbiz/trunk/build.xml (original)
+++ ofbiz/trunk/build.xml Thu Mar  5 06:54:41 2009
@@ -429,6 +429,16 @@
             <fileset dir="runtime/logs/test-results" includes="*.xml"/>
         </move>
     </target>
+    <target name="run-single-test-suite">
+        <antcall target="restore-runtime-data"/>
+        <java jar="ofbiz.jar" fork="true">
+            <jvmarg value="${memory.initial.param}"/>
+            <jvmarg value="${memory.max.param}"/>
+            <arg value="test"/>
+            <arg value="-component=${test.component}"/>
+            <arg value="-suitename=${test.suiteName}"/>
+        </java>
+    </target>
     <target name="run-test-list" depends="setup-separated-test-run">
         <delete dir="runtime/logs/test-results"/>
         <ant antfile="runtime/test-list-build.xml" target="all-tests"/>

Modified: ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/TestListContainer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/TestListContainer.java?rev=750342&r1=750341&r2=750342&view=diff
==============================================================================
--- ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/TestListContainer.java (original)
+++ ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/TestListContainer.java Thu Mar  5 06:54:41 2009
@@ -52,11 +52,11 @@
 
     public static final class FoundTest {
         public final String componentName;
-        public final String caseName;
+        public final String suiteName;
 
-        public FoundTest(String componentName, String caseName) {
+        public FoundTest(String componentName, String suiteName) {
             this.componentName = componentName;
-            this.caseName = caseName;
+            this.suiteName = suiteName;
         }
     }
 
@@ -83,10 +83,7 @@
             try {
                 Document testSuiteDocument = testSuiteResource.getDocument();
                 Element documentElement = testSuiteDocument.getDocumentElement();
-                for (Element testCaseElement : UtilXml.childElementList(documentElement, UtilMisc.toSet("test-case", "test-group"))) {
-                    String caseName = testCaseElement.getAttribute("case-name");
-                    foundTests.add(new FoundTest(componentName, caseName));
-                }
+                foundTests.add(new FoundTest(componentName, documentElement.getAttribute("suite-name")));
             } catch (GenericConfigException e) {
                 String errMsg = "Error reading XML document from ResourceHandler for loader [" + testSuiteResource.getLoaderName() + "] and location [" + testSuiteResource.getLocation() + "]";
                 Debug.logError(e, errMsg, module);
@@ -98,7 +95,7 @@
             PrintStream pout = new PrintStream(fout);
             if ("text".equals(mode)) {
                 for (FoundTest foundTest: foundTests) {
-                    pout.format("%s:%s\n", foundTest.componentName, foundTest.caseName);
+                    pout.format("%s:%s\n", foundTest.componentName, foundTest.suiteName);
                 }
             } else if ("ant".equals(mode)) {
                 pout.println("<project default=\"all-tests\">");
@@ -106,12 +103,12 @@
                 for (int i = 0; i < foundTests.size(); i++) {
                     if (i != 0) pout.print(',');
                     FoundTest foundTest = foundTests.get(i);
-                    pout.format("%s:%s", foundTest.componentName, foundTest.caseName.replace(' ', '_'));
+                    pout.format("%s:%s", foundTest.componentName, foundTest.suiteName);
                 }
                 pout.println("\"/>\n");
                 for (int i = 0; i < foundTests.size(); i++) {
                     FoundTest foundTest = foundTests.get(i);
-                    pout.format(" <target name=\"%1$s:%2$s\">\n  <ant antfile=\"build.xml\" target=\"run-single-test\">\n   <property name=\"test.component\" value=\"%1$s\"/>\n   <property name=\"test.case\" value=\"%3$s\"/>\n  </ant>\n </target>\n", foundTest.componentName, foundTest.caseName.replace(' ', '_'), foundTest.caseName);
+                    pout.format(" <target name=\"%1$s:%2$s\">\n  <ant antfile=\"build.xml\" target=\"run-single-test-suite\">\n   <property name=\"test.component\" value=\"%1$s\"/>\n   <property name=\"test.suiteName\" value=\"%2$s\"/>\n  </ant>\n </target>\n", foundTest.componentName, foundTest.suiteName);
                 }
                 pout.println("</project>");
             }