You are viewing a plain text version of this content. The canonical link for it is here.
Posted to easyant-commits@incubator.apache.org by jl...@apache.org on 2012/08/04 21:21:07 UTC

svn commit: r1369460 - in /incubator/easyant/plugins/trunk/test-junit/src/test/antunit: ./ src/ src/integration-test/ src/integration-test/java/ src/integration-test/java/org/ src/integration-test/java/org/apache/ src/integration-test/java/org/apache/e...

Author: jlboudart
Date: Sat Aug  4 21:21:06 2012
New Revision: 1369460

URL: http://svn.apache.org/viewvc?rev=1369460&view=rev
Log:
Add junit sample for tests

Added:
    incubator/easyant/plugins/trunk/test-junit/src/test/antunit/sample-module.ivy
    incubator/easyant/plugins/trunk/test-junit/src/test/antunit/src/
    incubator/easyant/plugins/trunk/test-junit/src/test/antunit/src/integration-test/
    incubator/easyant/plugins/trunk/test-junit/src/test/antunit/src/integration-test/java/
    incubator/easyant/plugins/trunk/test-junit/src/test/antunit/src/integration-test/java/org/
    incubator/easyant/plugins/trunk/test-junit/src/test/antunit/src/integration-test/java/org/apache/
    incubator/easyant/plugins/trunk/test-junit/src/test/antunit/src/integration-test/java/org/apache/easyant/
    incubator/easyant/plugins/trunk/test-junit/src/test/antunit/src/integration-test/java/org/apache/easyant/SampleITTest.java
    incubator/easyant/plugins/trunk/test-junit/src/test/antunit/src/test/
    incubator/easyant/plugins/trunk/test-junit/src/test/antunit/src/test/java/
    incubator/easyant/plugins/trunk/test-junit/src/test/antunit/src/test/java/org/
    incubator/easyant/plugins/trunk/test-junit/src/test/antunit/src/test/java/org/apache/
    incubator/easyant/plugins/trunk/test-junit/src/test/antunit/src/test/java/org/apache/easyant/
    incubator/easyant/plugins/trunk/test-junit/src/test/antunit/src/test/java/org/apache/easyant/SampleTest.java
Modified:
    incubator/easyant/plugins/trunk/test-junit/src/test/antunit/test-junit-test.xml

Added: incubator/easyant/plugins/trunk/test-junit/src/test/antunit/sample-module.ivy
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/test-junit/src/test/antunit/sample-module.ivy?rev=1369460&view=auto
==============================================================================
--- incubator/easyant/plugins/trunk/test-junit/src/test/antunit/sample-module.ivy (added)
+++ incubator/easyant/plugins/trunk/test-junit/src/test/antunit/sample-module.ivy Sat Aug  4 21:21:06 2012
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<!--
+   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.
+-->
+<ivy-module version="2.0" xmlns:ea="http://www.easyant.org"> 
+    <info organisation="org.apache.easyant" module="standard-java-app" revision="0.1" status="integration"/>
+    <dependencies>
+       <dependency org="junit" name="junit" rev="4.4" conf="default->default"/>
+    </dependencies>
+
+</ivy-module>

Added: incubator/easyant/plugins/trunk/test-junit/src/test/antunit/src/integration-test/java/org/apache/easyant/SampleITTest.java
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/test-junit/src/test/antunit/src/integration-test/java/org/apache/easyant/SampleITTest.java?rev=1369460&view=auto
==============================================================================
--- incubator/easyant/plugins/trunk/test-junit/src/test/antunit/src/integration-test/java/org/apache/easyant/SampleITTest.java (added)
+++ incubator/easyant/plugins/trunk/test-junit/src/test/antunit/src/integration-test/java/org/apache/easyant/SampleITTest.java Sat Aug  4 21:21:06 2012
@@ -0,0 +1,13 @@
+package org.apache.easyant;
+
+import junit.framework.TestCase;
+
+public class SampleITTest extends TestCase {
+    public void testTrue() {
+       assertTrue(true);
+    }
+    public void testShouldFail() {
+       assertTrue(false);
+    }
+
+}

