KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > fr > jayasoft > ivy > ConfigureTest


1 /*
2  * This file is subject to the licence found in LICENCE.TXT in the root directory of the project.
3  * Copyright Jayasoft 2005 - All rights reserved
4  *
5  * #SNAPSHOT#
6  */

7 package fr.jayasoft.ivy;
8
9 import java.io.File JavaDoc;
10 import java.io.IOException JavaDoc;
11 import java.text.ParseException JavaDoc;
12
13 import junit.framework.TestCase;
14
15 public class ConfigureTest extends TestCase {
16     public void testDefault() throws ParseException JavaDoc, IOException JavaDoc {
17         Ivy ivy = new Ivy();
18         ivy.configureDefault();
19         
20         assertNotNull(ivy.getDefaultResolver());
21     }
22     
23     public void testTypedefWithCustomClasspath() throws Exception JavaDoc {
24         Ivy ivy = new Ivy();
25         ivy.setVariable("ivy.custom.test.dir", new File JavaDoc("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 JavaDoc {
34         Ivy ivy = new Ivy();
35         ivy.setVariable("ivy.custom.test.dir", new File JavaDoc("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