1 6 7 package org.jfox.ioc.xml; 8 9 import java.io.File ; 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 19 20 public class ComponentBundleTest extends TestCase { 21 ComponentModuleDescriptor componentModuleDescriptor; 22 23 public void setUp() throws Exception { 24 super.setUp(); 25 componentModuleDescriptor = new ComponentModuleDescriptor(XMLUtils.getDocument(new File ("modules/SampleA/META-INF/module.xml").toURL())); 26 } 27 28 public void tearDown() throws Exception { 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 |