axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r547958 - in /webservices/axis2/trunk/java/modules: integration/test/org/apache/axis2/engine/ kernel/src/org/apache/axis2/description/ kernel/src/org/apache/axis2/phaseresolver/ kernel/src/org/apache/axis2/util/ kernel/test/org/apache/axis2...
Date Sat, 16 Jun 2007 18:19:01 GMT
Author: deepal
Date: Sat Jun 16 11:19:00 2007
New Revision: 547958

URL: http://svn.apache.org/viewvc?view=rev&rev=547958
Log:
fixing engage module for AxisMessage issue.
 - Now we can engage module to AxisMessages , but it will not add module operations to the
service.

Added:
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/ModuleEnagementTest.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/TestHandler.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/TestService.java
Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisMessage.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/phaseresolver/PhaseHolder.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/phaseresolver/PhaseResolver.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CallbackReceiver.java
    webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/ModuleHandler1.java
    webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/ModuleversionTest.java
    webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/engine/ModuleEngageTest.java

Added: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/ModuleEnagementTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/ModuleEnagementTest.java?view=auto&rev=547958
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/ModuleEnagementTest.java
(added)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/ModuleEnagementTest.java
Sat Jun 16 11:19:00 2007
@@ -0,0 +1,141 @@
+package org.apache.axis2.engine;
+
+import junit.framework.TestCase;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.description.*;
+
+import javax.xml.namespace.QName;
+import java.util.List;
+
+/*
+* 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.
+*
+*
+*/
+public class ModuleEnagementTest extends TestCase {
+    AxisConfiguration axisConfig;
+
+    protected void setUp() throws Exception {
+        AxisModule module = new AxisModule();
+        module.setName("TestModule");
+        module.setInFlow(getFlowWithHandler("H1", "OperationInPhase"));
+        module.setOutFlow(getFlowWithHandler("H2", "OperationOutPhase"));
+        module.setFaultInFlow(getFlowWithHandler("H3", "OperationInFaultPhase"));
+        module.setFaultOutFlow(getFlowWithHandler("H4", "OperationOutFaultPhase"));
+        axisConfig = ConfigurationContextFactory.createDefaultConfigurationContext().getAxisConfiguration();
+        axisConfig.addModule(module);
+    }
+
+    private Flow getFlowWithHandler(String handlername, String phaseName) {
+        HandlerDescription handler1 = new HandlerDescription();
+        TestHandler moduleHandler = new TestHandler();
+        moduleHandler.setName(handlername);
+        moduleHandler.setName(handlername);
+        moduleHandler.init(handler1);
+        PhaseRule rule1 = new PhaseRule();
+        rule1.setPhaseName(phaseName);
+        handler1.setRules(rule1);
+        handler1.setHandler(moduleHandler);
+        Flow flow = new Flow();
+        flow.addHandler(handler1);
+        return flow;
+    }
+
+    public void testModuleEngageForAxisService() throws AxisFault {
+        AxisService service = AxisService.createService(TestService.class.getName(), axisConfig);
+        axisConfig.addService(service);
+        AxisModule module = axisConfig.getModule("TestModule");
+        assertNotNull(module);
+        service.engageModule(module);
+        AxisOperation axisOperation = service.getOperation(new QName("testVoid"));
+        assertNotNull(axisOperation);
+        AxisMessage message = axisOperation.getMessage("In");
+        assertNotNull(message);
+        List list = message.getMessageFlow();
+        boolean found = false;
+        for (int i = 0; i < list.size(); i++) {
+            Phase phase = (Phase) list.get(i);
+            if (phase != null && phase.getName().equals("OperationInPhase")) {
+                List handler = phase.getHandlers();
+                for (int j = 0; j < handler.size(); j++) {
+                    Handler handler1 = (Handler) handler.get(j);
+                    if (handler1.getName().equals("H1")) {
+                        found = true;
+                    }
+
+                }
+            }
+        }
+        assertTrue(found);
+    }
+
+    public void engageModuleToAxisMessage1() throws Exception{
+        AxisService service = AxisService.createService(TestService.class.getName(), axisConfig);
+        axisConfig.addService(service);
+        AxisModule module = axisConfig.getModule("TestModule");
+        assertNotNull(module);
+        AxisOperation axisOperation = service.getOperation(new QName("testVoid"));
+        assertNotNull(axisOperation);
+        AxisMessage message = axisOperation.getMessage("In");
+        message.engageModule(module);
+        assertNotNull(message);
+        List list = message.getMessageFlow();
+        boolean found = false;
+        for (int i = 0; i < list.size(); i++) {
+            Phase phase = (Phase) list.get(i);
+            if (phase != null && phase.getName().equals("OperationInPhase")) {
+                List handler = phase.getHandlers();
+                for (int j = 0; j < handler.size(); j++) {
+                    Handler handler1 = (Handler) handler.get(j);
+                    if (handler1.getName().equals("H1")) {
+                        found = true;
+                    }
+
+                }
+            }
+        }
+        assertTrue(found);
+    }
+
+     public void engageModuleToAxisMessage2() throws Exception{
+         AxisService service = AxisService.createService(TestService.class.getName(), axisConfig);
+         axisConfig.addService(service);
+         AxisModule module = axisConfig.getModule("TestModule");
+         assertNotNull(module);
+         AxisOperation axisOperation = service.getOperation(new QName("testString"));
+         assertNotNull(axisOperation);
+         AxisMessage message = axisOperation.getMessage("In");
+         message.engageModule(module);
+         assertNotNull(message);
+         message = axisOperation.getMessage("Out");
+         List list = message.getMessageFlow();
+         boolean found = false;
+         for (int i = 0; i < list.size(); i++) {
+             Phase phase = (Phase) list.get(i);
+             if (phase != null && phase.getName().equals("OperationOutPhase")) {
+                 List handler = phase.getHandlers();
+                 for (int j = 0; j < handler.size(); j++) {
+                     Handler handler1 = (Handler) handler.get(j);
+                     if (handler1.getName().equals("H2")) {
+                         found = true;
+                     }
+
+                 }
+             }
+         }
+         assertFalse(found);
+    }
+}

