Author: deepal
Date: Tue Aug 23 07:14:54 2005
New Revision: 239411

URL: http://svn.apache.org/viewcvs?rev=239411&view=rev
Log:
Fixing Axis2 149,

since addressing is default none of test case can not use default constructor 
of Call. I mean  Call call = new Call(),
allways we have to use new Call(repository);

Added:
    
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/MessageContextEnabledEcho.java
    
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/MessageContextInjectionTest.java
Removed:
    
webservices/axis/trunk/java/modules/core/test/org/apache/axis2/engine/MessageContextEnabledEcho.java
    
webservices/axis/trunk/java/modules/core/test/org/apache/axis2/engine/MessageContextInjectionTest.java
Modified:
    
webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/MessageSender.java
    
webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentClassLoader.java
    
webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
    webservices/axis/trunk/java/modules/integration/maven.xml
    
webservices/axis/trunk/java/modules/integration/src/org/apache/axis2/interopt/whitemesa/round1/Round1Client.java
    
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/CallUnregisteredServiceTest.java
    
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLLoadTest.java
    
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLOnTwoChannelsTest.java
    
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLTest.java
    
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/FaultHandlingTest.java
    
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/HandlerFailureTest.java
    
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/OneWayRawXMLTest.java
    
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/SOAPversionTest.java
    
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/ServiceDispatchingTest.java
    
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/util/MyInOutMEPClient.java
    
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/groovy/GroovyServiceTest.java
    
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java
    
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMLoadTest.java
    
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMTest.java
    
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMToBase64Test.java
    
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/rest/RESTBasedEchoRawXMLTest.java

Modified: 
webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/MessageSender.java
URL: 
http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/MessageSender.java?rev=239411&r1=239410&r2=239411&view=diff
==============================================================================
--- 
webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/MessageSender.java
 (original)
+++ 
webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/MessageSender.java
 Tue Aug 23 07:14:54 2005
@@ -42,7 +42,17 @@
     }
 
     public MessageSender() throws AxisFault {
-        super(assumeServiceContext());
+        super(assumeServiceContext(null));
+    }
+
+    /**
+     * This constrctor is to take repository as aragumnet and build the 
Configurationcontext using that
+     * @param repo repository location
+     * @throws AxisFault
+     */
+
+    public MessageSender(String repo) throws AxisFault {
+        super(assumeServiceContext(repo));
     }
     /**
      * Send the SOAP Message, the actual worker
@@ -65,11 +75,11 @@
      * @return
      * @throws AxisFault
      */
