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 21611 - in incubator/depot/trunk/version/src: java/org/apache/depot/version java/org/apache/depot/version/ant/nested java/org/apache/depot/version/experimental/sample java/org/apache/depot/version/generation/source java/org/apache/depot/version/impl java/org/apache/depot/version/impl/data java/org/apache/depot/version/impl/data/util java/org/apache/depot/version/impl/util java/org/apache/depot/version/interfacing java/org/apache/depot/version/specification java/org/apache/depot/version/specification/formatting/format test/java/org/apache/depot/version/context test/java/org/apache/depot/version/discovery/loading test/java/org/apache/depot/version/extension test/java/org/apache/depot/version/impl test/java/org/apache/depot/version/impl/data test/java/org/apache/depot/version/impl/sample test/java/org/apache/depot/version/util/dom
Date Wed, 23 Jun 2004 19:07:08 GMT
Author: ajack
Date: Wed Jun 23 12:07:07 2004
New Revision: 21611

Modified:
   incubator/depot/trunk/version/src/java/org/apache/depot/version/Version.java
   incubator/depot/trunk/version/src/java/org/apache/depot/version/ant/nested/VersionNestedElement.java
   incubator/depot/trunk/version/src/java/org/apache/depot/version/experimental/sample/Overview.java
   incubator/depot/trunk/version/src/java/org/apache/depot/version/generation/source/AbstractVersionMarkerClassGenerator.java
   incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/ApacheVersion.java
   incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/ApacheVersionMarker.java
   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/util/VersionDataIncrementor.java
   incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/data/util/VersionDataIterator.java
   incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/data/util/VersionDataRangeIterator.java
   incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/util/ApacheVersionMarkerDiffTool.java
   incubator/depot/trunk/version/src/java/org/apache/depot/version/interfacing/ApacheVersionMarkerInterfaceProxy.java
   incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/ApacheVersionSpecification.java
   incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/formatting/format/ApacheVersionFormat.java
   incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/formatting/format/EclipseVersionFormat.java
   incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/formatting/format/JakartaCommonsVersionFormat.java
   incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/formatting/format/JavasoftVersionFormat.java
   incubator/depot/trunk/version/src/test/java/org/apache/depot/version/context/ExtensionRegistryTests.java
   incubator/depot/trunk/version/src/test/java/org/apache/depot/version/context/VersionInformationTests.java
   incubator/depot/trunk/version/src/test/java/org/apache/depot/version/context/VersionRegistryTests.java
   incubator/depot/trunk/version/src/test/java/org/apache/depot/version/discovery/loading/FilenameLoaderTests.java
   incubator/depot/trunk/version/src/test/java/org/apache/depot/version/extension/VirtualMachineExtensionInformationTests.java
   incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/VersionTest.java
   incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/data/VersionDataComparisonTest.java
   incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/data/VersionDataConstructorTests.java
   incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/data/VersionDataRangeIteratorTest.java
   incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/data/VersionDataRangeTest.java
   incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/sample/Version1.java
   incubator/depot/trunk/version/src/test/java/org/apache/depot/version/util/dom/DOMTests.java
Log:
First stab at reducing constructors.


Modified: incubator/depot/trunk/version/src/java/org/apache/depot/version/Version.java
==============================================================================
--- incubator/depot/trunk/version/src/java/org/apache/depot/version/Version.java	(original)
+++ incubator/depot/trunk/version/src/java/org/apache/depot/version/Version.java	Wed Jun 23 12:07:07 2004
@@ -42,7 +42,7 @@
 /**
  * This  Main version interface.
  * 
- * This class provides NO restrections on what and how to 
+ * This class provides NO restrictions on what and how to 
  * order and format or display version.  How it is created incremented or 
  * displayed is completly independent.
  * 
@@ -67,7 +67,7 @@
 	/**
 	 * <code>UNKNOWN</code> version. 
 	 */
-	public final static Version UNKNOWN = new ApacheVersion(0,0);
+	public final static Version UNKNOWN = ApacheVersion.UNKNOWN;
 
     /**
      * May this version be used in place of the specified version.

Modified: incubator/depot/trunk/version/src/java/org/apache/depot/version/ant/nested/VersionNestedElement.java
==============================================================================
--- incubator/depot/trunk/version/src/java/org/apache/depot/version/ant/nested/VersionNestedElement.java	(original)
+++ incubator/depot/trunk/version/src/java/org/apache/depot/version/ant/nested/VersionNestedElement.java	Wed Jun 23 12:07:07 2004
@@ -22,6 +22,8 @@
 import org.apache.depot.version.Version;
 import org.apache.depot.version.VersionException;
 import org.apache.depot.version.impl.ApacheVersion;
+import org.apache.depot.version.impl.data.ReleaseLevel;
+import org.apache.depot.version.impl.data.VersionData;
 import org.apache.depot.version.impl.data.VersionDataElement;
 import org.apache.depot.version.specification.VersionSpecification;
 import org.apache.tools.ant.BuildException;
@@ -80,13 +82,13 @@
 					version =
 						new ApacheVersion(
 							specification,
-							m_major,
-							m_minor,
-							m_releaseLevel,
-							m_releaseQualifier,
-							m_point,
-							m_buildNumber,
-							m_buildDate);
+							new VersionData(m_major,
+									m_minor,
+									ReleaseLevel.getFromString(m_releaseLevel),
+									m_releaseQualifier,
+									m_point,
+									m_buildNumber,
+									m_buildDate));
 			}
 			else {
 
@@ -95,13 +97,13 @@
 				else
 					version =
 						new ApacheVersion(
-							m_major,
-							m_minor,
-							m_releaseLevel,
-							m_releaseQualifier,
-							m_point,
-							m_buildNumber,
-							m_buildDate);
+							new VersionData(m_major,
+									m_minor,
+									ReleaseLevel.getFromString(m_releaseLevel),
+									m_releaseQualifier,
+									m_point,
+									m_buildNumber,
+									m_buildDate));
 			}
 		}
 		catch (VersionException ve) {

Modified: incubator/depot/trunk/version/src/java/org/apache/depot/version/experimental/sample/Overview.java
==============================================================================
--- incubator/depot/trunk/version/src/java/org/apache/depot/version/experimental/sample/Overview.java	(original)
+++ incubator/depot/trunk/version/src/java/org/apache/depot/version/experimental/sample/Overview.java	Wed Jun 23 12:07:07 2004
@@ -39,7 +39,7 @@
 	private VersionSpecification m_specification =
 		VersionSpecificationFactory.createDefaultVersionSpecification();
 	private VersionData m_data =
-		new VersionData(1, 1, ReleaseLevel.ALPHA, 1, 1, 1);
+		new VersionData(1, 1, ReleaseLevel.ALPHA, 1, 1, 1, null);
 
 	public Overview(PrintWriter out, String args[]) throws VersionException {
 		m_out = out;
@@ -84,7 +84,8 @@
 				VersionDataElement.MIN_RELEASE_LEVEL,
 				VersionDataElement.MIN_RELEASE_QUALIFIER,
 				VersionDataElement.MIN_POINT,
-				VersionDataElement.MIN_BUILD_NUMBER);
+				VersionDataElement.MIN_BUILD_NUMBER,
+				null);
 
 		VersionData upper =
 			new VersionData(
@@ -93,7 +94,8 @@
 				VersionDataElement.MIN_RELEASE_LEVEL,
 				VersionDataElement.MIN_RELEASE_QUALIFIER,
 				VersionDataElement.MIN_POINT + 1,
-				VersionDataElement.MIN_BUILD_NUMBER);
+				VersionDataElement.MIN_BUILD_NUMBER,
+				null);
 
 		present(
 			"Versions From : ["

Modified: incubator/depot/trunk/version/src/java/org/apache/depot/version/generation/source/AbstractVersionMarkerClassGenerator.java
==============================================================================
--- incubator/depot/trunk/version/src/java/org/apache/depot/version/generation/source/AbstractVersionMarkerClassGenerator.java	(original)
+++ incubator/depot/trunk/version/src/java/org/apache/depot/version/generation/source/AbstractVersionMarkerClassGenerator.java	Wed Jun 23 12:07:07 2004
@@ -183,7 +183,7 @@
 			}
 			out.println();
 			out.println("try { ");
-			out.println("importFromProperties(attributes);");
+			out.println("importProperties(attributes);");
 			out.println(" } catch ( Exception e ) {");
 			out.println("}");
 		}

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	Wed Jun 23 12:07:07 2004
@@ -49,31 +49,32 @@
 
 	public final static String VERSION_TAG = "version";
 	
-
+	public final static ApacheVersion UNKNOWN =
+		new ApacheVersion(null,VersionData.UNSET);
+	
+	/** The specification for this type of format */
 	private final VersionSpecification m_specification;
+	/** The data associated */
 	private VersionData m_data;
 
 	public static ApacheVersion fromVersion(Version version)
 		throws VersionException {
-		//
+		
 		// If a known type, just clone it
-		//
 		if (version instanceof ApacheVersion)
 			return (ApacheVersion) version;
 		else if (version instanceof CompoundVersion) {
 			return new ApacheVersion((CompoundVersion) version);
 		}
 
-		//
 		// Else attempt to import using String
-		//
 		return VersionImporter.importApacheVersion(version.toString());
 	}
 
 	/**
-	* Constructor for Version.
-	* @param other
-	*/
+	 * 
+	 * Construct an empty Version.
+	 */
 	public ApacheVersion() {
 		super();
 
@@ -83,16 +84,22 @@
 	}
 
 	/**
-	 * Constructor for Version.
+	 * Construct from another version.
+	 * 
 	 * @param other
 	 */
 	public ApacheVersion(ApacheVersion other) {
 		super();
 
 		m_specification = other.m_specification;
-		m_data = other.m_data;
+		m_data = new VersionData(other.m_data);
 	}
 
