1 17 package org.apache.servicemix.eip; 18 19 import java.io.File ; 20 import java.net.URI ; 21 import java.net.URL ; 22 23 import org.apache.servicemix.jbi.container.JBIContainer; 24 25 import junit.framework.TestCase; 26 27 public class DeploymentTest extends TestCase { 28 29 protected JBIContainer container; 30 31 protected void setUp() throws Exception { 32 container = new JBIContainer(); 33 container.setUseMBeanServer(false); 34 container.setCreateMBeanServer(false); 35 container.setEmbedded(true); 36 container.init(); 37 } 38 39 protected void tearDown() throws Exception { 40 if (container != null) { 41 container.shutDown(); 42 } 43 } 44 45 public void testDeployer() throws Exception { 46 EIPComponent component = new EIPComponent(); 47 container.activateComponent(component, "EIPComponent"); 48 49 container.start(); 51 52 URL url = getClass().getClassLoader().getResource("su/xbean.xml"); 54 File path = new File (new URI (url.toString())); 55 path = path.getParentFile(); 56 component.getServiceUnitManager().deploy("su", path.getAbsolutePath()); 57 component.getServiceUnitManager().start("su"); 58 59 component.getServiceUnitManager().stop("su"); 60 component.getServiceUnitManager().shutDown("su"); 61 component.getServiceUnitManager().undeploy("su", path.getAbsolutePath()); 62 } 63 64 } 65 | Popular Tags |