-    private static ServiceContext assumeServiceContext() throws AxisFault {
+    private static ServiceContext assumeServiceContext(String repo) throws 
AxisFault {
         ConfigurationContext sysContext = null;
         if (ListenerManager.configurationContext == null) {
             ConfigurationContextFactory efac = new 
ConfigurationContextFactory();
-            sysContext = efac.buildClientConfigurationContext(null);
+            sysContext = efac.buildClientConfigurationContext(repo);
         } else {
             sysContext = ListenerManager.configurationContext;
         }

Modified: 
webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentClassLoader.java
URL: 
http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentClassLoader.java?rev=239411&r1=239410&r2=239411&view=diff
==============================================================================
--- 
webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentClassLoader.java
 (original)
+++ 
webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentClassLoader.java
 Tue Aug 23 07:14:54 2005
@@ -6,26 +6,27 @@
 import java.net.URL;

 import java.net.URLClassLoader;

 import java.util.ArrayList;

+import java.util.HashMap;

 import java.util.zip.ZipEntry;

 import java.util.zip.ZipInputStream;

 

 /*

- * Copyright 2004,2005 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- *

- * 

- */

+* Copyright 2004,2005 The Apache Software Foundation.

+*

+* Licensed under the Apache License, Version 2.0 (the "License");

+* you may not use this file except in compliance with the License.

+* You may obtain a copy of the License at

+*

+*      http://www.apache.org/licenses/LICENSE-2.0

+*

+* Unless required by applicable law or agreed to in writing, software

+* distributed under the License is distributed on an "AS IS" BASIS,

+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+* See the License for the specific language governing permissions and

+* limitations under the License.

+*

+*

+*/

 

 /**

  * Author : Deepal Jayasinghe

@@ -40,6 +41,8 @@
     //To keep jar files inside /lib directory in the main jar

     private ArrayList lib_jars_list;

 

+    private HashMap loadedclass;

+

 

     /**

      * DeploymentClassLoader is exetend form URLClassLoader , and the 
constructor

@@ -53,6 +56,7 @@
         super(urls, parent);

         this.urls = urls;

         lib_jars_list = new ArrayList();

+        loadedclass = new HashMap();

         findLibJars();

     }

 

@@ -109,10 +113,15 @@
             throws ClassNotFoundException {

         Class cla = null;

         try {

+            cla = (Class)loadedclass.get(name);

+            if(cla != null){

+                return cla;

+            }

             boolean foundClass = false;

             try {

                 cla = super.findClass(name);

                 foundClass = true;

+                loadedclass.put(name, cla);

                 return cla;

             } catch (ClassNotFoundException e) {

                 foundClass = false;

@@ -120,12 +129,14 @@
             if (!foundClass) {

                 byte raw[] = getBytes(name);

                 cla = defineClass(name, raw, 0, raw.length);

+                loadedclass.put(name, cla);

                 foundClass = true;

                 return cla;

             }

             if (!foundClass) {

 //                throw new ClassNotFoundException("Class Not found : " + 
name);

-                throw new 
ClassNotFoundException(Messages.getMessage(DeploymentErrorMsgs.CLASS_NOT_FOUND, 
name));

+                throw new ClassNotFoundException(Messages.getMessage(

+                        DeploymentErrorMsgs.CLASS_NOT_FOUND, name));

             }

 

         } catch (Exception e) {


Modified: 
webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
URL: 
http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java?rev=239411&r1=239410&r2=239411&view=diff
==============================================================================
--- 
webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
 (original)
+++ 
webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
 Tue Aug 23 07:14:54 2005
@@ -257,14 +257,14 @@
             hotDeployment = false;

             hotUpdate = false;

             new RepositoryListenerImpl(folderName, this);

-            try {

-                ((AxisConfigurationImpl) 
axisConfig).setRepository(axis2repository);

-                engagdeModules();

-                ((AxisConfigurationImpl) axisConfig).setPhasesinfo(phasesinfo);

-            } catch (AxisFault axisFault) {

-                
log.info(Messages.getMessage(DeploymentErrorMsgs.MODULE_VAL_FAILED, 
axisFault.getMessage()));

-                throw new DeploymentException(axisFault);

-            }

+        }

+        try {

+            ((AxisConfigurationImpl) 
axisConfig).setRepository(axis2repository);

+            engagdeModules();

+            ((AxisConfigurationImpl) axisConfig).setPhasesinfo(phasesinfo);

+        } catch (AxisFault axisFault) {

+            
log.info(Messages.getMessage(DeploymentErrorMsgs.MODULE_VAL_FAILED, 
axisFault.getMessage()));

+            throw new DeploymentException(axisFault);

         }

         return axisConfig;

     }

@@ -476,7 +476,6 @@
 

     public Class getHandlerClass(String className, ClassLoader loader1) throws 
AxisFault {

         Class handlerClass = null;

-

         try {

             handlerClass = Class.forName(className, true, loader1);

         } catch (ClassNotFoundException e) {


Modified: webservices/axis/trunk/java/modules/integration/maven.xml
URL: 
http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/integration/maven.xml?rev=239411&r1=239410&r2=239411&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/integration/maven.xml (original)
+++ webservices/axis/trunk/java/modules/integration/maven.xml Tue Aug 23 
07:14:54 2005
@@ -38,6 +38,11 @@
         <copy file="../addressing/target/addressing.mar"

             
tofile="target/test-resources/mail-transport-server-enabledRepository/modules/addressing.mar"/>

 

+        <mkdir dir="target/test-resources/MessageContextInjectionRepo"/>

+        <mkdir dir="target/test-resources/intregrationRepo/modules"/>

+        <copy file="../addressing/target/addressing.mar"

+              
tofile="target/test-resources/intregrationRepo/modules/addressing.mar"/>

+

 

         <!-- Commons transport enabled enabled Repository -->

         <mkdir dir="target/test-resources/commons-http-enabledRepository"/>


Modified: 
webservices/axis/trunk/java/modules/integration/src/org/apache/axis2/interopt/whitemesa/round1/Round1Client.java
URL: 
http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/integration/src/org/apache/axis2/interopt/whitemesa/round1/Round1Client.java?rev=239411&r1=239410&r2=239411&view=diff
==============================================================================
--- 
webservices/axis/trunk/java/modules/integration/src/org/apache/axis2/interopt/whitemesa/round1/Round1Client.java
 (original)
+++ 
webservices/axis/trunk/java/modules/integration/src/org/apache/axis2/interopt/whitemesa/round1/Round1Client.java
 Tue Aug 23 07:14:54 2005
@@ -29,7 +29,7 @@
             throw new AxisFault(e);

         }

 

-        Call call = new Call();

+        Call call = new Call("target/test-resources/intregrationRepo");

         call.setTo(new EndpointReference(url.toString()));

         call.setSoapAction(soapAction);

         call.setTransportInfo(Constants.TRANSPORT_HTTP, 
Constants.TRANSPORT_HTTP, false);


Modified: 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/CallUnregisteredServiceTest.java
URL: 
http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/CallUnregisteredServiceTest.java?rev=239411&r1=239410&r2=239411&view=diff
==============================================================================
--- 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/CallUnregisteredServiceTest.java
 (original)
+++ 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/CallUnregisteredServiceTest.java
 Tue Aug 23 07:14:54 2005
@@ -79,7 +79,7 @@
             method.addChild(value);
 //            reqEnv.getBody().addChild(method);
 
-            Call call = new Call();
+            Call call = new Call("target/test-resources/intregrationRepo");
             EndpointReference targetEPR =
                     new EndpointReference("http://127.0.0.1:";
                     + (UtilServer.TESTING_PORT)

Modified: 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLLoadTest.java
URL: 
http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLLoadTest.java?rev=239411&r1=239410&r2=239411&view=diff
==============================================================================
--- 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLLoadTest.java
 (original)
+++ 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLLoadTest.java
 Tue Aug 23 07:14:54 2005
@@ -127,7 +127,8 @@
 
         OMElement payload = TestingUtils.createDummyOMElement();
 
-        org.apache.axis2.clientapi.Call call = new 
org.apache.axis2.clientapi.Call();
+        org.apache.axis2.clientapi.Call call =
+                new 
org.apache.axis2.clientapi.Call("target/test-resources/intregrationRepo");
 
         call.setTo(targetEPR);
         call.setTransportInfo(Constants.TRANSPORT_HTTP,

Modified: 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLOnTwoChannelsTest.java
URL: 
http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLOnTwoChannelsTest.java?rev=239411&r1=239410&r2=239411&view=diff
==============================================================================
--- 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLOnTwoChannelsTest.java
 (original)
+++ 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLOnTwoChannelsTest.java
 Tue Aug 23 07:14:54 2005
@@ -104,7 +104,8 @@
         value.setText("Isaac Assimov, the foundation Sega");
         method.addChild(value);
 
-        org.apache.axis2.clientapi.Call call = new 
org.apache.axis2.clientapi.Call(
+        org.apache.axis2.clientapi.Call call =
+                new org.apache.axis2.clientapi.Call(
                 serviceContext);
         call.engageModule(new QName(Constants.MODULE_ADDRESSING));
 

Modified: 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLTest.java
URL: 
http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLTest.java?rev=239411&r1=239410&r2=239411&view=diff
==============================================================================
--- 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLTest.java
 (original)
+++ 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLTest.java
 Tue Aug 23 07:14:54 2005
@@ -88,7 +88,8 @@
     public void testEchoXMLASync() throws Exception {
         OMElement payload = TestingUtils.createDummyOMElement();
 
-        org.apache.axis2.clientapi.Call call = new 
org.apache.axis2.clientapi.Call();
+        org.apache.axis2.clientapi.Call call =
+                new 
org.apache.axis2.clientapi.Call("target/test-resources/intregrationRepo");
 
         call.setTo(targetEPR);
         call.setTransportInfo(Constants.TRANSPORT_HTTP,
@@ -131,7 +132,8 @@
 
         OMElement payload = TestingUtils.createDummyOMElement();
 
-        org.apache.axis2.clientapi.Call call = new 
org.apache.axis2.clientapi.Call();
+        org.apache.axis2.clientapi.Call call =
+                new 
org.apache.axis2.clientapi.Call("target/test-resources/intregrationRepo");
 
         call.setTo(targetEPR);
         call.setTransportInfo(Constants.TRANSPORT_HTTP,
@@ -149,7 +151,8 @@
 
         OMElement payload = TestingUtils.createDummyOMElement();
 
-        org.apache.axis2.clientapi.Call call = new 
org.apache.axis2.clientapi.Call();
+        org.apache.axis2.clientapi.Call call =
+                new 
org.apache.axis2.clientapi.Call("target/test-resources/intregrationRepo");
 
         call.setTo(targetEPR);
         call.setTransportInfo(Constants.TRANSPORT_HTTP,

Modified: 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/FaultHandlingTest.java
URL: 
http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/FaultHandlingTest.java?rev=239411&r1=239410&r2=239411&view=diff
==============================================================================
--- 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/FaultHandlingTest.java
 (original)
+++ 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/FaultHandlingTest.java
 Tue Aug 23 07:14:54 2005
@@ -120,7 +120,7 @@
     }

 

     private MyInOutMEPClient getMyInOutMEPClient() throws AxisFault {

-        MyInOutMEPClient inOutMEPClient = new MyInOutMEPClient();

+        MyInOutMEPClient inOutMEPClient = new 
MyInOutMEPClient("target/test-resources/intregrationRepo");

         
inOutMEPClient.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);

         inOutMEPClient.setTo(targetEPR);

         inOutMEPClient.setTransportInfo(Constants.TRANSPORT_HTTP,


Modified: 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/HandlerFailureTest.java
URL: 
http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/HandlerFailureTest.java?rev=239411&r1=239410&r2=239411&view=diff
==============================================================================
--- 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/HandlerFailureTest.java
 (original)
+++ 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/HandlerFailureTest.java
 Tue Aug 23 07:14:54 2005
@@ -157,7 +157,8 @@
             value.setText("Isaac Assimov, the foundation Sega");
             method.addChild(value);
 
-            org.apache.axis2.clientapi.Call call = new 
org.apache.axis2.clientapi.Call();
+            org.apache.axis2.clientapi.Call call =
+                    new      
org.apache.axis2.clientapi.Call("target/test-resources/intregrationRepo");
             //EndpointReference targetEPR = new 
EndpointReference(AddressingConstants.WSA_TO, "http://127.0.0.1:"; + 
Utils.TESTING_PORT + "/axis/services/EchoXMLService");
             
             call.setTransportInfo(Constants.TRANSPORT_HTTP,

Added: 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/MessageContextEnabledEcho.java
URL: 
http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/MessageContextEnabledEcho.java?rev=239411&view=auto
==============================================================================
--- 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/MessageContextEnabledEcho.java
 (added)
+++ 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/MessageContextEnabledEcho.java
 Tue Aug 23 07:14:54 2005
@@ -0,0 +1,52 @@
+package org.apache.axis2.engine;

+

+import org.apache.axis2.context.MessageContext;

+import org.apache.axis2.om.OMElement;

+import org.apache.axis2.AxisFault;

+import org.apache.commons.logging.Log;

+import org.apache.commons.logging.LogFactory;

+/*

+* Copyright 2004,2005 The Apache Software Foundation.

+*

+* Licensed under the Apache License, Version 2.0 (the "License");

+* you may not use this file except in compliance with the License.

+* You may obtain a copy of the License at

+*

+*      http://www.apache.org/licenses/LICENSE-2.0

+*

+* Unless required by applicable law or agreed to in writing, software

+* distributed under the License is distributed on an "AS IS" BASIS,

+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+* See the License for the specific language governing permissions and

+* limitations under the License.

+*

+*

+*/

+

+/**

+ * Author: Deepal Jayasinghe

+ * Date: Aug 23, 2005

+ * Time: 7:14:30 PM

+ */

+public class MessageContextEnabledEcho {

+    private MessageContext msgcts;

+      private Log log = LogFactory.getLog(getClass());

+

+    public MessageContextEnabledEcho() {

+    }

+

+    public void init(MessageContext msgcts) {

+        this.msgcts = msgcts;

+

+    }

+

+    public OMElement echoOMElement(OMElement omEle) throws AxisFault {

+        if (msgcts != null) {

+            log.info("MessageContext injected");

+        } else {

+            throw new AxisFault("Message Context not injected");

+        }

+        return null;

+    }

+

+}
\ No newline at end of file

Added: 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/MessageContextInjectionTest.java
URL: 
http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/MessageContextInjectionTest.java?rev=239411&view=auto
==============================================================================
--- 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/MessageContextInjectionTest.java
 (added)
+++ 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/MessageContextInjectionTest.java
 Tue Aug 23 07:14:54 2005
@@ -0,0 +1,122 @@
+package org.apache.axis2.engine;

+

+import junit.framework.TestCase;

+import org.apache.axis2.addressing.EndpointReference;

+import org.apache.axis2.context.MessageContext;

+import org.apache.axis2.context.ConfigurationContext;

+import org.apache.axis2.soap.SOAPEnvelope;

+import org.apache.axis2.soap.SOAPFactory;

+import org.apache.axis2.soap.SOAP11Constants;

+import org.apache.axis2.transport.local.LocalTransportReceiver;

+import org.apache.axis2.description.ServiceDescription;

+import org.apache.axis2.description.ParameterImpl;

+import org.apache.axis2.description.OperationDescription;

+import org.apache.axis2.receivers.AbstractMessageReceiver;

+import org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver;

+import org.apache.axis2.util.Utils;

+import org.apache.axis2.om.OMElement;

+import org.apache.axis2.om.OMFactory;

+import org.apache.axis2.om.OMAbstractFactory;

+import org.apache.axis2.om.OMNamespace;

+import org.apache.axis2.clientapi.MessageSender;

+import org.apache.axis2.Constants;

+import org.apache.commons.logging.Log;

+import org.apache.commons.logging.LogFactory;

+

+import javax.xml.namespace.QName;

+/*

+* Copyright 2004,2005 The Apache Software Foundation.

+*

+* Licensed under the Apache License, Version 2.0 (the "License");

+* you may not use this file except in compliance with the License.

+* You may obtain a copy of the License at

+*

+*      http://www.apache.org/licenses/LICENSE-2.0

+*

+* Unless required by applicable law or agreed to in writing, software

+* distributed under the License is distributed on an "AS IS" BASIS,

+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+* See the License for the specific language governing permissions and

+* limitations under the License.

+*

+*

+*/

+

+/**

+ * Author: Deepal Jayasinghe

+ * Date: Aug 23, 2005

+ * Time: 7:06:37 PM

+ */

+public class MessageContextInjectionTest extends TestCase {

+    private EndpointReference targetEPR =

+            new 
EndpointReference("/axis/services/EchoXMLService/echoOMElement");

+    private Log log = LogFactory.getLog(getClass());

+    private QName serviceName = new QName("EchoXMLService");

+    private QName operationName = new QName("echoOMElement");

+

+

+    private AxisConfiguration engineRegistry;

+    private MessageContext mc;

+

+    private SOAPEnvelope envelope;

+

+    private boolean finish = false;

+

+    public MessageContextInjectionTest() {

+        super(MessageContextInjectionTest.class.getName());

+    }

+

+    public MessageContextInjectionTest(String testName) {

+        super(testName);

+    }

+

+    protected void setUp() throws Exception {

+        LocalTransportReceiver.CONFIG_CONTEXT = new ConfigurationContext(

+                new AxisConfigurationImpl());

+

+        ServiceDescription service = new ServiceDescription(serviceName);

+        service.addParameter(

+                new ParameterImpl(AbstractMessageReceiver.SERVICE_CLASS,

+                        MessageContextEnabledEcho.class.getName()));

+        OperationDescription operation = new OperationDescription(

+                operationName);

+        operation.setMessageReceiver(new RawXMLINOnlyMessageReceiver());

+        service.addOperation(operation);

+        service.setClassLoader(Thread.currentThread().getContextClassLoader());

+        LocalTransportReceiver.CONFIG_CONTEXT.getAxisConfiguration()

+                .addService(service);

+        Utils.resolvePhases(

+                LocalTransportReceiver.CONFIG_CONTEXT.getAxisConfiguration(),

+                service);

+    }

+

+    protected void tearDown() throws Exception {

+    }

+

+    private OMElement createEnvelope() {

+        OMFactory fac = OMAbstractFactory.getOMFactory();

+        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 Assimov, the foundation Sega"));

+        method.addChild(value);

+

+        return method;

+    }

+

+    public void testEchoXMLSync() throws Exception {

+        SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();

+

+        OMElement payload = createEnvelope();

+

+        MessageSender sender = new 
MessageSender("target/test-resources/intregrationRepo");

+

+        sender.setTo(targetEPR);

+        sender.setSenderTransport(Constants.TRANSPORT_LOCAL);

+        sender.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);

+        sender.send(operationName.getLocalPart(), payload);

+

+    }

+

+}


Modified: 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/OneWayRawXMLTest.java
URL: 
http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/OneWayRawXMLTest.java?rev=239411&r1=239410&r2=239411&view=diff
==============================================================================
--- 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/OneWayRawXMLTest.java
 (original)
+++ 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/OneWayRawXMLTest.java
 Tue Aug 23 07:14:54 2005
@@ -92,7 +92,7 @@
 
         OMElement payload = TestingUtils.createDummyOMElement();
 
-        MessageSender sender = new MessageSender();
+        MessageSender sender = new 
MessageSender("target/test-resources/intregrationRepo");
 
         sender.setTo(targetEPR);
         sender.setSenderTransport(Constants.TRANSPORT_HTTP);

Modified: 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/SOAPversionTest.java
URL: 
http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/SOAPversionTest.java?rev=239411&r1=239410&r2=239411&view=diff
==============================================================================
--- 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/SOAPversionTest.java
 (original)
+++ 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/SOAPversionTest.java
 Tue Aug 23 07:14:54 2005
@@ -80,7 +80,7 @@
         SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
 
         OMElement payload = createEnvelope();
-        MyInOutMEPClient inOutMEPClient = new MyInOutMEPClient();
+        MyInOutMEPClient inOutMEPClient = new 
MyInOutMEPClient("target/test-resources/intregrationRepo");
         inOutMEPClient.setSoapVersionURI(
                 SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
         inOutMEPClient.setTo(targetEPR);
@@ -101,7 +101,7 @@
         SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
 
         OMElement payload = createEnvelope();
-        MyInOutMEPClient inOutMEPClient = new MyInOutMEPClient();
+        MyInOutMEPClient inOutMEPClient = new 
MyInOutMEPClient("target/test-resources/intregrationRepo");
         inOutMEPClient.setSoapVersionURI(
                 SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
         inOutMEPClient.setTo(targetEPR);
@@ -124,7 +124,7 @@
         SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
 
         OMElement payload = createEnvelope();
-        MyInOutMEPClient inOutMEPClient = new MyInOutMEPClient();
+        MyInOutMEPClient inOutMEPClient = new 
MyInOutMEPClient("target/test-resources/intregrationRepo");
         inOutMEPClient.setSoapVersionURI(
                 SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
 

Modified: 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/ServiceDispatchingTest.java
URL: 
http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/ServiceDispatchingTest.java?rev=239411&r1=239410&r2=239411&view=diff
==============================================================================
--- 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/ServiceDispatchingTest.java
 (original)
+++ 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/ServiceDispatchingTest.java
 Tue Aug 23 07:14:54 2005
@@ -85,7 +85,8 @@
     public void testDispatchWithURLOnly() throws Exception {
         SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
         OMElement payload = TestingUtils.createDummyOMElement();
-        org.apache.axis2.clientapi.Call call = new 
org.apache.axis2.clientapi.Call();
+        org.apache.axis2.clientapi.Call call =
+                new 
org.apache.axis2.clientapi.Call("target/test-resources/intregrationRepo");
         call.setTo(
                 new 
EndpointReference("http://127.0.0.1:5555/axis/services/EchoXMLService/echoOMElement";));
         call.setTransportInfo(Constants.TRANSPORT_HTTP,
@@ -105,7 +106,8 @@
         value.addChild(
                 fac.createText(value, "Isaac Assimov, the foundation Sega"));
         payload.addChild(value);
-        org.apache.axis2.clientapi.Call call = new 
org.apache.axis2.clientapi.Call();
+        org.apache.axis2.clientapi.Call call =
+                new 
org.apache.axis2.clientapi.Call("target/test-resources/intregrationRepo");
         call.setTo(
                 new 
EndpointReference("http://127.0.0.1:5555/axis/services/EchoXMLService/";));
         call.setTransportInfo(Constants.TRANSPORT_HTTP,
@@ -130,7 +132,8 @@
         payload.addChild(value);
 
 
-        org.apache.axis2.clientapi.Call call = new 
org.apache.axis2.clientapi.Call();
+        org.apache.axis2.clientapi.Call call =
+                new 
org.apache.axis2.clientapi.Call("target/test-resources/intregrationRepo");
         call.setTo(
                 new EndpointReference("http://127.0.0.1:5555/axis/services/";));
         call.setTransportInfo(Constants.TRANSPORT_HTTP,

Modified: 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/util/MyInOutMEPClient.java
URL: 
http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/util/MyInOutMEPClient.java?rev=239411&r1=239410&r2=239411&view=diff
==============================================================================
--- 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/util/MyInOutMEPClient.java
 (original)
+++ 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/engine/util/MyInOutMEPClient.java
 Tue Aug 23 07:14:54 2005
@@ -33,6 +33,10 @@
         super(assumeServiceContext(null));

     }

 

+    public MyInOutMEPClient(String clientHome) throws AxisFault {

+        super(clientHome);    

+    }

+

     public SOAPEnvelope invokeBlockingWithEnvelopeOut(String axisop,

                                                       OMElement toSend) throws 
AxisFault {

         OperationDescription axisConfig =


Modified: 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/groovy/GroovyServiceTest.java
URL: 
http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/groovy/GroovyServiceTest.java?rev=239411&r1=239410&r2=239411&view=diff
==============================================================================
--- 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/groovy/GroovyServiceTest.java
 (original)
+++ 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/groovy/GroovyServiceTest.java
 Tue Aug 23 07:14:54 2005
@@ -88,7 +88,8 @@
         //OMElement payload = createPayLoad();

         OMElement payload = getpayLoad();

 

-        org.apache.axis2.clientapi.Call call = new 
org.apache.axis2.clientapi.Call();

+        org.apache.axis2.clientapi.Call call =

+                new 
org.apache.axis2.clientapi.Call("target/test-resources/intregrationRepo");

 

         call.setTo(targetEPR);

         call.setTransportInfo(Constants.TRANSPORT_HTTP,


Modified: 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java
URL: 
http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java?rev=239411&r1=239410&r2=239411&view=diff
==============================================================================
--- 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java
 (original)
+++ 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java
 Tue Aug 23 07:14:54 2005
@@ -115,8 +115,8 @@
         ModuleDescription moduleDesc = deploymentEngine.buildModule(file);

 

         ConfigurationContextFactory efac = new ConfigurationContextFactory();

-        ConfigurationContext sysContext = efac.buildClientConfigurationContext(

-                null);

+        ConfigurationContext sysContext =

+                
efac.buildClientConfigurationContext("target/test-resources/intregrationRepo");

 

         sysContext.getAxisConfiguration().addMdoule(moduleDesc);

         //sysContext.getAxisConfiguration().engageModule(moduleDesc.getName());


Modified: 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMLoadTest.java
URL: 
http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMLoadTest.java?rev=239411&r1=239410&r2=239411&view=diff
==============================================================================
--- 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMLoadTest.java
 (original)
+++ 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMLoadTest.java
 Tue Aug 23 07:14:54 2005
@@ -113,7 +113,8 @@
 
             OMElement payload = createEnvelope();
 
-            org.apache.axis2.clientapi.Call call = new 
org.apache.axis2.clientapi.Call();
+            org.apache.axis2.clientapi.Call call =
+                    new 
org.apache.axis2.clientapi.Call("target/test-resources/intregrationRepo");
             call.setTo(targetEPR);
             call.set(Constants.Configuration.ENABLE_MTOM,
                     Constants.VALUE_TRUE);

Modified: 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMTest.java
URL: 
http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMTest.java?rev=239411&r1=239410&r2=239411&view=diff
==============================================================================
--- 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMTest.java
 (original)
+++ 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMTest.java
 Tue Aug 23 07:14:54 2005
@@ -116,7 +116,8 @@
     public void testEchoXMLASync() throws Exception {
         OMElement payload = createEnvelope();
 
-        org.apache.axis2.clientapi.Call call = new 
org.apache.axis2.clientapi.Call();
+        org.apache.axis2.clientapi.Call call = new 
org.apache.axis2.clientapi.Call(
+                "target/test-resources/intregrationRepo" );
 
         call.setTo(targetEPR);
         call.setTransportInfo(Constants.TRANSPORT_HTTP,
@@ -161,7 +162,8 @@
 
         OMElement payload = createEnvelope();
 
-        org.apache.axis2.clientapi.Call call = new 
org.apache.axis2.clientapi.Call();
+        org.apache.axis2.clientapi.Call call =
+                new 
org.apache.axis2.clientapi.Call("target/test-resources/intregrationRepo");
         call.setTo(targetEPR);
         call.set(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
         call.setTransportInfo(Constants.TRANSPORT_HTTP,

Modified: 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMToBase64Test.java
URL: 
http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMToBase64Test.java?rev=239411&r1=239410&r2=239411&view=diff
==============================================================================
--- 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMToBase64Test.java
 (original)
+++ 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMToBase64Test.java
 Tue Aug 23 07:14:54 2005
@@ -103,7 +103,9 @@
     public void testEchoXMLASync() throws Exception {
         OMElement payload = createPayload();
 
-        org.apache.axis2.clientapi.Call call = new 
org.apache.axis2.clientapi.Call();
+        org.apache.axis2.clientapi.Call call =
+                new 
org.apache.axis2.clientapi.Call("target/test-resources/intregrationRepo");
+
 
         call.setTo(targetEPR);
         call.setTransportInfo(Constants.TRANSPORT_HTTP,
@@ -146,7 +148,8 @@
 
             OMElement payload = createPayload();
 
-            org.apache.axis2.clientapi.Call call = new 
org.apache.axis2.clientapi.Call();
+            org.apache.axis2.clientapi.Call call =
+                    new 
org.apache.axis2.clientapi.Call("target/test-resources/intregrationRepo");
 
             call.setTo(targetEPR);
             call.set(Constants.Configuration.ENABLE_MTOM, 
Constants.VALUE_TRUE);

Modified: 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/rest/RESTBasedEchoRawXMLTest.java
URL: 
http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/rest/RESTBasedEchoRawXMLTest.java?rev=239411&r1=239410&r2=239411&view=diff
==============================================================================
--- 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/rest/RESTBasedEchoRawXMLTest.java
 (original)
+++ 
webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/rest/RESTBasedEchoRawXMLTest.java
 Tue Aug 23 07:14:54 2005
@@ -156,7 +156,8 @@
 
         OMElement payload = createEnvelope();
 
-        org.apache.axis2.clientapi.Call call = new 
org.apache.axis2.clientapi.Call();
+        org.apache.axis2.clientapi.Call call =
+                new 
org.apache.axis2.clientapi.Call("target/test-resources/intregrationRepo");
 
         call.setTo(targetEPR);
         call.setTransportInfo(Constants.TRANSPORT_HTTP,


Reply via email to