KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > rift > coad > lib > deployment > DeploymentLoaderTest


1 /*
2  * CoadunationLib: The coaduntion implementation library.
3  * Copyright (C) 2006 Rift IT Contracting
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  *
19  * DeploymentLoaderTest.java
20  *
21  * JUnit based test
22  */

23
24 package com.rift.coad.lib.deployment;
25
26 import junit.framework.*;
27 import java.io.*;
28 import java.io.BufferedReader JavaDoc;
29 import java.io.InputStreamReader JavaDoc;
30 import java.io.InputStream JavaDoc;
31 import java.net.URL JavaDoc;
32 import java.net.URLClassLoader JavaDoc;
33 import com.rift.coad.lib.common.ResourceReader;
34
35
36
37 /**
38  *
39  * @author mincemeat
40  */

41 public class DeploymentLoaderTest extends TestCase {
42     
43     public DeploymentLoaderTest(String JavaDoc testName) {
44         super(testName);
45     }
46
47     protected void setUp() throws Exception JavaDoc {
48     }
49
50     protected void tearDown() throws Exception JavaDoc {
51     }
52
53     public static Test suite() {
54         TestSuite suite = new TestSuite(DeploymentLoaderTest.class);
55         
56         return suite;
57     }
58
59     /**
60      * Test of class com.rift.coad.lib.deployment.DeploymentLoader.
61      */

62     public void testInitLoader() throws Exception JavaDoc {
63         System.out.println("testClassLoader");
64         
65         // instanciate the deployment loader
66
DeploymentLoader instance = new DeploymentLoader(
67                 new java.io.File JavaDoc(System.getProperty("test.jar")));
68         
69         // load load in
70
com.rift.coad.lib.deployment.DeploymentInfo info =
71                 instance.getDeploymentInfo();
72         if (!info.getName().equals("CoadunationTest")) {
73             fail("The name of the coadunation entry is invalid");
74         }
75     }
76
77 }
78
Popular Tags