1 6 package fr.jayasoft.ivy.conflict; 7 8 11 12 import java.util.Date ; 13 14 import junit.framework.*; 15 import fr.jayasoft.ivy.Ivy; 16 17 18 public class RegexpConflictManagerTest extends TestCase 19 { 20 private Ivy ivy; 21 22 protected void setUp() throws Exception 23 { 24 ivy = new Ivy(); 25 ivy.configure( RegexpConflictManagerTest.class 26 .getResource( "ivyconf-regexp-test.xml" ) ); 27 } 28 29 public void testNoApiConflictResolve() throws Exception 30 { 31 try 32 { 33 ivy.resolve( RegexpConflictManagerTest.class 34 .getResource( "ivy-no-regexp-conflict.xml" ), null, 35 new String [] { "*" }, null, new Date (), false ); 36 } 37 catch ( StrictConflictException e ) 38 { 39 fail( "Unexpected conflict: " + e ); 40 } 41 } 42 43 public void testConflictResolve() throws Exception 44 { 45 try 46 { 47 ivy.resolve( RegexpConflictManagerTest.class 48 .getResource( "ivy-conflict.xml" ), null, 49 new String [] { "*" }, null, new Date (), false ); 50 51 fail( "Resolve should have failed with a conflict" ); 52 } 53 catch ( StrictConflictException e ) 54 { 55 assertTrue(e.getMessage().indexOf("[ org1 | mod1.2 | 2.0.0 ]:2.0 (needed by [ jayasoft | resolve-noconflict | 1.0 ])")!=-1); 57 assertTrue(e.getMessage().indexOf("conflicts with")!=-1); 58 assertTrue(e.getMessage().indexOf("[ org1 | mod1.2 | 2.1.0 ]:2.1 (needed by [ jayasoft | resolve-noconflict | 1.0 ])")!=-1); 59 } 60 } 61 } | Popular Tags |