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 36805 - in incubator/depot/trunk/version/src: java/org/apache/depot/version java/org/apache/depot/version/experimental/sample java/org/apache/depot/version/impl java/org/apache/depot/version/impl/gump java/org/apache/depot/version/interfacing java/org/apache/depot/version/specification/formatting java/org/apache/depot/version/specification/formatting/format test/java/org/apache/depot/version test/java/org/apache/depot/version/formatting test/java/org/apache/depot/version/impl test/java/org/apache/depot/version/impl/gump
Date Tue, 24 Aug 2004 05:02:36 GMT
Author: nickchalko
Date: Mon Aug 23 22:02:35 2004
New Revision: 36805

Added:
   incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/gump/
   incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/gump/GumpVersionTest.java
Modified:
   incubator/depot/trunk/version/src/java/org/apache/depot/version/VersionManager.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/impl/VersionImporter.java
   incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/gump/GumpVersionFormat.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/formatting/VersionFormat.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/DatetimestampedVersionFormat.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/VersionTestCase.java
   incubator/depot/trunk/version/src/test/java/org/apache/depot/version/formatting/ApacheVersionFormatTest.java
   incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/ApacheVersionSpecTest.java
   incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/ApacheVersionTest.java
Log:
Trying to reduce the use of version data.

Modified: incubator/depot/trunk/version/src/java/org/apache/depot/version/VersionManager.java
==============================================================================
--- incubator/depot/trunk/version/src/java/org/apache/depot/version/VersionManager.java	(original)
+++ incubator/depot/trunk/version/src/java/org/apache/depot/version/VersionManager.java	Mon
Aug 23 22:02:35 2004
@@ -18,10 +18,8 @@
 
 import java.util.Map;
 
-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.VersionData;
 import org.apache.depot.version.specification.VersionSpecification;
 import org.apache.depot.version.specification.VersionSpecificationFactory;
 import org.apache.depot.version.specification.formatting.VersionFormatException;
@@ -137,9 +135,8 @@
 	 * @throws VersionFormatException
 	 */
 	public Version createVersion(VersionSpecification spec, String versionString) throws VersionFormatException
{
-		VersionData data = spec.getVersionFormat().parseVersion(versionString);
+		return spec.getVersionFormat().parseVersion(versionString);
 
-		return new ApacheVersion(spec, data);
 	}
 
 	// :TODO:

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
Mon Aug 23 22:02:35 2004
@@ -57,7 +57,7 @@
 			presentSection("Provided Specification [" + versionStr + "]");
 
 			m_data =
-				m_specification.getVersionFormat().parseVersion(versionStr);
+				m_specification.getVersionFormat().parseVersionData(versionStr);
 
 			present("Provided Specificationter : [" + m_specification + "]");
 			present("Input : [" + versionStr + "]");

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 23 22:02:35 2004
@@ -108,7 +108,7 @@
 		ApacheVersion version = null;
 		VersionFormat format = specification.getVersionFormat();
 
-		VersionData versionData = format.parseVersion(data);
+		VersionData versionData = format.parseVersionData(data);
 
 		version = new ApacheVersion(specification, versionData);
 
@@ -171,7 +171,7 @@
 				try {
 					format = spec.getVersionFormat();
 
-					VersionData versionData = format.parseVersion(cleanData);
+					VersionData versionData = format.parseVersionData(cleanData);
 
 					version = new ApacheVersion(spec, versionData);
 				}

Modified: incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/gump/GumpVersionFormat.java
==============================================================================
--- incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/gump/GumpVersionFormat.java
(original)
+++ incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/gump/GumpVersionFormat.java
Mon Aug 23 22:02:35 2004
@@ -16,24 +16,29 @@
 
 import java.io.PrintWriter;
 
