incubator-easyant-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlboud...@apache.org
Subject svn commit: r1366340 - in /incubator/easyant/plugins/trunk/ivy-provisioning/src: main/resources/ivy-provisioning.ant test/ test/antunit/ test/antunit/ivy-provisioning-test.xml test/antunit/sample-module.ivy
Date Fri, 27 Jul 2012 11:24:46 GMT
Author: jlboudart
Date: Fri Jul 27 11:24:46 2012
New Revision: 1366340

URL: http://svn.apache.org/viewvc?rev=1366340&view=rev
Log:
Add ivy-provisioning test case

Added:
    incubator/easyant/plugins/trunk/ivy-provisioning/src/test/
    incubator/easyant/plugins/trunk/ivy-provisioning/src/test/antunit/
    incubator/easyant/plugins/trunk/ivy-provisioning/src/test/antunit/ivy-provisioning-test.xml
    incubator/easyant/plugins/trunk/ivy-provisioning/src/test/antunit/sample-module.ivy
Modified:
    incubator/easyant/plugins/trunk/ivy-provisioning/src/main/resources/ivy-provisioning.ant

Modified: incubator/easyant/plugins/trunk/ivy-provisioning/src/main/resources/ivy-provisioning.ant
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/ivy-provisioning/src/main/resources/ivy-provisioning.ant?rev=1366340&r1=1366339&r2=1366340&view=diff
==============================================================================
--- incubator/easyant/plugins/trunk/ivy-provisioning/src/main/resources/ivy-provisioning.ant
(original)
+++ incubator/easyant/plugins/trunk/ivy-provisioning/src/main/resources/ivy-provisioning.ant
Fri Jul 27 11:24:46 2012
@@ -23,9 +23,6 @@
     <ea:import mrid="org.apache.easyant.plugins#abstract-provisioning;0.9" />
 
     <target name="-ivy-provisioning:init" extensionOf="abstract-provisioning:provisioning-ready">
-        <ea:parameter property="lib.main" default="${basedir}/lib/main" description="directory
where main libraries are picked up" />
-        <ea:parameter property="lib.test" default="${basedir}/lib/test" description="directory
where test libraries are picked up" />
-        <ea:parameter property="lib.provided" default="${basedir}/lib/provided" description="directory
where provided libraries are picked up" />
         <ea:parameter property="main.confs" default="default" description="confs used
for main librairies" />
         <ea:parameter property="test.confs" default="test" description="confs used for
test librairies" />
         <ea:parameter property="provided.confs" default="provided" description="confs
used for provided librairies" />
@@ -63,13 +60,13 @@
     <target name="-ivy-provisioning:resolve" depends="abstract-provisioning:provisioning-ready">
         <ivy:resolve file="${project.ivy.file}" settingsRef="${project.ivy.instance}"
/>
         <condition property="project.contains.main.confs">
-            <matches string="${ivy.configurations}" pattern="${main.confs}"/>
+            <matches string="${ivy.resolved.configurations}" pattern="${main.confs}"/>
         </condition>
         <condition property="project.contains.test.confs">
-            <matches string="${ivy.configurations}" pattern="${test.confs}"/>
+            <matches string="${ivy.resolved.configurations}" pattern="${test.confs}"/>
         </condition>
         <condition property="project.contains.provided.confs">
-            <matches string="${ivy.configurations}" pattern="${provided.confs}"/>
+            <matches string="${ivy.resolved.configurations}" pattern="${provided.confs}"/>
         </condition>
     </target>
 

