incubator-depot-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: rev 10450 - in incubator/depot/trunk/version: src/java src/test/java/org/apache/depot/version/ant/available src/test/java/org/apache/depot/version/ant/constraint src/test/java/org/apache/depot/version/ant/environment src/test/java/org/apache/depot/version/ant/stamp transient
Date Fri, 30 Apr 2004 14:55:15 GMT
Author: ajack
Date: Fri Apr 30 07:55:14 2004
New Revision: 10450

Added:
   incubator/depot/trunk/version/transient/
Removed:
   incubator/depot/trunk/version/src/java/depot-version
Modified:
   incubator/depot/trunk/version/src/java/depot-version-antlib.xml
   incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/available/VersionAvailableTaskTest.java
   incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/available/available.xml
   incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/constraint/constraint-check.xml
   incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/constraint/constraint.xml
   incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/environment/EnvironmentTaskTest.java
   incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/environment/environment.xml
   incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/stamp/VersionGeneratorTaskTest.java
   incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/stamp/version.xml
Log:
Get these working as antlibs, and test them all.


Modified: incubator/depot/trunk/version/src/java/depot-version-antlib.xml
==============================================================================
--- incubator/depot/trunk/version/src/java/depot-version-antlib.xml	(original)
+++ incubator/depot/trunk/version/src/java/depot-version-antlib.xml	Fri Apr 30 07:55:14 2004
@@ -11,26 +11,26 @@
 -->
 <antlib>
 	<!-- Generate a version class in a *.java (does NOT compile it) -->
-   	<typedef name="stamp" 
+   	<taskdef name="stamp" 
 		classname="org.apache.depot.version.ant.stamp.VersionMarkerGeneratorTask"/>
 
 	<!-- Document an environment -->
-	<typedef name="environment"
+	<taskdef name="environment"
 		classname="org.apache.depot.version.ant.environment.EnvironmentTask"/>
 
 	<!-- Runtime env checking (fails if constraints fail) -->
-	<typedef name="environment-check"
+	<taskdef name="environment-check"
 		classname="org.apache.depot.version.ant.environment.EnvironmentCheckTask"/>
 
 	<!-- Set a property if a version is available -->
-	<typedef name="version-available"
+	<taskdef name="version-available"
 		classname="org.apache.depot.version.ant.available.AvailableTask"/>
 
 	<!-- Generate a constraint class (does NOT compile it) -->
-	<typedef name="constraint"
+	<taskdef name="constraint"
 		classname="org.apache.depot.version.ant.constraint.ConstraintGeneratorTask"/>
 
 	<!-- Constraint checking -->
-	<typedef name="constraint-check"
+	<taskdef name="constraint-check"
 		classname="org.apache.depot.version.ant.constraint.ConstraintCheckTask"/>
 </antlib>

Modified: incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/available/VersionAvailableTaskTest.java
==============================================================================
--- incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/available/VersionAvailableTaskTest.java
(original)
+++ incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/available/VersionAvailableTaskTest.java
Fri Apr 30 07:55:14 2004
@@ -17,33 +17,42 @@
 package org.apache.depot.version.ant.available;
 
 import org.apache.tools.ant.BuildFileTest;
+import org.apache.tools.ant.Project;
 
 public class VersionAvailableTaskTest extends BuildFileTest {
 
-    /**
-     * Constructor for VersionTask.
-     * @param arg0
-     */
-    public VersionAvailableTaskTest(String arg0) {
-        super(arg0);
-    }
-
-    public void setUp() {
-        configureProject("src/test/java/org/apache/depot/version/ant/available/available.xml");
-    }
-
-    public void testExistence() {
-        executeTarget("testExistence");
-        assertPropertySet("version.available");
-    }
- 
-    public void testAbsence() {
-       executeTarget("testAbsence");
-       assertPropertyUnset("version.available");
-   }
- 
-    public void testHigher() {
-       executeTarget("testHigher");
-       assertPropertySet("version.available");
-   } 
+	/**
+	 * Constructor for VersionTask.
+	 * 
+	 * @param arg0
+	 */
+	public VersionAvailableTaskTest(String arg0) {
+		super(arg0);
+	}
+
+	public void setUp() {
+		configureProject(
+				"src/test/java/org/apache/depot/version/ant/available/available.xml",
+				Project.MSG_DEBUG);
+	}
+
+	public void testExistence() {
+		try {
+			executeTarget("testExistence");
+			assertPropertySet("version.available");
+		} finally {
+			System.out.println("Ant Output:");
+			System.out.println(getOutput());
+		}
+	}
+
+	public void testAbsence() {
+		executeTarget("testAbsence");
+		assertPropertyUnset("version.available");
+	}
+
+	public void testHigher() {
+		executeTarget("testHigher");
+		assertPropertySet("version.available");
+	}
 }