+	/*
+	 * Construct from a CompoundVersion
+	 * 
+	 * @see CompoundVersion
+	 */
 	public ApacheVersion(CompoundVersion version) throws VersionException {
 		m_specification =
 			VersionSpecificationFactory.createDefaultVersionSpecification();
@@ -101,7 +108,7 @@
 				VersionDataElementSet.DEFAULT,
 				version.getMajor(),
 				version.getMinor(),
-				version.getReleaseLevel(),
+				ReleaseLevel.getFromString(version.getReleaseLevel()),
 				version.getReleaseQualifier(),
 				version.getPoint(),
 				version.getBuildNumber(),
@@ -160,7 +167,7 @@
 		throws VersionFormatException, VersionException {
 		this(VersionImporter.importApacheVersion(specification, data));
 
-		m_data.importFromProperties(properties);
+		m_data.importProperties(properties);
 	}
 
 	/**
@@ -170,270 +177,22 @@
 	public ApacheVersion(String data, Map properties)
 		throws VersionFormatException, VersionException {
 		this(VersionImporter.importApacheVersion(data));
-		m_data.importFromProperties(properties);
-	}
-
-	public void importFromProperties(Map properties) throws VersionException {
-		m_data.importFromProperties(properties);
-	}
-
-	/**
-	* Constructor for Version.
-	* @param other
-	*/
-	public ApacheVersion(Map properties) throws VersionException {
-		super();
-
-		m_specification =
-			VersionSpecificationFactory.createDefaultVersionSpecification();
-		m_data = new VersionData(properties);
-	}
-
-	/**
-	 * Constructor for Version.
-	 * @param major
-	 * @param minor
-	 */
-	public ApacheVersion(int major, int minor) {
-		this(
-			new VersionData(
-				major,
-				minor,
-				VersionDataElement.DEFAULT_RELEASE_LEVEL,
-				VersionDataElement.DEFAULT_RELEASE_QUALIFIER,
-				VersionDataElement.DEFAULT_POINT,
-				VersionDataElement.DEFAULT_BUILD_NUMBER));
-	}
-
-	/**
-	 * Constructor for Version.
-	 * @param major
-	 * @param minor
-	 * @param releaseLevel
-	 */
-	public ApacheVersion(int major, int minor, ReleaseLevel releaseLevel)
-		throws VersionException {
-		this(
-			new VersionData(
-				major,
-				minor,
-				releaseLevel,
-				VersionDataElement.DEFAULT_RELEASE_QUALIFIER,
-				VersionDataElement.DEFAULT_POINT,
-				VersionDataElement.DEFAULT_BUILD_NUMBER));
-	}
-
-	/**
-	 * Constructor for Version.
-	 * @param major
-	 * @param minor
-	 * @param releaseLevel
-	 * @param point
-	 */
-	public ApacheVersion(
-		int major,
-		int minor,
-		ReleaseLevel releaseLevel,
-		int point)
-		throws VersionException {
-		this(
-			new VersionData(
-				major,
-				minor,
-				releaseLevel,
-				VersionDataElement.DEFAULT_RELEASE_QUALIFIER,
-				point,
-				VersionDataElement.DEFAULT_BUILD_NUMBER));
+		m_data.importProperties(properties);
 	}
 
-	/**
-	 * Constructor for Version.
-	 * @param major
-	 * @param minor
-	 * @param releaseLevel
-	 * @param point
-	 * @param buildNumber
-	 * @param attributes
-	 */
-	public ApacheVersion(
-		int major,
-		int minor,
-		String releaseLevel,
-		int point,
-		int buildNumber,
-		Map attributes)
-		throws VersionException {
-		this(
-			new VersionData(
-				major,
-				minor,
-				ReleaseLevel.getFromString(releaseLevel),
-				VersionDataElement.DEFAULT_RELEASE_QUALIFIER,
-				point,
-				buildNumber,
-				attributes));
-	}
 
 	/**
 	 * Constructor for Version.
-	 * @param major
-	 * @param minor
-	 * @param releaseLevel
-	 * @param point
-	 * @param buildNumber
-	 */
-	public ApacheVersion(
-		int major,
-		int minor,
-		ReleaseLevel releaseLevel,
-		int releaseQualifier,
-		int point,
-		int buildNumber) {
-		this(
-			new VersionData(
-				major,
-				minor,
-				releaseLevel,
-				releaseQualifier,
-				point,
-				buildNumber));
-	}
-
-	/**
-	 * Constructor for Version.
-	 * @param major
-	 * @param minor
-	 * @param releaseLevel
-	 * @param point
-	 * @param buildNumber
-	 */
-	public ApacheVersion(
-		int major,
-		int minor,
-		ReleaseLevel releaseLevel,
-		int releaseQualifier,
-		int point,
-		int buildNumber,
-		Date buildDate) {
-		this(
-			new VersionData(
-				major,
-				minor,
-				releaseLevel,
-				releaseQualifier,
-				point,
-				buildNumber,
-				buildDate));
-	}
-
-	/**
-	 * Constructor for Version.
-	 * @param major
-	 * @param minor
-	 * @param releaseLevel
-	 * @param point
-	 * @param buildNumber
-	 */
-	public ApacheVersion(
-		VersionSpecification specification,
-		int major,
-		int minor,
-		ReleaseLevel releaseLevel,
-		int releaseQualifier,
-		int point,
-		int buildNumber,
-		Date buildDate) {
-		this(
-			specification,
-			new VersionData(
-				major,
-				minor,
-				releaseLevel,
-				releaseQualifier,
-				point,
-				buildNumber,
-				buildDate));
-	}
-	/**
-	 * Constructor for Version.
-	 * @param major
-	 * @param minor
-	 * @param releaseLevel
-	 * @param point
-	 * @param buildNumber
-	*/
-	public ApacheVersion(
-		VersionSpecification specification,
-		int major,
-		int minor,
-		String releaseLevel,
-		int releaseQualifier,
-		int point,
-		int buildNumber,
-		Date buildDate)
-		throws VersionException {
-		this(
-			specification,
-			new VersionData(
-				major,
-				minor,
-				ReleaseLevel.getFromString(releaseLevel),
-				releaseQualifier,
-				point,
-				buildNumber,
-				buildDate));
-	}
-
-	/**
-	 * Constructor for Version.
-	 * @param major
-	 * @param minor
-	 * @param releaseLevel
-	 * @param point
-	 * @param buildNumber
-	*/
-	public ApacheVersion(
-		int major,
-		int minor,
-		String releaseLevel,
-		int releaseQualifier,
-		int point,
-		int buildNumber,
-		Date buildDate)
-		throws VersionException {
-		this(
-			new VersionData(
-				major,
-				minor,
-				ReleaseLevel.getFromString(releaseLevel),
-				releaseQualifier,
-				point,
-				buildNumber,
-				buildDate));
-	}
-	/**
-	 * Constructor for Version.
-	 * @param identifier
-	 * @param format
+	 * @param specification
 	 * @param data
 	 */
-	ApacheVersion(
+	public ApacheVersion(
 		final VersionSpecification specification,
 		final VersionData data) {
 		m_specification = specification;
 		m_data = data;
 	}
-
-	/**
-	 * Constructor for Version.
-	 * @param major
-	 * @param minor
-	 * @param point
-	 */
-	public ApacheVersion(int major, int minor, int point) {
-		this(new VersionData(major, minor, point));
-	}
-
+	
 	public String getVersion() {
 		return m_specification.getVersionFormat().toVersionString(m_data);
 	}
@@ -486,6 +245,10 @@
 		return comparison;
 	}
 
+	public Map importProperties(Map properties) throws VersionException {
+		return m_data.importProperties(properties);
+	}
+	
 	public VersionData getVersionData() {
 		return m_data;
 	}
@@ -826,10 +589,24 @@
 		VersionSpecificationFactory.createDefaultVersionSpecification();
 		m_data = new VersionData(element);
 	}
+	
 	public void consumeDOMElement(String tag, Element element) {
 	}
+	
 	public void consumeDOMObject(String tag, Object object) {
 	}
+
+	public static ApacheVersion getTestVersion() {
+		return new TestApacheVersion();
+	}
+
+	public static ApacheVersion getTestVersion(int major, int minor) {
+		return new TestApacheVersion(major,minor);
+	}
+	
+	public static ApacheVersion getTestVersion(int major, int minor, ReleaseLevel level, int point) {
+		return new TestApacheVersion(major,minor,level,point);
+	}
 }
 
 //
@@ -837,7 +614,15 @@
 //
 class TestApacheVersion extends ApacheVersion {
 	TestApacheVersion() {
-		super(1, 1, 1);
+		super(VersionData.getTestVersionData());
+	}
+
+	TestApacheVersion(int major,int minor) {
+		super(VersionData.getTestVersionData(major,minor));
+	}
+
+	TestApacheVersion(int major, int minor, ReleaseLevel level, int point) {
+		super(VersionData.getTestVersionData(major,minor,level,point));
 	}
 
 	TestApacheVersion(String format) throws VersionException {

Modified: incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/ApacheVersionMarker.java
==============================================================================
--- incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/ApacheVersionMarker.java	(original)
+++ incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/ApacheVersionMarker.java	Wed Jun 23 12:07:07 2004
@@ -35,9 +35,6 @@
 import org.apache.depot.version.VersionConstants;
 import org.apache.depot.version.VersionException;
 import org.apache.depot.version.VersionMarker;
-import org.apache.depot.version.impl.data.ReleaseLevel;
-import org.apache.depot.version.impl.data.VersionData;
-import org.apache.depot.version.impl.data.VersionDataElement;
 import org.apache.depot.version.specification.VersionSpecification;
 import org.apache.depot.version.specification.formatting.VersionFormat;
 import org.apache.depot.version.specification.formatting.VersionFormatException;
@@ -82,9 +79,14 @@
 		validate();
 	}
 
-	public ApacheVersionMarker(String id, CompoundVersion version)
-		throws VersionException {
-		m_identifier = new VersionIdentifier(id);
+	public ApacheVersionMarker(String identifier, ApacheVersion version) {
+		m_identifier = new VersionIdentifier(identifier);
+		m_version = version;
+		validate();
+	}
+	
+	public ApacheVersionMarker(String identifier, CompoundVersion version) throws VersionException {
+		m_identifier = new VersionIdentifier(identifier);
 		m_version = new ApacheVersion(version);
 		validate();
 	}
@@ -105,42 +107,6 @@
 	 * Constructor for Version.
 	 * @param other
 	 */
-	public ApacheVersionMarker(String identifier, VersionData data) {
-		this(new VersionIdentifier(identifier), data);
-	}
-
-	/**
-	 * Constructor for Version.
-	 * @param other
-	 */
-	public ApacheVersionMarker(
-		VersionIdentifier identifier,
-		VersionData data) {
-		super();
-
-		m_identifier = identifier;
-		m_version = new ApacheVersion(data);
-		validate();
-	}
-
-	/**
-	 * Constructor for Version.
-	 * @param other
-	 */
-	public ApacheVersionMarker(
-		VersionIdentifier identifier,
-		ApacheVersion version) {
-		super();
-
-		m_identifier = identifier;
-		m_version = version;
-		validate();
-	}
-
-	/**
-	 * Constructor for Version.
-	 * @param other
-	 */
 	public ApacheVersionMarker(VersionIdentifier identifier, Date date) {
 		super();
 
@@ -157,17 +123,6 @@
 		this(new VersionIdentifier(identifier), date);
 	}
 
-	/**
-	 * Constructor for Version.
-	     * @param other
-	     */
-	public ApacheVersionMarker(VersionData data) {
-		super();
-
-		m_identifier = VersionIdentifier.extractVersionIdentifier(getClass());
-		m_version = new ApacheVersion(data);
-		validate();
-	}
 
 	/**
 	 * Constructor for Version.
@@ -202,6 +157,16 @@
 	}
 
 	/**
+	 * Constructor for ApacheVersion.
+	 * @param other
+	 */
+	public ApacheVersionMarker(VersionIdentifier id, ApacheVersion version){
+		m_identifier = id;
+		m_version = version;
+		validate();
+	}
+
+	/**
 	 * Constructor for Version.
 	 * @param other
 	 */
@@ -232,8 +197,20 @@
 				id,
 				specification,
 				data));
