You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@depot.apache.org by ni...@apache.org on 2004/05/07 07:41:24 UTC

svn commit: rev 10556 - incubator/depot/trunk/update/src/test/org/apache/depot/update/ant

Author: nickchalko
Date: Fri May  7 00:41:23 2004
New Revision: 10556

Modified:
   incubator/depot/trunk/update/src/test/org/apache/depot/update/ant/CachedResourceSetTaskTest.java
   incubator/depot/trunk/update/src/test/org/apache/depot/update/ant/build.xml
Log:
fix the basename.

Modified: incubator/depot/trunk/update/src/test/org/apache/depot/update/ant/CachedResourceSetTaskTest.java
==============================================================================
--- incubator/depot/trunk/update/src/test/org/apache/depot/update/ant/CachedResourceSetTaskTest.java	(original)
+++ incubator/depot/trunk/update/src/test/org/apache/depot/update/ant/CachedResourceSetTaskTest.java	Fri May  7 00:41:23 2004
@@ -20,9 +20,7 @@
 import java.io.FileNotFoundException;
 import java.io.FileReader;
 import java.io.IOException;
-
 import javax.xml.parsers.ParserConfigurationException;
-
 import org.apache.depot.common.log.Logger;
 import org.apache.tools.ant.BuildFileTest;
 import org.custommonkey.xmlunit.XMLAssert;
@@ -101,17 +99,19 @@
 	 * Test the exporting of cached set test1.
 	 *  
 	 */
