1 6 package fr.jayasoft.ivy.conflict; 7 8 import java.util.Date ; 9 10 import fr.jayasoft.ivy.ConflictManager; 11 import fr.jayasoft.ivy.Ivy; 12 import junit.framework.TestCase; 13 14 public class StrictConflictManagerTest extends TestCase { 15 16 public void testInitFromConf() throws Exception { 17 Ivy ivy = new Ivy(); 18 ivy.configure(StrictConflictManagerTest.class.getResource("ivyconf-strict-test.xml")); 19 ConflictManager cm = ivy.getDefaultConflictManager(); 20 assertTrue(cm instanceof StrictConflictManager); 21 } 22 23 public void testNoConflictResolve() throws Exception { 24 Ivy ivy = new Ivy(); 25 ivy.configure(StrictConflictManagerTest.class.getResource("ivyconf-strict-test.xml")); 26 27 ivy.resolve(StrictConflictManagerTest.class.getResource("ivy-noconflict.xml"), null, new String [] { "*" }, null, new Date (), false); 28 } 29 30 public void testConflictResolve() throws Exception { 31 Ivy ivy = new Ivy(); 32 ivy.configure(StrictConflictManagerTest.class.getResource("ivyconf-strict-test.xml")); 33 34 try { 35 ivy.resolve(StrictConflictManagerTest.class.getResource("ivy-conflict.xml"), null, new String [] { "*" }, null, new Date (), false); 36 37 fail("Resolve should have failed with a conflict"); 38 } catch (StrictConflictException e) { 39 } 41 } 42 43 } 44 | Popular Tags |