1 16 17 package org.apache.axis2.description; 18 19 import org.apache.axis2.AbstractTestCase; 20 import org.apache.axis2.context.MessageContext; 21 import org.apache.axis2.engine.AxisConfiguration; 22 import org.apache.axis2.engine.AxisFault; 23 import org.apache.axis2.engine.Handler; 24 import org.apache.axis2.handlers.AbstractHandler; 25 26 import javax.xml.namespace.QName ; 27 28 public class RegistryTest extends AbstractTestCase { 29 private AxisConfiguration reg; 30 31 public RegistryTest(String testName) { 32 super(testName); 33 } 34 35 36 public void testRegistry() throws Exception { 37 55 56 } 57 58 public void testHandlerMedatata() { 59 HandlerDescription hmd = new HandlerDescription(); 60 testParameteInClude(hmd); 61 } 62 63 public void testService() { 64 ServiceDescription service = new ServiceDescription(new QName ("Service1")); 65 testParameteInClude(service); 66 testFlowIncludeTest(service); 67 68 69 } 70 71 public void testModule() { 72 ModuleDescription module = new ModuleDescription(new QName ("module1")); 73 testParameteInClude(module); 74 testFlowIncludeTest(module); 75 } 76 77 public void testOpeartion() { 78 OperationDescription op = new OperationDescription(new QName ("op")); 79 testParameteInClude(op); 80 } 81 82 83 public void testParameteInClude(ParameterInclude parmInclude) { 84 String key = "value1"; 85 Parameter p = new ParameterImpl(key, "value2"); 86 parmInclude.addParameter(p); 87 assertEquals(p, parmInclude.getParameter(key)); 88 } 89 90 public void testFlowIncludeTest(FlowInclude flowInclude) { 91 Flow flow1 = new FlowImpl(); 92 Flow flow2 = new FlowImpl(); 93 Flow flow3 = new FlowImpl(); 94 95 flowInclude.setInFlow(flow1); 96 flowInclude.setFaultInFlow(flow2); 97 flowInclude.setOutFlow(flow3); 98 assertSame(flow1, flowInclude.getInFlow()); 99 assertSame(flow2, flowInclude.getFaultInFlow()); 100 assertSame(flow3, flowInclude.getOutFlow()); 101 } 102 103 104 105 public void testHandlers() throws AxisFault { 106 Handler handler = new AbstractHandler() { 107 public void invoke(MessageContext msgContext) throws AxisFault { 108 } 109 }; 110 handler.init(new HandlerDescription()); 111 assertNull(handler.getName()); 112 assertNull(handler.getParameter("hello")); 113 handler.cleanup(); 114 } 115 116 117 } 118 | Popular Tags |