Modified: incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/available/available.xml
==============================================================================
--- incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/available/available.xml
(original)
+++ incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/available/available.xml
Fri Apr 30 07:55:14 2004
@@ -14,17 +14,15 @@
 See the License for the specific language governing permissions and
 limitations under the License.
 -->
-<project name="version-test" basedir="../../../../../.." default="testSimple">
+<project name="version-test" basedir="../../../../../../" default="test">
 	<taskdef resource="depot-version-antlib.xml"/>
 	
 	<target name="testExistence">
-		<version-available property="version.available" versionId="org.apache.version">
-		</version-available>
+		<version-available property="version.available" versionId="org.apache.version"/>
 	</target>	
 		
 	<target name="testAbsence">
-		<version-available property="version.available" versionId="org.apache.bogus">
-		</version-available>
+		<version-available property="version.available" versionId="org.apache.bogus"/>
 	</target>
 		
 	<target name="testHigher">
@@ -34,5 +32,7 @@
 				minor="2"/>
 		</version-available>
 	</target>
+	
+	<target name="test" depends="testExistence, testAbsence, testHigher" />
 	
 </project>

Modified: incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/constraint/constraint-check.xml
==============================================================================
--- incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/constraint/constraint-check.xml
(original)
+++ incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/constraint/constraint-check.xml
Fri Apr 30 07:55:14 2004
@@ -1,10 +1,10 @@
 <?xml version="1.0"?>
-<project name="constain-test" basedir="../../../../../../../.." default="testSimple">
+<project name="constraint-check" basedir="../../../../../../../../.." default="test">
 
 	<taskdef resource="depot-version-antlib.xml"/>
 	
 	<target name="testSimple">
-		<version-constraint-check>
+		<constraint-check>
          	<constraintSet severity="error">
                  <lessThan versionId="org.apache.log4j"
                                  version="1.5" />
@@ -13,18 +13,20 @@
                          upperVersion="2.5" />
                  <exists versionId="org.apache.log4j" />
         	</constraintSet>
-	 	</version-constraint-check>
+	 	</constraint-check>
 	</target>
 	
 	<target name="testText">
-		<version-constraint-check>
+		<constraint-check>
          	<constraintSet>
          			org.apache.acorn &lt; 1
          			org.apache.acorn &lt;= 1
          			org.apache.acorn EqualTo 1
          			org.apache.acorn GreaterThanOrEqualTo 1
         	</constraintSet>
-	 	</version-constraint-check>
+	 	</constraint-check>
 	</target>
+	
+	<target name="test" depends="testSimple, testText" />	
 	
 </project>

Modified: incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/constraint/constraint.xml
==============================================================================
--- incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/constraint/constraint.xml
(original)
+++ incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/constraint/constraint.xml
Fri Apr 30 07:55:14 2004
@@ -1,10 +1,10 @@
 <?xml version="1.0"?>
-<project name="constain-test" basedir="../../../../../../../.." default="testSimple">
+<project name="constraint" basedir="../../../../../../../../.." default="test">
 
 	<taskdef resource="depot-version-antlib.xml"/>
 	
 	<target name="testSimple">
-		<version-constraint versionId="org.apache.acorn" dest="transient/test" overWrite="true">
+		<constraint versionId="org.apache.acorn" dest="transient/test" overWrite="true">
          	<constraintSet severity="error">
                  <lessThan versionId="org.apache.log4j"
                                  version="1.5" />
@@ -13,16 +13,19 @@
                          upperVersion="2.5" />
                  <exists versionId="org.apache.log4j" />
         	</constraintSet>
