ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1027142 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java src/tests/antunit/taskdefs/optional/junit/junit-test.xml
Date Mon, 25 Oct 2010 14:34:48 GMT
Author: bodewig
Date: Mon Oct 25 14:34:48 2010
New Revision: 1027142

URL: http://svn.apache.org/viewvc?rev=1027142&view=rev
Log:
the package name ends at the last dot of a classname, not the first.  PR 45227.

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
    ant/core/trunk/src/tests/antunit/taskdefs/optional/junit/junit-test.xml

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=1027142&r1=1027141&r2=1027142&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Mon Oct 25 14:34:48 2010
@@ -175,7 +175,13 @@ Fixed bugs:
 
  * <parallel> could allow tasks to start executing even if a task
    scheduled to run before them timed out.
-   Bugzilla Report 49527
+   Bugzilla Report 49527.
+
+ * If a <junit> batch with multiple tests times out Ant logs a message
+   about a test named Batch-With-Multiple-Tests since 1.8.0 but the
+   logic that determined the Java package of this pseudo-test has been
+   wrong.
+   Bugzilla Report 45227.
 
 Other changes:
 --------------

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java?rev=1027142&r1=1027141&r2=1027142&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java Mon
Oct 25 14:34:48 2010
@@ -2057,7 +2057,7 @@ public class JUnitTask extends Task {
      */
     private static JUnitTest createDummyTestForBatchTest(JUnitTest test) {
         JUnitTest t = (JUnitTest) test.clone();
-        int index = test.getName().indexOf('.');
+        int index = test.getName().lastIndexOf('.');
         // make sure test looks as if it was in the same "package" as
         // the last test of the batch
         String pack = index > 0 ? test.getName().substring(0, index + 1) : "";

Modified: ant/core/trunk/src/tests/antunit/taskdefs/optional/junit/junit-test.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/optional/junit/junit-test.xml?rev=1027142&r1=1027141&r2=1027142&view=diff
==============================================================================
--- ant/core/trunk/src/tests/antunit/taskdefs/optional/junit/junit-test.xml (original)
+++ ant/core/trunk/src/tests/antunit/taskdefs/optional/junit/junit-test.xml Mon Oct 25 14:34:48
2010
@@ -24,9 +24,10 @@
 
   <macrodef name="empty-test">
     <attribute name="classname"/>
+    <attribute name="package" default="test"/>
     <sequential>
       <echo file="${input}/@{classname}.java"><![CDATA[
-package test;
+package @{package};
 import junit.framework.TestCase;
 
 public class @{classname} extends TestCase {
@@ -44,9 +45,9 @@ public class @{classname} extends TestCa
   <target name="testTimeoutLogOfBatchTests">
     <mkdir dir="${input}"/>
     <mkdir dir="${output}"/>
-    <empty-test classname="ATest"/>
+    <empty-test classname="ATest" package="org.apache.ant.test"/>
       <echo file="${input}/BTest.java"><![CDATA[
-package test;
+package org.apache.ant.test;
 import junit.framework.TestCase;
 
 public class BTest extends TestCase {
@@ -55,8 +56,8 @@ public class BTest extends TestCase {
     }
 }
 ]]>  </echo>
-    <empty-test classname="CTest"/>
-    <empty-test classname="DTest"/>
+    <empty-test classname="CTest" package="org.apache.ant.test"/>
+    <empty-test classname="DTest" package="org.apache.ant.test"/>
     <javac srcdir="${input}" destdir="${output}">
       <classpath refid="junit"/>
     </javac>
@@ -71,6 +72,7 @@ public class BTest extends TestCase {
     </junit>
     <au:assertLogContains text="ATest"/>
     <au:assertLogContains text="BTest"/>
+    <au:assertLogContains text="org.apache.ant.test.Batch-With-Multiple-Tests"/>
     <au:assertLogDoesntContain text="CTest"/>
     <au:assertLogDoesntContain text="DTest"/>
   </target>



Mime
View raw message