incubator-easyant-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlboud...@apache.org
Subject svn commit: r1366306 - in /incubator/easyant/plugins/trunk/deps-lib/src: main/resources/deps-lib.ant test/ test/antunit/ test/antunit/deps-lib-test.xml
Date Fri, 27 Jul 2012 08:30:31 GMT
Author: jlboudart
Date: Fri Jul 27 08:30:31 2012
New Revision: 1366306

URL: http://svn.apache.org/viewvc?rev=1366306&view=rev
Log:
Add deps-lib test case

Added:
    incubator/easyant/plugins/trunk/deps-lib/src/test/
    incubator/easyant/plugins/trunk/deps-lib/src/test/antunit/
    incubator/easyant/plugins/trunk/deps-lib/src/test/antunit/deps-lib-test.xml
Modified:
    incubator/easyant/plugins/trunk/deps-lib/src/main/resources/deps-lib.ant

Modified: incubator/easyant/plugins/trunk/deps-lib/src/main/resources/deps-lib.ant
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/deps-lib/src/main/resources/deps-lib.ant?rev=1366306&r1=1366305&r2=1366306&view=diff
==============================================================================
--- incubator/easyant/plugins/trunk/deps-lib/src/main/resources/deps-lib.ant (original)
+++ incubator/easyant/plugins/trunk/deps-lib/src/main/resources/deps-lib.ant Fri Jul 27 08:30:31
2012
@@ -30,7 +30,7 @@
         </fileset>
     </target>   
     
-    <target name="deps-lib:plugin" extensionOf="abstract-provisioning:provisioning-finished">
+    <target name="deps-lib:plugin" depends="deps-lib:init">
         <ea:parameter path="compile.main.classpath"  
             description="main compilation path" />
         <ea:parameter path="compile.test.classpath"  

Added: incubator/easyant/plugins/trunk/deps-lib/src/test/antunit/deps-lib-test.xml
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/deps-lib/src/test/antunit/deps-lib-test.xml?rev=1366306&view=auto
==============================================================================
--- incubator/easyant/plugins/trunk/deps-lib/src/test/antunit/deps-lib-test.xml (added)
+++ incubator/easyant/plugins/trunk/deps-lib/src/test/antunit/deps-lib-test.xml Fri Jul 27
08:30:31 2012
@@ -0,0 +1,69 @@
+<!--
+   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;deps-lib-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>
+    
+    <target name="setUp" depends="clean">
+      <path id="compile.main.classpath"/>
+      <path id="compile.test.classpath"/>
+      <mkdir dir="lib/main"/>
+      <mkdir dir="lib/test"/>
+      <echo file="lib/main/foobar.jar"/>
+      <echo file="lib/test/foobar-test.jar"/>
+    </target>
+    <target name="tearDown" depends="clean"/>
+
+
+    <target name="test-deps-lib">
+        <property name="main.classpath" refid="compile.main.classpath"/>
+        <property name="test.classpath" refid="compile.test.classpath"/>
+        <au:assertPropertyEquals name="main.classpath" value=""/>
+        <au:assertPropertyEquals name="test.classpath" value=""/>
+    </target>
+    
+    <target name="test-deps-lib:init" depends="deps-lib:init">
+        <au:assertReferenceSet refid="lib.main.fileset"/>
+        <au:assertReferenceSet refid="lib.test.fileset"/>
+    </target>
+
+    <target name="test-deps-lib:plugin" depends="deps-lib:plugin">
+        <property name="main.classpath" refid="compile.main.classpath"/>
+        <property name="test.classpath" refid="compile.test.classpath"/>
+        <au:assertPropertyEquals name="main.classpath" value="${basedir}/lib/main/foobar.jar"/>
+        <au:assertPropertyEquals name="test.classpath" value="${basedir}/lib/test/foobar-test.jar"/>
+
+        <au:assertReferenceSet refid="compile.main.classpath"/>
+        <au:assertReferenceSet refid="compile.test.classpath"/>
+    </target>
+</project>



Mime
View raw message