You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@depot.apache.org by ni...@apache.org on 2004/07/31 09:03:43 UTC
svn commit: rev 31030 - in incubator/depot/trunk/version/src: java/org/apache/depot/version test/java/org/apache/depot/version/ant/stamp
Author: nickchalko
Date: Sat Jul 31 02:03:42 2004
New Revision: 31030
Modified:
incubator/depot/trunk/version/src/java/org/apache/depot/version/VersionManager.java
incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/stamp/VersionGeneratorTaskTest.java
Log:
Added a test for round tripping Version Stamp to a VersionMarker.
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 Sat Jul 31 02:03:42 2004
@@ -58,7 +58,7 @@
* A instance if a version stamp.
* @return VersionMarker of the correct spec with all values filled in.
*/
- VersionMarker createVersionMarker(Object stamp) {
+ public VersionMarker createVersionMarker(Object stamp) {
try {
String specId = getSpecificationId(stamp);
Modified: incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/stamp/VersionGeneratorTaskTest.java
==============================================================================
--- incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/stamp/VersionGeneratorTaskTest.java (original)
+++ incubator/depot/trunk/version/src/test/java/org/apache/depot/version/ant/stamp/VersionGeneratorTaskTest.java Sat Jul 31 02:03:42 2004
@@ -1,67 +1,81 @@
/*
- * 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.
+ * 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.ant.stamp;
+import org.apache.acorn.version.version.Version;
+import org.apache.depot.version.VersionManager;
+import org.apache.depot.version.VersionMarker;
import org.apache.tools.ant.BuildFileTest;
import org.apache.tools.ant.Project;
public class VersionGeneratorTaskTest extends BuildFileTest {
- /**
- * Constructor for VersionTask.
- * @param arg0
- */
- public VersionGeneratorTaskTest(String arg0) {
- super(arg0);
- }
-
- public void setUp() {
- configureProject("src/test/java/org/apache/depot/version/ant/stamp/version.xml",
+ /**
+ * Constructor for VersionTask.
+ *
+ * @param arg0
+ */
+ public VersionGeneratorTaskTest(String arg0) {
+ super(arg0);
+ }
+
+ public void setUp() {
+ configureProject(
+ "src/test/java/org/apache/depot/version/ant/stamp/version.xml",
Project.MSG_INFO);
- }
- public void testComplex() {
- executeTarget("testComplex");
- }
-
- public void testComplexAttributed() {
- executeTarget("testComplexAttributed");
- }
-
- public void testVersionString() {
- executeTarget("testVersionString");
- }
-
- public void testVersion2String() {
- executeTarget("testVersion2String");
- }
-
- public void testVersionString2() {
- executeTarget("testVersionString2");
- }
-
- public void testVersionString3() {
- executeTarget("testVersionString3");
- }
-
- public void testDefaultedAttributes() {
- executeTarget("testDefaultedAttributes");
- }
-
- public void testDependent() {
- executeTarget("testDependent");
- }
-}
+ }
+
+ public void testComplex() {
+ executeTarget("testComplex");
+ }
+
+ public void testComplexAttributed() {
+ executeTarget("testComplexAttributed");
+ }
+
+ public void testVersionString() {
+ executeTarget("testVersionString");
+ }
+
+ public void testVersion2String() {
+ executeTarget("testVersion2String");
+
+ //TODO ok now lets make sure we got what we wanted.
+ Version stamp = Version.INSTANCE;
+ VersionManager manager = VersionManager.getManager();
+ VersionMarker marker = manager.createVersionMarker(stamp);
+ assertEquals("Long version of " + stamp + " genreated vs marker", stamp
+ .getLongVersion(), marker.getLongVersion());
+// TODO a bunch more tests.
+ }
+
+ public void testVersionString2() {
+ executeTarget("testVersionString2");
+ }
+
+ public void testVersionString3() {
+ executeTarget("testVersionString3");
+ }
+
+ public void testDefaultedAttributes() {
+ executeTarget("testDefaultedAttributes");
+ }
+
+ public void testDependent() {
+ executeTarget("testDependent");
+ }
+}
\ No newline at end of file