Added: incubator/easyant/plugins/trunk/ivy-provisioning/src/test/antunit/ivy-provisioning-test.xml
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/ivy-provisioning/src/test/antunit/ivy-provisioning-test.xml?rev=1366340&view=auto
==============================================================================
--- incubator/easyant/plugins/trunk/ivy-provisioning/src/test/antunit/ivy-provisioning-test.xml
(added)
+++ incubator/easyant/plugins/trunk/ivy-provisioning/src/test/antunit/ivy-provisioning-test.xml
Fri Jul 27 11:24:46 2012
@@ -0,0 +1,96 @@
+<!--
+   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;ivy-provisioning-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">
+       <property name="project.ivy.instance" value="project.ivy.instance"/>
+       <ivy:settings id="${project.ivy.instance}"/>
+       <property name="project.ivy.file" value="sample-module.ivy"/>
+    </target>
+
+    <target name="tearDown" depends="clean"/>
+    
+    <target name="test-ivy-provisioning:init" depends="-ivy-provisioning:init">
+        <au:assertPropertyEquals name="main.confs" value="default"/>
+        <au:assertPropertyEquals name="test.confs" value="test"/>
+        <au:assertPropertyEquals name="provided.confs" value="provided"/>
+        <au:assertPropertyEquals name="project.ivy.instance" value="project.ivy.instance"/>
+        <au:assertPropertyEquals name="project.ivy.file" value="sample-module.ivy"/>
+        <au:assertPropertyEquals name="retrieve.dependencies" value="false"/>
+        <au:assertPropertyEquals name="retrieve.pattern.lib.main" value="${lib.main}/[artifact]-[revision].[ext]"/>
+        <au:assertPropertyEquals name="retrieve.pattern.lib.test" value="${lib.test}/[artifact]-[revision].[ext]"/>
+        <au:assertPropertyEquals name="retrieve.pattern.lib.provided" value="${lib.provided}/[artifact]-[revision].[ext]"/>
+        <au:assertPropertyEquals name="sync.lib.dir" value="true"/>
+        <au:assertPropertyEquals name="is.project.ivy.settings.configured" value="true"/>
+        <au:assertReferenceSet refid="lib.main.fileset"/>
+        <au:assertReferenceSet refid="lib.test.fileset"/>
+        <au:assertReferenceSet refid="lib.provided.fileset"/>
+        <au:assertReferenceSet refid="project.lib.main.classpath"/>
+        <au:assertReferenceSet refid="project.lib.test.classpath"/>
+        <au:assertReferenceSet refid="project.lib.provided.classpath"/>
+    </target>
+
+    <target name="test-ivy-provisioning:resolve" depends="-ivy-provisioning:resolve">
+        <au:assertLogContains text=":: resolving dependencies :: org.apache.easyant#standard-java-app;0.1"/>
+        <au:assertPropertyEquals name="project.contains.main.confs" value="true"/>
+        <au:assertPropertyEquals name="project.contains.test.confs" value="true"/>
+        <au:assertPropertyEquals name="project.contains.provided.confs" value="true"/>
+    </target>
+
+    <target name="prepare-resolve">
+                <property name="retrieve.dependencies" value="true"/>
+    </target>
+
+    <target name="test-ivy-provisioning:resolve-main-confs" depends="prepare-resolve,-ivy-provisioning:resolve-main-confs">
+        <au:assertReferenceSet refid="cache.main.classpath"/>
+        <au:assertReferenceSet refid="compile.main.classpath"/>
+        <au:assertFileExists file="${lib.main}"/>
+    </target>
+
+    <target name="test-ivy-provisioning:resolve-test-confs" depends="prepare-resolve,-ivy-provisioning:resolve-test-confs">
+        <au:assertReferenceSet refid="cache.test.classpath"/>
+        <au:assertReferenceSet refid="compile.test.classpath"/>
+        <au:assertFileExists file="${lib.test}"/>
+    </target>
+
+    <target name="test-ivy-provisioning:resolve-provided-confs" depends="prepare-resolve,-ivy-provisioning:resolve-provided-confs">
+        <au:assertReferenceSet refid="cache.provided.classpath"/>
+        <au:assertReferenceSet refid="compile.main.classpath"/>
+        <au:assertFileExists file="${lib.provided}"/>
+    </target>
+
+
+
+</project>

Added: incubator/easyant/plugins/trunk/ivy-provisioning/src/test/antunit/sample-module.ivy
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/ivy-provisioning/src/test/antunit/sample-module.ivy?rev=1366340&view=auto
==============================================================================
--- incubator/easyant/plugins/trunk/ivy-provisioning/src/test/antunit/sample-module.ivy (added)
+++ incubator/easyant/plugins/trunk/ivy-provisioning/src/test/antunit/sample-module.ivy Fri
Jul 27 11:24:46 2012
@@ -0,0 +1,29 @@
+<?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"/>
+    <configurations>
+        <conf name="default" description="runtime dependencies artifact can be used with
this conf"/>
+        <conf name="test" description="this scope indicates that the dependency is not
required for normal use of the application, and is only available for the test compilation
and execution phases."/>
+        <conf name="provided" description="this is much like compile, but indicates you
expect the JDK or a container to provide it. It is only available on the compilation classpath,
and is not transitive."/>
+    </configurations>
+    <dependencies>
+        <dependency org="junit" name="junit" rev="4.4" conf="*->default"/>
+    </dependencies>
+
+</ivy-module>



Mime
View raw message