axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r170333 - in /webservices/axis/trunk/java/modules/core: ./ samples/deployment/invalidservice/ samples/deployment/invalidservice/META-INF/ samples/deployment/invalidservice/org/ samples/deployment/invalidservice/org/apache/ samples/deployment/invalidservice/org/apache/axis/ samples/deployment/serviceModule/ samples/deployment/serviceModule/META-INF/ samples/deployment/serviceModule/org/ samples/deployment/serviceModule/org/apache/ samples/deployment/serviceModule/org/apache/axis/ src/org/apache/axis/deployment/ test/org/apache/axis/deployment/
Date Mon, 16 May 2005 07:54:01 GMT
Author: deepal
Date: Mon May 16 00:53:59 2005
New Revision: 170333

URL: http://svn.apache.org/viewcvs?rev=170333&view=rev
Log:
deployment test cases , to check whether service specific module try to add handlers to system
pre defined phases

Added:
    webservices/axis/trunk/java/modules/core/samples/deployment/invalidservice/
    webservices/axis/trunk/java/modules/core/samples/deployment/invalidservice/META-INF/
    webservices/axis/trunk/java/modules/core/samples/deployment/invalidservice/META-INF/service.xml
    webservices/axis/trunk/java/modules/core/samples/deployment/invalidservice/build.xml
    webservices/axis/trunk/java/modules/core/samples/deployment/invalidservice/org/
    webservices/axis/trunk/java/modules/core/samples/deployment/invalidservice/org/apache/
    webservices/axis/trunk/java/modules/core/samples/deployment/invalidservice/org/apache/axis/
    webservices/axis/trunk/java/modules/core/samples/deployment/invalidservice/org/apache/axis/InvalidService.java
    webservices/axis/trunk/java/modules/core/samples/deployment/serviceModule/
    webservices/axis/trunk/java/modules/core/samples/deployment/serviceModule/META-INF/
    webservices/axis/trunk/java/modules/core/samples/deployment/serviceModule/META-INF/module.xml
    webservices/axis/trunk/java/modules/core/samples/deployment/serviceModule/build.xml
    webservices/axis/trunk/java/modules/core/samples/deployment/serviceModule/org/
    webservices/axis/trunk/java/modules/core/samples/deployment/serviceModule/org/apache/
    webservices/axis/trunk/java/modules/core/samples/deployment/serviceModule/org/apache/axis/
    webservices/axis/trunk/java/modules/core/samples/deployment/serviceModule/org/apache/axis/InavalidModuleImpl.java
    webservices/axis/trunk/java/modules/core/samples/deployment/serviceModule/org/apache/axis/ModuleHandler1.java
    webservices/axis/trunk/java/modules/core/test/org/apache/axis/deployment/InvalidServiceTest.java
Modified:
    webservices/axis/trunk/java/modules/core/maven.xml
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java

Modified: webservices/axis/trunk/java/modules/core/maven.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/maven.xml?rev=170333&r1=170332&r2=170333&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/maven.xml (original)
+++ webservices/axis/trunk/java/modules/core/maven.xml Mon May 16 00:53:59 2005
@@ -11,8 +11,10 @@
         <j:jelly xmlns="jelly:ant">
 <!--		<ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="src/samples/deployment/service1"/>
-->
 		<ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="samples/deployment/service2"/>
+           <ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="samples/deployment/invalidservice"/>
         <ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="samples/deployment/OutService"/>
 		<ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="samples/deployment/module1"/>
+            <ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="samples/deployment/serviceModule"/>
 	<!--	<ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="samples/deployment/module2"/>
-->
 	</j:jelly>
       <ant:copy file="${basedir}/test-resources/deployment/server.xml" tofile="${basedir}/target/test-resources/deployment/server.xml"/>

Added: webservices/axis/trunk/java/modules/core/samples/deployment/invalidservice/META-INF/service.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/samples/deployment/invalidservice/META-INF/service.xml?rev=170333&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/samples/deployment/invalidservice/META-INF/service.xml
(added)
+++ webservices/axis/trunk/java/modules/core/samples/deployment/invalidservice/META-INF/service.xml
Mon May 16 00:53:59 2005
@@ -0,0 +1,5 @@
+<service name="">
+    <parameter name="ServiceClass" locked="xsd:false">org.apache.axis.InvalidService</parameter>
+    <module ref="serviceModule"/>
+    <operation name="echo"/>
+</service>
\ No newline at end of file

