1 7 package fr.jayasoft.ivy; 8 9 import java.io.File ; 10 import java.io.IOException ; 11 import java.text.ParseException ; 12 13 import junit.framework.TestCase; 14 15 public class ConfigureTest extends TestCase { 16 public void testDefault() throws ParseException , IOException { 17 Ivy ivy = new Ivy(); 18 ivy.configureDefault(); 19 20 assertNotNull(ivy.getDefaultResolver()); 21 } 22 23 public void testTypedefWithCustomClasspath() throws Exception { 24 Ivy ivy = new Ivy(); 25 ivy.setVariable("ivy.custom.test.dir", new File ("test/java/fr/jayasoft/ivy").toURL().toString()); 26 ivy.configure(ConfigureTest.class.getResource("ivyconf-custom-typedef.xml")); 27 28 DependencyResolver custom = ivy.getResolver("custom"); 29 assertNotNull(custom); 30 assertEquals("fr.jayasoft.ivy.resolver.CustomResolver", custom.getClass().getName()); 31 } 32 33 public void testTypedefWithCustomClasspathWithFile() throws Exception { 34 Ivy ivy = new Ivy(); 35 ivy.setVariable("ivy.custom.test.dir", new File ("test/java/fr/jayasoft/ivy").toString()); 36 ivy.configure(ConfigureTest.class.getResource("ivyconf-custom-typedef2.xml")); 37 38 DependencyResolver custom = ivy.getResolver("custom"); 39 assertNotNull(custom); 40 assertEquals("fr.jayasoft.ivy.resolver.CustomResolver", custom.getClass().getName()); 41 } 42 43 } 44 | Popular Tags |