maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r667494 - /maven/artifact/trunk/src/test/java/org/apache/maven/artifact/versioning/DefaultArtifactVersionTest.java
Date Fri, 13 Jun 2008 12:14:33 GMT
Author: brett
Date: Fri Jun 13 05:14:32 2008
New Revision: 667494

URL: http://svn.apache.org/viewvc?rev=667494&view=rev
Log:
[MARTIFACT-16] DefaultArtifactVersion.hashCode() violates general contract - test case added
Submitted by: 	Benjamin Bentmann

Modified:
    maven/artifact/trunk/src/test/java/org/apache/maven/artifact/versioning/DefaultArtifactVersionTest.java

Modified: maven/artifact/trunk/src/test/java/org/apache/maven/artifact/versioning/DefaultArtifactVersionTest.java
URL: http://svn.apache.org/viewvc/maven/artifact/trunk/src/test/java/org/apache/maven/artifact/versioning/DefaultArtifactVersionTest.java?rev=667494&r1=667493&r2=667494&view=diff
==============================================================================
--- maven/artifact/trunk/src/test/java/org/apache/maven/artifact/versioning/DefaultArtifactVersionTest.java
(original)
+++ maven/artifact/trunk/src/test/java/org/apache/maven/artifact/versioning/DefaultArtifactVersionTest.java
Fri Jun 13 05:14:32 2008
@@ -158,7 +158,6 @@
         assertVersionOlder( "2.0.1-xyz-SNAPSHOT", "2.0.1-123-SNAPSHOT" );
     }
 
-
     public void testSnapshotVsReleases()
     {
         //assertVersionOlder( "1.0-RC1", "1.0-SNAPSHOT" ); not feasible if "1.0-SNAPSHOT"
< "1.0-beta-1" too
@@ -167,6 +166,14 @@
         assertVersionOlder( "1.0-SNAPSHOT", "1.0-rc-1" );
     }
 
+    public void testHashCode()
+    {
+        ArtifactVersion v1 = newArtifactVersion( "1" );
+        ArtifactVersion v2 = newArtifactVersion( "1.0" );
+        assertEquals( true, v1.equals( v2 ) );
+        assertEquals( v1.hashCode(), v2.hashCode() );
+    }
+
     private void assertVersionOlder( String left, String right )
     {
         assertTrue( left + " should be older than " + right,



Mime
View raw message