-	public void testExport1() throws FileNotFoundException, SAXException, IOException, ParserConfigurationException {
+	public void testExport1() throws FileNotFoundException, SAXException,
+			IOException, ParserConfigurationException {
 		try {
 			executeTarget("testExport1");
 			File generatedFile = new File("build/test1-export.build.xml");
 			File expectedFile = new File(
-					"src/test/org/apache/depot/update/ant/test1-export.build.xml");
+					"build/expected-test1-export.build.xml");
 			assertTrue("Expected " + generatedFile + " to  exists",
 					generatedFile.exists());
-			XMLAssert.assertXMLEqual( "Exported cached set test1", new FileReader(
-					generatedFile), new FileReader(expectedFile));
-			
+			XMLAssert
+					.assertXMLEqual("Exported cached set test1",
+							new FileReader(expectedFile), new FileReader(
+									generatedFile));
 		} finally {
 			System.out.println(getOutput());
 		}

Modified: incubator/depot/trunk/update/src/test/org/apache/depot/update/ant/build.xml
==============================================================================
--- incubator/depot/trunk/update/src/test/org/apache/depot/update/ant/build.xml	(original)
+++ incubator/depot/trunk/update/src/test/org/apache/depot/update/ant/build.xml	Fri May  7 00:41:23 2004
@@ -27,87 +27,95 @@
 	<path id="update.classpath">
 		<fileset dir="lib">
 			<include name="*.jar" />
-		</fileset>
-			<pathelement location="build/depot-update/classes" />
+		</fileset>
+		<pathelement location="build/depot-update/classes" />
 	</path>
 
-		<typedef resource="depot-update-antlib.xml" classpathref="update.classpath"/>
-		<repository id="maven" url="http://www.ibiblio.org/maven/" remote="true" />
-		<repository id="localtest" url="file:///${localtest.dir}" remote="true" />
-		<target name="test1" depends="clean-jars">
-
-			<!-- this test should find the 1.1 jar already in place. -->
-			<copy toDir="${depot.home}/local-repository">
-				<fileset dir="${localtest.dir}">
-					<include name="**/*1.1*" />
-				</fileset>
-			</copy>
-			<cachedset id="test1">
-				<resource name="helloworld" ext="jar" version="1.1" repository="localtest" />
-			</cachedset>
-			<copy toDir="${sandbox.dir}">
-				<fileset refid="test1.fileset" />
-			</copy>
-		</target>
-		<target name="test2" depends="clean-jars">
-			<!-- Since the local repo is cleaned this test should return the 1.2 jar downloaded for localtest -->
-			<cachedset id="test2">
-				<resource name="helloworld" ext="jar" version="1.2" repository="localtest" />
-			</cachedset>
-			<copy toDir="${sandbox.dir}">
-				<fileset refid="test2.fileset" />
-			</copy>
-		</target>
-		<target name="test3" depends="clean-jars">
-
-			<!-- helloworld 1.3 does not exist this should fail. -->
-			<cachedset id="test3">
-				<resource name="helloworld" ext="jar" version="1.3" repository="localtest" />
-			</cachedset>
-			<copy toDir="${sandbox.dir}">
-				<fileset refid="test3.fileset" />
-			</copy>
-		</target>
-		<target name="test4" depends="clean-jars">
-
-			<!-- this test should find the 1.2 jar from localtest -->
-			<copy toDir="${depot.home}/local-repository">
-				<fileset dir="${localtest.dir}">
-					<include name="**/*1.1*" />
-				</fileset>
-			</copy>
-			<cachedset id="test4">
-				<resource name="helloworld" ext="jar" version="1.2" repository="localtest" />
-			</cachedset>
-			<copy toDir="${sandbox.dir}">
-				<fileset refid="test4.fileset" />
-			</copy>
-		</target>
+	<typedef resource="depot-update-antlib.xml" classpathref="update.classpath" />
+	<repository id="maven" url="http://www.ibiblio.org/maven/" remote="true" />
+	<repository id="localtest" url="file:///${localtest.dir}" remote="true" />
+	<target name="test1" depends="clean-jars">
+
+		<!-- this test should find the 1.1 jar already in place. -->
+		<copy toDir="${depot.home}/local-repository">
+			<fileset dir="${localtest.dir}">
+				<include name="**/*1.1*" />
+			</fileset>
+		</copy>
+		<cachedset id="test1">
+			<resource name="helloworld" ext="jar" version="1.1" repository="localtest" />
+		</cachedset>
+		<copy toDir="${sandbox.dir}">
+			<fileset refid="test1.fileset" />
+		</copy>
+	</target>
+	<target name="test2" depends="clean-jars">
+		<!-- Since the local repo is cleaned this test should return the 1.2 jar downloaded for localtest -->
+		<cachedset id="test2">
+			<resource name="helloworld" ext="jar" version="1.2" repository="localtest" />
+		</cachedset>
+		<copy toDir="${sandbox.dir}">
+			<fileset refid="test2.fileset" />
+		</copy>
+	</target>
+	<target name="test3" depends="clean-jars">
+
+		<!-- helloworld 1.3 does not exist this should fail. -->
+		<cachedset id="test3">
+			<resource name="helloworld" ext="jar" version="1.3" repository="localtest" />
+		</cachedset>
+		<copy toDir="${sandbox.dir}">
+			<fileset refid="test3.fileset" />
+		</copy>
+	</target>
+	<target name="test4" depends="clean-jars">
+
+		<!-- this test should find the 1.2 jar from localtest -->
+		<copy toDir="${depot.home}/local-repository">
+			<fileset dir="${localtest.dir}">
+				<include name="**/*1.1*" />
+			</fileset>
+		</copy>
+		<cachedset id="test4">
+			<resource name="helloworld" ext="jar" version="1.2" repository="localtest" />
+		</cachedset>
+		<copy toDir="${sandbox.dir}">
+			<fileset refid="test4.fileset" />
+		</copy>
+	</target>
 
 
-		<target name="test99">
-			<!--cachedset id="foo">
+	<target name="test99">
+		<!--cachedset id="foo">
 			<project name="xalan" version="4" module="http://gump.apache.org/modules/xalan.xml" />
 		</cachedset-->
-		</target>
-		<target name="testNotFound">
-			<cachedset id="testNotFound">
-				<resource name="notfound" ext="jar" version="1.2" repository="localtest" />
-			</cachedset>
-			<!-- have to use the chaced set before it is used. -->
-			<copy toDir="${sandbox.dir}">
-				<fileset refid="testNotFound.fileset" />
-			</copy>
-		</target>
-
-
-		<target name="testExport1" depends="test1">
-			<delete file="build/test1-export.build.xml" />
-			<cachedsetexport refid="test1" toFile="build/test1-export.build.xml" />
-		</target>
-
-		<target name="clean-jars">
-			<delete dir="${local.repository}" />
-			<delete dir="${sandbox.dir}" />
-		</target>
-	</project>
+	</target>
+	<target name="testNotFound">
+		<cachedset id="testNotFound">
+			<resource name="notfound" ext="jar" version="1.2" repository="localtest" />
+		</cachedset>
+		<!-- have to use the chaced set before it is used. -->
+		<copy toDir="${sandbox.dir}">
+			<fileset refid="testNotFound.fileset" />
+		</copy>
+	</target>
+
+
+	<target name="testExport1" depends="test1">
+		<delete file="build/test1-export.build.xml" />
+		<path id="convert" location="${basedir}" />
+		<pathconvert property="converted" refid="convert" targetos="unix" />
+		<copy file="src/test/org/apache/depot/update/ant/test1-export.build.xml"
+		      tofile="build/expected-test1-export.build.xml" overwrite="true">
+			<filterset>
+				<filter token="basedir" value="${converted}" />
+			</filterset>
+		</copy>
+		<cachedsetexport refid="test1" toFile="build/test1-export.build.xml" />
+	</target>
+
+	<target name="clean-jars">
+		<delete dir="${local.repository}" />
+		<delete dir="${sandbox.dir}" />
+	</target>
+</project>