+import org.apache.depot.version.Version;
 import org.apache.depot.version.impl.data.VersionData;
 import org.apache.depot.version.specification.formatting.VersionFormat;
 import org.apache.depot.version.specification.formatting.VersionFormatException;
 
 /**
- *
+ *  
  */
 public class GumpVersionFormat implements VersionFormat {
 
-	/* (non-Javadoc)
+	/*
+	 * (non-Javadoc)
+	 * 
 	 * @see org.apache.depot.version.specification.formatting.VersionFormat#getFormatId()
 	 */
 	public String getFormatId() {
-		
+
 		return "org.apache.gump.version.format";
 	}
 
-	/* (non-Javadoc)
+	/*
+	 * (non-Javadoc)
+	 * 
 	 * @see org.apache.depot.version.specification.formatting.VersionFormat#getVersionFormatDescription()
 	 */
 	public String getVersionFormatDescription() {
@@ -41,16 +46,19 @@
 		return "gumped projects";
 	}
 
-	/* (non-Javadoc)
+	/*
+	 * (non-Javadoc)
+	 * 
 	 * @see org.apache.depot.version.specification.formatting.VersionFormat#parseVersion(java.lang.String)
 	 */
 	public VersionData parseVersionData(String version)
 			throws VersionFormatException {
-		// TODO Auto-generated method stub
-		return null;
+		throw new UnsupportedOperationException();
 	}
 
-	/* (non-Javadoc)
+	/*
+	 * (non-Javadoc)
+	 * 
 	 * @see org.apache.depot.version.specification.formatting.VersionFormat#toVersionString(org.apache.depot.version.impl.data.VersionData)
 	 */
 	public String toVersionString(VersionData data) {
@@ -58,20 +66,35 @@
 		return null;
 	}
 
-	/* (non-Javadoc)
-	 * @see org.apache.depot.version.specification.formatting.VersionFormat#format(org.apache.depot.version.impl.data.VersionData,
java.lang.String)
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.depot.version.specification.formatting.VersionFormat#format(org.apache.depot.version.impl.data.VersionData,
+	 *      java.lang.String)
 	 */
 	public String format(VersionData data, String styleName) {
 		// TODO Auto-generated method stub
 		return null;
 	}
 
-	/* (non-Javadoc)
-	 * @see org.apache.depot.common.util.debug.Dumpable#dump(java.io.PrintWriter, int, boolean)
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.depot.common.util.debug.Dumpable#dump(java.io.PrintWriter,
+	 *      int, boolean)
 	 */
 	public void dump(PrintWriter out, int depth, boolean verbose) {
 		// TODO Auto-generated method stub
 
 	}
 
-}
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.depot.version.specification.formatting.VersionFormat#parseVersion(java.lang.String)
+	 */
+	public Version parseVersion(String version) throws VersionFormatException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+}
\ No newline at end of file

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
Mon Aug 23 22:02:35 2004
@@ -188,7 +188,7 @@
 		VersionSpecification specification =
 			VersionSpecificationFactory.createDefaultVersionSpecification();
 
