1 16 17 package org.apache.axis2.deployment; 18 19 import org.apache.axis2.AbstractTestCase; 20 import org.apache.axis2.context.ConfigurationContextFactory; 21 import org.apache.axis2.description.Flow; 22 import org.apache.axis2.description.OperationDescription; 23 import org.apache.axis2.description.ServiceDescription; 24 import org.apache.axis2.engine.AxisConfiguration; 25 26 import javax.xml.namespace.QName ; 27 28 public class BuildERWithDeploymentTest extends AbstractTestCase { 29 32 public BuildERWithDeploymentTest(String testName) { 33 super(testName); 34 } 35 36 public void testDeployment() throws Exception { 37 String filename = "./target/test-resources/deployment"; 38 ConfigurationContextFactory builder = new ConfigurationContextFactory(); 39 AxisConfiguration er = builder.buildConfigurationContext(filename).getAxisConfiguration(); 40 41 assertNotNull(er); 42 ServiceDescription service = er.getService(new QName ("service2")); 43 assertNotNull(service); 44 48 ClassLoader cl = service.getClassLoader(); 49 assertNotNull(cl); 50 Class.forName("Echo2", true, cl); 51 assertNotNull(service.getName()); 52 55 Flow flow = service.getFaultInFlow(); 56 assertTrue(flow.getHandlerCount() > 0); 57 flow = service.getInFlow(); 58 assertTrue(flow.getHandlerCount() > 0); 59 flow = service.getOutFlow(); 60 assertTrue( flow.getHandlerCount() > 0); 61 assertNotNull(service.getParameter("para2")); 62 63 OperationDescription op = service.getOperation(new QName ("opname")); 64 assertNotNull(op); 65 66 } 67 } 68 | Popular Tags |