Added: incubator/easyant/plugins/trunk/test-junit/src/test/antunit/src/test/java/org/apache/easyant/SampleTest.java
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/test-junit/src/test/antunit/src/test/java/org/apache/easyant/SampleTest.java?rev=1369460&view=auto
==============================================================================
--- incubator/easyant/plugins/trunk/test-junit/src/test/antunit/src/test/java/org/apache/easyant/SampleTest.java (added)
+++ incubator/easyant/plugins/trunk/test-junit/src/test/antunit/src/test/java/org/apache/easyant/SampleTest.java Sat Aug  4 21:21:06 2012
@@ -0,0 +1,13 @@
+package org.apache.easyant;
+
+import junit.framework.TestCase;
+
+public class SampleTest extends TestCase {
+    public void testTrue() {
+       assertTrue(true);
+    }
+    public void testShouldFail() {
+       assertTrue(false);
+    }
+
+}

Modified: incubator/easyant/plugins/trunk/test-junit/src/test/antunit/test-junit-test.xml
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/test-junit/src/test/antunit/test-junit-test.xml?rev=1369460&r1=1369459&r2=1369460&view=diff
==============================================================================
--- incubator/easyant/plugins/trunk/test-junit/src/test/antunit/test-junit-test.xml (original)
+++ incubator/easyant/plugins/trunk/test-junit/src/test/antunit/test-junit-test.xml Sat Aug  4 21:21:06 2012
@@ -34,9 +34,15 @@
         </delete>
     </target>
     
-    <!--TODO: add a junit sample -->
     <!--FIXME: test-junit targets get executed as they are prefixed by "test" -->
-    <target name="setUp" depends="clean"/>
+    <target name="setUp" depends="clean">
+        <ivy:settings id="project.ivy.instance"/>
+        <ivy:cachepath pathid="compile.test.classpath" file="sample-module.ivy" settingsRef="project.ivy.instance"/>
+        <mkdir dir="${target}/test/classes"/>
+        <mkdir dir="${target}/integration-test/classes"/>
+        <javac srcdir="src/test/java" destdir="${target}/test/classes" classpathref="compile.test.classpath"/>
+        <javac srcdir="src/integration-test/java" destdir="${target}/integration-test/classes" classpathref="compile.test.classpath"/>
+    </target>
     <target name="tearDown" depends="clean"/>
     
     <target name="test-test-junit:init" depends="test-junit:init">
@@ -58,24 +64,18 @@
         <au:assertFileExists file="${test.integration.run.dir}"/>
  
     </target>
+
+    <target name="configure-plugin">
+       <property name="test.mode.run" value="true"/>
+       <property name="test.run.failonerror" value="false"/>
+    </target>
     
-    <target name="test-test-junit:run">
-        <au:expectfailure message="At least one integration test has failed. See logs in ${target.test.xml} for details or use the report target to run the test with a report">
-            <antcall target="test-junit:run">
-                <param name="test.mode.run" value="true"/>
-                <param name="test.failed" value="true"/>
-            </antcall>
-        </au:expectfailure>
-        
-    </target>
-
-    <target name="test-test-junit:run-integration">
-        <au:expectfailure message="At least one integration test has failed. See logs in ${target.test.xml} for details or use the report target to run the test with a report">
-            <antcall target="test-junit:run-integration">
-                <param name="test.mode.run" value="true"/>
-                <param name="test.integration.failed" value="true"/>
-            </antcall>
-        </au:expectfailure>
+    <target name="test-test-junit:run" depends="configure-plugin,test-junit:run">
+        <au:assertLogContains text="At least one test has failed. See logs in ${target.test.xml} for details or use the report target to run the test with a report" level="error"/>
+    </target>
+
+    <target name="test-test-junit:run-integration" depends="configure-plugin,test-junit:run-integration">
+        <au:assertLogContains text="At least one integration test has failed. See logs in ${target.test.xml} for details or use the report target to run the test with a report" level="error"/>
 
     </target>