-		m_data = specification.getVersionFormat().parseVersion(version);
+		m_data = specification.getVersionFormat().parseVersionData(version);
 	}
 
 	/**

Modified: incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/formatting/VersionFormat.java
==============================================================================
--- incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/formatting/VersionFormat.java
(original)
+++ incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/formatting/VersionFormat.java
Mon Aug 23 22:02:35 2004
@@ -17,6 +17,7 @@
 package org.apache.depot.version.specification.formatting;
 
 import org.apache.depot.common.util.debug.Dumpable;
+import org.apache.depot.version.Version;
 import org.apache.depot.version.impl.data.VersionData;
 
 /**
@@ -24,54 +25,77 @@
  * 
  * Implements field -> method
  * 
- * 	Get from :
+ * Get from :
  * 
- * 		public	 static final {Class} {METHOD_NAME}
+ * public static final {Class} {METHOD_NAME}
  * 
- *  Set to:
+ * Set to:
  * 
- * 		public set{MethodName}({Class})
+ * public set{MethodName}({Class})
  * 
  * 
  * @author ajack
  */
 public interface VersionFormat extends Dumpable {
 
-    public final String LONG = "LONG";
-    public final String SHORT = "SHORT";
-    public final String DEFUALT = "DEFAULT";
-
-    String getFormatId();
-
-    //:TODO: These have to parse release levels also...
-
-    //
-    // Meta-information
-    //
-    //:TODO: Perhaps separate this "meta-information" out...
-    // :TODO:String getVersionFormatMask();
-    public String getVersionFormatDescription();
-
-
-    /**
-     * Parse a version creating a VersionData object for it.
-     * @param version The version string to be parsed
-     * @return a VersionData representing the Version specified by the string.
-     * @throws VersionFormatException
-     */
-    public VersionData parseVersion(String version) throws VersionFormatException;
-    /**
-     * Convert a VersionData to it's default String representation.
-     * @param data the VersionData
-     * @return the DEFAULT string presentation of data
-     */
-    public String toVersionString(VersionData data);
-
-    /**
-     * Format the VersionData in styleName format.
-     * @param data
-     * @param styleName
-     * @return the styleName formated String of VersionData
-     */
-    public String format(VersionData data, String styleName);
-}
+	public final String LONG = "LONG";
+
+	public final String SHORT = "SHORT";
+
+	public final String DEFUALT = "DEFAULT";
+
+	String getFormatId();
+
+	//:TODO: These have to parse release levels also...
+
+	//
+	// Meta-information
+	//
+	//:TODO: Perhaps separate this "meta-information" out...
+	// :TODO:String getVersionFormatMask();
+	public String getVersionFormatDescription();
+
+	/**
+	 * Parse a version creating a VersionData object for it.
+	 * 
+	 * @param version
+	 *            The version string to be parsed
+	 * @return a VersionData representing the Version specified by the string.
+	 * 
+	 * @throws VersionFormatException
+	 * 
+	 * @deprecated use parseVersion instead
+	 */
+	public VersionData parseVersionData(String version)
+			throws VersionFormatException;
+
+	/**
+	 * Parse a version creating a VersionData object for it.
+	 * 
+	 * @param version
+	 *            The version string to be parsed
+	 * @return a Version representing the Version specified by the string.
+	 * 
+	 * @throws VersionFormatException
+	 *  
+	 */
+	public Version parseVersion(String version) throws VersionFormatException;
+
+	/**
+	 * Convert a VersionData to it's default String representation.
+	 * 
+	 * @param data
+	 *            the VersionData
+	 * @return the DEFAULT string presentation of data
+	 */
+	public String toVersionString(VersionData data);
+
+	/**
+	 * Format the VersionData in styleName format.
+	 * 
+	 * @param data
+	 * @param styleName
+	 * @return the styleName formated String of VersionData
+	 */
+	public String format(VersionData data, String styleName);
+}
\ No newline at end of file

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
Mon Aug 23 22:02:35 2004
@@ -20,6 +20,8 @@
 import java.util.StringTokenizer;
 
 import org.apache.depot.common.log.Logger;
+import org.apache.depot.version.Version;
+import org.apache.depot.version.impl.ApacheVersion;
 import org.apache.depot.version.impl.VersionImplementationConstants;
 import org.apache.depot.version.impl.data.ReleaseLevel;
 import org.apache.depot.version.impl.data.VersionData;
@@ -62,23 +64,20 @@
 	//
 	//	{MAJOR}.{MINOR}[.{POINT}][-{RELEASE_LEVEL}][-{BUILD_NUMBER}]
 	//
-	public VersionData parseVersion(String versionString)
-		throws VersionFormatException {
+	public VersionData parseVersionData(String versionString)
+			throws VersionFormatException {
 		int elementMask = 0;
 
 		Logger.getLogger().debug(
-			"Parse Apache Version String: [" + versionString + "]");
+				"Parse Apache Version String: [" + versionString + "]");
 
 		StringTokenizer tokens = new StringTokenizer(versionString, ". ");
 
 		//  ---------------------------------------------------------------------------
 		//  Extract MAJOR (a mandatory element)
 		elementMask |= VersionDataElement.ELEMENT_MAJOR;
-		int major =
-			parseInt(
-				versionString,
-				VersionDataElement.MAJOR,
-				tokens.nextToken());
+		int major = parseInt(versionString, VersionDataElement.MAJOR, tokens
+				.nextToken());
 
 		//  ---------------------------------------------------------------------------
 		// Extract MINOR
@@ -98,10 +97,9 @@
 			}
 
 			elementMask |= VersionDataElement.ELEMENT_MINOR;