-
-		importFromProperties(properties);
+		importProperties(properties);
+		validate();
+	}
+	
+	/**
+	* Constructor for Version.
+	* @param other
+	*/
+	public ApacheVersionMarker(
+		String id,
+		Map properties)
+		throws VersionFormatException, VersionException {
+		this(id);
+		importProperties(properties);
 		validate();
 	}
 
@@ -273,31 +250,13 @@
 				specification,
 				data));
 
-		importFromProperties(attributes);
+		importProperties(attributes);
 
 		m_attributes = attributes;
 		m_annotations = annotations;
 		validate();
 	}
 
-	/**
-	* Constructor for Version.
-	* @param other
-	*/
-	public ApacheVersionMarker(
-		VersionIdentifier id,
-		VersionSpecification specification,
-		VersionData data,
-		Map attributes,
-		List annotations)
-		throws VersionFormatException, VersionException {
-		this(id, specification, data);
-
-		m_attributes = attributes;
-		m_annotations = annotations;
-
-		validate();
-	}
 
 	/**
 	* Constructor for Version.
@@ -311,9 +270,9 @@
 		throws VersionFormatException, VersionException {
 		this(id, version);
 
-		importFromProperties(attributes);
-
-		m_attributes = attributes;
+		// :TODO: Ensure importProperties does return the
+		// ununsed ones
+		m_attributes = importProperties(attributes);
 		m_annotations = annotations;
 		validate();
 	}
@@ -330,7 +289,7 @@
 		throws VersionFormatException, VersionException {
 		this(new VersionIdentifier(id), version);
 
-		importFromProperties(attributes);
+		importProperties(attributes);
 
 		m_attributes = attributes;
 		m_annotations = annotations;
@@ -362,267 +321,14 @@
 	public ApacheVersionMarker(String id, String data, Map properties)
 		throws VersionFormatException, VersionException {
 		this(VersionImporter.importApacheVersionMarker(id, data));
-		importFromProperties(properties);
-		validate();
-	}
-
-	public void importFromProperties(Map properties) throws VersionException {
-		m_version.importFromProperties(properties);
-	}
-
-	/**
-	* Constructor for Version.
-	* @param other
-	*/
-	public ApacheVersionMarker(VersionIdentifier id, Map properties)
-		throws VersionException {
-		super();
-
-		m_identifier = id;
-		//:TODO: Share properties but don't have 2 uses for 1
-		m_version = new ApacheVersion(properties);
 		importProperties(properties);
 		validate();
 	}
 
-	/**
-	* Constructor for Version.
-	* @param other
-	*/
-	public ApacheVersionMarker(String id, Map properties)
-		throws VersionException {
-		this(VersionIdentifier.importVersionIdentifier(id), properties);
-	}
-
-	/**
-	 * Constructor for Version.
-	 * @param major
-	 * @param minor
-	 * @param releaseLevel
-	 * @param point
-	 * @param buildNumber
-	 */
-	public ApacheVersionMarker(String id, int major, int minor) {
-		this(
-			id,
-			new VersionData(
-				major,
-				minor,
-				VersionDataElement.DEFAULT_RELEASE_LEVEL,
-				VersionDataElement.DEFAULT_RELEASE_QUALIFIER,
-				VersionDataElement.DEFAULT_POINT,
-				VersionDataElement.DEFAULT_BUILD_NUMBER));
-	}
-
-	/**
-		 * Constructor for Version.
-		 * @param major
-		 * @param minor
-		 * @param releaseLevel
-		 * @param point
-		 * @param buildNumber
-		 */
-	public ApacheVersionMarker(VersionIdentifier id, int major, int minor) {
-		this(
-			id,
-			new VersionData(
-				major,
-				minor,
-				VersionDataElement.DEFAULT_RELEASE_LEVEL,
-				VersionDataElement.DEFAULT_RELEASE_QUALIFIER,
-				VersionDataElement.DEFAULT_POINT,
-				VersionDataElement.DEFAULT_BUILD_NUMBER));
-	}
-
-	/**
-	 * Constructor for Version.
-	 * @param major
-	 * @param minor
-	 * @param releaseLevel
-	 * @param point
-	 * @param buildNumber
-	 */
-	public ApacheVersionMarker(
-		String id,
-		int major,
-		int minor,
-		ReleaseLevel releaseLevel)
-		throws VersionException {
-		this(
-			id,
-			new VersionData(
-				major,
-				minor,
-				releaseLevel,
-				VersionDataElement.DEFAULT_RELEASE_QUALIFIER,
-				VersionDataElement.DEFAULT_POINT,
-				VersionDataElement.DEFAULT_BUILD_NUMBER));
-	}
-
-	/**
-	 * Constructor for Version.
-	 * @param major
-	 * @param minor
-	 * @param releaseLevel
-	 * @param point
-	 * @param buildNumber
-	 */
-	public ApacheVersionMarker(
-		String id,
-		int major,
-		int minor,
-		ReleaseLevel releaseLevel,
-		int point)
-		throws VersionException {
-		this(
-			id,
-			new VersionData(
-				major,
-				minor,
-				releaseLevel,
-				VersionDataElement.DEFAULT_RELEASE_QUALIFIER,
-				point,
-				VersionDataElement.DEFAULT_BUILD_NUMBER));
-	}
-
-	/**
-	 * Constructor for Version.
-	 * @param major
-	 * @param minor
-	 * @param releaseLevel
-	 * @param point
-	 * @param buildNumber
-	 */
-	public ApacheVersionMarker(
-		String id,
-		int major,
-		int minor,
-		String releaseLevel,
-		int point,
-		int buildNumber,
-		Map attributes)
-		throws VersionException {
-		this(
-			id,
-			new VersionData(
-				major,
-				minor,
-				ReleaseLevel.getFromString(releaseLevel),
-				VersionDataElement.DEFAULT_RELEASE_QUALIFIER,
-				point,
-				buildNumber,
-				attributes));
-	}
-
-	/**
-	 * Constructor for Version.
-	 * @param major
-	 * @param minor
-	 * @param releaseLevel
-	 * @param point
-	 * @param buildNumber
-	 */
-	public ApacheVersionMarker(
-		String id,
-		VersionSpecification specification,
-		int major,
-		int minor,
-		String releaseLevel,
-		int releaseQualifier,
-		int point,
-		int buildNumber,
-		Map attributes)
-		throws VersionException {
-		this(
-			id,
-			specification,
-			new VersionData(
-				major,
-				minor,
-				ReleaseLevel.getFromString(releaseLevel),
-				releaseQualifier,
-				point,
-				buildNumber,
-				attributes));
-	}
-
-	/**
-	 * Constructor for Version.
-	 * @param major
-	 * @param minor
-	 * @param releaseLevel
-	 * @param point
-	 * @param buildNumber
-	 */
-	public ApacheVersionMarker(
-		int major,
-		int minor,
-		ReleaseLevel releaseLevel,
-		int releaseQualifier,
-		int point,
-		int buildNumber) {
-		this(
-			new VersionData(
-				major,
-				minor,
-				releaseLevel,
-				releaseQualifier,
-				point,
-				buildNumber));
-	}
-	/**
-	 * Constructor for Version.
-	 * @param major
-	 * @param minor
-	 * @param releaseLevel
-	 * @param point
-	 * @param buildNumber
-	 */
-	public ApacheVersionMarker(
-		int major,
-		int minor,
-		ReleaseLevel releaseLevel,
-		int buildNumber) {
-		this(new VersionData(major, minor, releaseLevel, buildNumber));
-	}
-
-	/**
-	 * Constructor for Version.
-	 * @param identifier
-	 * @param format
-	 * @param data
-	 */
-	ApacheVersionMarker(
-		final String identifier,
-		final VersionSpecification specification,
-		final VersionData data) {
-		this(new VersionIdentifier(identifier), specification, data);
+	public Map importProperties(Map properties) throws VersionException {
+		return m_version.importProperties(properties);
 	}
 
-	/**
-	 * Constructor for Version.
-	 * @param identifier
-	 * @param format
-	 * @param data
-	 */
-	ApacheVersionMarker(
-		final VersionIdentifier identifier,
-		final VersionSpecification spec,
-		final VersionData data) {
-		m_identifier = identifier;
-		m_version = new ApacheVersion(spec, data);
-		validate();
-	}
-
-	/**
-	 * Constructor for Version.
-	 * @param major
-	 * @param minor
-	 * @param point
-	 */
-	public ApacheVersionMarker(int major, int minor, int point) {
-		this(new VersionData(major, minor, point));
-	}
 
 	public String getId() {
 		return m_identifier.toString();
@@ -832,14 +538,6 @@
 		m_annotations = annotations;
 	}
 
-	private Map importProperties(Map properties) {
-		Map unused = null;
-
-		// :TODO: Map unusedByVersion = m_version.importProperties(properties)
-
-		return unused;
-	}
-
 	private void validate() {
 		if (null == m_identifier)
 			throw new IllegalArgumentException("Invalid (null) identifier");
@@ -899,10 +597,48 @@
 		m_identifier =
 			new VersionIdentifier(element.getAttribute(VERSION_ID_ATTRIBUTE));
 	}
+	
 	public void consumeDOMElement(String tag, Element element) {
 	}
 	public void consumeDOMObject(String tag, Object object) {
 		if (object instanceof ApacheVersion)
 			m_version = (ApacheVersion) object;
 	}
+
+	public static ApacheVersionMarker getTestVersionMarker(String identifier) {
+		return new TestApacheVersionMarker(identifier);
+	}
+	
+	public static ApacheVersionMarker getTestVersionMarker(VersionIdentifier identifier) {
+		return new TestApacheVersionMarker(identifier);
+	}
+	
+	public static ApacheVersionMarker getTestVersionMarker(String identifier,int major, int minor) {
+		return new TestApacheVersionMarker(identifier,major,minor);
+	}
+	
+	public static ApacheVersionMarker getTestVersionMarker(VersionIdentifier identifier,int major, int minor) {
+		return new TestApacheVersionMarker(identifier,major,minor);
+	}
 }