Added: webservices/axis/trunk/java/modules/core/samples/deployment/invalidservice/build.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/samples/deployment/invalidservice/build.xml?rev=170333&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/samples/deployment/invalidservice/build.xml (added)
+++ webservices/axis/trunk/java/modules/core/samples/deployment/invalidservice/build.xml Mon
May 16 00:53:59 2005
@@ -0,0 +1,53 @@
+<?xml version="1.0"?>
+<project basedir="." default="jar">
+	<property name="src" location="."/>
+	<property name="build" location="build"/>
+	<property name="build.classes" location="${build}/classes"/>
+	<property name="build.lib" location="${build}/lib"/>
+	<property name="lib" location="lib"/>
+	<property name="root" location="../../../"/>
+	<property name="jar.dir" location="${root}/target/test-resources/InvalidDeployment/services/"/>
+
+	<path id="axis.test.classpath">
+		<path refid="maven.dependency.classpath"></path>
+		<pathelement location="../../../target/classes"/>
+		<pathelement location="../../../target/test-classes"/>
+	</path>
+
+	<target name="compile" depends="init" unless="jars.uptodate">
+	   <mkdir dir="${build.classes}"/>
+	   <mkdir dir="${build.lib}"/>
+		<javac destdir="${build.classes}" debug="on">
+			<classpath refid="axis.test.classpath" />
+			<src path="${src}"/>
+		</javac>
+	</target>
+
+	<target name="jar" depends="compile" unless="jars.uptodate">
+       <copy todir="${build.classes}/META-INF">
+			<fileset dir="${basedir}/META-INF/">
+			<include name="**/*.xml"/>
+			<exclude name="build.xml"/>
+			</fileset>
+		</copy>
+
+		<mkdir dir="${jar.dir}"/>
+		<jar jarfile="${jar.dir}/invalidService.jar" basedir="${build.classes}" >
+			<include name="**" />
+		</jar>
+		<delete dir="${build}"/>
+	</target>
+
+	<target name="init">
+		<uptodate property="jars.uptodate" targetfile="${jar.dir}/invalidService.jar">
+			<srcfiles dir="${src}">
+				<include name="**/*.java"/>
+				<include name="**/*.xml"/>
+				<include name="**/*.wsdl"/>
+				<exclude name="${build}/**"/>
+			</srcfiles>
+		</uptodate>
+		<echo message="the files are up to date = ${jars.uptodate}"></echo>
+	</target>
+
+</project>

Added: webservices/axis/trunk/java/modules/core/samples/deployment/invalidservice/org/apache/axis/InvalidService.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/samples/deployment/invalidservice/org/apache/axis/InvalidService.java?rev=170333&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/samples/deployment/invalidservice/org/apache/axis/InvalidService.java
(added)
+++ webservices/axis/trunk/java/modules/core/samples/deployment/invalidservice/org/apache/axis/InvalidService.java
Mon May 16 00:53:59 2005
@@ -0,0 +1,32 @@
+package org.apache.axis;
+
+import org.apache.axis.soap.SOAPEnvelope;
+
+/*
+ * 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 16, 2005
+ * Time: 11:49:07 AM
+ */
+public class InvalidService {
+    public SOAPEnvelope echo(SOAPEnvelope in){
+        return in;
+    }    
+}

Added: webservices/axis/trunk/java/modules/core/samples/deployment/serviceModule/META-INF/module.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/samples/deployment/serviceModule/META-INF/module.xml?rev=170333&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/samples/deployment/serviceModule/META-INF/module.xml
(added)
+++ webservices/axis/trunk/java/modules/core/samples/deployment/serviceModule/META-INF/module.xml
Mon May 16 00:53:59 2005
@@ -0,0 +1,28 @@
+<module name="serviceModule" class="org.apache.axis.InavalidModuleImpl">
+    <inflow>
+        <handler name="h1" class="org.apache.axis.ModuleHandler1">
+            <order phase="Dispatch" />
+        </handler>
+        <handler name="h2" class="org.apache.axis.ModuleHandler1">
+             <order phase="TransportIn"/>
+        </handler>
+    </inflow>
+
+    <outflow>
+        <handler name="h3" class="org.apache.axis.ModuleHandler1">
+            <order phase="Dispatch"/>
+        </handler>
+    </outflow>
+
+    <Outfaultflow>
+        <handler name="h4" class="org.apache.axis.ModuleHandler1">
+             <order phase="userphase1"/>
+        </handler>
+    </Outfaultflow>
+
+    <INfaultflow>
+        <handler name="h5" class="org.apache.axis.ModuleHandler1">
+             <order phase="userphase1"/>
+        </handler>
+    </INfaultflow>
+</module>
\ No newline at end of file