-			minor =
-				parseInt(versionString, VersionDataElement.MINOR, minorToken);
-		}
-		else {
+			minor = parseInt(versionString, VersionDataElement.MINOR,
+					minorToken);
+		} else {
 			// :TODO: Do we allow no minor? Throw Exception?
 		}
 
@@ -110,14 +108,15 @@
 			overflow = overflow + tokens.nextToken();
 
 		Logger.getLogger().debug(
-			"Major/Minor/Extra : [" + major + "/" + minor + "/" + overflow + "]");
-		
+				"Major/Minor/Extra : [" + major + "/" + minor + "/" + overflow
+						+ "]");
+
 		int point = VersionDataElement.DEFAULT_BUILD_NUMBER;
 		ReleaseLevel releaseLevel = ReleaseLevel.RELEASE;
 		int releaseQualifier = VersionDataElement.DEFAULT_RELEASE_QUALIFIER;
 		int buildNumber = VersionDataElement.DEFAULT_BUILD_NUMBER;
 		Date buildDate = null;
-		
+
 		if (overflow.length() > 0) {
 			StringTokenizer tokens2 = new StringTokenizer(overflow, "- ");
 
@@ -126,11 +125,11 @@
 			String remainder = "";
 
 			if (tokens2.hasMoreTokens())
-				pointToken  = tokens2.nextToken();
+				pointToken = tokens2.nextToken();
 
 			try {
 				possiblePoint = pointToken;
-				
+
 				//	Terminated point with a non-digit
 				int nonNumericPos = findEndOfNumericalArea(possiblePoint);
 
@@ -140,15 +139,11 @@
 					possiblePoint = possiblePoint.substring(0, nonNumericPos);
 				}
 
-				point =
-					parseInt(
-						versionString,
-						VersionDataElement.POINT,
+				point = parseInt(versionString, VersionDataElement.POINT,
 						possiblePoint);
 
 				elementMask |= VersionDataElement.ELEMENT_POINT;
-			}
-			catch (VersionFormatException vfe) {
+			} catch (VersionFormatException vfe) {
 				remainder = pointToken;
 			}
 
@@ -156,8 +151,8 @@
 				remainder = tokens2.nextToken();
 
 			Logger.getLogger().debug(
-				"Point/Extra : [" + point  + "/" + remainder + "]");
-			
+					"Point/Extra : [" + point + "/" + remainder + "]");
+
 			if (remainder.length() > 0)
 				try {
 					// Extract Release Level (perhaps with Qualifier)
@@ -167,79 +162,60 @@
 						// Release Level w/o a numeric qualifier
 						elementMask |= VersionDataElement.ELEMENT_RELEASE_LEVEL;
 
-						releaseLevel =
-							parseReleaseLevel(versionString, remainder);
-					}
-					else {
+						releaseLevel = parseReleaseLevel(versionString,
+								remainder);
+					} else {
 						String possibleRL = remainder.substring(0, digitPosn);
 						String possibleRQ = remainder.substring(digitPosn);
 
 						// Release Level
 						elementMask |= VersionDataElement.ELEMENT_RELEASE_LEVEL;
 
-						releaseLevel =
-							parseReleaseLevel(versionString, possibleRL);
+						releaseLevel = parseReleaseLevel(versionString,
+								possibleRL);
 
 						// Release Qualifier
-						elementMask
-							|= VersionDataElement.ELEMENT_RELEASE_QUALIFIER;
+						elementMask |= VersionDataElement.ELEMENT_RELEASE_QUALIFIER;
 
-						releaseQualifier =
-							parseInt(
-								versionString,
+						releaseQualifier = parseInt(versionString,
 								VersionDataElement.RELEASE_QUALIFIER,
 								possibleRQ);
 					}
 
 					Logger.getLogger().debug(
-						"RelaseLevel/Qualifier : [" + releaseLevel  + "/" + releaseQualifier + "]");				
+							"RelaseLevel/Qualifier : [" + releaseLevel + "/"
+									+ releaseQualifier + "]");
 
 					if (tokens2.hasMoreTokens()) {
-						
+
 						String data = tokens2.nextToken();
-						
-						try
-						{
+
+						try {
 							Date value = parseDate(data);
-							
 
 							elementMask |= VersionDataElement.ELEMENT_BUILD_DATE;
 							buildDate = value;
-						}
-						catch (Exception e)
-						{
-						
-						elementMask |= VersionDataElement.ELEMENT_BUILD_NUMBER;
-						buildNumber =
-							parseInt(
-								versionString,
-								VersionDataElement.BUILD_NUMBER,
-								tokens2.nextToken());
+						} catch (Exception e) {
+
+							elementMask |= VersionDataElement.ELEMENT_BUILD_NUMBER;
+							buildNumber = parseInt(versionString,
+									VersionDataElement.BUILD_NUMBER, tokens2
+											.nextToken());
 						}
 					}
-				}
-				catch (VersionFormatException vfe) {
+				} catch (VersionFormatException vfe) {
 					Logger.getLogger().debug("Previous", vfe);
 					elementMask |= VersionDataElement.ELEMENT_BUILD_NUMBER;
-					buildNumber =
-						parseInt(
-							versionString,
-							VersionDataElement.BUILD_NUMBER,
-							remainder);
+					buildNumber = parseInt(versionString,
+							VersionDataElement.BUILD_NUMBER, remainder);
 				}
 		}
 
 		//:TODO: Trap remainder and fail if leftovers...
 