+
+//
+// Testing Instances
+//
+class TestApacheVersionMarker extends ApacheVersionMarker {
+	TestApacheVersionMarker(String identifier) {
+		super(identifier, ApacheVersion.getTestVersion());
+	}
+
+	TestApacheVersionMarker(String identifier,int major,int minor) {
+		super(identifier, ApacheVersion.getTestVersion(major,minor));
+	}
+	
+	TestApacheVersionMarker(VersionIdentifier identifier) {
+		super(identifier, ApacheVersion.getTestVersion());
+	}
+
+	TestApacheVersionMarker(VersionIdentifier identifier,int major,int minor) {
+		super(identifier, ApacheVersion.getTestVersion(major,minor));
+	}
+}
\ No newline at end of file

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	Wed Jun 23 12:07:07 2004
@@ -31,7 +31,6 @@
 import org.apache.depot.version.VersionError;
 import org.apache.depot.version.VersionException;
 import org.apache.depot.version.impl.VersionImplementationConstants;
-import org.apache.depot.version.specification.formatting.VersionFormatException;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -55,12 +54,14 @@
 
 	public static final VersionData UNSET =
 		new VersionData(
+		    VersionDataElementSet.UNSET,
 			VersionDataElement.UNSET_MAJOR,
 			VersionDataElement.UNSET_MINOR,
 			VersionDataElement.UNSET_RELEASE_LEVEL,
 			VersionDataElement.UNSET_RELEASE_QUALIFIER,
 			VersionDataElement.UNSET_POINT,
-			VersionDataElement.UNSET_BUILD_NUMBER);
+			VersionDataElement.UNSET_BUILD_NUMBER,
+			null);
 
 	private VersionDataElementSet m_elements = null;
 
@@ -107,156 +108,12 @@
 		m_releaseQualifier = other.m_releaseQualifier;
 		m_point = other.m_point;
 		m_buildNumber = other.m_buildNumber;
+		m_buildDate = other.m_buildDate;
 	}
-
-	/**
-	 * Constructor for VersionData.
-	 */
-	public VersionData(
-		int major,
-		int minor,
-		String releaseLevel,
-		int releaseQualifier,
-		int point,
-		int buildNumber)
-		throws VersionException {
-		this(
-			major,
-			minor,
-			ReleaseLevel.getFromString(releaseLevel),
-			releaseQualifier,
-			point,
-			buildNumber);
-	}
-	/**
-	 * Constructor for VersionData.
-	 */
-	public VersionData(
-		int major,
-		int minor,
-		String releaseLevel,
-		int buildNumber)
-		throws VersionException {
-		this(
-			major,
-			minor,
-			ReleaseLevel.getFromString(releaseLevel),
-			VersionDataElement.DEFAULT_RELEASE_QUALIFIER,
-			VersionDataElement.DEFAULT_POINT,
-			buildNumber);
-	}
-
-	/**
-	 * Constructor for VersionData.
-	 */
-	public VersionData(
-		int major,
-		int minor,
-		ReleaseLevel releaseLevel,
-		int buildNumber) {
-		this(
-			major,
-			minor,
-			releaseLevel,
-			VersionDataElement.DEFAULT_RELEASE_QUALIFIER,
-			VersionDataElement.DEFAULT_POINT,
-			buildNumber);
-	}
-
-	/**
-	 * Constructor for VersionData.
-	 */
-	public VersionData(
-		int major,
-		int minor,
-		String releaseLevel,
-		int releaseQualifier,
-		int point,
-		int buildNumber,
-		Map attributes)
-		throws VersionException {
-		this(
-			major,
-			minor,
-			ReleaseLevel.getFromString(releaseLevel),
-			releaseQualifier,
-			point,
-			buildNumber,
-			attributes);
-	}
-
-	/**
-	 * Constructor for VersionData.
-	 */
-	public VersionData(
-		VersionDataElementSet elements,
-		int major,
-		int minor,
-		String releaseLevel,
-		int releaseQualifier,
-		int point,
-		int buildNumber)
-		throws VersionException {
-		this(
-			elements,
-			major,
-			minor,
-			ReleaseLevel.getFromString(releaseLevel),
-			releaseQualifier,
-			point,
-			buildNumber);
-	}
-
-	/**
-	 * Constructor for VersionData.
-	 */
-	public VersionData(
-		int major,
-		int minor,
-		String releaseLevel,
-		int releaseQualifier,
-		int point,
-		int buildNumber,
-		Date buildDate)
-		throws VersionException {
-		this(
-			new VersionDataElementSet(),
-			major,
-			minor,
-			ReleaseLevel.getFromString(releaseLevel),
-			releaseQualifier,
-			point,
-			buildNumber,
-			buildDate);
-	}
-
-	/**
-	 * Constructor for VersionData.
-	 */
-	public VersionData(
-		VersionDataElementSet elements,
-		int major,
-		int minor,
-		String releaseLevel,
-		int releaseQualifier,
-		int point,
-		int buildNumber,
-		Date buildDate)
-		throws VersionException {
-		this(
-			elements,
-			major,
-			minor,
-			ReleaseLevel.getFromString(releaseLevel),
-			releaseQualifier,
-			point,
-			buildNumber,
-			buildDate);
-	}
-
+	
 	/**
 	 * Constructor for VersionData.
-	 */
+	*/
 	public VersionData(
 		VersionDataElementSet elements,
 		int major,
@@ -264,7 +121,8 @@
 		ReleaseLevel releaseLevel,
 		int releaseQualifier,
 		int point,
-		int buildNumber) {
+		int buildNumber,
+		Date buildDate) {
 		m_elements = elements;
 
 		m_major = major;
@@ -274,8 +132,9 @@
 		m_point = point;
 
 		m_buildNumber = buildNumber;
-	}
-	/**
+
+		m_buildDate = buildDate;
+	}/**
 	 * Constructor for VersionData.
 	*/
 	public VersionData(
@@ -286,7 +145,11 @@
 		int point,
 		int buildNumber,
 		Date buildDate) {
+		
+		// Start empty...
 		m_elements = new VersionDataElementSet();
+
+		// Sniff each value for unset...
 		setMajor(major);
 		setMinor(minor);
 		setReleaseLevel(releaseLevel);
@@ -295,33 +158,9 @@
 		setBuildNumber(buildNumber);
 		setBuildDate(buildDate);
 	}
-	/**
-	 * Constructor for VersionData.
-	*/
-	public VersionData(
-		VersionDataElementSet elements,
-		int major,
-		int minor,
-		ReleaseLevel releaseLevel,
-		int releaseQualifier,
-		int point,
-		int buildNumber,
-		Date buildDate) {
-		m_elements = elements;
-
-		m_major = major;
-		m_minor = minor;
-		m_releaseLevel = releaseLevel;
-		m_releaseQualifier = releaseQualifier;
-		m_point = point;
-
-		m_buildNumber = buildNumber;
-
-		m_buildDate = buildDate;
-	}
 
 	/**
-	 * Constructor for VersionData.
+	 * Constructor for VersionData from a Date (e.g. a nightly).
 	*/
 	public VersionData(Date buildDate) {
 		m_elements =
@@ -335,277 +174,7 @@
 		setBuildNumber(VersionDataElement.DEFAULT_BUILD_NUMBER);
 		setBuildDate(buildDate);
 	}
