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/07/26 16:53:56 UTC

svn commit: r1366081 - in /incubator/easyant/plugins/trunk/compile-test-java/src/test: ./ antunit/ antunit/src/ antunit/src/integration-test/ antunit/src/integration-test/java/ antunit/src/integration-test/java/org/ antunit/src/integration-test/java/or...

Author: jlboudart
Date: Thu Jul 26 16:53:55 2012
New Revision: 1366081

URL: http://svn.apache.org/viewvc?rev=1366081&view=rev
Log:
add compile-test-java test case

Added:
    incubator/easyant/plugins/trunk/compile-test-java/src/test/
    incubator/easyant/plugins/trunk/compile-test-java/src/test/antunit/
    incubator/easyant/plugins/trunk/compile-test-java/src/test/antunit/compile-test-java-test.xml
    incubator/easyant/plugins/trunk/compile-test-java/src/test/antunit/src/
    incubator/easyant/plugins/trunk/compile-test-java/src/test/antunit/src/integration-test/
    incubator/easyant/plugins/trunk/compile-test-java/src/test/antunit/src/integration-test/java/
    incubator/easyant/plugins/trunk/compile-test-java/src/test/antunit/src/integration-test/java/org/
    incubator/easyant/plugins/trunk/compile-test-java/src/test/antunit/src/integration-test/java/org/apache/
    incubator/easyant/plugins/trunk/compile-test-java/src/test/antunit/src/integration-test/java/org/apache/easyant/
    incubator/easyant/plugins/trunk/compile-test-java/src/test/antunit/src/integration-test/java/org/apache/easyant/example/
    incubator/easyant/plugins/trunk/compile-test-java/src/test/antunit/src/integration-test/java/org/apache/easyant/example/Example2.java
    incubator/easyant/plugins/trunk/compile-test-java/src/test/antunit/src/test/
    incubator/easyant/plugins/trunk/compile-test-java/src/test/antunit/src/test/java/
    incubator/easyant/plugins/trunk/compile-test-java/src/test/antunit/src/test/java/org/
    incubator/easyant/plugins/trunk/compile-test-java/src/test/antunit/src/test/java/org/apache/
    incubator/easyant/plugins/trunk/compile-test-java/src/test/antunit/src/test/java/org/apache/easyant/
    incubator/easyant/plugins/trunk/compile-test-java/src/test/antunit/src/test/java/org/apache/easyant/example/
    incubator/easyant/plugins/trunk/compile-test-java/src/test/antunit/src/test/java/org/apache/easyant/example/Example.java

Added: incubator/easyant/plugins/trunk/compile-test-java/src/test/antunit/compile-test-java-test.xml
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/compile-test-java/src/test/antunit/compile-test-java-test.xml?rev=1366081&view=auto
==============================================================================
--- incubator/easyant/plugins/trunk/compile-test-java/src/test/antunit/compile-test-java-test.xml (added)
+++ incubator/easyant/plugins/trunk/compile-test-java/src/test/antunit/compile-test-java-test.xml Thu Jul 26 16:53:55 2012
@@ -0,0 +1,68 @@
+<!--
+   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-test-java-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"/>
+    <target name="tearDown" depends="clean"/>
+    
+    <target name="test-compile-test-java">
+        <au:assertPropertyEquals name="src.test.java" value="${basedir}/src/test/java"/>
+        <au:assertPropertyEquals name="src.test.integration.java" value="${basedir}/src/integration-test/java"/>
+        <au:assertPropertyEquals name="javac.debug.mode" value="true"/>
+        <au:assertPropertyEquals name="has.src.test.java" value="true"/>
+        <au:assertPropertyEquals name="has.src.test.integration.java" value="true"/>
+    </target>
+
+    <target name="test-compile-test-java:compile" depends="compile-test-java:compile">
+        <au:assertPropertyEquals name="test.compile.includes.pattern" value="**/*.java"/>
+        <au:assertPropertyEquals name="test.compile.excludes.pattern" value=""/>
+        <au:assertPropertyEquals name="test.compile.java.target.version" value="${ant.java.version}"/>
+        <au:assertPropertyEquals name="test.compile.java.source.version" value="${ant.java.version}"/>
+ 
+        <au:assertFileExists file="${target.test.classes}"/>
+        <au:assertFileExists file="${target.test.classes}/org/apache/easyant/example/Example.class"/>
+    </target>
+
+    <target name="test-compile-test-java:compile-integration" depends="compile-test-java:compile-integration">
+        <au:assertPropertyEquals name="test.integration.compile.includes.pattern" value="**/*.java"/>
+        <au:assertPropertyEquals name="test.integration.compile.excludes.pattern" value=""/>
+        <au:assertPropertyEquals name="test.integration.compile.java.target.version" value="${ant.java.version}"/>
+        <au:assertPropertyEquals name="test.integration.compile.java.source.version" value="${ant.java.version}"/>
+ 
+        <au:assertFileExists file="${target.test.integration.classes}"/>
+        <au:assertFileExists file="${target.test.integration.classes}/org/apache/easyant/example/Example2.class"/>
+    </target>
+
+</project>

Added: incubator/easyant/plugins/trunk/compile-test-java/src/test/antunit/src/integration-test/java/org/apache/easyant/example/Example2.java
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/compile-test-java/src/test/antunit/src/integration-test/java/org/apache/easyant/example/Example2.java?rev=1366081&view=auto
==============================================================================
--- incubator/easyant/plugins/trunk/compile-test-java/src/test/antunit/src/integration-test/java/org/apache/easyant/example/Example2.java (added)
+++ incubator/easyant/plugins/trunk/compile-test-java/src/test/antunit/src/integration-test/java/org/apache/easyant/example/Example2.java Thu Jul 26 16:53:55 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 Example2().sayHello("EasyAnt"));
+    }
+
+    /* 
+     * @param who Who says hello
+     */
+    public String sayHello(String who) throws IOException {
+        Properties props = new Properties();
+        props.load(Example2.class.getResourceAsStream("/main.properties"));
+        return props.getProperty("example") + " " + who + "!";
+    }
+    public String CheckstyleShouldComplainAboutMethodName() throws IOException {
+        return "CheckstyleShouldComplainAboutMethodName !";
+    }
+
+}

Added: incubator/easyant/plugins/trunk/compile-test-java/src/test/antunit/src/test/java/org/apache/easyant/example/Example.java
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/compile-test-java/src/test/antunit/src/test/java/org/apache/easyant/example/Example.java?rev=1366081&view=auto
==============================================================================
--- incubator/easyant/plugins/trunk/compile-test-java/src/test/antunit/src/test/java/org/apache/easyant/example/Example.java (added)
+++ incubator/easyant/plugins/trunk/compile-test-java/src/test/antunit/src/test/java/org/apache/easyant/example/Example.java Thu Jul 26 16:53:55 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 + "!";
+    }
+}