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 de...@apache.org on 2005/05/14 11:39:02 UTC
svn commit: r170133 - in /webservices/axis/trunk/java/modules/core:
src/org/apache/axis/deployment/ src/org/apache/axis/phaseresolver/
test-resources/deployment/BadConfigOrderChange/
test-resources/deployment/SystemPhaseRemove/ test/org/apache/axis/deployment/
Author: deepal
Date: Sat May 14 02:39:01 2005
New Revision: 170133
URL: http://svn.apache.org/viewcvs?rev=170133&view=rev
Log:
adding new test cases for deployment
Added:
webservices/axis/trunk/java/modules/core/test-resources/deployment/BadConfigOrderChange/
webservices/axis/trunk/java/modules/core/test-resources/deployment/BadConfigOrderChange/server.xml
webservices/axis/trunk/java/modules/core/test-resources/deployment/SystemPhaseRemove/
webservices/axis/trunk/java/modules/core/test-resources/deployment/SystemPhaseRemove/server.xml
webservices/axis/trunk/java/modules/core/test/org/apache/axis/deployment/ModifiedConfigFileTest.java
webservices/axis/trunk/java/modules/core/test/org/apache/axis/deployment/SystemPhasesremovedTest.java
Modified:
webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java?rev=170133&r1=170132&r2=170133&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java Sat May 14 02:39:01 2005
@@ -26,7 +26,10 @@
import org.apache.axis.deployment.scheduler.SchedulerTask;
import org.apache.axis.deployment.util.DeploymentData;
import org.apache.axis.description.*;
-import org.apache.axis.engine.*;
+import org.apache.axis.engine.AxisConfiguration;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.engine.AxisSystemImpl;
+import org.apache.axis.engine.Handler;
import org.apache.axis.modules.Module;
import org.apache.axis.phaseresolver.PhaseException;
import org.apache.axis.phaseresolver.PhaseMetadata;
@@ -255,14 +258,19 @@
DeploymentData tempdata = DeploymentData.getInstance();
ArrayList inPhases = tempdata.getINPhases();
//TODO condition checking should be otherway since null value can occur
- if (!(((String) inPhases.get(0)).equals(PhaseMetadata.PHASE_TRANSPORTIN) &&
- ((String) inPhases.get(1)).equals(PhaseMetadata.PHASE_PRE_DISPATCH) &&
- ((String) inPhases.get(2)).equals(PhaseMetadata.PHASE_DISPATCH) &&
- ((String) inPhases.get(3)).equals(PhaseMetadata.PHASE_POST_DISPATCH))) {
+ try {
+ if (!(((String) inPhases.get(0)).equals(PhaseMetadata.PHASE_TRANSPORTIN) &&
+ ((String) inPhases.get(1)).equals(PhaseMetadata.PHASE_PRE_DISPATCH) &&
+ ((String) inPhases.get(2)).equals(PhaseMetadata.PHASE_DISPATCH) &&
+ ((String) inPhases.get(3)).equals(PhaseMetadata.PHASE_POST_DISPATCH))) {
+ throw new DeploymentException("Invalid System predefined inphases , phase order dose not" +
+ " support\n recheck server.xml");
+ }
+ } catch (DeploymentException e) {
throw new DeploymentException("Invalid System predefined inphases , phase order dose not" +
- " support\n recheck server.xml");
+ " support\n recheck server.xml");
}
- ArrayList outPhaes = tempdata.getOUTPhases();
+ // ArrayList outPhaes = tempdata.getOUTPhases();
//TODO do the validation code here
//ArrayList systemDefaultPhases =((AxisSystemImpl)axisConfig).getInPhasesUptoAndIncludingPostDispatch();
}
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java?rev=170133&r1=170132&r2=170133&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java Sat May 14 02:39:01 2005
@@ -169,7 +169,7 @@
}
}
} else {
- throw new PhaseException("referance to invalid module " + modulename.getLocalPart() + " by server.xml");
+ throw new PhaseException("referance to invalid module " + modulename.getLocalPart() + " by server.xml");
}
if (flow != null) {
Added: webservices/axis/trunk/java/modules/core/test-resources/deployment/BadConfigOrderChange/server.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test-resources/deployment/BadConfigOrderChange/server.xml?rev=170133&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/test-resources/deployment/BadConfigOrderChange/server.xml (added)
+++ webservices/axis/trunk/java/modules/core/test-resources/deployment/BadConfigOrderChange/server.xml Sat May 14 02:39:01 2005
@@ -0,0 +1,35 @@
+<server name ="AxisJava2.0" >
+ <parameter name="hotdeployment" locked="xsd:false">true</parameter>
+ <parameter name="hotupdate" locked="xsd:false">true</parameter>
+
+ <messageReceiver mep="INOUT" class="org.apache.axis.receivers.RawXMLINOutMessageRecevier"/>
+
+ <transportReceiver name="http">
+ </transportReceiver>
+ <transportSender name="http" class="org.apache.axis.transport.http.HTTPTransportSender">
+ </transportSender>
+
+ <phaseOrder type="inflow">
+ <!-- System pre defined phases -->
+ <phase name="Dispatch"/>
+ <phase name="PostDispatch"/>
+ <phase name="TransportIn"/>
+ <phase name="PreDispatch"/>
+ <!-- System pre defined phases -->
+ <!-- After Postdispatch phase module author or or service author can add any phase he want -->
+ <phase name="userphase1"/>
+ </phaseOrder>
+ <phaseOrder type="outflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="userphase1"/>
+ </phaseOrder>
+ <phaseOrder type="INfaultflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="userphase1"/>
+ </phaseOrder>
+ <phaseOrder type="Outfaultflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="userphase1"/>
+ </phaseOrder>
+</server>
+
Added: webservices/axis/trunk/java/modules/core/test-resources/deployment/SystemPhaseRemove/server.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test-resources/deployment/SystemPhaseRemove/server.xml?rev=170133&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/test-resources/deployment/SystemPhaseRemove/server.xml (added)
+++ webservices/axis/trunk/java/modules/core/test-resources/deployment/SystemPhaseRemove/server.xml Sat May 14 02:39:01 2005
@@ -0,0 +1,33 @@
+<server name ="AxisJava2.0" >
+ <parameter name="hotdeployment" locked="xsd:false">true</parameter>
+ <parameter name="hotupdate" locked="xsd:false">true</parameter>
+
+ <messageReceiver mep="INOUT" class="org.apache.axis.receivers.RawXMLINOutMessageRecevier"/>
+
+ <transportReceiver name="http">
+ </transportReceiver>
+ <transportSender name="http" class="org.apache.axis.transport.http.HTTPTransportSender">
+ </transportSender>
+
+ <phaseOrder type="inflow">
+ <!-- System pre defined phases -->
+ <phase name="TransportIn"/>
+ <phase name="PreDispatch"/>
+ <!-- System pre defined phases -->
+ <!-- After Postdispatch phase module author or or service author can add any phase he want -->
+ <phase name="userphase1"/>
+ </phaseOrder>
+ <phaseOrder type="outflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="userphase1"/>
+ </phaseOrder>
+ <phaseOrder type="INfaultflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="userphase1"/>
+ </phaseOrder>
+ <phaseOrder type="Outfaultflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="userphase1"/>
+ </phaseOrder>
+</server>
+
Added: webservices/axis/trunk/java/modules/core/test/org/apache/axis/deployment/ModifiedConfigFileTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis/deployment/ModifiedConfigFileTest.java?rev=170133&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis/deployment/ModifiedConfigFileTest.java (added)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis/deployment/ModifiedConfigFileTest.java Sat May 14 02:39:01 2005
@@ -0,0 +1,50 @@
+package org.apache.axis.deployment;
+
+import junit.framework.TestCase;
+import org.apache.axis.engine.AxisConfiguration;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.phaseresolver.PhaseException;
+import org.apache.axis.context.EngineContextFactory;
+
+import javax.xml.stream.XMLStreamException;
+
+/*
+ * 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: May 14, 2005
+ * Time: 3:13:52 PM
+ */
+public class ModifiedConfigFileTest extends TestCase {
+
+ AxisConfiguration er;
+
+ public void testPhaseOrderchage() {
+ try {
+ String filename = "./test-resources/deployment/BadConfigOrderChange";
+ EngineContextFactory builder = new EngineContextFactory();
+ er = builder.buildEngineContext(filename).getEngineConfig();
+ fail("this must failed gracefully with DeploymentException \"Invalid System predefined " +
+ "inphases , phase order dose not\" +\n support\\n recheck server.xml\"");
+ } catch (DeploymentException e) {
+ e.printStackTrace();
+ }
+ }
+
+}
Added: webservices/axis/trunk/java/modules/core/test/org/apache/axis/deployment/SystemPhasesremovedTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis/deployment/SystemPhasesremovedTest.java?rev=170133&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis/deployment/SystemPhasesremovedTest.java (added)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis/deployment/SystemPhasesremovedTest.java Sat May 14 02:39:01 2005
@@ -0,0 +1,46 @@
+package org.apache.axis.deployment;
+
+import junit.framework.TestCase;
+import org.apache.axis.engine.AxisConfiguration;
+import org.apache.axis.context.EngineContextFactory;
+
+/*
+ * 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: May 14, 2005
+ * Time: 3:30:53 PM
+ */
+public class SystemPhasesremovedTest extends TestCase{
+
+ AxisConfiguration er;
+
+ public void testPhaseOrderchage() {
+ try {
+ String filename = "./test-resources/deployment/SystemPhaseRemove";
+ EngineContextFactory builder = new EngineContextFactory();
+ er = builder.buildEngineContext(filename).getEngineConfig();
+ fail("this must failed gracefully with DeploymentException \"Invalid System predefined " +
+ "inphases , phase order dose not\" +\n support\\n recheck server.xml\"");
+ } catch (DeploymentException e) {
+ e.printStackTrace();
+ }
+ }
+
+}