maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject svn commit: r571859 [2/2] - in /maven/artifact/trunk/src: main/java/org/apache/maven/artifact/manager/ main/java/org/apache/maven/artifact/resolver/ test/java/org/apache/maven/artifact/resolver/
Date Sat, 01 Sep 2007 19:15:57 GMT
Modified: maven/artifact/trunk/src/test/java/org/apache/maven/artifact/resolver/DefaultArtifactCollectorTest.java
URL: http://svn.apache.org/viewvc/maven/artifact/trunk/src/test/java/org/apache/maven/artifact/resolver/DefaultArtifactCollectorTest.java?rev=571859&r1=571858&r2=571859&view=diff
==============================================================================
--- maven/artifact/trunk/src/test/java/org/apache/maven/artifact/resolver/DefaultArtifactCollectorTest.java
(original)
+++ maven/artifact/trunk/src/test/java/org/apache/maven/artifact/resolver/DefaultArtifactCollectorTest.java
Sat Sep  1 12:15:55 2007
@@ -311,14 +311,9 @@
 
         b.addDependency( "c", "[1.0,2.0]" );
 
-        try
-        {
-            ArtifactResolutionResult res = collect( a );
-            fail( "Should not succeed collecting, got: " + res.getArtifacts() );
-        }
-        catch ( ArtifactResolutionException expected )
-        {
-        }
+        ArtifactResolutionResult res = collect( a );
+
+        assertTrue( res.hasVersionRangeViolations() );
     }
 
     public void testUnboundedRangeWhenVersionUnavailable()
@@ -329,15 +324,9 @@
         a.addDependency( "c", "[2.0,]" );
         b.addDependency( "c", "[1.0,]" );
 
-        try
-        {
-            ArtifactResolutionResult res = collect( a );
-            fail( "Should not succeed collecting, got: " + res.getArtifacts() );
-        }
-        catch ( ArtifactResolutionException expected )
-        {
-            assertTrue( true );
-        }
+        ArtifactResolutionResult res = collect( a );
+
+        assertTrue( res.hasVersionRangeViolations() );        
     }
 
     public void testUnboundedRangeBelowLastRelease()
@@ -362,15 +351,9 @@
         createArtifactSpec( "c", "2.0" );
         a.addDependency( "c", "[10.0,)" );
 
-        try
-        {
-            ArtifactResolutionResult res = collect( a );
-            fail( "Should not succeed collecting, got: " + res.getArtifacts() );
-        }
-        catch ( ArtifactResolutionException expected )
-        {
-            assertTrue( true );
-        }
+        ArtifactResolutionResult res = collect( a );
+
+        assertTrue( res.hasVersionRangeViolations() );
     }
 
     public void testResolveManagedVersion()
@@ -675,6 +658,11 @@
         a.addDependency( "b", "[1.0,)" );
         createArtifactSpec( "b", "1.0-SNAPSHOT" );
 
+        ArtifactResolutionResult res = collect( a );
+
+        assertTrue( res.hasVersionRangeViolations() );
+
+        /*
         try
         {
             ArtifactResolutionResult res = collect( a );
@@ -684,6 +672,7 @@
         {
             assertTrue( e.getMessage().indexOf( "[1.0-SNAPSHOT]" ) < e.getMessage().indexOf(
"[1.0,)" ) );
         }
+        */
     }
 
     private Artifact getArtifact( String id, Set artifacts )



Mime
View raw message