-
-	/**
-	  * Constructor for VersionData.
-	  */
-	public VersionData(
-		int major,
-		int minor,
-		ReleaseLevel releaseLevel,
-		int releaseQualifier,
-		int point,
-		int buildNumber) {
-		m_elements = VersionDataElementSet.DEFAULT;
-
-		m_major = major;
-		m_minor = minor;
-		m_releaseLevel = releaseLevel;
-		m_releaseQualifier = releaseQualifier;
-		m_point = point;
-		m_buildNumber = buildNumber;
-	}
-
-	/**
-	 * Constructor for VersionData.
-	 */
-	public VersionData(
-		VersionDataElementSet elements,
-		int major,
-		int minor,
-		String releaseLevel,
-		int releaseQualifier,
-		int point,
-		int buildNumber,
-		Map attributes)
-		throws VersionException {
-		this(
-			elements,
-			major,
-			minor,
-			ReleaseLevel.getFromString(releaseLevel),
-			releaseQualifier,
-			point,
-			buildNumber,
-			attributes);
-	}
-	/**
-	 * Constructor for VersionData.
-	 */
-	public VersionData(
-		VersionDataElementSet elements,
-		int major,
-		int minor,
-		ReleaseLevel releaseLevel,
-		int releaseQualifier,
-		int point,
-		int buildNumber,
-		Map attributes)
-		throws VersionException {
-		m_elements = elements;
-
-		m_major = major;
-		m_minor = minor;
-		m_releaseLevel = releaseLevel;
-		m_releaseQualifier = releaseQualifier;
-		m_point = point;
-		m_buildNumber = buildNumber;
-
-		importFromProperties(attributes);
-	}
-
-	/**
-	   * Constructor for VersionData.
-	   */
-	public VersionData(
-		int major,
-		int minor,
-		ReleaseLevel releaseLevel,
-		int releaseQualifier,
-		int point,
-		int buildNumber,
-		Map attributes)
-		throws VersionException {
-		m_elements = VersionDataElementSet.DEFAULT;
-
-		m_major = major;
-		m_minor = minor;
-		m_releaseLevel = releaseLevel;
-		m_releaseQualifier = releaseQualifier;
-		m_point = point;
-		m_buildNumber = buildNumber;
-
-		importFromProperties(attributes);
-	}
-
-	/**
-	 * Constructor for VersionData.
-	 */
-	public VersionData(int major, int minor, int point) {
-		m_elements =
-			new VersionDataElementSet(
-				VersionDataElement.ELEMENT_MAJOR
-					| VersionDataElement.ELEMENT_MINOR
-					| VersionDataElement.ELEMENT_POINT);
-
-		m_major = major;
-		m_minor = minor;
-		m_releaseLevel = ReleaseLevel.RELEASE;
-		m_releaseQualifier = VersionDataElement.DEFAULT_RELEASE_QUALIFIER;
-		m_point = point;
-		m_buildNumber = VersionDataElement.DEFAULT_BUILD_NUMBER;
-	}
-
-	/**
-	 * Constructor for VersionData.
-	 * 
-	 * @throws VersionFormatException if the string cannot be parsed.
-	 */
-	public VersionData(Map properties) throws VersionException {
-		m_elements = new VersionDataElementSet();
-		importFromProperties(properties);
-	}
-
-	/**
-	 * Constructor for VersionData.
-	 */
-	/*public VersionData(
-	    VersionDataElementSet elements,
-	    int major,
-	    int minor,
-	    String releaseLevel,
-	    int point,
-	    int buildNumber,
-	    String versionLocation,
-	    String versionDescription)
-	    throws VersionException {
-	    this(
-	        elements,
-	        major,
-	        minor,
-	        ReleaseLevel.getFromString(releaseLevel),
-	        point,
-	        buildNumber,
-	        versionLocation,
-	        versionDescription);
-	}*/
-
-	/**
-	 * Constructor for VersionData.
-	 */
-	/*public VersionData(
-	    int major,
-	    int minor,
-	    String releaseLevel,
-	    int point,
-	    int buildNumber,
-	    String versionLocation,
-	    String versionDescription)
-	    throws VersionException {
-	    this(
-	        major,
-	        minor,
-	        ReleaseLevel.getFromString(releaseLevel),
-	        point,
-	        buildNumber,
-	        versionLocation,
-	        versionDescription);
-	}*/
-
-	/**
-	 * Constructor for VersionData.
-	 */
-	/*public VersionData(
-	    int major,
-	    int minor,
-	    ReleaseLevel releaseLevel,
-	    int point,
-	    int buildNumber,
-	    String versionLocationUrl,
-	    String versionDescription) {
-	    m_major = major;
-	    m_minor = minor;
-	    m_releaseLevel = releaseLevel;
-	    m_point = point;
-	    m_buildNumber = buildNumber;
-	
-	    setAttribute(VersionConstants.LOCATION_URL, versionLocationUrl);
-	    setAttribute(VersionConstants.DESCRIPTION, versionDescription);
-	}*/
-
-	/**
-	 * Constructor for VersionData.
-	 */
-	/*public VersionData(
-	    int major,
-	    int minor,
-	    ReleaseLevel releaseLevel,
-	    int point,
-	    int buildNumber,
-	    String versionLocationUrl,
-	    String versionDescription,
-	    HashMap attributes) {
-	    m_major = major;
-	    m_minor = minor;
-	    m_releaseLevel = releaseLevel;
-	    m_point = point;
-	    m_buildNumber = buildNumber;
-	
-	    setAttribute(VersionConstants.LOCATION_URL, versionLocationUrl);
-	    setAttribute(VersionConstants.DESCRIPTION, versionDescription);
 	
-	    m_attributes = attributes;
-	}*/
-
-	/**
-	 * Constructor for VersionData.
-	 */
-	/*public VersionData(
-	    int major,
-	    int minor,
-	    String releaseLevel,
-	    int point,
-	    int buildNumber,
-	    String versionLocationUrl,
-	    String versiondescription,
-	    HashMap attributes)
-	    throws VersionException {
-	    this(
-	        major,
-	        minor,
-	        ReleaseLevel.getFromString(releaseLevel),
-	        point,
-	        buildNumber,
-	        versionLocationUrl,
-	        versiondescription,
-	        attributes);
-	}*/
-
-	/*public VersionData(
-	    String major,
-	    String minor,
-	    String releaseLevel,
-	    String point,
-	    String buildNumber,
-	    Map attributes)
-	    throws VersionException {
-	    super();
-	
-	    m_major =
-	        importIntValue(
-	            VersionDataElement.MAJOR,
-	            major,
-	            VersionDataElement.DEFAULT_MAJOR);
-	    m_minor =
-	        importIntValue(
-	            VersionDataElement.MINOR,
-	            minor,
-	            VersionDataElement.DEFAULT_MINOR);
-	    m_releaseLevel = ReleaseLevel.getFromString(releaseLevel);
-	    m_point =
-	        importIntValue(
-	            VersionDataElement.POINT,
-	            point,
-	            VersionDataElement.DEFAULT_POINT);
-	    m_buildNumber =
-	        importIntValue(
-	            VersionDataElement.BUILD_NUMBER,
-	            buildNumber,
-	            VersionDataElement.DEFAULT_BUILD_NUMBER);
-	
-	    importFromProperties(attributes);
-	}
-	*/
 	public boolean isValid() {
 		boolean valid = false;
 
@@ -696,46 +265,27 @@
 		return m_releaseQualifier;
 	}
 
-	/*public void setVersion(String version) throws VersionFormatException {
-	    importFromString(version);
-	}*/
-
-	/*public void importFromString(String version)
-	    throws VersionFormatException {
-	    VersionFormat format =
-	        VersionFormatFactory.createDefaultVersionFormat();
-	
-	    VersionData imported = format.parseVersion(version);
-	
-	    m_elements = imported.m_elements;
-	
-	    m_major = imported.m_major;
-	    m_minor = imported.m_minor;
-	    m_releaseLevel = imported.m_releaseLevel;
-	    m_point = imported.m_point;
-	    m_buildNumber = imported.m_buildNumber;
-	    m_attributes = imported.m_attributes;
-	}*/
-
 	/**
 	 * import a property set.
 	 * 
 	 * @param properties
 	 */