Added: webservices/axis/trunk/java/modules/core/samples/deployment/serviceModule/build.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/samples/deployment/serviceModule/build.xml?rev=170333&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/samples/deployment/serviceModule/build.xml (added)
+++ webservices/axis/trunk/java/modules/core/samples/deployment/serviceModule/build.xml Mon
May 16 00:53:59 2005
@@ -0,0 +1,52 @@
+<?xml version="1.0"?>
+<project basedir="." default="jar">
+	<property name="src" location="."/>
+	<property name="build" location="build"/>
+	<property name="build.classes" location="${build}/classes"/>
+	<property name="build.lib" location="${build}/lib"/>
+	<property name="lib" location="lib"/>
+	<property name="root" location="../../../"/>
+	<property name="jar.dir" location="${root}/target/test-resources/InvalidDeployment/modules/"/>
+
+	<path id="axis.test.classpath">
+		<path refid="maven.dependency.classpath"></path>
+		<pathelement location="../../../target/classes"/>
+	</path>
+
+	<target name="compile" depends="init" unless="jars.uptodate">
+	   <mkdir dir="${build.classes}"/>
+	   <mkdir dir="${build.lib}"/>
+		<javac destdir="${build.classes}" debug="on">
+			<classpath refid="axis.test.classpath" />
+			<src path="${src}"/>
+		</javac>
+	</target>
+
+	<target name="jar" depends="compile" unless="jars.uptodate">
+       <copy todir="${build.classes}/META-INF">
+			<fileset dir="${basedir}/META-INF/">
+			<include name="**/*.xml"/>
+			<exclude name="build.xml"/>
+			</fileset>
+		</copy>
+
+		<mkdir dir="${jar.dir}"/>
+		<jar jarfile="${jar.dir}/serviceModule.jar" basedir="${build.classes}" >
+			<include name="**" />
+		</jar>
+		<delete dir="${build}"/>
+	</target>
+
+	<target name="init">
+		<uptodate property="jars.uptodate" targetfile="${jar.dir}/serviceModule.jar">
+			<srcfiles dir="${src}">
+				<include name="**/*.java"/>
+				<include name="**/*.xml"/>
+				<include name="**/*.wsdl"/>
+				<exclude name="${build}/**"/>
+			</srcfiles>
+		</uptodate>
+		<echo message="the files are up to date = ${jars.uptodate}"></echo>
+	</target>
+
+</project>