-	 	</version-constraint>
+	 	</constraint>
 	</target>
 	
 	
 	<target name="testText">
-		<version-constraint versionId="org.apache.acorn" dest="transient/test" overWrite="true">
+		<constraint versionId="org.apache.acorn" dest="transient/test" overWrite="true">
          	<constraintSet>
          			org.apache.acorn &lt; 1
          			org.apache.acorn &lt;= 1
         	</constraintSet>
-	 	</version-constraint>
+	 	</constraint>
 	</target>
+		
+	<target name="test" depends="testSimple, testText" />
+	
 </project>

Modified: incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/environment/EnvironmentTaskTest.java
==============================================================================
--- incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/environment/EnvironmentTaskTest.java
(original)
+++ incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/environment/EnvironmentTaskTest.java
Fri Apr 30 07:55:14 2004
@@ -33,7 +33,7 @@
     }
 
     public void test() {
-        executeTarget("test");
+        executeTarget("testEnv");
     }
     
     public void testAnnotated() {
@@ -41,6 +41,6 @@
     }
    
    public void testCheck() {
-	  executeTarget("check");
+	  executeTarget("testCheck");
    }
 }

Modified: incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/environment/environment.xml
==============================================================================
--- incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/environment/environment.xml
(original)
+++ incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/environment/environment.xml
Fri Apr 30 07:55:14 2004
@@ -1,18 +1,20 @@
 <?xml version="1.0"?>
-<project name="environment-test" basedir="../../../../../../.." default="testMinimal">
+<project name="environment-test" basedir="../../../../../../.." default="test">
 
 	<taskdef resource="depot-version-antlib.xml"/>
 	
-	<target name="test">
-		<version-environment />
+	<target name="testEnv">
+		<environment />
 	</target>
 	
 	<target name="testAnnotated">
-		<version-environment annotated="true"/>
+		<environment annotated="true"/>
 	</target>
 	
-	<target name="check">
-		<version-environment-check />
+	<target name="checkCheck">
+		<environment-check />
 	</target>
+	
+	<target name="test" depends="testEnv, testAnnotated, testCheck" />
 	
 </project>

Modified: incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/stamp/VersionGeneratorTaskTest.java
==============================================================================
--- incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/stamp/VersionGeneratorTaskTest.java
(original)
+++ incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/stamp/VersionGeneratorTaskTest.java
Fri Apr 30 07:55:14 2004
@@ -29,7 +29,7 @@
     }
 
     public void setUp() {
-        configureProject("src/test/java/org/apache/version/ant/stamp/version.xml");
+        configureProject("src/test/java/org/apache/depot/version/ant/stamp/version.xml");
     }
     public void testComplex() {
         executeTarget("testComplex");

Modified: incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/stamp/version.xml
==============================================================================
--- incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/stamp/version.xml
(original)
+++ incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/stamp/version.xml
Fri Apr 30 07:55:14 2004
@@ -1,12 +1,15 @@
 <?xml version="1.0"?>
-<project name="version-test" basedir="../../../../../../../../.." default="testSimple">
+<project name="version-test" basedir="../../../../../../../../.." default="test">
 	
 	<taskdef resource="depot-version-antlib.xml"/>
 
 	<target name="init" >
 	    <delete dir="transient/test"/>
 		<mkdir dir="transient/test"/>
+	    <delete dir="transient/classes"/>
+        <mkdir dir="transient/classes"/>
 	</target>
+	
 	<target name="testComplex" depends="init" >
 		<stamp dest="transient/test" overWrite="true">
 			<versionMarker
@@ -69,12 +72,16 @@
 	</target>
     
     <target name="compile" > 
-        <mkdir dir="build/transient"/>
-        <javac srcdir      ="transient/test"
-           destdir     ="build/transient/"
->
-      <classpath path="target\classes"/>
-    </javac>
+        <javac  srcdir="transient/test"
+				destdir="transient/classes"
+			>
+			<classpath path="transient/classes"/>
+		</javac>
     </target>
+    
+    
+	<target name="test" 
+		depends="testComplex, testComplexAttributed, testVersionString, testVersionString2, testVersionString3,
testDefaultedAttributes" />
+	
 	
 </project>

Mime
View raw message