-		return new VersionData(
-			new VersionDataElementSet(elementMask),
-			major,
-			minor,
-			releaseLevel,
-			releaseQualifier,
-			point,
-			buildNumber,
-			buildDate);
+		return new VersionData(new VersionDataElementSet(elementMask), major,
+				minor, releaseLevel, releaseQualifier, point, buildNumber,
+				buildDate);
 	}
 
 	public String toVersionString(VersionData data) {
@@ -299,8 +275,7 @@
 			}
 		}
 		if (m_elements.hasBuildNumber()) {
-			if (VersionDataElement.UNSET_BUILD_NUMBER
-				!= data.getBuildNumber()) {
+			if (VersionDataElement.UNSET_BUILD_NUMBER != data.getBuildNumber()) {
 				output.append("-");
 				output.append(data.getBuildNumber());
 
@@ -311,8 +286,12 @@
 
 	/**
 	 * Apply the named format to the VersionData.
-	 * @param data  The VersionData to format.
-	 * @param format The String name of the fromat to use (uses DEFAULT if null or not found)
+	 * 
+	 * @param data
+	 *            The VersionData to format.
+	 * @param format
+	 *            The String name of the fromat to use (uses DEFAULT if null or
+	 *            not found)
 	 * @return the format string representation of the version data given.
 	 */
 	public String format(VersionData data, String format) {
@@ -321,11 +300,20 @@
 		if (format != null) {
 			if (format.equals(VersionFormat.DEFUALT)) {
 				result = defaultFormat(data);
-			}
-			else if (format.equals(VersionFormat.SHORT)) {
+			} else if (format.equals(VersionFormat.SHORT)) {
 				result = shortFormat(data);
 			}
 		}
 		return result == null ? defaultFormat(data) : result;
 	}
-}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.depot.version.specification.formatting.VersionFormat#parseVersion(java.lang.String)
+	 */
+	public Version parseVersion(String version) throws VersionFormatException {
+
+		return new ApacheVersion(parseVersionData(version));
+	}
+}
\ No newline at end of file

Modified: incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/formatting/format/DatetimestampedVersionFormat.java
==============================================================================
--- incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/formatting/format/DatetimestampedVersionFormat.java
(original)
+++ incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/formatting/format/DatetimestampedVersionFormat.java
Mon Aug 23 22:02:35 2004
@@ -18,6 +18,7 @@
 
 import java.util.Date;
 
+import org.apache.depot.version.Version;
 import org.apache.depot.version.impl.VersionImplementationConstants;
 import org.apache.depot.version.impl.data.VersionData;
 import org.apache.depot.version.specification.formatting.VersionFormatException;
@@ -46,7 +47,7 @@
 		return "{DATETIMESTAMP} = YYYYMMDD[HHMM[SS]]";
 	}
 