-	public void importFromProperties(Map properties) throws VersionException {
-		if (null != properties)
-			for (Iterator i = properties.keySet().iterator(); i.hasNext();) {
-				Object keyObj = i.next();
-				Object value = properties.get(keyObj);
-
-				if (keyObj instanceof String) {
-					String key = (String) keyObj;
-					importFromNamedObject(key, value);
-				}
+	public Map importProperties(Map properties) throws VersionException {
+		Map unused = null; // :TODO: put those not imported here
+		
+		for (Iterator i = properties.keySet().iterator(); i.hasNext();) {
+			Object keyObj = i.next();
+			Object value = properties.get(keyObj);
+
+			if (keyObj instanceof String) {
+				importNamedObject((String) keyObj, value);
 			}
+		}
+		
+		return unused;
 	}
 
-	public void importFromNamedObject(String key, Object value)
+	public void importNamedObject(String key, Object value)
 		throws VersionException {
 
 		if (value instanceof String) {
@@ -830,32 +380,32 @@
 	}
 
 	public boolean isMajorUnset() {
-		return (VersionDataElement.UNSET_MAJOR == m_major);
+		return !m_elements.hasMajor() || (VersionDataElement.UNSET_MAJOR == m_major);
 	}
 
 	public boolean isMinorUnset() {
-		return (VersionDataElement.UNSET_MINOR == m_minor);
+		return !m_elements.hasMinor() || (VersionDataElement.UNSET_MINOR == m_minor);
 	}
 
 	public boolean isReleaseLevelUnset() {
-		return (ReleaseLevel.UNSET == m_releaseLevel);
+		return !m_elements.hasReleaseLevel() || (ReleaseLevel.UNSET == m_releaseLevel);
 	}
 
 	public boolean isReleaseQualifierUnset() {
-		return (
+		return !m_elements.hasReleaseQualifier() || (
 			VersionDataElement.UNSET_RELEASE_QUALIFIER == m_releaseQualifier);
 	}
 
 	public boolean isPointUnset() {
-		return (VersionDataElement.UNSET_POINT == m_point);
+		return !m_elements.hasPoint() || (VersionDataElement.UNSET_POINT == m_point);
 	}
 
 	public boolean isBuildNumberUnset() {
-		return (VersionDataElement.UNSET_BUILD_NUMBER == m_buildNumber);
+		return !m_elements.hasBuildNumber() || (VersionDataElement.UNSET_BUILD_NUMBER == m_buildNumber);
 	}
 
 	public boolean isBuildDateUnset() {
-		return (VersionDataElement.UNSET_BUILD_DATE != m_buildDate);
+		return !m_elements.hasBuildDate() || (VersionDataElement.UNSET_BUILD_DATE != m_buildDate);
 	}
 
 	/**
@@ -1264,12 +814,64 @@
 		if (null != map)
 			for (int i = 0; i < map.getLength(); ++i) {
 				Attr attr = (Attr) map.item(i);
-				importFromNamedObject(attr.getName(), attr.getNodeValue());
+				importNamedObject(attr.getName(), attr.getNodeValue());
 
 			}
 	}
 	public void consumeDOMElement(String tag, Element element) {
 	}
 	public void consumeDOMObject(String tag, Object object) {
+	}
+
+	public static VersionData getTestVersionData()
+	{
+		return new TestVersionData();
+	}
+	public static VersionData getTestVersionData(int major,int minor)
+	{
+		return new TestVersionData(major,minor);
+	}
+	public static VersionData getTestVersionData(int major,int minor,ReleaseLevel level,int point)
+	{
+		return new TestVersionData(major,minor);
+	}
+}
+
+
+//
+// Testing Instances
+//
+class TestVersionData extends VersionData {
+	TestVersionData(int major,int minor) {
+		super(		VersionDataElementSet.SHORT,
+					major, 
+					minor, 
+					VersionDataElement.UNSET_RELEASE_LEVEL, 
+					VersionDataElement.UNSET_RELEASE_QUALIFIER, 
+					VersionDataElement.UNSET_POINT, 
+					VersionDataElement.UNSET_BUILD_NUMBER,
+					VersionDataElement.UNSET_BUILD_DATE);
+	}
+	
+	TestVersionData(int major,int minor,ReleaseLevel level, int point) {
+		super(		VersionDataElementSet.SHORT,
+					major, 
+					minor, 
+					level, 
+					VersionDataElement.UNSET_RELEASE_QUALIFIER, 
+					point, 
+					VersionDataElement.UNSET_BUILD_NUMBER,
+					VersionDataElement.UNSET_BUILD_DATE);
+	}
+	
+	TestVersionData() {
+		super(		VersionDataElementSet.SHORT,
+					1, 
+					1, 
+					VersionDataElement.UNSET_RELEASE_LEVEL, 
+					VersionDataElement.UNSET_RELEASE_QUALIFIER, 
+					1, 
+					VersionDataElement.UNSET_BUILD_NUMBER,
+					VersionDataElement.UNSET_BUILD_DATE);
 	}
 }

Modified: incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/data/util/VersionDataIncrementor.java
==============================================================================
--- incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/data/util/VersionDataIncrementor.java	(original)
+++ incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/data/util/VersionDataIncrementor.java	Wed Jun 23 12:07:07 2004
@@ -16,6 +16,7 @@
 
 package org.apache.depot.version.impl.data.util;
 
+import java.util.Date;
 import java.util.Iterator;
 
 import org.apache.depot.version.impl.data.ReleaseLevel;
@@ -77,6 +78,9 @@
             incLevel = releaseLevel.nextLevel();
         }
 
+        //:TODO: Increment?
+        Date buildDate = initial.getBuildDate();
+        
         if (m_element == VersionDataElement.RELEASE_LEVEL)
             incLevel = releaseLevel.nextLevel();
 
@@ -113,7 +117,8 @@
                     releaseLevel,
                     releaseQualifier,
                     point,
-                    buildNumber);
+                    buildNumber,
+					buildDate);
 
         return inc;
     }

Modified: incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/data/util/VersionDataIterator.java
==============================================================================
--- incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/data/util/VersionDataIterator.java	(original)
+++ incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/data/util/VersionDataIterator.java	Wed Jun 23 12:07:07 2004
@@ -59,7 +59,8 @@
                     VersionDataElement.MIN_RELEASE_LEVEL,
                     VersionDataElement.MIN_RELEASE_QUALIFIER,
                     VersionDataElement.MIN_POINT,
-                    VersionDataElement.MIN_BUILD_NUMBER);
+                    VersionDataElement.MIN_BUILD_NUMBER,
+					null);
     }
 
     /**
@@ -102,7 +103,8 @@
         }
     }
 
-    public static void main(String args[]) throws Exception {
+  	/* Tests ought be unit tests...
+  	  public static void main(String args[]) throws Exception {
         VersionData lower =
             new VersionData(
                 VersionDataElement.MAX_MAJOR - 10,
@@ -136,5 +138,6 @@
             System.out.println("Total Count:" + count);
         }
     }
-
+  	 */
+   
 }

Modified: incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/data/util/VersionDataRangeIterator.java
==============================================================================
--- incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/data/util/VersionDataRangeIterator.java	(original)
+++ incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/data/util/VersionDataRangeIterator.java	Wed Jun 23 12:07:07 2004
@@ -90,6 +90,7 @@
         }
     }
 
+    	/* Tests ought be unit tests...
     public static void main(String args[]) throws Exception {
         VersionData lower = new VersionData(1, 1, "alpha", 1, 1, 1);
         VersionData upper = new VersionData(1, 1, "alpha", 1, 1, 10);
@@ -108,4 +109,6 @@
 
         System.out.println("Total Count:" + count);
     }
+    
+    */
 }

Modified: incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/util/ApacheVersionMarkerDiffTool.java
==============================================================================
--- incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/util/ApacheVersionMarkerDiffTool.java	(original)
+++ incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/util/ApacheVersionMarkerDiffTool.java	Wed Jun 23 12:07:07 2004
@@ -83,8 +83,8 @@
 	public static void main(String args[]) throws Exception {
 		AnnotationScratchpad pad =
 			ApacheVersionMarkerDiffTool.diff(
-				new ApacheVersionMarker("A"),
-				new ApacheVersionMarker("B", 1, 2));
+				ApacheVersionMarker.getTestVersionMarker("A"),
+				ApacheVersionMarker.getTestVersionMarker("B", 1, 2));
 
 		DebugUtils.dump(pad);
 	}

Modified: incubator/depot/trunk/version/src/java/org/apache/depot/version/interfacing/ApacheVersionMarkerInterfaceProxy.java
==============================================================================
--- incubator/depot/trunk/version/src/java/org/apache/depot/version/interfacing/ApacheVersionMarkerInterfaceProxy.java	(original)
+++ incubator/depot/trunk/version/src/java/org/apache/depot/version/interfacing/ApacheVersionMarkerInterfaceProxy.java	Wed Jun 23 12:07:07 2004
@@ -26,6 +26,7 @@
 import org.apache.depot.common.util.debug.DebugUtils;
 import org.apache.depot.version.VersionConstants;
 import org.apache.depot.version.VersionException;
+import org.apache.depot.version.impl.ApacheVersion;
 import org.apache.depot.version.impl.ApacheVersionMarker;
 import org.apache.depot.version.impl.VersionIdentifier;
 import org.apache.depot.version.impl.data.ReleaseLevel;
@@ -83,8 +84,7 @@
 
 		return new ApacheVersionMarker(
 			m_id,
-			m_specification,
-			m_data,
+			new ApacheVersion(m_specification,m_data),
 			m_attributes,
 			m_annotations);
 	}

Modified: incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/ApacheVersionSpecification.java
==============================================================================
--- incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/ApacheVersionSpecification.java	(original)
+++ incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/ApacheVersionSpecification.java	Wed Jun 23 12:07:07 2004
@@ -28,7 +28,8 @@
  * 
  */
 public class ApacheVersionSpecification extends VersionSpecificationImpl {
-
+	
+	
     /**
      * @see org.apache.depot.version.specification.VersionSpecification#getId()
      */

Modified: incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/formatting/format/ApacheVersionFormat.java
==============================================================================
--- incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/formatting/format/ApacheVersionFormat.java	(original)
+++ incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/formatting/format/ApacheVersionFormat.java	Wed Jun 23 12:07:07 2004
@@ -16,6 +16,7 @@
 
 package org.apache.depot.version.specification.formatting.format;
 
+import java.util.Date;
 import java.util.StringTokenizer;
 
 import org.apache.depot.common.log.Logger;
@@ -108,6 +109,7 @@
 		ReleaseLevel releaseLevel = ReleaseLevel.RELEASE;
 		int releaseQualifier = VersionDataElement.DEFAULT_RELEASE_QUALIFIER;
 		int buildNumber = VersionDataElement.DEFAULT_BUILD_NUMBER;
+		Date buildDate = null;
 
 		// Attach anything left after major/minor onto extra tokens
 		if (tokens.hasMoreTokens())
@@ -224,7 +226,8 @@
 			releaseLevel,
 			releaseQualifier,
 			point,
-			buildNumber);
+			buildNumber,
+			buildDate);
 	}
 
 	public String toVersionString(VersionData data) {

Modified: incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/formatting/format/EclipseVersionFormat.java
==============================================================================
--- incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/formatting/format/EclipseVersionFormat.java	(original)
+++ incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/formatting/format/EclipseVersionFormat.java	Wed Jun 23 12:07:07 2004
@@ -16,6 +16,7 @@
 
 package org.apache.depot.version.specification.formatting.format;
 
+import java.util.Date;
 import java.util.StringTokenizer;
 
 import org.apache.depot.version.impl.data.ReleaseLevel;
@@ -73,6 +74,7 @@
         ReleaseLevel releaseLevel = VersionDataElement.DEFAULT_RELEASE_LEVEL;
         int releaseQualifier = VersionDataElement.DEFAULT_RELEASE_QUALIFIER;
         int buildNumber = VersionDataElement.DEFAULT_BUILD_NUMBER;
+        Date buildDate = null;
 
         if (tokens.hasMoreTokens()) {
 
@@ -92,7 +94,8 @@
                 releaseLevel,
                 releaseQualifier,
                 point,
-                buildNumber);
+                buildNumber,
+				buildDate);
 
         return data;
 

Modified: incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/formatting/format/JakartaCommonsVersionFormat.java
==============================================================================
--- incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/formatting/format/JakartaCommonsVersionFormat.java	(original)
+++ incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/formatting/format/JakartaCommonsVersionFormat.java	Wed Jun 23 12:07:07 2004
@@ -16,6 +16,7 @@
 
 package org.apache.depot.version.specification.formatting.format;
 
+import java.util.Date;
 import java.util.StringTokenizer;
 
 import org.apache.depot.version.impl.data.ReleaseLevel;
