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:20:18 UTC
svn commit: r1369458 - in
/incubator/easyant/plugins/trunk/test-junit/src/test: ./ antunit/
antunit/test-junit-test.xml
Author: jlboudart
Date: Sat Aug 4 21:20:18 2012
New Revision: 1369458
URL: http://svn.apache.org/viewvc?rev=1369458&view=rev
Log:
Add basic test case in test-junit
Added:
incubator/easyant/plugins/trunk/test-junit/src/test/
incubator/easyant/plugins/trunk/test-junit/src/test/antunit/
incubator/easyant/plugins/trunk/test-junit/src/test/antunit/test-junit-test.xml
Added: 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=1369458&view=auto
==============================================================================
--- incubator/easyant/plugins/trunk/test-junit/src/test/antunit/test-junit-test.xml (added)
+++ incubator/easyant/plugins/trunk/test-junit/src/test/antunit/test-junit-test.xml Sat Aug 4 21:20:18 2012
@@ -0,0 +1,85 @@
+<!--
+ 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.
+-->
+<project name="org.apache.easyant.plugins;test-junit-test"
+ xmlns:au="antlib:org.apache.ant.antunit"
+ xmlns:ivy="antlib:org.apache.ivy.ant"
+ xmlns:ea="antlib:org.apache.easyant">
+
+ <!-- Import your plugin -->
+ <property name="target" value="target/test-antunit"/>
+ <!-- configure easyant in current project -->
+ <ea:configure-easyant-ivy-instance />
+ <!-- import our local plugin -->
+ <ea:import-test-module moduleIvy="../../../module.ivy" sourceDirectory="../../main/resources"/>
+
+ <!-- Defines a setUp / tearDown (before each test) that cleans the environnement -->
+ <target name="clean" description="remove stale build artifacts before / after each test">
+ <delete dir="${basedir}" includeemptydirs="true">
+ <include name="**/target/**"/>
+ <include name="**/lib/**"/>
+ </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="tearDown" depends="clean"/>
+
+ <target name="test-test-junit:init" depends="test-junit:init">
+ <au:assertPropertyEquals name="test.run.forkmode" value="perTest"/>
+ <au:assertPropertyEquals name="test.run.fork" value="true"/>
+ <au:assertPropertyEquals name="test.run.jvmargs" value=""/>
+ <au:assertPropertyEquals name="test.integration.run.forkmode" value="perTest"/>
+ <au:assertPropertyEquals name="test.integration.run.fork" value="true"/>
+ <au:assertPropertyEquals name="test.integration.run.jvmargs" value=""/>
+ </target>
+
+ <target name="test-test-junit:test" depends="-test-junit:test">
+ <au:assertFileExists file="${target.test.xml}"/>
+ <au:assertFileExists file="${test.run.dir}"/>
+ </target>
+
+ <target name="test-test-junit:integration-test" depends="-test-junit:integration-test">
+ <au:assertFileExists file="${target.test.xml}"/>
+ <au:assertFileExists file="${test.integration.run.dir}"/>
+
+ </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>
+
+ <target name="test-test-junit:report" depends="test-junit:report">
+ <!--TODO: add this missing test case -->
+ </target>
+</project>