Added: webservices/axis/trunk/java/modules/core/samples/deployment/serviceModule/org/apache/axis/InavalidModuleImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/samples/deployment/serviceModule/org/apache/axis/InavalidModuleImpl.java?rev=170333&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/samples/deployment/serviceModule/org/apache/axis/InavalidModuleImpl.java
(added)
+++ webservices/axis/trunk/java/modules/core/samples/deployment/serviceModule/org/apache/axis/InavalidModuleImpl.java
Mon May 16 00:53:59 2005
@@ -0,0 +1,40 @@
+package org.apache.axis;
+
+import org.apache.axis.modules.Module;
+import org.apache.axis.engine.AxisConfiguration;
+import org.apache.axis.engine.AxisFault;
+
+/*
+ * 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 16, 2005
+ * Time: 11:41:08 AM
+ */
+public class InavalidModuleImpl implements Module{
+    // initialize the module
+    public void init(AxisConfiguration axisSystem) throws AxisFault {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    // shutdown the module
+    public void shutdown(AxisConfiguration axisSystem) throws AxisFault {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+}

Added: webservices/axis/trunk/java/modules/core/samples/deployment/serviceModule/org/apache/axis/ModuleHandler1.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/samples/deployment/serviceModule/org/apache/axis/ModuleHandler1.java?rev=170333&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/samples/deployment/serviceModule/org/apache/axis/ModuleHandler1.java
(added)
+++ webservices/axis/trunk/java/modules/core/samples/deployment/serviceModule/org/apache/axis/ModuleHandler1.java
Mon May 16 00:53:59 2005
@@ -0,0 +1,58 @@
+package org.apache.axis;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.engine.Handler;
+import org.apache.axis.handlers.AbstractHandler;
+
+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: May 16, 2005
+ * Time: 11:39:25 AM
+ */
+public class ModuleHandler1  extends AbstractHandler implements Handler {
+    private Log log = LogFactory.getLog(getClass());
+    private String message;
+    private QName name;
+    public ModuleHandler1() {
+       this.message = "inside invalid module";
+    }
+    public QName getName() {
+        return name;
+    }
+
+    public void invoke(MessageContext msgContext) throws AxisFault {
+        log.info("I am " + message + " Handler Running :)");
+    }
+
+    public void revoke(MessageContext msgContext) {
+        log.info("I am " + message + " Handler Running :)");
+    }
+
+    public void setName(QName name) {
+        this.name = name;
+    }
+
+}

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=170333&r1=170332&r2=170333&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
Mon May 16 00:53:59 2005
@@ -365,7 +365,6 @@
         int count = flow.getHandlerCount();
         ClassLoader loader1 = currentArchiveFile.getClassLoader();
         for (int j = 0; j < count; j++) {
-            //todo handle exception in properway
             HandlerDescription handlermd = flow.getHandler(j);
             Class handlerClass = null;
             Handler handler;
@@ -430,7 +429,6 @@
     }
 
     public void doDeploy() {
-        //todo complete this
         if (wsToDeploy.size() > 0) {
             for (int i = 0; i < wsToDeploy.size(); i++) {
                 currentArchiveFile = (ArchiveFileData) wsToDeploy.get(i);
@@ -448,17 +446,14 @@
                             log.info("Invalid service" + currentArchiveFile.getName());
                             log.info("DeploymentException  " + de);
                             serviceStatus = "Error:\n" + de.getMessage();
-                            de.printStackTrace();
                         } catch (AxisFault axisFault) {
                             log.info("Invalid service" + currentArchiveFile.getName());
                             log.info("AxisFault  " + axisFault);
                             serviceStatus = "Error:\n" + axisFault.getMessage();
-                            axisFault.printStackTrace();
                         } catch (Exception e) {
                             log.info("Invalid service" + currentArchiveFile.getName());
                             log.info("Exception  " + e);
                             serviceStatus = "Error:\n" + e.getMessage();
-                            e.printStackTrace();
                         } finally {
                             if (serviceStatus.startsWith("Error:")) {
                                 axisConfig.getFaulytServices().put(getAxisServiceName(currentArchiveFile.getName()),
serviceStatus);
@@ -490,7 +485,6 @@
     }
 
     public void unDeploy() {
-        //todo complete this
         String serviceName = "";
         try {
             if (wsToUnDeploy.size() > 0) {

Added: webservices/axis/trunk/java/modules/core/test/org/apache/axis/deployment/InvalidServiceTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis/deployment/InvalidServiceTest.java?rev=170333&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis/deployment/InvalidServiceTest.java
(added)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis/deployment/InvalidServiceTest.java
Mon May 16 00:53:59 2005
@@ -0,0 +1,51 @@
+package org.apache.axis.deployment;
+
+import junit.framework.TestCase;
+import org.apache.axis.context.EngineContextFactory;
+import org.apache.axis.engine.AxisConfiguration;
+
+/*
+ * 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 16, 2005
+ * Time: 12:13:53 PM
+ */
+public class InvalidServiceTest extends TestCase {
+    /**
+     * This is used to test whether service specific module  try to add handlers to system
pre defined phases
+     */
+
+    AxisConfiguration er;
+
+    public void testInvalidService() {
+        try {
+            String filename = "./target/test-resources/InvalidDeployment";
+            EngineContextFactory builder = new EngineContextFactory();
+            er = builder.buildEngineContext(filename).getEngineConfig();
+            String msg = (String) er.getFaulytServices().get("invalidService");
+            if (msg == null || msg.equals("")) {
+                fail("this must failed gracefully with AxisFault ervice specifi module can
not" +
+                        "refer system pre defined phases");
+            }
+        } catch (DeploymentException e) {
+            return;
+        }
+    }
+}



Mime
View raw message