@@ -66,6 +67,7 @@
         ReleaseLevel releaseLevel = VersionDataElement.DEFAULT_RELEASE_LEVEL;
         int releaseQualifier = VersionDataElement.DEFAULT_RELEASE_QUALIFIER;
         int buildNumber = VersionDataElement.DEFAULT_BUILD_NUMBER;
+        Date buildDate = null;
 
         if (tokens.hasMoreTokens()) {
             String token = tokens.nextToken();
@@ -100,7 +102,8 @@
                 releaseLevel,
                 releaseQualifier,
                 point,
-                buildNumber);
+                buildNumber,
+				buildDate);
 
         return version;
 

Modified: incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/formatting/format/JavasoftVersionFormat.java
==============================================================================
--- incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/formatting/format/JavasoftVersionFormat.java	(original)
+++ incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/formatting/format/JavasoftVersionFormat.java	Wed Jun 23 12:07:07 2004
@@ -16,6 +16,7 @@
 
 package org.apache.depot.version.specification.formatting.format;
 
+import java.util.Date;
 import java.util.StringTokenizer;
 
 import org.apache.depot.version.impl.data.ReleaseLevel;
@@ -69,6 +70,7 @@
         ReleaseLevel releaseLevel = VersionDataElement.DEFAULT_RELEASE_LEVEL;
         int releaseQualifier = VersionDataElement.DEFAULT_RELEASE_QUALIFIER;
         int buildNumber = VersionDataElement.DEFAULT_BUILD_NUMBER;
+        Date buildDate = null;
 
         if (tokens.hasMoreTokens())
             point =
@@ -84,7 +86,8 @@
                 releaseLevel,
                 releaseQualifier,
                 point,
-                buildNumber);
+                buildNumber,
+				buildDate);
 
         return data;
 

Modified: incubator/depot/trunk/version/src/test/java/org/apache/depot/version/context/ExtensionRegistryTests.java
==============================================================================
--- incubator/depot/trunk/version/src/test/java/org/apache/depot/version/context/ExtensionRegistryTests.java	(original)
+++ incubator/depot/trunk/version/src/test/java/org/apache/depot/version/context/ExtensionRegistryTests.java	Wed Jun 23 12:07:07 2004
@@ -65,23 +65,23 @@
 		assertTrue("Entries", 2 == registry.size());
 	}
 
