incubator-easyant-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlboud...@apache.org
Subject svn commit: r1370042 - in /incubator/easyant/plugins/trunk/test-testng/src: main/resources/ test/antunit/ test/antunit/src/ test/antunit/src/integration-test/ test/antunit/src/integration-test/java/ test/antunit/src/integration-test/java/org/ test/antu...
Date Mon, 06 Aug 2012 22:07:10 GMT
Author: jlboudart
Date: Mon Aug  6 22:07:09 2012
New Revision: 1370042

URL: http://svn.apache.org/viewvc?rev=1370042&view=rev
Log:
test-testng test case is now working :)

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

Modified: incubator/easyant/plugins/trunk/test-testng/src/main/resources/test-testng.ant
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/test-testng/src/main/resources/test-testng.ant?rev=1370042&r1=1370041&r2=1370042&view=diff
==============================================================================
--- incubator/easyant/plugins/trunk/test-testng/src/main/resources/test-testng.ant (original)
+++ incubator/easyant/plugins/trunk/test-testng/src/main/resources/test-testng.ant Mon Aug
 6 22:07:09 2012
@@ -44,9 +44,7 @@
                 <classpath refid="run.@{prefix}.classpath" />
                 <xmlfileset dir="${target.@{prefix}.classes}" includes="${testng.filename}"
/>
                 <!-- Alternative way to launch testng, maybe this could be an alternative
target? -->
-                <!--
-                            <classfileset dir="${build.test.dir}" includes="**/*.class"
/>
-                -->
+                            <classfileset dir="${target.@{prefix}.classes}" includes="**/*.class"
/>
             </testng>
         </sequential>
     </macrodef>

Added: incubator/easyant/plugins/trunk/test-testng/src/test/antunit/sample-module.ivy
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/test-testng/src/test/antunit/sample-module.ivy?rev=1370042&view=auto
==============================================================================
--- incubator/easyant/plugins/trunk/test-testng/src/test/antunit/sample-module.ivy (added)
+++ incubator/easyant/plugins/trunk/test-testng/src/test/antunit/sample-module.ivy Mon Aug
 6 22:07:09 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="org.testng" name="testng" rev="6.7" conf="default->default"/>
+    </dependencies>
+
+</ivy-module>

Added: incubator/easyant/plugins/trunk/test-testng/src/test/antunit/src/integration-test/java/org/apache/easyant/SampleITTest.java
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/test-testng/src/test/antunit/src/integration-test/java/org/apache/easyant/SampleITTest.java?rev=1370042&view=auto
==============================================================================
--- incubator/easyant/plugins/trunk/test-testng/src/test/antunit/src/integration-test/java/org/apache/easyant/SampleITTest.java
(added)
+++ incubator/easyant/plugins/trunk/test-testng/src/test/antunit/src/integration-test/java/org/apache/easyant/SampleITTest.java
Mon Aug  6 22:07:09 2012
@@ -0,0 +1,17 @@
+package org.apache.easyant;
+
+import org.testng.annotations.*;
+import org.testng.Assert;
+
+public class SampleITTest {
+
+    @Test
+    public void testTrue() {
+       Assert.assertTrue(true);
+    }
+    @Test
+    public void testShouldFail() {
+       Assert.assertTrue(false);
+    }
+
+}

Added: incubator/easyant/plugins/trunk/test-testng/src/test/antunit/src/test/java/org/apache/easyant/SampleTest.java
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/test-testng/src/test/antunit/src/test/java/org/apache/easyant/SampleTest.java?rev=1370042&view=auto
==============================================================================
--- incubator/easyant/plugins/trunk/test-testng/src/test/antunit/src/test/java/org/apache/easyant/SampleTest.java
(added)
+++ incubator/easyant/plugins/trunk/test-testng/src/test/antunit/src/test/java/org/apache/easyant/SampleTest.java
Mon Aug  6 22:07:09 2012
@@ -0,0 +1,17 @@
+package org.apache.easyant;
+
+import org.testng.annotations.*;
+import org.testng.Assert;
+
+public class SampleTest {
+
+    @Test
+    public void testTrue() {
+       Assert.assertTrue(true);
+    }
+    @Test
+    public void testShouldFail() {
+       Assert.assertTrue(false);
+    }
+
+}

Modified: incubator/easyant/plugins/trunk/test-testng/src/test/antunit/test-testng-test.xml
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/test-testng/src/test/antunit/test-testng-test.xml?rev=1370042&r1=1370041&r2=1370042&view=diff
==============================================================================
--- incubator/easyant/plugins/trunk/test-testng/src/test/antunit/test-testng-test.xml (original)
+++ incubator/easyant/plugins/trunk/test-testng/src/test/antunit/test-testng-test.xml Mon
Aug  6 22:07:09 2012
@@ -34,9 +34,15 @@
         </delete>
     </target>
     
-    <!--TODO: add a testng sample -->
     <!--FIXME: test-testng 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-testng:init" depends="test-testng:init">
@@ -50,24 +56,19 @@
     <target name="test-test-testng:integration-test" depends="-test-testng:integration-test">
         <au:assertFileExists file="${target.test.xml}"/>
     </target>
+
+    <target name="configure-plugin">
+       <property name="test.mode.run" value="true"/>
+       <property name="test.run.failonerror" value="false"/>
+    </target>
+
     
-    <target name="test-test-testng:run">
-        <au:expectfailure message="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">
-            <antcall target="test-testng:run">
-                <param name="test.mode.run" value="true"/>
-                <param name="test.failed" value="true"/>
-            </antcall>
-        </au:expectfailure>
-        
-    </target>
-
-    <target name="test-test-testng: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-testng:run-integration">
-                <param name="test.mode.run" value="true"/>
-                <param name="test.integration.failed" value="true"/>
-            </antcall>
-        </au:expectfailure>
+    <target name="test-test-testng:run" depends="configure-plugin,test-testng: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-testng:run-integration" depends="configure-plugin,test-testng: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>
 



Mime
View raw message