You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by sa...@apache.org on 2005/12/11 11:25:13 UTC

svn commit: r355955 - in /webservices/axis2/trunk/java/modules: codegen/src/org/apache/axis2/wsdl/template/java/ integration/test/org/apache/axis2/integration/ integration/test/org/apache/axis2/mail/ integration/test/org/apache/axis2/processingModel/

Author: sanjiva
Date: Sun Dec 11 02:25:00 2005
New Revision: 355955

URL: http://svn.apache.org/viewcvs?rev=355955&view=rev
Log:
Removed ugly way of creating a new ServiceGroupContext and also did some
minor refactoring in the process. (2nd part of commit)

Modified:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilsJMSServer.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilsTCPServer.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailRequestResponseRawXMLTest.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/processingModel/SoapProcessingModelTest.java

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl?rev=355955&r1=355954&r2=355955&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl Sun Dec 11 02:25:00 2005
@@ -51,7 +51,7 @@
 		    //creating the configuration
            _configurationContext = new org.apache.axis2.context.ConfigurationContextFactory().buildClientConfigurationContext(axis2Home);
            _configurationContext.getAxisConfiguration().addService(_service);
-           _serviceContext =_service.getParent().getServiceGroupContext(_configurationContext).getServiceContext(_service.getName().getLocalPart());
+           _serviceContext =new org.apache.axis2.context.ServiceGroupContext(_configurationContext, _service.getParent()).getServiceContext(_service.getName().getLocalPart());
            _clientOptions.setTo(new org.apache.axis2.addressing.EndpointReference(targetEndpoint));
 
         <!--  Set the soap version depending on the binding. Default is 1.1 so don't set anything for that case-->

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java?rev=355955&r1=355954&r2=355955&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java Sun Dec 11 02:25:00 2005
@@ -21,6 +21,7 @@
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.ConfigurationContextFactory;
 import org.apache.axis2.context.ServiceContext;
+import org.apache.axis2.context.ServiceGroupContext;
 import org.apache.axis2.deployment.DeploymentEngine;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.ModuleDescription;
