1 16 17 package org.apache.axis2.engine; 18 19 21 import junit.framework.TestCase; 22 import org.apache.axis2.Constants; 23 import org.apache.axis2.addressing.AddressingConstants; 24 import org.apache.axis2.addressing.EndpointReference; 25 import org.apache.axis2.context.MessageContext; 26 import org.apache.axis2.context.ServiceContext; 27 import org.apache.axis2.description.ServiceDescription; 28 import org.apache.axis2.integration.TestingUtils; 29 import org.apache.axis2.integration.UtilServer; 30 import org.apache.axis2.om.OMAbstractFactory; 31 import org.apache.axis2.om.OMElement; 32 import org.apache.axis2.soap.SOAPFactory; 33 import org.apache.axis2.util.Utils; 34 import org.apache.commons.logging.Log; 35 import org.apache.commons.logging.LogFactory; 36 37 import javax.xml.namespace.QName ; 38 39 public class EchoRawXMLChunckedTest extends TestCase { 40 private EndpointReference targetEPR = 41 new EndpointReference(AddressingConstants.WSA_TO, 42 "http://127.0.0.1:" 43 + (UtilServer.TESTING_PORT) 44 + "/axis/services/EchoXMLService/echoOMElement"); 45 private Log log = LogFactory.getLog(getClass()); 46 private QName serviceName = new QName ("EchoXMLService"); 47 private QName operationName = new QName ("echoOMElement"); 48 private QName transportName = new QName ("http://localhost/my", "NullTransport"); 49 50 private AxisConfiguration engineRegistry; 51 private MessageContext mc; 52 private ServiceContext serviceContext; 55 private ServiceDescription service; 56 57 private boolean finish = false; 58 59 public EchoRawXMLChunckedTest() { 60 super(EchoRawXMLChunckedTest.class.getName()); 61 } 62 63 public EchoRawXMLChunckedTest(String testName) { 64 super(testName); 65 } 66 67 protected void setUp() throws Exception { 68 UtilServer.start(Constants.TESTING_PATH + "chuncked-enabledRepository"); 69 service = 70 Utils.createSimpleService(serviceName, 71 Echo.class.getName(), 72 operationName); 73 UtilServer.deployService(service); 74 serviceContext = 75 UtilServer.getConfigurationContext().createServiceContext(service.getName()); 76 77 78 } 79 80 protected void tearDown() throws Exception { 81 UtilServer.unDeployService(serviceName); 82 UtilServer.stop(); 83 } 84 85 86 126 public void testEchoXMLSync() throws Exception { 127 SOAPFactory fac = OMAbstractFactory.getSOAP11Factory(); 128 129 OMElement payload = TestingUtils.createDummyOMElement(); 130 131 org.apache.axis2.clientapi.Call call = new org.apache.axis2.clientapi.Call(Constants.TESTING_PATH + "chuncked-enabledRepository"); 132 133 call.setTo(targetEPR); 134 call.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, false); 135 136 OMElement result = 137 (OMElement) call.invokeBlocking(operationName.getLocalPart(), payload); 138 TestingUtils.campareWithCreatedOMElement(result); 139 call.close(); 140 } 141 } 142 | Popular Tags |