Added: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/TestHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/TestHandler.java?view=auto&rev=547958
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/TestHandler.java
(added)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/TestHandler.java
Sat Jun 16 11:19:00 2007
@@ -0,0 +1,51 @@
+package org.apache.axis2.engine;
+
+import org.apache.axis2.handlers.AbstractHandler;
+import org.apache.axis2.context.MessageContext;
+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.
+*
+*
+*/
+public class TestHandler extends AbstractHandler {
+    private static final Log log = LogFactory.getLog(TestHandler .class);
+    private String message;
+    private String name;
+
+    public TestHandler() {
+        this.message = "inside invalid module";
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
+        log.info("I am " + message + " Handler Running :)");
+        return InvocationResponse.CONTINUE;
+    }
+
+    public void revoke(MessageContext msgContext) {
+        log.info("I am " + message + " Handler Running :)");
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

Added: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/TestService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/TestService.java?view=auto&rev=547958
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/TestService.java
(added)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/TestService.java
Sat Jun 16 11:19:00 2007
@@ -0,0 +1,31 @@
+package org.apache.axis2.engine;
+
+/*
+* 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.
+*
+*
+*/
+public class TestService {
+    public void testVoid(){
+
+    }
+    public String testString(String a){
+        return null;
+    }
+
+    public String  testFault(String foo) throws Exception{
+        return null;
+    }
+}

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisMessage.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisMessage.java?view=diff&rev=547958&r1=547957&r2=547958
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisMessage.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisMessage.java
Sat Jun 16 11:19:00 2007
@@ -18,6 +18,9 @@
 package org.apache.axis2.description;
 
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.modules.Module;
+import org.apache.axis2.phaseresolver.PhaseResolver;
+import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.wsdl.SOAPHeaderMessage;
 import org.apache.ws.commons.schema.*;
 
@@ -43,6 +46,14 @@
     private String direction;
     private String messagePartName;
 
+    // To store deploy-time module refs
+    private ArrayList modulerefs;
+
+    /**
+     * list of engaged modules
+     */
+    private ArrayList engagedModules = new ArrayList();
+
     // private PolicyInclude policyInclude;
 
 
@@ -57,6 +68,7 @@
 	public AxisMessage() {
         soapHeaders = new ArrayList();
         handlerChain = new ArrayList();
+        modulerefs = new ArrayList();
     }
 
     public ArrayList getMessageFlow() {
@@ -175,13 +187,58 @@
         return soapHeaders;
     }
 
+    /**
+     *
+     * We do not support adding module operations when engaging a module to an AxisMessage
+     * @param axisModule AxisModule to engage
+     * @throws AxisFault something went wrong
+     */
     public void engageModule(AxisModule axisModule) throws AxisFault {
-        throw new UnsupportedOperationException("Sorry we do not support this");
+        if (axisModule == null) {
+            return;
+        }
+        Iterator module_itr = engagedModules.iterator();
+        boolean isEngagable;
+        String moduleName = axisModule.getName();
+        while (module_itr.hasNext()) {
+            AxisModule module = (AxisModule) module_itr.next();
+            String modu = module.getName();
+            isEngagable = org.apache.axis2.util.Utils.checkVersion(moduleName, modu);
+            if (!isEngagable) {
+                return ;
+            }
+        }
+
+        Module module = axisModule.getModule();
+        if (module != null) {
+            module.engageNotify(this);
+        }
+        AxisConfiguration axisConfig = getAxisConfiguration();
+        PhaseResolver phaseResolver = new PhaseResolver(axisConfig);
+        phaseResolver.engageModuleToMessage(this, axisModule);
+        engagedModules.add(axisModule);
     }
 
     public boolean isEngaged(String moduleName) {
-        throw new UnsupportedOperationException("axisMessage.isEngaged() is not supported");
+        Iterator engagedModuleItr = engagedModules.iterator();
+        while (engagedModuleItr.hasNext()) {
+            AxisModule axisModule = (AxisModule) engagedModuleItr.next();
+            if (axisModule.getName().equals(moduleName)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public ArrayList getModulerefs() {
+        return modulerefs;
+    }
 
+    public void addModuleRefs(String moduleName) {
+        modulerefs.add(moduleName);
     }
 
+    public AxisOperation getAxisOperation(){
+        return (AxisOperation) getParent();
+    }
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/phaseresolver/PhaseHolder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/phaseresolver/PhaseHolder.java?view=diff&rev=547958&r1=547957&r2=547958
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/phaseresolver/PhaseHolder.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/phaseresolver/PhaseHolder.java
Sat Jun 16 11:19:00 2007
@@ -24,17 +24,18 @@
 import org.apache.axis2.i18n.Messages;
 
 import java.util.ArrayList;
+import java.util.List;
 
 /**
  * This class hold all the phases found in the services.xml and server.xml
  */
 public class PhaseHolder {
-    private ArrayList phaseList;
+    private List phaseList;
 
     public PhaseHolder() {
     }
 
-    public PhaseHolder(ArrayList phases) {
+    public PhaseHolder(List phases) {
         this.phaseList = phases;
     }
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/phaseresolver/PhaseResolver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/phaseresolver/PhaseResolver.java?view=diff&rev=547958&r1=547957&r2=547958
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/phaseresolver/PhaseResolver.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/phaseresolver/PhaseResolver.java
Sat Jun 16 11:19:00 2007
@@ -17,15 +17,14 @@
 
 package org.apache.axis2.phaseresolver;
 
-import org.apache.axis2.description.AxisModule;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.Flow;
-import org.apache.axis2.description.HandlerDescription;
+import org.apache.axis2.description.*;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.engine.Phase;
+import org.apache.axis2.wsdl.WSDLConstants;
 
 import java.util.ArrayList;
 import java.util.Iterator;
+import java.util.List;
 
 /**
  * Class PhaseResolver
@@ -54,144 +53,54 @@
         this.axisConfig = axisconfig;
     }
 
-    public void engageModuleToOperation(AxisOperation axisOperation, AxisModule module)
-            throws PhaseException {
-        Flow flow = null;
-
-        for (int type = IN_FLOW; type < OUT_FAULT_FLOW; type++) {
-            switch (type) {
-                case PhaseMetadata.IN_FLOW : {
-                    ArrayList phases = new ArrayList();
-
-                    if (axisConfig != null) {
-                        Iterator itr_axis_config =
-                                axisConfig.getInFlowPhases().iterator();
-
-                        while (itr_axis_config.hasNext()) {
-                            Object o = itr_axis_config.next();
-
-                            phases.add(o);
-                        }
-                    }
-
-                    Iterator itr_ops = axisOperation.getRemainingPhasesInFlow().iterator();
-
-                    while (itr_ops.hasNext()) {
-                        Object o = itr_ops.next();
-
-                        phases.add(o);
-                    }
-
-                    phaseHolder = new PhaseHolder(phases);
-
-                    break;
-                }
-
-                case PhaseMetadata.OUT_FLOW : {
-                    ArrayList phases = new ArrayList();
-                    Iterator itr_ops = axisOperation.getPhasesOutFlow().iterator();
-
-                    while (itr_ops.hasNext()) {
-                        Object o = itr_ops.next();
-
-                        phases.add(o);
-                    }
-
-                    if (axisConfig != null) {
-                        Iterator itr_axis_config = axisConfig.getOutFlowPhases().iterator();
-
-                        while (itr_axis_config.hasNext()) {
-                            Object o = itr_axis_config.next();
-
-                            phases.add(o);
-                        }
-                    }
-
-                    phaseHolder = new PhaseHolder(phases);
-
-                    break;
-                }
-
-                case PhaseMetadata.FAULT_IN_FLOW : {
-                    ArrayList phases = new ArrayList();
-
-                    if (axisConfig != null) {
-                        Iterator itr_axis_config = axisConfig.getInFaultFlowPhases().iterator();
-
-                        while (itr_axis_config.hasNext()) {
-                            Object o = itr_axis_config.next();
-
-                            phases.add(o);
-                        }
-                    }
-
-                    Iterator itr_ops = axisOperation.getPhasesInFaultFlow().iterator();
-
-                    while (itr_ops.hasNext()) {
-                        Object o = itr_ops.next();
-
-                        phases.add(o);
-                    }
-
-                    phaseHolder = new PhaseHolder(phases);
-
-                    break;
-                }
-
-                case PhaseMetadata.FAULT_OUT_FLOW : {
-                    ArrayList phases = new ArrayList();
-                    Iterator itr_ops = axisOperation.getPhasesOutFaultFlow().iterator();
-                    while (itr_ops.hasNext()) {
-                        Object o = itr_ops.next();
-
-                        phases.add(o);
-                    }
-                    if (axisConfig != null) {
-                        Iterator itr_axis_config = axisConfig.getOutFaultFlowPhases().iterator();
-                        while (itr_axis_config.hasNext()) {
-                            Object o = itr_axis_config.next();
-                            phases.add(o);
-                        }
-                    }
-                    phaseHolder = new PhaseHolder(phases);
-                    break;
-                }
+    private void engageModuleToFlow(Flow flow, List handlerChain) throws PhaseException {
+        phaseHolder = new PhaseHolder(handlerChain);
+        if (flow != null) {
+            for (int j = 0; j < flow.getHandlerCount(); j++) {
+                HandlerDescription metadata = flow.getHandler(j);
+                phaseHolder.addHandler(metadata);
             }
+        }
+    }
 
-            switch (type) {
-                case PhaseMetadata.IN_FLOW : {
-                    flow = module.getInFlow();
-
-                    break;
-                }
-
-                case PhaseMetadata.OUT_FLOW : {
-                    flow = module.getOutFlow();
-
-                    break;
-                }
-
-                case PhaseMetadata.FAULT_IN_FLOW : {
-                    flow = module.getFaultInFlow();
-
-                    break;
-                }
-
-                case PhaseMetadata.FAULT_OUT_FLOW : {
-                    flow = module.getFaultOutFlow();
-
-                    break;
-                }
+    private void engageModuleToOperation(AxisOperation axisOperation,
+                                         AxisModule axisModule,
+                                         int flowType) throws PhaseException {
+        List phases = new ArrayList();
+        Flow flow = null;
+        switch(flowType){
+            case PhaseMetadata.IN_FLOW : {
+                phases.addAll(axisConfig.getInFlowPhases());
+                phases.addAll(axisOperation.getRemainingPhasesInFlow());
+                flow = axisModule.getInFlow();
+                break;
             }
-
-            if (flow != null) {
-                for (int j = 0; j < flow.getHandlerCount(); j++) {
-                    HandlerDescription metadata = flow.getHandler(j);
-
-                    phaseHolder.addHandler(metadata);
-                }
+            case PhaseMetadata.OUT_FLOW : {
+                phases.addAll(axisOperation.getPhasesOutFlow());
+                phases.addAll(axisConfig.getOutFlowPhases());
+                flow = axisModule.getOutFlow();
+                break;
+            }
+            case PhaseMetadata.FAULT_OUT_FLOW : {
+                phases.addAll(axisOperation.getPhasesOutFaultFlow());
+                phases.addAll(axisConfig.getOutFaultFlowPhases());
+                flow = axisModule.getFaultOutFlow();
+                break;
+            }
+            case PhaseMetadata.FAULT_IN_FLOW : {
+                phases.addAll(axisOperation.getPhasesInFaultFlow());
+                phases.addAll(axisConfig.getInFaultFlowPhases());
+                flow = axisModule.getFaultInFlow();
+                break;
             }
         }
+        engageModuleToFlow(flow,phases);
+    }
+    public void engageModuleToOperation(AxisOperation axisOperation, AxisModule module)
+            throws PhaseException {
+        for (int type = IN_FLOW; type < OUT_FAULT_FLOW; type++) {
+            engageModuleToOperation(axisOperation, module, type);
+        }
     }
 
     /**
@@ -295,6 +204,19 @@
                 phase.removeHandler(handler);
                 break;
             }
+        }
+    }
+
+    public void engageModuleToMessage(AxisMessage axisMessage, AxisModule axisModule)
+            throws PhaseException {
+        String direction = axisMessage.getDirection();
+        AxisOperation axisOperation = axisMessage.getAxisOperation();
+        if (WSDLConstants.MESSAGE_LABEL_OUT_VALUE.equalsIgnoreCase(direction)) {
+            engageModuleToOperation(axisOperation, axisModule, PhaseMetadata.OUT_FLOW);
+        } else if (WSDLConstants.MESSAGE_LABEL_IN_VALUE.equalsIgnoreCase(direction)) {
+            engageModuleToOperation(axisOperation, axisModule, PhaseMetadata.IN_FLOW);
+        } else if (WSDLConstants.MESSAGE_LABEL_FAULT_VALUE.equals(direction)) {
+            //TODO : Need to handle fault correctly
         }
     }
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CallbackReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CallbackReceiver.java?view=diff&rev=547958&r1=547957&r2=547958
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CallbackReceiver.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CallbackReceiver.java
Sat Jun 16 11:19:00 2007
@@ -47,7 +47,7 @@
     }
 
     public Callback lookupCallback(String msgID) {
-        return (Callback) callbackStore.get(msgID);
+        return (Callback) callbackStore.remove(msgID);
     }
 
     public void receive(MessageContext messageCtx) throws AxisFault {

Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/ModuleHandler1.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/ModuleHandler1.java?view=diff&rev=547958&r1=547957&r2=547958
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/ModuleHandler1.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/ModuleHandler1.java
Sat Jun 16 11:19:00 2007
@@ -22,7 +22,7 @@
 *
 */
 
-public class ModuleHandler1 extends AbstractHandler implements Handler {
+public class ModuleHandler1 extends AbstractHandler  {
     private static final Log log = LogFactory.getLog(ModuleHandler1 .class);
     private String message;
     private String name;

Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/ModuleversionTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/ModuleversionTest.java?view=diff&rev=547958&r1=547957&r2=547958
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/ModuleversionTest.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/ModuleversionTest.java
Sat Jun 16 11:19:00 2007
@@ -75,21 +75,21 @@
         boolean found2 = false;
         boolean found3 = false;
         while (engageModules.hasNext()) {
-            String qName = (String) engageModules.next();
+            String qName = ((AxisModule) engageModules.next()).getName();
             if (qName.equals("Module2-0.95")) {
                 found1 = true;
             }
         }
         engageModules = axiConfiguration.getEngagedModules().iterator();
         while (engageModules.hasNext()) {
-            String name = (String) engageModules.next();
+            String name = ((AxisModule) engageModules.next()).getName();
             if (name.equals("Module1")) {
                 found2 = true;
             }
         }
         engageModules = axiConfiguration.getEngagedModules().iterator();
         while (engageModules.hasNext()) {
-            String qName = (String) engageModules.next();
+            String qName = ((AxisModule) engageModules.next()).getName();
             if (qName.equals("testModule-1.93")) {
                 found3 = true;
             }

Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/engine/ModuleEngageTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/engine/ModuleEngageTest.java?view=diff&rev=547958&r1=547957&r2=547958
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/engine/ModuleEngageTest.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/engine/ModuleEngageTest.java
Sat Jun 16 11:19:00 2007
@@ -17,32 +17,28 @@
 package org.apache.axis2.engine;
 
 import junit.framework.TestCase;
-import org.apache.axis2.AxisFault;
 import org.apache.axis2.AbstractTestCase;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.ModuleHandler1;
 import org.apache.axis2.context.ConfigurationContextFactory;
-import org.apache.axis2.deployment.DeploymentException;
-import org.apache.axis2.description.AxisModule;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.phaseresolver.PhaseException;
+import org.apache.axis2.description.*;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
+import java.util.List;
 
 public class ModuleEngageTest extends TestCase {
-    AxisConfiguration ac;
+    AxisConfiguration axisConfig;
 
-    public void testModuleEngageMent() throws PhaseException,
-            DeploymentException,
-            AxisFault,
+    public void testModuleEngagement() throws AxisFault,
             XMLStreamException {
         String filename = AbstractTestCase.basedir + "/target/test-resources/deployment";
-        ac = ConfigurationContextFactory.createConfigurationContextFromFileSystem(filename,
null)
+        axisConfig = ConfigurationContextFactory.createConfigurationContextFromFileSystem(filename,
null)
                 .getAxisConfiguration();
-        AxisModule module = ac.getModule("module1");
+        AxisModule module = axisConfig.getModule("module1");
         assertNotNull(module);
-        ac.engageModule("module1");
-        AxisService service = ac.getService("service2");
+        axisConfig.engageModule("module1");
+        AxisService service = axisConfig.getService("service2");
         assertNotNull(service);
         AxisOperation moduleOperation = service.getOperation(
                 new QName("creatSeq"));



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message