-	public VersionData parseVersion(String versionString)
+	public VersionData parseVersionData(String versionString)
 			throws VersionFormatException {
 
 		Date value = parseDate(versionString);
@@ -60,5 +61,13 @@
 		output.append(VersionImplementationConstants.DATETIME_FORMAT.format(data.getBuildDate()));
 
 		return output.toString();
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.depot.version.specification.formatting.VersionFormat#parseVersion(java.lang.String)
+	 */
+	public Version parseVersion(String version) throws VersionFormatException {
+		// TODO Auto-generated method stub
+		return null;
 	}
 }

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
Mon Aug 23 22:02:35 2004
@@ -19,6 +19,7 @@
 import java.util.Date;
 import java.util.StringTokenizer;
 
+import org.apache.depot.version.Version;
 import org.apache.depot.version.impl.data.ReleaseLevel;
 import org.apache.depot.version.impl.data.VersionData;
 import org.apache.depot.version.impl.data.VersionDataElement;
@@ -48,7 +49,7 @@
         return "http://eclipse.org";
     }
 
-    public VersionData parseVersion(String versionString)
+    public VersionData parseVersionData(String versionString)
         throws VersionFormatException {
         VersionData data = null;
 
@@ -119,4 +120,12 @@
         
         return output.toString();
     }
+
+	/* (non-Javadoc)
+	 * @see org.apache.depot.version.specification.formatting.VersionFormat#parseVersion(java.lang.String)
+	 */
+	public Version parseVersion(String version) throws VersionFormatException {
+		// TODO Auto-generated method stub
+		return null;
+	}
 }

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
Mon Aug 23 22:02:35 2004
@@ -19,6 +19,7 @@
 import java.util.Date;
 import java.util.StringTokenizer;
 
+import org.apache.depot.version.Version;
 import org.apache.depot.version.impl.data.ReleaseLevel;
 import org.apache.depot.version.impl.data.VersionData;
 import org.apache.depot.version.impl.data.VersionDataElement;
@@ -47,7 +48,7 @@
         return "http://jakarta.apache.org/commons/versioning.html";
     }
 
-    public VersionData parseVersion(String versionString)
+    public VersionData parseVersionData(String versionString)
         throws VersionFormatException {
         VersionData version = null;
 
@@ -151,4 +152,12 @@
 
         return str;
     }
+
+	/* (non-Javadoc)
+	 * @see org.apache.depot.version.specification.formatting.VersionFormat#parseVersion(java.lang.String)
+	 */
+	public Version parseVersion(String version) throws VersionFormatException {
+		// TODO Auto-generated method stub
+		return null;
+	}
 }

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
Mon Aug 23 22:02:35 2004
@@ -19,6 +19,7 @@
 import java.util.Date;
 import java.util.StringTokenizer;
 
+import org.apache.depot.version.Version;
 import org.apache.depot.version.impl.data.ReleaseLevel;
 import org.apache.depot.version.impl.data.VersionData;
 import org.apache.depot.version.impl.data.VersionDataElement;
@@ -47,7 +48,7 @@
         return "http://jakarta.apache.org/commons/versioning.html";
     }
 
-    public VersionData parseVersion(String versionString)
+    public VersionData parseVersionData(String versionString)
         throws VersionFormatException {
         VersionData data = null;
 
@@ -107,4 +108,12 @@
 
         return output.toString();
     }
+
+	/* (non-Javadoc)
+	 * @see org.apache.depot.version.specification.formatting.VersionFormat#parseVersion(java.lang.String)
+	 */
+	public Version parseVersion(String version) throws VersionFormatException {
+		// TODO Auto-generated method stub
+		return null;
+	}
 }

