1 16 17 package org.apache.axis2.engine; 18 19 import org.apache.axis2.AbstractTestCase; 20 import org.apache.axis2.context.ConfigurationContext; 21 import org.apache.axis2.context.MessageContext; 22 import org.apache.axis2.description.ServiceDescription; 23 import org.apache.axis2.om.OMAbstractFactory; 24 import org.apache.axis2.soap.SOAPFactory; 25 import org.apache.axis2.soap.impl.llom.SOAPProcessingException; 26 27 public class MessageContextTest extends AbstractTestCase { 28 public MessageContextTest(String testName) { 29 super(testName); 30 } 31 32 public void testMesssageContext() throws AxisFault, SOAPProcessingException { 33 AxisConfiguration er = new AxisConfigurationImpl(); 34 ServiceDescription servicesDesc = new ServiceDescription(); 35 er.addService(servicesDesc); 36 37 ConfigurationContext engineContext = new ConfigurationContext(er); 38 39 MessageContext msgctx = new MessageContext(engineContext); 40 41 SOAPFactory omFac = OMAbstractFactory.getSOAP11Factory(); 42 43 msgctx.setEnvelope(omFac.getDefaultEnvelope()); 44 assertNotNull(msgctx.getEnvelope()); 45 46 msgctx.setFaultTo(null); 47 assertNull(msgctx.getFaultTo()); 48 49 msgctx.setFrom(null); 50 assertNull(msgctx.getFrom()); 51 52 msgctx.setRelatesTo(null); 53 assertNull(msgctx.getRelatesTo()); 54 55 msgctx.setReplyTo(null); 56 assertNull(msgctx.getReplyTo()); 57 58 msgctx.setMessageID(null); 59 assertNull(msgctx.getMessageID()); 60 } 61 } 62 | Popular Tags |