incubator-easyant-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlboud...@apache.org
Subject svn commit: r1370448 - in /incubator/easyant/plugins/trunk/compile-groovy/src: main/resources/ test/ test/antunit/ test/antunit/src/ test/antunit/src/main/ test/antunit/src/main/groovy/ test/antunit/src/main/groovy/org/ test/antunit/src/main/groovy/org...
Date Tue, 07 Aug 2012 19:19:38 GMT
Author: jlboudart
Date: Tue Aug  7 19:19:37 2012
New Revision: 1370448

URL: http://svn.apache.org/viewvc?rev=1370448&view=rev
Log:
Add compile-groovy test case

Added:
    incubator/easyant/plugins/trunk/compile-groovy/src/test/
    incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/
    incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/compile-groovy-test.xml
    incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/sample-module.ivy
    incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/src/
    incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/src/main/
    incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/src/main/groovy/
    incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/src/main/groovy/org/
    incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/src/main/groovy/org/apache/
    incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/src/main/groovy/org/apache/easyant/
    incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/src/main/groovy/org/apache/easyant/example/
    incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/src/main/groovy/org/apache/easyant/example/Example.groovy
    incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/src/main/groovy/org/apache/easyant/example/Example2.groovy
    incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/src/main/groovy/org/apache/easyant/example/Example2.java
Modified:
    incubator/easyant/plugins/trunk/compile-groovy/src/main/resources/compile-groovy.ant

Modified: incubator/easyant/plugins/trunk/compile-groovy/src/main/resources/compile-groovy.ant
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/compile-groovy/src/main/resources/compile-groovy.ant?rev=1370448&r1=1370447&r2=1370448&view=diff
==============================================================================
--- incubator/easyant/plugins/trunk/compile-groovy/src/main/resources/compile-groovy.ant (original)
+++ incubator/easyant/plugins/trunk/compile-groovy/src/main/resources/compile-groovy.ant Tue
Aug  7 19:19:37 2012
@@ -33,6 +33,9 @@
     </target>
 
     <target name="-compile-groovy:configure" depends="compile-groovy:init,abstract-compile:compile-ready">
+         <ea:parameter property="project.ivy.instance" default="project.ivy.instance"
+            description="the ivy instance name for your project" />
+
         <ea:findclasspath pathid="resolved.groovy.classpath" organisation="org.codehaus.groovy"
module="groovy-all" revision="1.6.0">
             <ea:project-dependency-strategy />
             <ea:environment-strategy env="GROOVY_HOME"/>
@@ -43,7 +46,7 @@
 
     </target>
 
-    <target name="compile-groovy:compile" depends="compile-groovy:configure" if="has.src.main.groovy"
extensionOf="abstract-compile:compile-finished">
+    <target name="compile-groovy:compile" depends="-compile-groovy:configure" if="has.src.main.groovy"
extensionOf="abstract-compile:compile-finished">
         <mkdir dir="${target.main.classes}" />
         <!--
         <groovyc> Attributes

Added: incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/compile-groovy-test.xml
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/compile-groovy-test.xml?rev=1370448&view=auto
==============================================================================
--- incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/compile-groovy-test.xml
(added)
+++ incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/compile-groovy-test.xml
Tue Aug  7 19:19:37 2012
@@ -0,0 +1,62 @@
+<!--
+   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;compile-groovy-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"/>
+
+    <property name="src.main.groovy" value="${basedir}/src/main/groovy"/>
+   
+    <!-- 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">
+        <!--FIXME: findclasspath requires project.ivy.instance and a resolved module -->
+        <ivy:settings id="project.ivy.instance"/>
+        <ivy:resolve file="sample-module.ivy" settingsRef="project.ivy.instance"/>
+    </target>
+    <target name="tearDown" depends="clean"/>
+    
+    <target name="test-compile-groovy:init" depends="compile-groovy:init">
+        <au:assertPropertyEquals name="src.main.groovy" value="${basedir}/src/main/groovy"/>
+        <au:assertPropertyEquals name="compile.groovy.includes.pattern" value="**/*.groovy"/>
+        <au:assertPropertyEquals name="compile.groovy.excludes.pattern" value=""/>
+        <au:assertPropertyEquals name="has.src.main.groovy" value="true"/>
+    </target>
+    
+    <target name="test-compile-groovy:configure" depends="-compile-groovy:configure">
+         <au:assertReferenceSet refid="resolved.groovy.classpath"/>
+    </target>
+
+    <target name="test-compile-groovy:compile" depends="compile-groovy:compile">
+        <au:assertFileExists file="${target.main.classes}"/>	
+        <au:assertFileExists file="${target.main.classes}/org/apache/easyant/example/Example.class"/>
+        <au:assertFileExists file="${target.main.classes}/org/apache/easyant/example/Example2.class"/>
+    </target>
+</project>