-	private VirtualMachineExtensionInformation create(
+	/*private VirtualMachineExtensionInformation create(
 		int major,
 		int minor,
 		LoadType type) {
 		return create("test", major, minor, type);
-	}
+	}*/
 
 	private VirtualMachineExtensionInformation create(String id) {
 		return create(id, 1, 1, LoadType.PACKAGE);
 	}
 
-	private VirtualMachineExtensionInformation create(
+	/*private VirtualMachineExtensionInformation create(
 		String id,
 		int major,
 		int minor) {
 		return create(id, major, minor, LoadType.PACKAGE);
-	}
+	}*/
 
 
 	private VirtualMachineExtensionInformation create(
@@ -90,7 +90,7 @@
 		int minor,
 		LoadType type) {
 
-		ApacheVersion version = new ApacheVersion(major, minor);
+		ApacheVersion version = ApacheVersion.getTestVersion(major, minor);
 
 		VirtualMachineExtension extension =
 			new VirtualMachineExtension(

Modified: incubator/depot/trunk/version/src/test/java/org/apache/depot/version/context/VersionInformationTests.java
==============================================================================
--- incubator/depot/trunk/version/src/test/java/org/apache/depot/version/context/VersionInformationTests.java	(original)
+++ incubator/depot/trunk/version/src/test/java/org/apache/depot/version/context/VersionInformationTests.java	Wed Jun 23 12:07:07 2004
@@ -102,7 +102,7 @@
 		LoadType type) {
 		VersionIdentifier versionId = new VersionIdentifier(id);
 
-		ApacheVersion version = new ApacheVersion(major, minor);
+		ApacheVersion version = ApacheVersion.getTestVersion(major, minor);
 
 		ApacheVersionMarker marker =
 			new ApacheVersionMarker(versionId, version);

Modified: incubator/depot/trunk/version/src/test/java/org/apache/depot/version/context/VersionRegistryTests.java
==============================================================================
--- incubator/depot/trunk/version/src/test/java/org/apache/depot/version/context/VersionRegistryTests.java	(original)
+++ incubator/depot/trunk/version/src/test/java/org/apache/depot/version/context/VersionRegistryTests.java	Wed Jun 23 12:07:07 2004
@@ -86,7 +86,7 @@
 
 		VersionIdentifier versionId = new VersionIdentifier(id);
 
-		ApacheVersion version = new ApacheVersion(major, minor);
+		ApacheVersion version = ApacheVersion.getTestVersion(major, minor);
 
 		ApacheVersionMarker marker =
 			new ApacheVersionMarker(versionId, version);

Modified: incubator/depot/trunk/version/src/test/java/org/apache/depot/version/discovery/loading/FilenameLoaderTests.java
==============================================================================
--- incubator/depot/trunk/version/src/test/java/org/apache/depot/version/discovery/loading/FilenameLoaderTests.java	(original)
+++ incubator/depot/trunk/version/src/test/java/org/apache/depot/version/discovery/loading/FilenameLoaderTests.java	Wed Jun 23 12:07:07 2004
@@ -51,7 +51,7 @@
 
 		performAndCheckExtract(
 			"foo-1.2.jar",
-			new ApacheVersionMarker(
+			ApacheVersionMarker.getTestVersionMarker(
 				new VersionIdentifier(
 					VersionIdentifierType.PRODUCT_NAME_TYPE,
 					TEST_ID),
@@ -63,7 +63,7 @@
 
 		performAndCheckExtract(
 			"foo_1.2.jar",
-			new ApacheVersionMarker(
+			ApacheVersionMarker.getTestVersionMarker(
 				new VersionIdentifier(
 					VersionIdentifierType.PRODUCT_NAME_TYPE,
 					TEST_ID),
@@ -76,7 +76,7 @@
 
 		performAndCheckExtract(
 			"org/abc/foo-1.2/foo.jar",
-			new ApacheVersionMarker(
+			ApacheVersionMarker.getTestVersionMarker(
 				new VersionIdentifier(
 					VersionIdentifierType.PRODUCT_NAME_TYPE,
 					TEST_ID),
@@ -89,7 +89,7 @@
 
 		performAndCheckExtract(
 			"org/abc/foo-1.2/foo_1.2.jar",
-			new ApacheVersionMarker(
+			ApacheVersionMarker.getTestVersionMarker(
 				new VersionIdentifier(
 					VersionIdentifierType.PRODUCT_NAME_TYPE,
 					TEST_ID),
@@ -102,7 +102,7 @@
 
 		performAndCheckExtract(
 			"org/abc/foo-1.2/foo.jar",
-			new ApacheVersionMarker(
+			ApacheVersionMarker.getTestVersionMarker(
 				new VersionIdentifier(
 					VersionIdentifierType.PRODUCT_NAME_TYPE,
 					TEST_ID),

Modified: incubator/depot/trunk/version/src/test/java/org/apache/depot/version/extension/VirtualMachineExtensionInformationTests.java
==============================================================================
--- incubator/depot/trunk/version/src/test/java/org/apache/depot/version/extension/VirtualMachineExtensionInformationTests.java	(original)
+++ incubator/depot/trunk/version/src/test/java/org/apache/depot/version/extension/VirtualMachineExtensionInformationTests.java	Wed Jun 23 12:07:07 2004
@@ -111,7 +111,7 @@
 		int major,
 		int minor,
 		LoadType type) {
-		ApacheVersion version = new ApacheVersion(major, minor);
+		ApacheVersion version = ApacheVersion.getTestVersion(major, minor);
 
 		VirtualMachineExtension extension =
 			new VirtualMachineExtension(

Modified: incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/VersionTest.java
==============================================================================
--- incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/VersionTest.java	(original)
+++ incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/VersionTest.java	Wed Jun 23 12:07:07 2004
@@ -57,15 +57,15 @@
      */
     protected void setUp() throws Exception {
         m_version11A1 =
-            new ApacheVersion(1, 1, ReleaseLevel.ALPHA, 1);
+            ApacheVersion.getTestVersion(1, 1, ReleaseLevel.ALPHA, 1);
         m_version11A2 =
-            new ApacheVersion(1, 1, ReleaseLevel.ALPHA, 2);
+            ApacheVersion.getTestVersion(1, 1, ReleaseLevel.ALPHA, 2);
         m_version11B1 =
-            new ApacheVersion(1, 1, ReleaseLevel.BETA, 1);
+            ApacheVersion.getTestVersion(1, 1, ReleaseLevel.BETA, 1);
         m_version12A1 =
-            new ApacheVersion(1, 2, ReleaseLevel.ALPHA, 1);
+            ApacheVersion.getTestVersion(1, 2, ReleaseLevel.ALPHA, 1);
         m_version21A1 =
-            new ApacheVersion(2, 1, ReleaseLevel.ALPHA, 1);
+            ApacheVersion.getTestVersion(2, 1, ReleaseLevel.ALPHA, 1);
     }
 
     /**

Modified: incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/data/VersionDataComparisonTest.java
==============================================================================
--- incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/data/VersionDataComparisonTest.java	(original)
+++ incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/data/VersionDataComparisonTest.java	Wed Jun 23 12:07:07 2004
@@ -35,8 +35,8 @@
 	}
 
 	public void testEqual() throws VersionException {
-		VersionData data1 = new VersionData(1, 1, "alpha", 1, 1, 1);
-		VersionData data2 = new VersionData(2, 1, "alpha", 1, 1, 1);
+		VersionData data1 = new VersionData(1, 1, ReleaseLevel.ALPHA, 1, 1, 1, null);
+		VersionData data2 = new VersionData(2, 1, ReleaseLevel.ALPHA, 1, 1, 1, null);
 
 		VersionDataComparison expr1 = VersionDataComparison.getEqual(data1);
 
@@ -45,8 +45,8 @@
 	}
 
 	public void testLessThanAtMajor() throws VersionException {
-		VersionData data1 = new VersionData(1, 1, "alpha", 1, 1, 1);
-		VersionData data2 = new VersionData(2, 1, "alpha", 1, 1, 1);
+		VersionData data1 = new VersionData(1, 1, ReleaseLevel.ALPHA, 1, 1, 1, null);
+		VersionData data2 = new VersionData(2, 1, ReleaseLevel.ALPHA, 1, 1, 1, null);
 
 		VersionDataComparison expr1 = VersionDataComparison.getLessThan(data1);
 		VersionDataComparison expr2 = VersionDataComparison.getLessThan(data2);
@@ -55,8 +55,8 @@
 	}
 
 	public void testLessThanAtMinor() throws VersionException {
-		VersionData data1 = new VersionData(1, 1, "alpha", 1, 1, 1);
-		VersionData data2 = new VersionData(1, 2, "alpha", 1, 1, 1);
+		VersionData data1 = new VersionData(1, 1, ReleaseLevel.ALPHA, 1, 1, 1, null);
+		VersionData data2 = new VersionData(1, 2, ReleaseLevel.ALPHA, 1, 1, 1, null);
 
 		VersionDataComparison expr1 = VersionDataComparison.getLessThan(data1);
 		VersionDataComparison expr2 = VersionDataComparison.getLessThan(data2);
@@ -65,8 +65,8 @@
 	}
 
 	public void testLessThanAtRelease() throws VersionException {
-		VersionData data1 = new VersionData(1, 1, "alpha", 1, 1, 1);
-		VersionData data2 = new VersionData(1, 1, "beta", 1, 1, 1);
+		VersionData data1 = new VersionData(1, 1, ReleaseLevel.ALPHA, 1, 1, 1, null);
+		VersionData data2 = new VersionData(1, 1, ReleaseLevel.BETA, 1, 1, 1, null);
 
 		VersionDataComparison expr1 = VersionDataComparison.getLessThan(data1);
 		VersionDataComparison expr2 = VersionDataComparison.getLessThan(data2);
@@ -75,8 +75,8 @@
 	}
 
 	public void testLessThanAtPoint() throws VersionException {
-		VersionData data1 = new VersionData(1, 1, "alpha", 1, 1, 1);
-		VersionData data2 = new VersionData(1, 1, "alpha", 1, 2, 1);
+		VersionData data1 = new VersionData(1, 1, ReleaseLevel.ALPHA, 1, 1, 1,null);
+		VersionData data2 = new VersionData(1, 1, ReleaseLevel.ALPHA, 1, 2, 1,null);
 
 		VersionDataComparison expr1 = VersionDataComparison.getLessThan(data1);
 		VersionDataComparison expr2 = VersionDataComparison.getLessThan(data2);
@@ -86,8 +86,8 @@
 
 	public void testLessThanAtReleasexprualifierNumber()
 		throws VersionException {
-		VersionData data1 = new VersionData(1, 1, "alpha", 1, 1, 1);
-		VersionData data2 = new VersionData(1, 1, "alpha", 2, 1, 1);
+		VersionData data1 = new VersionData(1, 1, ReleaseLevel.ALPHA, 1, 1, 1,null);
+		VersionData data2 = new VersionData(1, 1, ReleaseLevel.ALPHA, 2, 1, 1,null);
 
 		VersionDataComparison expr1 = VersionDataComparison.getLessThan(data1);
 		VersionDataComparison expr2 = VersionDataComparison.getLessThan(data2);

Modified: incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/data/VersionDataConstructorTests.java
==============================================================================
--- incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/data/VersionDataConstructorTests.java	(original)
+++ incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/data/VersionDataConstructorTests.java	Wed Jun 23 12:07:07 2004
@@ -49,7 +49,8 @@
         properties.put("buildNumber", "20030302");
 
         ApacheVersion version2 =
-            new ApacheVersion(properties);
+            new ApacheVersion();
+        version2.importProperties(properties);
 
         assertTrue("Extracted Major", (1 == version1.getMajor()));
         assertTrue("Extracted Minor", (2 == version1.getMinor()));
@@ -82,7 +83,7 @@
 
         ApacheVersion version2 =
             new ApacheVersion(
-                new VersionData(1, 2, ReleaseLevel.ALPHA, 4, 3, 20030302));
+                new VersionData(1, 2, ReleaseLevel.ALPHA, 4, 3, 20030302, null));
 
         assertTrue("Extracted Major", (1 == version1.getMajor()));
         assertTrue("Extracted Minor", (2 == version1.getMinor()));

Modified: incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/data/VersionDataRangeIteratorTest.java
==============================================================================
--- incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/data/VersionDataRangeIteratorTest.java	(original)
+++ incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/data/VersionDataRangeIteratorTest.java	Wed Jun 23 12:07:07 2004
@@ -36,8 +36,8 @@
     }
 
     public void testTenBuildNumbers()  throws VersionException {
-        VersionData lower = new VersionData(1, 1, "alpha", 1, 1, 1);
-        VersionData upper = new VersionData(1, 1, "alpha", 1, 1, 10);
+        VersionData lower = new VersionData(1, 1, ReleaseLevel.ALPHA, 1, 1, 1, null);
+        VersionData upper = new VersionData(1, 1, ReleaseLevel.ALPHA, 1, 1, 10, null);
 
         int count = 0;
         for (Iterator i = new VersionDataRangeIterator(lower, upper);

Modified: incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/data/VersionDataRangeTest.java
==============================================================================
--- incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/data/VersionDataRangeTest.java	(original)
+++ incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/data/VersionDataRangeTest.java	Wed Jun 23 12:07:07 2004
@@ -35,14 +35,14 @@
 
     public void testEqual() throws VersionException {
         VersionData lower =
-            new VersionData(1, 1, "alpha", 1, 1, 1);
+            new VersionData(1, 1, ReleaseLevel.ALPHA, 1, 1, 1, null);
         VersionData upper =
-            new VersionData(2, 1, "alpha", 1, 1, 1);
+            new VersionData(2, 1, ReleaseLevel.ALPHA, 1, 1, 1, null);
 
         VersionData in =
-            new VersionData(1, 2, "alpha", 1, 1, 1);
+            new VersionData(1, 2, ReleaseLevel.ALPHA, 1, 1, 1, null);
         VersionData out =
-            new VersionData(3, 1, "alpha", 1, 1, 1);
+            new VersionData(3, 1, ReleaseLevel.ALPHA, 1, 1, 1, null);
 
         VersionDataRange r1 = new VersionDataRange(lower, upper);
 

Modified: incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/sample/Version1.java
==============================================================================
--- incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/sample/Version1.java	(original)
+++ incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/sample/Version1.java	Wed Jun 23 12:07:07 2004
@@ -16,14 +16,17 @@
 
 package org.apache.depot.version.impl.sample;
 
+import org.apache.depot.version.impl.ApacheVersion;
 import org.apache.depot.version.impl.ApacheVersionMarker;
 import org.apache.depot.version.impl.data.ReleaseLevel;
+import org.apache.depot.version.impl.data.VersionData;
 
 /**
  * @author ajack
  */
 public class Version1 extends ApacheVersionMarker {
-    public Version1() {
-        super(0, 1, ReleaseLevel.DEVELOPMENT, 1);
-    }
-}
+	public Version1() {
+		super("test1", new ApacheVersion(new VersionData(0, 1,
+				ReleaseLevel.DEVELOPMENT, 0, 1, 0, null)));
+	}
+}
\ No newline at end of file

Modified: incubator/depot/trunk/version/src/test/java/org/apache/depot/version/util/dom/DOMTests.java
==============================================================================
--- incubator/depot/trunk/version/src/test/java/org/apache/depot/version/util/dom/DOMTests.java	(original)
+++ incubator/depot/trunk/version/src/test/java/org/apache/depot/version/util/dom/DOMTests.java	Wed Jun 23 12:07:07 2004
@@ -46,31 +46,31 @@
 		//DebugUtils.dump("Environment", env2);
 	}
 	public void testApacheVersionDOM() throws DepotException {
-		ApacheVersion version = new ApacheVersion(1, 1, ReleaseLevel.ALPHA, 1);
+		ApacheVersion version = ApacheVersion.getTestVersion(1, 1, ReleaseLevel.ALPHA, 1);
 		;
 		Document doc = DOMUtils.produceDOM(version);
 		//DOMUtils.dump(SystemUtils.getSystemOut(), doc);
 	}
 	public void testApacheVersionDOMLoop() throws DepotException {
-		ApacheVersion version = new ApacheVersion(1, 1, ReleaseLevel.ALPHA, 1);
+		ApacheVersion version = ApacheVersion.getTestVersion(1, 1, ReleaseLevel.ALPHA, 1);
 		;
 		ApacheVersion version2 = new ApacheVersion(DOMUtils
 				.getRootElement(DOMUtils.produceDOM(version)));
 		//DebugUtils.dump("ApacheVersion", version2);
 	}
-	public void testApacheVersionMarkerDOM() throws DepotException {
+	public void testApacheMarkerVersionDOM() throws DepotException {
 		VersionIdentifier versionId = new VersionIdentifier("test");
-		ApacheVersion version = new ApacheVersion(1, 1);
+		ApacheVersion version = ApacheVersion.getTestVersion(1, 1);
 		ApacheVersionMarker marker = new ApacheVersionMarker(versionId, version);
 		Document doc = DOMUtils.produceDOM(marker);
 		//DOMUtils.dump(SystemUtils.getSystemOut(), doc);
 	}
 	public void testApacheVersionMarkerDOMLoop() throws DepotException {
 		VersionIdentifier versionId = new VersionIdentifier("test");
-		ApacheVersion version = new ApacheVersion(1, 1);
+		ApacheVersion version = ApacheVersion.getTestVersion(1, 1);
 		ApacheVersionMarker marker = new ApacheVersionMarker(versionId, version);
-		ApacheVersionMarker marker2 = new ApacheVersionMarker(DOMUtils
+		ApacheVersion marker2 = new ApacheVersion(DOMUtils
 				.getRootElement(DOMUtils.produceDOM(marker)));
-		//DebugUtils.dump("ApacheVersionMarker", marker2);
+		//DebugUtils.dump("ApacheVersion", marker2);
 	}
 }

Mime
View raw message