ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject svn commit: r1050993 - in /ant/core/trunk/src: main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java tests/antunit/antunit-base.xml tests/antunit/taskdefs/optional/junit/junit-test.xml tests/antunit/taskdefs/xslt-test.xml
Date Mon, 20 Dec 2010 05:28:05 GMT
Author: antoine
Date: Mon Dec 20 05:28:04 2010
New Revision: 1050993

URL: http://svn.apache.org/viewvc?rev=1050993&view=rev
Log:
needed for execution of single methods according to email of Jesse Glick. Bugzilla 34748.reference
of the email http://mail-archives.apache.org/mod_mbox/ant-dev/201012.mbox/%3Cloom.20101217T222806-442@post.gmane.org%3E

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

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=1050993&r1=1050992&r2=1050993&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
Dec 20 05:28:04 2010
@@ -718,6 +718,7 @@ public class JUnitTask extends Task {
         addClasspathEntry("/org/apache/tools/ant/launch/AntMain.class");
         addClasspathEntry("/org/apache/tools/ant/Task.class");
         addClasspathEntry("/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.class");
+        addClasspathEntry("/org/apache/tools/ant/taskdefs/optional/junit/JUnit4TestMethodAdapter.class");
     }
 
     private static JUnitTaskMirror createMirror(JUnitTask task, ClassLoader loader) {

Modified: ant/core/trunk/src/tests/antunit/antunit-base.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/antunit-base.xml?rev=1050993&r1=1050992&r2=1050993&view=diff
==============================================================================
--- ant/core/trunk/src/tests/antunit/antunit-base.xml (original)
+++ ant/core/trunk/src/tests/antunit/antunit-base.xml Mon Dec 20 05:28:04 2010
@@ -20,6 +20,7 @@
   <property name="input" location="${java.io.tmpdir}/testinput"/>
   <property name="output" location="${java.io.tmpdir}/testoutput"/>
   <available property="jdk1.6+" classname="java.util.ServiceLoader"/>
+  <available property="jdk1.5+" classname="java.net.Proxy"/>
 
   <target name="tearDown">
     <delete dir="${input}"/>

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=1050993&r1=1050992&r2=1050993&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 Dec 20 05:28:04
2010
@@ -300,4 +300,53 @@ public class BTest extends TestCase {
     </au:expectfailure>
   </target>
 
+	<target name="-setUp.methods" depends="setUp">
+	  <property name="junit-3.8.2.location" location="../../../../lib/optional/junit-3.8.2.jar"/>
+	  <property name="junit-4.8.1.location" location="../../../../lib/optional/junit-4.8.1.jar"/>
+	  <condition property="test.can.run">
+	     <and>
+	     	<available file="${junit-3.8.2.location}"/>
+	     	<available file="${junit-4.8.1.location}"/>
+	     	<isset property="jdk1.5+"/>
+	     </and>
+	  </condition>
+	</target>
+
+	<target name="testFailNone" depends="-setUp.methods" if="test.can.run">
+		<echo file="${input}/T1.java">public class T1 extends
+			junit.framework.TestCase {
+			public void testOK() {}
+			public void testBad() {throw new RuntimeException("failed");}
+			}</echo>
+		<echo file="${input}/T2.java">
+		    import org.junit.Test;
+		    public class T2 {
+			@Test 
+			public void ok() {}
+			@Test 
+			public void bad() {
+			throw new RuntimeException("failed");}
+			}</echo>
+		<javac srcdir="${input}" destdir="${output}" includes="T1.java,T2.java" source="5"
+			 includeantruntime="false" >
+			 <classpath>
+			   <pathelement path="${java.class.path}"/>
+			 </classpath>
+		</javac>
+		<junit fork="true" printsummary="true" failureproperty="test.failed" errorproperty="test.haseerror">
+			<classpath>
+			  <pathelement location="${output}"/>
+			  <pathelement location="${junit-3.8.2.location}"/>
+			  <pathelement location="${junit-4.8.1.location}"/>
+			</classpath>
+			<test name="T1" methods="testOK" />
+			<test name="T2" methods="ok" />
+		</junit>
+		<au:assertFalse>
+		<or>
+		   <isset property="test.failed"/>
+		   <isset property="test.haserror"/>
+		</or>
+		</au:assertFalse>
+	</target>
 </project>

Modified: ant/core/trunk/src/tests/antunit/taskdefs/xslt-test.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/xslt-test.xml?rev=1050993&r1=1050992&r2=1050993&view=diff
==============================================================================
--- ant/core/trunk/src/tests/antunit/taskdefs/xslt-test.xml (original)
+++ ant/core/trunk/src/tests/antunit/taskdefs/xslt-test.xml Mon Dec 20 05:28:04 2010
@@ -147,7 +147,6 @@ undefined='<xsl:value-of select="$undefi
     </xslt>
   </target>
 
-  <available property="jdk1.5+" classname="java.net.Proxy"/>
 
   <target name="testTraceJdk14" unless="jdk1.5+" depends="setUp">
     <xslt in="${legacy.dir}/data.xml"



Mime
View raw message