incubator-depot-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nickcha...@apache.org
Subject svn commit: rev 37358 - in incubator/depot/trunk/update/src/test/org/apache/depot/update: . ant/cache artifact
Date Thu, 02 Sep 2004 05:07:42 GMT
Author: nickchalko
Date: Wed Sep  1 22:07:42 2004
New Revision: 37358

Modified:
   incubator/depot/trunk/update/src/test/org/apache/depot/update/ArtifactInstanceTest.java
   incubator/depot/trunk/update/src/test/org/apache/depot/update/ant/cache/CachedResourceSetTaskTest.java
   incubator/depot/trunk/update/src/test/org/apache/depot/update/artifact/ArtifactTests.java
Log:
No longer dependent on the version Test classes.

Modified: incubator/depot/trunk/update/src/test/org/apache/depot/update/ArtifactInstanceTest.java
==============================================================================
--- incubator/depot/trunk/update/src/test/org/apache/depot/update/ArtifactInstanceTest.java
(original)
+++ incubator/depot/trunk/update/src/test/org/apache/depot/update/ArtifactInstanceTest.java
Wed Sep  1 22:07:42 2004
@@ -15,7 +15,10 @@
 import org.apache.depot.update.artifact.ArtifactType;
 import org.apache.depot.update.util.net.VirtualResourceLocator;
 import org.apache.depot.version.Version;
-import org.apache.depot.version.impl.TestApacheVersion;
+import org.apache.depot.version.impl.ApacheVersion;
+import org.apache.depot.version.specification.ApacheVersionSpecification;
+import org.apache.depot.version.specification.formatting.VersionFormatException;
+import org.apache.depot.version.specification.formatting.format.ApacheVersionFormat;
 
 /**
  * @author <a href="http://incubator.apache.org/depot">The Apache Incubator Depot Project</a>
@@ -75,17 +78,17 @@
 	//
 	//	-----------------------------------------------------------------
 	//
-	public static List getTestArtifactList(String group, int count) {
+	public static List getTestArtifactList(String group, int count) throws VersionFormatException
{
 		List resourceList = new ArrayList();
 	
 		// Populate with some test resources...
 		for (int i = 0; i < count; ++i) {
 			String name = group + Integer.toString(1 + i);
 			resourceList.add(ArtifactInstanceTest.getTestArtifactInstance(name,
-					TestApacheVersion.getTestVersion(1, i),
+					getTestVersion(1, i),
 					ArtifactType.JAVA_BINARY));
 			resourceList.add(ArtifactInstanceTest.getTestArtifactInstance(name,
-					TestApacheVersion.getTestVersion(1, i),
+					getTestVersion(1, i),
 					ArtifactType.SOURCE_CODE));
 	
 			// :TODO: Add some randomness
@@ -94,17 +97,28 @@
 		return resourceList;
 	}
 
-	public static ArtifactInstance getTestArtifactInstance() {
+	/**
+	 * @param i
+	 * @param i2
+	 * @return
+	 * @throws VersionFormatException
+	 */
+	public static Version getTestVersion(int major, int minor) throws VersionFormatException
{
+		ApacheVersionFormat format = new ApacheVersionFormat();
+		return format.parseVersion(major+"."+minor);
+	}
+
+	public static ArtifactInstance getTestArtifactInstance() throws VersionFormatException {
 		return getTestArtifactInstance("test");
 	}
 
-	public static ArtifactInstance getTestArtifactInstance(String name) {
+	public static ArtifactInstance getTestArtifactInstance(String name) throws VersionFormatException
{
 		return getTestArtifactInstance(name, ArtifactType.JAVA_BINARY);
 	}
 
 	public static ArtifactInstance getTestArtifactInstance(String name,
-			ArtifactType type) {
-		return getTestArtifactInstance(name, TestApacheVersion.getTestVersion(1, 1), type);
+			ArtifactType type) throws VersionFormatException {
+		return getTestArtifactInstance(name, getTestVersion(1, 1), type);
 	}
 
 	public static ArtifactInstance getTestArtifactInstance(String name,

Modified: incubator/depot/trunk/update/src/test/org/apache/depot/update/ant/cache/CachedResourceSetTaskTest.java
==============================================================================
--- incubator/depot/trunk/update/src/test/org/apache/depot/update/ant/cache/CachedResourceSetTaskTest.java
(original)
+++ incubator/depot/trunk/update/src/test/org/apache/depot/update/ant/cache/CachedResourceSetTaskTest.java
Wed Sep  1 22:07:42 2004
@@ -26,7 +26,6 @@
 
 import org.apache.depot.common.log.Logger;
 import org.apache.tools.ant.BuildFileTest;
-import org.custommonkey.xmlunit.XMLAssert;
 import org.xml.sax.SAXException;
 
 /**

Modified: incubator/depot/trunk/update/src/test/org/apache/depot/update/artifact/ArtifactTests.java
==============================================================================
--- incubator/depot/trunk/update/src/test/org/apache/depot/update/artifact/ArtifactTests.java
(original)
+++ incubator/depot/trunk/update/src/test/org/apache/depot/update/artifact/ArtifactTests.java
Wed Sep  1 22:07:42 2004
@@ -23,9 +23,10 @@
 
 import org.apache.depot.common.log.Logger;
 import org.apache.depot.update.Artifact;
-import org.apache.depot.update.ArtifactInstance;
+import org.apache.depot.update.ArtifactInstanceTest;
 import org.apache.depot.version.Version;
-import org.apache.depot.version.impl.TestApacheVersion;
+import org.apache.depot.version.specification.formatting.VersionFormatException;
+
 
 /**
  * @author arb_jack
@@ -91,17 +92,17 @@
 	//
 	//	-----------------------------------------------------------------
 	//
-	public static List getTestArtifactList(String group, int count) {
+	public static List getTestArtifactList(String group, int count) throws VersionFormatException
{
 		List ArtifactList = new ArrayList();
 	
 		// Populate with some test Artifacts...
 		for (int i = 0; i < count; ++i) {
 			String name = group + Integer.toString(1 + i);
 			ArtifactList.add(ArtifactTests.getTestArtifact(name,
-					TestApacheVersion.getTestVersion(1, i),
+					ArtifactInstanceTest.getTestVersion(1, i),
 					ArtifactType.JAVA_BINARY));
 			ArtifactList.add(ArtifactTests.getTestArtifact(name,
-					TestApacheVersion.getTestVersion(1, i),
+					ArtifactInstanceTest.getTestVersion(1, i),
 					ArtifactType.SOURCE_CODE));
 	
 			// :TODO: Add some randomness
@@ -110,16 +111,16 @@
 		return ArtifactList;
 	}
 
-	public static Artifact getTestArtifact() {
+	public static Artifact getTestArtifact() throws VersionFormatException {
 		return getTestArtifact("test");
 	}
 
-	public static Artifact getTestArtifact(String name) {
+	public static Artifact getTestArtifact(String name) throws VersionFormatException {
 		return getTestArtifact(name, ArtifactType.JAVA_BINARY);
 	}
 
-	public static Artifact getTestArtifact(String name, ArtifactType type) {
-		return getTestArtifact(name, TestApacheVersion.getTestVersion(1, 1), type);
+	public static Artifact getTestArtifact(String name, ArtifactType type) throws VersionFormatException
{
+		return getTestArtifact(name, ArtifactInstanceTest.getTestVersion(1, 1), type);
 	}
 
 	public static Artifact getTestArtifact(String name, Version version,

Mime
View raw message