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 36491 - in incubator/depot/trunk/version/src: java/org/apache/depot/version/impl java/org/apache/depot/version/impl/data test/java/org/apache/depot/version/impl test/java/org/apache/depot/version/impl/data
Date Tue, 17 Aug 2004 05:55:15 GMT
Author: nickchalko
Date: Mon Aug 16 22:55:14 2004
New Revision: 36491

Added:
   incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/data/TestVersionData.java
Modified:
   incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/ApacheVersion.java
   incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/VersionImporter.java
   incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/data/VersionData.java
   incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/VersionImporterTests.java
Log:
Fixed some unit test.
Moved classes in to its own .java file.

Modified: incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/ApacheVersion.java
==============================================================================
--- incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/ApacheVersion.java
(original)
+++ incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/ApacheVersion.java
Mon Aug 16 22:55:14 2004
@@ -671,6 +671,10 @@
 //
 // Testing Instances
 //
+/**
+ * 
+ * @deprecated
+ */
 class TestApacheVersion extends ApacheVersion {
 	TestApacheVersion() {
 		super(VersionData.getTestVersionData());

Modified: incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/VersionImporter.java
==============================================================================
--- incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/VersionImporter.java
(original)
+++ incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/VersionImporter.java
Mon Aug 16 22:55:14 2004
@@ -146,9 +146,9 @@
 		//
 		String cleanData = null;
 		StringTokenizer tokens = new StringTokenizer(data, " ");
-		if (tokens.hasMoreTokens())
+		if (tokens.hasMoreTokens()){
 			cleanData = tokens.nextToken();
-
+		}
 		//
 		//  Try all other specifications...
 		//

Modified: incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/data/VersionData.java
==============================================================================
--- incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/data/VersionData.java
(original)
+++ incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/data/VersionData.java
Mon Aug 16 22:55:14 2004
@@ -42,6 +42,7 @@
 
 /**
  * @author arb_jack@users.apache.org
+ * 
  */
 public class VersionData
 	implements Dumpable, Comparable, DOMProducer, DOMConsumer {
@@ -840,38 +841,3 @@
 	}
 }
 
-
-//
-// Testing Instances
-//
-class TestVersionData extends VersionData {
-	TestVersionData(int major,int minor) {
-		super(		major, 
-					minor, 
-					VersionDataElement.DEFAULT_RELEASE_LEVEL, 
-					VersionDataElement.DEFAULT_RELEASE_QUALIFIER, 
-					VersionDataElement.DEFAULT_POINT, 
-					VersionDataElement.DEFAULT_BUILD_NUMBER,
-					VersionDataElement.DEFAULT_BUILD_DATE);
-	}
-	
-	TestVersionData(int major,int minor,ReleaseLevel level, int point) {
-		super(		major, 
-					minor, 
-					level, 
-					VersionDataElement.DEFAULT_RELEASE_QUALIFIER, 
-					point, 
-					VersionDataElement.DEFAULT_BUILD_NUMBER,
-					VersionDataElement.DEFAULT_BUILD_DATE);
-	}
-	
-	TestVersionData() {
-		super(		1, 
-					1, 
-					VersionDataElement.DEFAULT_RELEASE_LEVEL, 
-					VersionDataElement.DEFAULT_RELEASE_QUALIFIER, 
-					1, 
-					VersionDataElement.DEFAULT_BUILD_NUMBER,
-					VersionDataElement.DEFAULT_BUILD_DATE);
-	}
-}

Modified: incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/VersionImporterTests.java
==============================================================================
--- incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/VersionImporterTests.java
(original)
+++ incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/VersionImporterTests.java
Mon Aug 16 22:55:14 2004
@@ -40,7 +40,7 @@
 
 	public void testApacheFormatIsDefaulted() throws VersionException {
 
-		ApacheVersion version = importVersion("1.0");
+		ApacheVersion version = importApacheVersion("1.0");
 
 		VersionSpecification spec = version.getSpecification();
 
@@ -49,19 +49,19 @@
 	}
 
 	public void testTypical() throws VersionException {
-		ApacheVersion version = importVersion("1.2.3-alpha-20030302");
+		ApacheVersion version = importApacheVersion("1.2.3-alpha-20030302");
 
 		assertEquals("Release Qualifier Correct", ReleaseLevel.ALPHA, version
 				.getReleaseLevelObject());
 
 		VersionSpecification spec = version.getSpecification();
 
-		assertEquals("Apache Specification Used", spec,
-				new ApacheVersionSpecification());
+		assertEquals("Apache Specification Used", 
+				new ApacheVersionSpecification(), spec);
 	}
 
 	public void testReleaseQualifier() throws VersionException {
-		ApacheVersion version = importVersion("1.2.3-alpha1-20030302");
+		ApacheVersion version = importApacheVersion("1.2.3-alpha1-20030302");
 
 		assertEquals("Release Qualifier for" + version, 1, version
 				.getReleaseQualifier());
@@ -72,7 +72,7 @@
 				spec);
 	}
 
-	private ApacheVersion importVersion(String data) throws VersionException {
+	private ApacheVersion importApacheVersion(String data) throws VersionException {
 		ApacheVersion version = VersionImporter.importApacheVersion(data);
 
 		return version;

Added: incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/data/TestVersionData.java
==============================================================================
--- (empty file)
+++ incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/data/TestVersionData.java
Mon Aug 16 22:55:14 2004
@@ -0,0 +1,49 @@
+/*
+ * Copyright  2004 The Apache Software Foundation
+ *
+ *  Licensed 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.depot.version.impl.data;
+
+class TestVersionData extends VersionData {
+	TestVersionData(int major,int minor) {
+		super(		major, 
+					minor, 
+					VersionDataElement.DEFAULT_RELEASE_LEVEL, 
+					VersionDataElement.DEFAULT_RELEASE_QUALIFIER, 
+					VersionDataElement.DEFAULT_POINT, 
+					VersionDataElement.DEFAULT_BUILD_NUMBER,
+					VersionDataElement.DEFAULT_BUILD_DATE);
+	}
+	
+	TestVersionData(int major,int minor,ReleaseLevel level, int point) {
+		super(		major, 
+					minor, 
+					level, 
+					VersionDataElement.DEFAULT_RELEASE_QUALIFIER, 
+					point, 
+					VersionDataElement.DEFAULT_BUILD_NUMBER,
+					VersionDataElement.DEFAULT_BUILD_DATE);
+	}
+	
+	TestVersionData() {
+		super(		1, 
+					1, 
+					VersionDataElement.DEFAULT_RELEASE_LEVEL, 
+					VersionDataElement.DEFAULT_RELEASE_QUALIFIER, 
+					1, 
+					VersionDataElement.DEFAULT_BUILD_NUMBER,
+					VersionDataElement.DEFAULT_BUILD_DATE);
+	}
+}

Mime
View raw message