Added: incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/sample-module.ivy
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/sample-module.ivy?rev=1370448&view=auto
==============================================================================
--- incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/sample-module.ivy (added)
+++ incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/sample-module.ivy Tue
Aug  7 19:19:37 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>

Added: incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/src/main/groovy/org/apache/easyant/example/Example.groovy
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/src/main/groovy/org/apache/easyant/example/Example.groovy?rev=1370448&view=auto
==============================================================================
--- incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/src/main/groovy/org/apache/easyant/example/Example.groovy
(added)
+++ incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/src/main/groovy/org/apache/easyant/example/Example.groovy
Tue Aug  7 19:19:37 2012
@@ -0,0 +1,36 @@
+/*
+ *  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.
+ *
+ */
+package org.apache.easyant.example;
+
+import java.io.IOException;
+import java.util.Properties;
+
+public class Example {
+    public static void main(String[] args) throws IOException {
+        System.out.println(new Example().sayHello("EasyAnt"));
+    }
+
+    /* 
+     * @param who Who says hello
+     */
+    public String sayHello(String who) throws IOException {
+        Properties props = new Properties();
+        props.load(Example.class.getResourceAsStream("/main.properties"));
+        return props.getProperty("example") + " " + who + "!";
+    }
+}

Added: incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/src/main/groovy/org/apache/easyant/example/Example2.groovy
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/src/main/groovy/org/apache/easyant/example/Example2.groovy?rev=1370448&view=auto
==============================================================================
--- incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/src/main/groovy/org/apache/easyant/example/Example2.groovy
(added)
+++ incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/src/main/groovy/org/apache/easyant/example/Example2.groovy
Tue Aug  7 19:19:37 2012
@@ -0,0 +1,40 @@
+/*
+ *  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.
+ *
+ */
+package org.apache.easyant.example;
+
+import java.io.IOException;
+import java.util.Properties;
+
+public class Example2 {
+    public static void main(String[] args) throws IOException {
+        System.out.println(new Example().sayHello("EasyAnt"));
+    }
+
+    /* 
+     * @param who Who says hello
+     */
+    public String sayHello(String who) throws IOException {
+        Properties props = new Properties();
+        props.load(Example.class.getResourceAsStream("/main.properties"));
+        return props.getProperty("example") + " " + who + "!";
+    }
+    public String CheckstyleShouldComplainAboutMethodName() throws IOException {
+        return "CheckstyleShouldComplainAboutMethodName !";
+    }
+
+}

Added: incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/src/main/groovy/org/apache/easyant/example/Example2.java
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/src/main/groovy/org/apache/easyant/example/Example2.java?rev=1370448&view=auto
==============================================================================
--- incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/src/main/groovy/org/apache/easyant/example/Example2.java
(added)
+++ incubator/easyant/plugins/trunk/compile-groovy/src/test/antunit/src/main/groovy/org/apache/easyant/example/Example2.java
Tue Aug  7 19:19:37 2012
@@ -0,0 +1,40 @@
+/*
+ *  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.
+ *
+ */
+package org.apache.easyant.example;
+
+import java.io.IOException;
+import java.util.Properties;
+
+public class Example2 {
+    public static void main(String[] args) throws IOException {
+        System.out.println(new Example().sayHello("EasyAnt"));
+    }
+
+    /* 
+     * @param who Who says hello
+     */
+    public String sayHello(String who) throws IOException {
+        Properties props = new Properties();
+        props.load(Example.class.getResourceAsStream("/main.properties"));
+        return props.getProperty("example") + " " + who + "!";
+    }
+    public String CheckstyleShouldComplainAboutMethodName() throws IOException {
+        return "CheckstyleShouldComplainAboutMethodName !";
+    }
+
+}



Mime
View raw message