Modified: incubator/depot/trunk/version/src/test/java/org/apache/depot/version/VersionTestCase.java
==============================================================================
--- incubator/depot/trunk/version/src/test/java/org/apache/depot/version/VersionTestCase.java
(original)
+++ incubator/depot/trunk/version/src/test/java/org/apache/depot/version/VersionTestCase.java
Mon Aug 23 22:02:35 2004
@@ -1,8 +1,17 @@
 /*
- * Created on Aug 17, 2004
+ * Copyright  2004 The Apache Software Foundation
  *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
+ *  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;
 
@@ -14,10 +23,7 @@
 import org.apache.depot.version.specification.formatting.VersionFormatException;
 
 /**
- * @author Nick
  * 
- * TODO To change the template for this generated type comment go to Window -
- * Preferences - Java - Code Style - Code Templates
  */
 public class VersionTestCase extends TestCase {
 	private static final VersionManager MANAGER = VersionManager.getManager();

Modified: incubator/depot/trunk/version/src/test/java/org/apache/depot/version/formatting/ApacheVersionFormatTest.java
==============================================================================
--- incubator/depot/trunk/version/src/test/java/org/apache/depot/version/formatting/ApacheVersionFormatTest.java
(original)
+++ incubator/depot/trunk/version/src/test/java/org/apache/depot/version/formatting/ApacheVersionFormatTest.java
Mon Aug 23 22:02:35 2004
@@ -157,7 +157,7 @@
     }
 
     private VersionData testParse(String input) throws VersionFormatException {
-        VersionData version = m_format.parseVersion(input);
+        VersionData version = m_format.parseVersionData(input);
 
         assertNotNull("Returned ok: " + input, version);
         assertTrue("Major ok: " + input, 5 == version.getMajor());

Modified: incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/ApacheVersionSpecTest.java
==============================================================================
--- incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/ApacheVersionSpecTest.java
(original)
+++ incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/ApacheVersionSpecTest.java
Mon Aug 23 22:02:35 2004
@@ -1,5 +1,17 @@
 /*
- * $Id: $
+ * 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;
 
@@ -18,8 +30,6 @@
 import org.apache.depot.version.specification.experimental.JakartaCommonsVersionSpecification;
 
 /**
- * @author ajack
- * @author $Author: $
  * @version $Revision: $
  */
 public class ApacheVersionSpecTest extends TestCase {

Modified: incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/ApacheVersionTest.java
==============================================================================
--- incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/ApacheVersionTest.java
(original)
+++ incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/ApacheVersionTest.java
Mon Aug 23 22:02:35 2004
@@ -1,5 +1,17 @@
 /*
- * $Id: $
+ * 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;
 
@@ -10,8 +22,6 @@
 import org.apache.depot.version.specification.formatting.VersionFormatException;
 
 /**
- * @author <a href="http://nick.chalko.com">Nick Chalko </a>
- * @author $Author: $
  * @version $Revision: $
  */
 public class ApacheVersionTest extends VersionTestCase {

Added: incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/gump/GumpVersionTest.java
==============================================================================
--- (empty file)
+++ incubator/depot/trunk/version/src/test/java/org/apache/depot/version/impl/gump/GumpVersionTest.java
Mon Aug 23 22:02:35 2004
@@ -0,0 +1,56 @@
+/*
+ * 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.gump;
+
+import org.apache.depot.version.CompoundVersion;
+import org.apache.depot.version.VersionException;
+import org.apache.depot.version.VersionTestCase;
+import org.apache.depot.version.impl.data.ReleaseLevel;
+import org.apache.depot.version.impl.gump.GumpVersion;
+import org.apache.depot.version.specification.formatting.VersionFormatException;
+
+/**
+ * @version $Revision: $
+ */
+public class GumpVersionTest extends VersionTestCase {
+
+	/**
+	 * @param specification
+	 */
+	public GumpVersionTest() {
+		super(GumpVersion.SPECIFICATION);
+	}
+
+	// :TODO: 1.0.0 ! 1.0.-1 == UNSET
+	// Maybe it should be....
+	// :TODO: final != rel
+	// Maybe it should be....
+
+	public void testEquals() throws VersionFormatException {
+		assertAllEqual(new String[] { "1","gump-1", "GUMP-1" });
+	}
+
+	public void testNonCompatible() throws VersionFormatException {
+		assertVersionInOrder(new String[] { "gump-1", "gump-2" }, false);
+	}
+
+	public void testCompatible() throws VersionFormatException {
+
+	}
+
+
+
+}
\ No newline at end of file

Mime
View raw message