@@ -32,24 +33,31 @@
 
 public class UtilServer {
     private static int count = 0;
+
     private static SimpleHTTPServer receiver;
+
     public static final int TESTING_PORT = 5555;
+
     public static final String FAILURE_MESSAGE = "Intentional Failure";
-    
+
     private static ThreadPool tp = null;
-                                            
-    public static synchronized void deployService(AxisService service) throws AxisFault {
-        receiver.getConfigurationContext().getAxisConfiguration().addService(service);
+
+    public static synchronized void deployService(AxisService service)
+            throws AxisFault {
+        receiver.getConfigurationContext().getAxisConfiguration().addService(
+                service);
     }
 
-    public static synchronized void unDeployService(QName service) throws AxisFault {
-        receiver.getConfigurationContext().getAxisConfiguration().removeService(
-                service.getLocalPart());
+    public static synchronized void unDeployService(QName service)
+            throws AxisFault {
+        receiver.getConfigurationContext().getAxisConfiguration()
+                .removeService(service.getLocalPart());
     }
 
     public static synchronized void unDeployClientService() throws AxisFault {
-        if(receiver.getConfigurationContext().getAxisConfiguration() !=null){
-            receiver.getConfigurationContext().getAxisConfiguration().removeService("AnonymousService");
+        if (receiver.getConfigurationContext().getAxisConfiguration() != null) {
+            receiver.getConfigurationContext().getAxisConfiguration()
+                    .removeService("AnonymousService");
         }
     }
 
@@ -59,16 +67,15 @@
 
     public static synchronized void start(String repository) throws Exception {
         if (count == 0) {
-        	tp = new ThreadPool();
+            tp = new ThreadPool();
             ConfigurationContext er = getNewConfigurationContext(repository);
 
             receiver = new SimpleHTTPServer(er, Constants.TESTING_PORT);
 
             try {
                 receiver.start();
-                System.out.print(
-                        "Server started on port " + Constants.TESTING_PORT +
-                                ".....");
+                System.out.print("Server started on port "
+                        + Constants.TESTING_PORT + ".....");
             } finally {
 
             }
@@ -83,29 +90,28 @@
         count++;
     }
 
-    public static ConfigurationContext getNewConfigurationContext(String repository) throws Exception {
+    public static ConfigurationContext getNewConfigurationContext(
+            String repository) throws Exception {
         ConfigurationContextFactory erfac = new ConfigurationContextFactory();
         File file = new File(repository);
         if (!file.exists()) {
-            throw new Exception(
-                    "repository directory " + file.getAbsolutePath() +
-                            " does not exists");
+            throw new Exception("repository directory "
+                    + file.getAbsolutePath() + " does not exists");
         }
-        return erfac.buildConfigurationContext(
-                file.getAbsolutePath());
+        return erfac.buildConfigurationContext(file.getAbsolutePath());
     }
 
     public static synchronized void stop() {
         if (count == 1) {
             receiver.stop();
-            while(receiver.isRunning()){
+            while (receiver.isRunning()) {
                 try {
                     Thread.sleep(1000);
                 } catch (InterruptedException e1) {
                 }
             }
             count = 0;
-            //tp.doStop();
+            // tp.doStop();
             System.out.print("Server stopped .....");
         } else {
             count--;
@@ -117,48 +123,46 @@
     }
 
     public static ServiceContext createAdressedEnabledClientSide(
-            AxisService service)
-            throws AxisFault {
+            AxisService service) throws AxisFault {
         DeploymentEngine deploymentEngine = new DeploymentEngine();
-        File file = new File(
-                org.apache.axis2.Constants.TESTING_REPOSITORY +
-                        "/modules/addressing.mar");
+        File file = new File(org.apache.axis2.Constants.TESTING_REPOSITORY
+                + "/modules/addressing.mar");
         TestCase.assertTrue(file.exists());
 
         ConfigurationContextFactory efac = new ConfigurationContextFactory();
-        ConfigurationContext sysContext =
-                efac.buildClientConfigurationContext("target/test-resources/integrationRepo");
-         ModuleDescription moduleDesc = deploymentEngine.buildModule(file,sysContext.getAxisConfiguration());
-        sysContext.getAxisConfiguration().addModule(moduleDesc);
-        //sysContext.getAxisConfiguration().engageModule(moduleDesc.getName());
+        ConfigurationContext configContext = efac
+                .buildClientConfigurationContext("target/test-resources/integrationRepo");
+        ModuleDescription moduleDesc = deploymentEngine.buildModule(file,
+                configContext.getAxisConfiguration());
+        configContext.getAxisConfiguration().addModule(moduleDesc);
+        // sysContext.getAxisConfiguration().engageModule(moduleDesc.getName());
 
-        sysContext.getAxisConfiguration().addService(service);
+        configContext.getAxisConfiguration().addService(service);
 
-        return service.getParent().getServiceGroupContext(sysContext
-        ).getServiceContext(service.getName().getLocalPart());
+        return new ServiceGroupContext(configContext, service.getParent())
+                .getServiceContext(service.getName().getLocalPart());
     }
 
     public static ServiceContext createAdressedEnabledClientSide(
-            AxisService service, String clientHome)
-            throws AxisFault {
+            AxisService service, String clientHome) throws AxisFault {
         DeploymentEngine deploymentEngine = new DeploymentEngine();
-        File file = new File(
-                org.apache.axis2.Constants.TESTING_REPOSITORY +
-                        "/modules/addressing.mar");
+        File file = new File(org.apache.axis2.Constants.TESTING_REPOSITORY
+                + "/modules/addressing.mar");
         TestCase.assertTrue(file.exists());
 
         ConfigurationContextFactory efac = new ConfigurationContextFactory();
-        ConfigurationContext sysContext =
-                efac.buildClientConfigurationContext(clientHome);
-        ModuleDescription moduleDesc = deploymentEngine.buildModule(file,sysContext.getAxisConfiguration());
+        ConfigurationContext configContext = efac
+                .buildClientConfigurationContext(clientHome);
+        ModuleDescription moduleDesc = deploymentEngine.buildModule(file,
+                configContext.getAxisConfiguration());
 
-        sysContext.getAxisConfiguration().addModule(moduleDesc);
-        //sysContext.getAxisConfiguration().engageModule(moduleDesc.getName());
+        configContext.getAxisConfiguration().addModule(moduleDesc);
+        // sysContext.getAxisConfiguration().engageModule(moduleDesc.getName());
 
-        sysContext.getAxisConfiguration().addService(service);
+        configContext.getAxisConfiguration().addService(service);
 
-        return service.getParent().getServiceGroupContext(sysContext
-        ).getServiceContext(service.getName().getLocalPart());
+        return new ServiceGroupContext(configContext, service.getParent())
+                .getServiceContext(service.getName().getLocalPart());
     }
 
 }

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilsJMSServer.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilsJMSServer.java?rev=355955&r1=355954&r2=355955&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilsJMSServer.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilsJMSServer.java Sun Dec 11 02:25:00 2005
@@ -32,24 +32,28 @@
 
 public class UtilsJMSServer {
     private static int count = 0;
+
     private static SimpleJMSListener receiver;
 
     public static final int TESTING_PORT = 5555;
+
     public static final String FAILURE_MESSAGE = "Intentional Failure";
+
     private static Log log = LogFactory.getLog(UtilsJMSServer.class);
 
     public static synchronized void deployService(AxisService service)
             throws AxisFault {
 
-        receiver.getSystemContext().getAxisConfiguration().addService(service);
-
-        ServiceGroupContext serviceGroupContext = service.getParent().getServiceGroupContext(receiver.getSystemContext());
+        receiver.getConfigurationContext().getAxisConfiguration().addService(service);
 
+        ServiceGroupContext serviceGroupContext = new ServiceGroupContext(
+                receiver.getConfigurationContext(), service.getParent());
     }
 
     public static synchronized void unDeployService(QName service)
             throws AxisFault {
-        receiver.getSystemContext().getAxisConfiguration().removeService(service.getLocalPart());
+        receiver.getConfigurationContext().getAxisConfiguration().removeService(
+                service.getLocalPart());
     }
 
     public static synchronized void start() throws Exception {
@@ -61,30 +65,31 @@
             String username = null;
             String password = null;
             boolean doThreads = true;
-                
-            cfMap.put(JNDIVendorAdapter.CONTEXT_FACTORY, "org.activemq.jndi.ActiveMQInitialContextFactory");
+
+            cfMap.put(JNDIVendorAdapter.CONTEXT_FACTORY,
+                    "org.activemq.jndi.ActiveMQInitialContextFactory");
             cfMap.put(JNDIVendorAdapter.PROVIDER_URL, "tcp://localhost:61616");
 
-            //start JMS server
-            ConfigurationContextFactory erfac =
-                    new ConfigurationContextFactory();
+            // start JMS server
+            ConfigurationContextFactory erfac = new ConfigurationContextFactory();
             File file = new File(org.apache.axis2.Constants.TESTING_REPOSITORY);
             System.out.println(file.getAbsoluteFile());
             if (!file.exists()) {
                 throw new Exception("Repository directory does not exist");
             }
 
-             ConfigurationContext er  = erfac.buildConfigurationContext(
-                    file.getAbsolutePath());
+            ConfigurationContext er = erfac.buildConfigurationContext(file
+                    .getAbsolutePath());
             try {
                 Thread.sleep(2000);
             } catch (InterruptedException e1) {
                 throw new AxisFault("Thread interuptted", e1);
             }
-            er.getAxisConfiguration().engageModule(
-                    new QName("addressing"));
-            receiver =
-                    new SimpleJMSListener(org.apache.axis2.Constants.TESTING_REPOSITORY, connectorMap, cfMap, destination, username, password, doThreads);
+            er.getAxisConfiguration().engageModule(new QName("addressing"));
+            receiver = new SimpleJMSListener(
+                    org.apache.axis2.Constants.TESTING_REPOSITORY,
+                    connectorMap, cfMap, destination, username, password,
+                    doThreads);
             receiver.start();
 
         }
@@ -101,7 +106,7 @@
                 count--;
             }
         } catch (Exception e) {
-           log.error(e.getMessage(), e);
+            log.error(e.getMessage(), e);
         }
     }
 

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilsTCPServer.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilsTCPServer.java?rev=355955&r1=355954&r2=355955&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilsTCPServer.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilsTCPServer.java Sun Dec 11 02:25:00 2005
@@ -30,50 +30,50 @@
 
 public class UtilsTCPServer {
     private static int count = 0;
+
     private static TCPServer receiver;
 
     public static final int TESTING_PORT = 5555;
+
     public static final String FAILURE_MESSAGE = "Intentional Failure";
+
     private static Log log = LogFactory.getLog(UtilsTCPServer.class);
 
     public static synchronized void deployService(AxisService service)
             throws AxisFault {
 
-        receiver.getSystemContext().getAxisConfiguration().addService(service);
-        ServiceGroupContext serviceGroupContext = service.getParent().getServiceGroupContext(receiver.getSystemContext());
-
+        receiver.getConfigurationContext().getAxisConfiguration().addService(service);
+        ServiceGroupContext serviceGroupContext = new ServiceGroupContext(
+                receiver.getConfigurationContext(), service.getParent());
     }
 
     public static synchronized void unDeployService(QName service)
             throws AxisFault {
-        receiver.getSystemContext().getAxisConfiguration().removeService(service.getLocalPart());
+        receiver.getConfigurationContext().getAxisConfiguration().removeService(
+                service.getLocalPart());
     }
 
     public static synchronized void start() throws Exception {
         if (count == 0) {
 
-            //start tcp server
+            // start tcp server
 
-            ConfigurationContextFactory erfac =
-                    new ConfigurationContextFactory();
+            ConfigurationContextFactory erfac = new ConfigurationContextFactory();
             File file = new File(org.apache.axis2.Constants.TESTING_REPOSITORY);
             System.out.println(file.getAbsoluteFile());
             if (!file.exists()) {
                 throw new Exception("Repository directory does not exist");
             }
 
-             ConfigurationContext er  = erfac.buildConfigurationContext(
-                    file.getAbsolutePath());
+            ConfigurationContext er = erfac.buildConfigurationContext(file
+                    .getAbsolutePath());
             try {
                 Thread.sleep(2000);
             } catch (InterruptedException e1) {
                 throw new AxisFault("Thread interuptted", e1);
             }
-            er.getAxisConfiguration().engageModule(
-                    new QName("addressing"));
-            receiver =
-                    new TCPServer(UtilServer.TESTING_PORT,
-                            er);
+            er.getAxisConfiguration().engageModule(new QName("addressing"));
+            receiver = new TCPServer(UtilServer.TESTING_PORT, er);
             receiver.start();
 
         }
@@ -90,7 +90,7 @@
                 count--;
             }
         } catch (AxisFault e) {
-           log.error(e.getMessage(), e);
+            log.error(e.getMessage(), e);
         }
     }
 

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailRequestResponseRawXMLTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailRequestResponseRawXMLTest.java?rev=355955&r1=355954&r2=355955&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailRequestResponseRawXMLTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailRequestResponseRawXMLTest.java Sun Dec 11 02:25:00 2005
@@ -16,7 +16,7 @@
 
 package org.apache.axis2.mail;
 
-//todo
+// todo
 
 import junit.framework.TestCase;
 import org.apache.axis2.AxisFault;
@@ -28,12 +28,14 @@
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.context.ServiceContext;
+import org.apache.axis2.context.ServiceGroupContext;
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.OutInAxisOperation;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.engine.Echo;
 import org.apache.axis2.engine.MessageReceiver;
+import org.apache.axis2.engine.ServiceGroupContextTest;
 import org.apache.axis2.om.OMAbstractFactory;
 import org.apache.axis2.om.OMElement;
 import org.apache.axis2.om.OMFactory;
@@ -49,21 +51,26 @@
 import javax.xml.stream.XMLStreamException;
 
 public class MailRequestResponseRawXMLTest extends TestCase {
-    private EndpointReference targetEPR =
-            new EndpointReference("foo@127.0.0.1" +
-                    "/axis/services/EchoXMLService/echoOMElement");
+    private EndpointReference targetEPR = new EndpointReference("foo@127.0.0.1"
+            + "/axis/services/EchoXMLService/echoOMElement");
+
     private Log log = LogFactory.getLog(getClass());
+
     private QName serviceName = new QName("EchoXMLService");
+
     private QName operationName = new QName("echoOMElement");
+
     private QName transportName = new QName("http://localhost/my",
             "NullTransport");
 
     private AxisConfiguration engineRegistry;
+
     private MessageContext mc;
 
     private SOAPEnvelope envelope;
 
     private boolean finish = false;
+
     private ConfigurationContext config;
 
     public MailRequestResponseRawXMLTest() {
@@ -79,19 +86,16 @@
 
         SimpleMailListener ml = new SimpleMailListener();
 
-
-        ml.init(configContext,
-                configContext.getAxisConfiguration().getTransportIn(
-                        new QName(Constants.TRANSPORT_MAIL)));
+        ml.init(configContext, configContext.getAxisConfiguration()
+                .getTransportIn(new QName(Constants.TRANSPORT_MAIL)));
         ml.start();
-//        configContext.getAxisConfiguration().engageModule(
-//                new QName(Constants.MODULE_ADDRESSING));
-        AxisService service =
-                Utils.createSimpleService(serviceName,
-                        Echo.class.getName(),
-                        operationName);
+        // configContext.getAxisConfiguration().engageModule(
+        // new QName(Constants.MODULE_ADDRESSING));
+        AxisService service = Utils.createSimpleService(serviceName, Echo.class
+                .getName(), operationName);
         configContext.getAxisConfiguration().addService(service);
-        ServiceContext serviceContext = service.getParent().getServiceGroupContext(configContext).getServiceContext(service.getName().getLocalPart());
+        ServiceContext serviceContext = new ServiceGroupContext(configContext,
+                service.getParent()).getServiceContext(service.getName().getLocalPart());
     }
 
     protected void tearDown() throws Exception {
@@ -103,8 +107,8 @@
         OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
         OMElement method = fac.createOMElement("echoOMElement", omNs);
         OMElement value = fac.createOMElement("myValue", omNs);
-        value.addChild(
-                fac.createText(value, "Isaac Asimov, The Foundation Trilogy"));
+        value.addChild(fac.createText(value,
+                "Isaac Asimov, The Foundation Trilogy"));
         method.addChild(value);
 
         return method;
@@ -112,10 +116,10 @@
 
     public void testEchoXMLCompleteASync() throws Exception {
 
-        ConfigurationContext configContext = UtilsMailServer.createClientConfigurationContext();
+        ConfigurationContext configContext = UtilsMailServer
+                .createClientConfigurationContext();
         AxisService service = new AxisService(serviceName);
-        AxisOperation axisOperation = new OutInAxisOperation(
-                operationName);
+        AxisOperation axisOperation = new OutInAxisOperation(operationName);
         axisOperation.setMessageReceiver(new MessageReceiver() {
             public void receive(MessageContext messgeCtx) throws AxisFault {
                 envelope = messgeCtx.getEnvelope();
@@ -123,7 +127,9 @@
         });
         service.addOperation(axisOperation);
         configContext.getAxisConfiguration().addService(service);
-        ServiceContext serviceContext = service.getParent().getServiceGroupContext(configContext).getServiceContext(service.getName().getLocalPart());
+        ServiceContext serviceContext = new ServiceGroupContext(configContext,
+                service.getParent()).getServiceContext(service.getName()
+                .getLocalPart());
 
         org.apache.axis2.client.Call call = new org.apache.axis2.client.Call(
                 serviceContext);
@@ -137,8 +143,9 @@
         Callback callback = new Callback() {
             public void onComplete(AsyncResult result) {
                 try {
-                    result.getResponseEnvelope().serializeAndConsume(XMLOutputFactory.newInstance()
-                            .createXMLStreamWriter(System.out));
+                    result.getResponseEnvelope().serializeAndConsume(
+                            XMLOutputFactory.newInstance()
+                                    .createXMLStreamWriter(System.out));
                 } catch (XMLStreamException e) {
                     reportError(e);
                 } finally {
@@ -152,8 +159,7 @@
             }
         };
 
-        call.invokeNonBlocking(operationName.getLocalPart(),
-                createEnvelope(),
+        call.invokeNonBlocking(operationName.getLocalPart(), createEnvelope(),
                 callback);
         int index = 0;
         while (!finish) {
@@ -168,88 +174,90 @@
 
     }
 
-//    public ConfigurationContext createServerConfigurationContext() throws Exception {
-//        ConfigurationContextFactory builder = new ConfigurationContextFactory();
-//        ConfigurationContext configContext =
-//                builder.buildConfigurationContext(
-//                        org.apache.axis2.Constants.TESTING_REPOSITORY);
-//
-//        TransportInDescription transportIn =
-//                new TransportInDescription(new QName(Constants.TRANSPORT_MAIL));
-//        transportIn.addParameter(
-//                new ParameterImpl("transport.mail.pop3.host", "127.0.0.1"));
-//        transportIn.addParameter(
-//                new ParameterImpl("transport.mail.pop3.user", "foo@127.0.0.1"));
-//        transportIn.addParameter(
-//                new ParameterImpl("transport.mail.pop3.password", "axis2"));
-//        transportIn.addParameter(
-//                new ParameterImpl("transport.mail.pop3.port", "1134"));
-//        transportIn.addParameter(
-//                new ParameterImpl("transport.mail.replyToAddress",
-//                        "foo@127.0.0.1"));
-//        transportIn.setReceiver(new SimpleMailListener());
-//        transportIn.getReceiver().init(configContext, transportIn);
-//
-//        TransportOutDescription transportOut =
-//                new TransportOutDescription(
-//                        new QName(Constants.TRANSPORT_MAIL));
-//
-//        transportOut.addParameter(
-//                new ParameterImpl("transport.mail.smtp.host", "127.0.0.1"));
-//        transportOut.addParameter(
-//                new ParameterImpl("transport.mail.smtp.user", "foo"));
-//        transportOut.addParameter(
-//                new ParameterImpl("transport.mail.smtp.password", "axis2"));
-//        transportOut.addParameter(
-//                new ParameterImpl("transport.mail.smtp.port", "1049"));
-//        transportOut.setSender(new MailTransportSender());
-//        transportOut.getSender().init(configContext, transportOut);
-//
-//        configContext.getAxisConfiguration().addTransportIn(transportIn);
-//        configContext.getAxisConfiguration().addTransportOut(transportOut);
-//        return configContext;
-//    }
-//
-//    public ConfigurationContext createClientConfigurationContext() throws Exception {
-//        ConfigurationContextFactory builder = new ConfigurationContextFactory();
-//        ConfigurationContext configContext =
-//                builder.buildConfigurationContext(
-//                        org.apache.axis2.Constants.TESTING_REPOSITORY);
-//
-//        TransportInDescription transportIn =
-//                new TransportInDescription(new QName(Constants.TRANSPORT_MAIL));
-//        transportIn.addParameter(
-//                new ParameterImpl("transport.mail.pop3.host", "127.0.0.1"));
-//        transportIn.addParameter(
-//                new ParameterImpl("transport.mail.pop3.user", "bar@127.0.0.1"));
-//        transportIn.addParameter(
-//                new ParameterImpl("transport.mail.pop3.password", "axis2"));
-//        transportIn.addParameter(
-//                new ParameterImpl("transport.mail.pop3.port", "1134"));
-//        transportIn.addParameter(
-//                new ParameterImpl("transport.mail.replyToAddress",
-//                        "bar@127.0.0.1"));
-//        transportIn.setReceiver(new SimpleMailListener());
-//        transportIn.getReceiver().init(configContext, transportIn);
-//
-//        TransportOutDescription transportOut =
-//                new TransportOutDescription(
-//                        new QName(Constants.TRANSPORT_MAIL));
-//
-//        transportOut.addParameter(
-//                new ParameterImpl("transport.mail.smtp.host", "127.0.0.1"));
-//        transportOut.addParameter(
-//                new ParameterImpl("transport.mail.smtp.user", "bar"));
-//        transportOut.addParameter(
-//                new ParameterImpl("transport.mail.smtp.password", "axis2"));
-//        transportOut.addParameter(
-//                new ParameterImpl("transport.mail.smtp.port", "1049"));
-//        transportOut.setSender(new MailTransportSender());
-//        transportOut.getSender().init(configContext, transportOut);
-//
-//        configContext.getAxisConfiguration().addTransportIn(transportIn);
-//        configContext.getAxisConfiguration().addTransportOut(transportOut);
-//        return configContext;
-//    }
+    // public ConfigurationContext createServerConfigurationContext() throws
+    // Exception {
+    // ConfigurationContextFactory builder = new ConfigurationContextFactory();
+    // ConfigurationContext configContext =
+    // builder.buildConfigurationContext(
+    // org.apache.axis2.Constants.TESTING_REPOSITORY);
+    //
+    // TransportInDescription transportIn =
+    // new TransportInDescription(new QName(Constants.TRANSPORT_MAIL));
+    // transportIn.addParameter(
+    // new ParameterImpl("transport.mail.pop3.host", "127.0.0.1"));
+    // transportIn.addParameter(
+    // new ParameterImpl("transport.mail.pop3.user", "foo@127.0.0.1"));
+    // transportIn.addParameter(
+    // new ParameterImpl("transport.mail.pop3.password", "axis2"));
+    // transportIn.addParameter(
+    // new ParameterImpl("transport.mail.pop3.port", "1134"));
+    // transportIn.addParameter(
+    // new ParameterImpl("transport.mail.replyToAddress",
+    // "foo@127.0.0.1"));
+    // transportIn.setReceiver(new SimpleMailListener());
+    // transportIn.getReceiver().init(configContext, transportIn);
+    //
+    // TransportOutDescription transportOut =
+    // new TransportOutDescription(
+    // new QName(Constants.TRANSPORT_MAIL));
+    //
+    // transportOut.addParameter(
+    // new ParameterImpl("transport.mail.smtp.host", "127.0.0.1"));
+    // transportOut.addParameter(
+    // new ParameterImpl("transport.mail.smtp.user", "foo"));
+    // transportOut.addParameter(
+    // new ParameterImpl("transport.mail.smtp.password", "axis2"));
+    // transportOut.addParameter(
+    // new ParameterImpl("transport.mail.smtp.port", "1049"));
+    // transportOut.setSender(new MailTransportSender());
+    // transportOut.getSender().init(configContext, transportOut);
+    //
+    // configContext.getAxisConfiguration().addTransportIn(transportIn);
+    // configContext.getAxisConfiguration().addTransportOut(transportOut);
+    // return configContext;
+    // }
+    //
+    // public ConfigurationContext createClientConfigurationContext() throws
+    // Exception {
+    // ConfigurationContextFactory builder = new ConfigurationContextFactory();
+    // ConfigurationContext configContext =
+    // builder.buildConfigurationContext(
+    // org.apache.axis2.Constants.TESTING_REPOSITORY);
+    //
+    // TransportInDescription transportIn =
+    // new TransportInDescription(new QName(Constants.TRANSPORT_MAIL));
+    // transportIn.addParameter(
+    // new ParameterImpl("transport.mail.pop3.host", "127.0.0.1"));
+    // transportIn.addParameter(
+    // new ParameterImpl("transport.mail.pop3.user", "bar@127.0.0.1"));
+    // transportIn.addParameter(
+    // new ParameterImpl("transport.mail.pop3.password", "axis2"));
+    // transportIn.addParameter(
+    // new ParameterImpl("transport.mail.pop3.port", "1134"));
+    // transportIn.addParameter(
+    // new ParameterImpl("transport.mail.replyToAddress",
+    // "bar@127.0.0.1"));
+    // transportIn.setReceiver(new SimpleMailListener());
+    // transportIn.getReceiver().init(configContext, transportIn);
+    //
+    // TransportOutDescription transportOut =
+    // new TransportOutDescription(
+    // new QName(Constants.TRANSPORT_MAIL));
+    //
+    // transportOut.addParameter(
+    // new ParameterImpl("transport.mail.smtp.host", "127.0.0.1"));
+    // transportOut.addParameter(
+    // new ParameterImpl("transport.mail.smtp.user", "bar"));
+    // transportOut.addParameter(
+    // new ParameterImpl("transport.mail.smtp.password", "axis2"));
+    // transportOut.addParameter(
+    // new ParameterImpl("transport.mail.smtp.port", "1049"));
+    // transportOut.setSender(new MailTransportSender());
+    // transportOut.getSender().init(configContext, transportOut);
+    //
+    // configContext.getAxisConfiguration().addTransportIn(transportIn);
+    // configContext.getAxisConfiguration().addTransportOut(transportOut);
+    // return configContext;
+    // }
 
 }

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/processingModel/SoapProcessingModelTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/processingModel/SoapProcessingModelTest.java?rev=355955&r1=355954&r2=355955&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/processingModel/SoapProcessingModelTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/processingModel/SoapProcessingModelTest.java Sun Dec 11 02:25:00 2005
@@ -16,9 +16,10 @@
 
 package org.apache.axis2.processingModel;
 
-//todo
+// todo
 
 import junit.framework.TestCase;
+
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
 import org.apache.axis2.client.InOutMEPClient;
@@ -26,6 +27,7 @@
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.context.ServiceContext;
+import org.apache.axis2.context.ServiceGroupContext;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.engine.Echo;
 import org.apache.axis2.engine.util.TestConstants;
@@ -45,8 +47,8 @@
 public class SoapProcessingModelTest extends TestCase implements TestConstants {
 
     private Log log = LogFactory.getLog(getClass());
-    private AxisService service;
 
+    private AxisService service;
 
     private boolean finish = false;
 
@@ -60,7 +62,8 @@
 
     protected void setUp() throws Exception {
         UtilServer.start();
-        service = Utils.createSimpleService(serviceName, Echo.class.getName(), operationName);
+        service = Utils.createSimpleService(serviceName, Echo.class.getName(),
+                operationName);
         UtilServer.deployService(service);
 
     }
@@ -70,18 +73,20 @@
         UtilServer.stop();
     }
 
-
     public void sendMessageWithHeader(SOAPEnvelope envelope) throws AxisFault {
         InOutMEPClient inOutMC = null;
 
         try {
-            ConfigurationContext configContext = Utils.getNewConfigurationContext(org.apache.axis2.Constants.TESTING_REPOSITORY);
+            ConfigurationContext configContext = Utils
+                    .getNewConfigurationContext(org.apache.axis2.Constants.TESTING_REPOSITORY);
 
-            ServiceContext serviceContext =
-                    service.getParent().getServiceGroupContext(configContext).getServiceContext(service.getName().getLocalPart());
+            ServiceContext serviceContext = new ServiceGroupContext(
+                    configContext, service.getParent())
+                    .getServiceContext(service.getName().getLocalPart());
             inOutMC = new InOutMEPClient(serviceContext);
 
-            MessageContext msgctx = new MessageContext(serviceContext.getConfigurationContext());
+            MessageContext msgctx = new MessageContext(serviceContext
+                    .getConfigurationContext());
 
             msgctx.setEnvelope(envelope);
 
@@ -90,10 +95,8 @@
             options.setTo(targetEPR);
             options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
 
-            MessageContext result =
-                    inOutMC.invokeBlocking(
-                            serviceContext.getAxisService().getOperation(operationName),
-                            msgctx);
+            MessageContext result = inOutMC.invokeBlocking(serviceContext
+                    .getAxisService().getOperation(operationName), msgctx);
         } catch (Exception e) {
             e.printStackTrace();
             fail("Exception Occurred !! ." + e.getMessage());
@@ -101,15 +104,16 @@
         } finally {
             inOutMC.close();
         }
-//        fail("Fix Me Deepal");
+        // fail("Fix Me Deepal");
     }
 
     public void testSendingMustUnderstandWithNextRole() throws Exception {
         SOAPFactory fac = OMAbstractFactory.getSOAP12Factory();
         SOAPEnvelope envelope = fac.getDefaultEnvelope();
-        OMNamespace headerNs = fac.createOMNamespace("http://dummyHeader", "dh");
-        SOAPHeaderBlock h1 =
-                fac.createSOAPHeaderBlock("DummyHeader", headerNs, envelope.getHeader());
+        OMNamespace headerNs = fac
+                .createOMNamespace("http://dummyHeader", "dh");
+        SOAPHeaderBlock h1 = fac.createSOAPHeaderBlock("DummyHeader", headerNs,
+                envelope.getHeader());
         h1.setMustUnderstand(true);
         h1.addChild(fac.createText("Dummy String"));
         h1.setRole(SOAP12Constants.SOAP_ROLE_NEXT);
@@ -119,23 +123,24 @@
 
     }
 
-//    public void testSendingMustUnderstandWithArbitaryRole() throws Exception {
-//        try {
-//            SOAPFactory fac = OMAbstractFactory.getSOAP12Factory();
-//            SOAPEnvelope envelope = fac.getDefaultEnvelope();
-//            OMNamespace headerNs = fac.createOMNamespace("http://dummyHeader", "dh");
-//            SOAPHeaderBlock h1 =
-//                    fac.createSOAPHeaderBlock("DummyHeader", headerNs, envelope.getHeader());
-//            h1.setMustUnderstand(true);
-//            h1.addChild(fac.createText("Dummy String"));
-//            h1.setRole("http://myOwnRole");
-//            OMElement payload = TestingUtils.createDummyOMElement();
-//            envelope.getBody().addChild(payload);
-//            sendMessageWithHeader(envelope);
-//
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//            assertTrue(e.getMessage().indexOf("Must Understand check failed") > -1);
-//        }
-//    }
+    // public void testSendingMustUnderstandWithArbitaryRole() throws Exception
+    // {
+    // try {
+    // SOAPFactory fac = OMAbstractFactory.getSOAP12Factory();
+    // SOAPEnvelope envelope = fac.getDefaultEnvelope();
+    // OMNamespace headerNs = fac.createOMNamespace("http://dummyHeader", "dh");
+    // SOAPHeaderBlock h1 =
+    // fac.createSOAPHeaderBlock("DummyHeader", headerNs, envelope.getHeader());
+    // h1.setMustUnderstand(true);
+    // h1.addChild(fac.createText("Dummy String"));
+    // h1.setRole("http://myOwnRole");
+    // OMElement payload = TestingUtils.createDummyOMElement();
+    // envelope.getBody().addChild(payload);
+    // sendMessageWithHeader(envelope);
+    //
+    // } catch (Exception e) {
+    // e.printStackTrace();
+    // assertTrue(e.getMessage().indexOf("Must Understand check failed") > -1);
+    // }
+    // }
 }