merge r377583 from branch 2.0.x

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@377591 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2006-02-14 02:55:13 +00:00
parent e84c6e0e86
commit 51b55e42ff
2 changed files with 10 additions and 2 deletions

View File

@ -224,6 +224,7 @@ public class DefaultArtifactVersion
majorVersion = null;
minorVersion = null;
incrementalVersion = null;
buildNumber = null;
}
}
}

View File

@ -132,8 +132,15 @@ public class DefaultArtifactVersionTest
assertEquals( "check minor version", 0, version.getMinorVersion() );
assertEquals( "check incremental version", 0, version.getIncrementalVersion() );
assertEquals( "check build number", 1, version.getBuildNumber() );
assertEquals( "check qualifier", null, version.getQualifier() );
assertNull( "check qualifier", version.getQualifier() );
assertEquals( "check string value", "2.0-1", version.toString() );
version = new DefaultArtifactVersion( "5.0.0alpha-2006020117" );
assertEquals( "check major version", 0, version.getMajorVersion() );
assertEquals( "check minor version", 0, version.getMinorVersion() );
assertEquals( "check incremental version", 0, version.getIncrementalVersion() );
assertEquals( "check build number", 0, version.getBuildNumber() );
assertEquals( "check qualifier", "5.0.0alpha-2006020117", version.getQualifier() );
}
public void testVersionComparing()
@ -145,7 +152,7 @@ public class DefaultArtifactVersionTest
assertTrue( version.compareTo( new DefaultArtifactVersion( "2" ) ) < 0 );
version = new DefaultArtifactVersion( "1" );
assertTrue( version.compareTo( new DefaultArtifactVersion( "1" ) ) == 0 );
assertEquals( 0, version.compareTo( new DefaultArtifactVersion( "1" ) ) );
version = new DefaultArtifactVersion( "2" );
assertTrue( version.compareTo( new DefaultArtifactVersion( "1" ) ) > 0 );