KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jfox > ioc > xml > ComponentBundleTest


1 /* JFox, the OpenSource J2EE Application Server
2  *
3  * Distributable under GNU LGPL license by gun.org
4  * more details please visit http://www.huihoo.org/jfox
5  */

6
7 package org.jfox.ioc.xml;
8
9 import java.io.File JavaDoc;
10
11 import junit.framework.TestCase;
12 import org.jfox.ioc.deploy.ComponentDescriptor;
13 import org.jfox.ioc.deploy.ComponentModuleDescriptor;
14 import org.jfox.ioc.util.XMLUtils;
15
16 /**
17  * @author <a HREF="mailto:young_yy@hotmail.com">Young Yang</a>
18  */

19
20 public class ComponentBundleTest extends TestCase {
21     ComponentModuleDescriptor componentModuleDescriptor;
22
23     public void setUp() throws Exception JavaDoc {
24         super.setUp();
25         componentModuleDescriptor = new ComponentModuleDescriptor(XMLUtils.getDocument(new File JavaDoc("modules/SampleA/META-INF/module.xml").toURL()));
26     }
27
28     public void tearDown() throws Exception JavaDoc {
29         super.setUp();
30     }
31
32     public void testCount() {
33         ComponentDescriptor[] cds = componentModuleDescriptor.getComponentDescriptors();
34         assertEquals(1, cds.length);
35     }
36
37     public void testComponentDescriptor() {
38         ComponentDescriptor cd = componentModuleDescriptor.getComponentDescriptors()[0];
39         assertEquals(cd.getImplementation(), "org.jfox.ioc.TestComponentA");
40     }
41
42 }
Popular Tags