axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hemap...@apache.org
Subject svn commit: r226341 - in /webservices/axis/trunk/java: ./ modules/core/src/org/apache/axis2/engine/ modules/samples/ modules/samples/src/org/apache/axis2/soap12testing/client/ modules/samples/src/org/apache/axis2/soap12testing/server/ modules/samples/t...
Date Fri, 29 Jul 2005 10:23:45 GMT
Author: hemapani
Date: Fri Jul 29 03:23:12 2005
New Revision: 226341

URL: http://svn.apache.org/viewcvs?rev=226341&view=rev
Log:
updates to the SOAP 1.2 test suite 

Modified:
    webservices/axis/trunk/java/maven.xml
    webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java
    webservices/axis/trunk/java/modules/samples/project.xml
    webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/MessageComparator.java
    webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/SOAP12TestClient.java
    webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/SOAPCreater.java
    webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/server/SimpleServer.java
    webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/soap12testing/soap12testsuite/SOAP12Test.java

Modified: webservices/axis/trunk/java/maven.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/maven.xml?rev=226341&r1=226340&r2=226341&view=diff
==============================================================================
--- webservices/axis/trunk/java/maven.xml (original)
+++ webservices/axis/trunk/java/maven.xml Fri Jul 29 03:23:12 2005
@@ -293,6 +293,7 @@
             <fileset dir="modules/xml/target/classes"/>
             <fileset dir="modules/wsdl/target/classes"/>
             <fileset dir="modules/saaj/target/classes"/>
+            <fileset dir="modules/common/target/classes"/>
             <fileset dir="modules/addressing/target/">
                 <include name="modules/addressing.mar"/>
             </fileset>

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java?rev=226341&r1=226340&r2=226341&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java
Fri Jul 29 03:23:12 2005
@@ -63,25 +63,26 @@
      */
     public ServiceDescription findService(MessageContext messageContext) throws AxisFault
{
         final String URI_ID_STRING = "/services";
-        OMElement bodyFirstChild = messageContext.getEnvelope().getBody()
-                .getFirstElement();
-        OMNamespace ns = bodyFirstChild.getNamespace();
-        if (ns != null) {
-            String filePart = ns.getName();
+        OMElement bodyFirstChild = messageContext.getEnvelope().getBody().getFirstElement();
+                
+        if(bodyFirstChild != null){
+            OMNamespace ns = bodyFirstChild.getNamespace();
+            if (ns != null) {
+                String filePart = ns.getName();
 
-            String[] values = Utils.parseRequestURLForServiceAndOperation(
-                    filePart);
-            if (values[1] != null) {
-                operatoinName = new QName(values[1]);
+                String[] values = Utils.parseRequestURLForServiceAndOperation(
+                        filePart);
+                if (values[1] != null) {
+                    operatoinName = new QName(values[1]);
+                }
+                if (values[0] != null) {
+                    serviceName = new QName(values[0]);
+                    AxisConfiguration registry =
+                            messageContext.getSystemContext().getAxisConfiguration();
+                    return registry.getService(serviceName);
+                }
             }
-            if (values[0] != null) {
-                serviceName = new QName(values[0]);
-                AxisConfiguration registry =
-                        messageContext.getSystemContext().getAxisConfiguration();
-                return registry.getService(serviceName);
-            }
-        }
+        }        
         return null;
-
     }
 }

Modified: webservices/axis/trunk/java/modules/samples/project.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/project.xml?rev=226341&r1=226340&r2=226341&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/project.xml (original)
+++ webservices/axis/trunk/java/modules/samples/project.xml Fri Jul 29 03:23:12 2005
@@ -166,9 +166,10 @@
                 <exclude>**/*InteropStubTest.java</exclude>
                 <exclude>**/*EchoRawXMLChunckedTest.java</exclude>
                 <exclude>**org/apache/axis2/mail/*.java</exclude>
-                <exclude>**/*SOAP12Test.java</exclude>
+                <!--
+		<exclude>**/*SOAP12Test.java</exclude>
                 <exclude>**/*SOAP12TestWithFaults.java</exclude>
-
+		-->
                 <!--		<exclude>**/*MailEchoRawXMLTest.java</exclude>
                 <exclude>**/*MailOneWayRawXMLTest.java</exclude>
                 <exclude>**/*MailRequestResponseRawXMLTest.java</exclude>

Modified: webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/MessageComparator.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/MessageComparator.java?rev=226341&r1=226340&r2=226341&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/MessageComparator.java
(original)
+++ webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/MessageComparator.java
Fri Jul 29 03:23:12 2005
@@ -30,12 +30,15 @@
 import java.util.Map;
 
 public class MessageComparator {
+    //public static final String TEST_MAIN_DIR = "./modules/samples/";
+    public static final String TEST_MAIN_DIR = "./";
+    
+    
     public boolean compare(String testNumber, InputStream replyMessage) {
         SOAPEnvelope replyMessageEnvelope;
         SOAPEnvelope requiredMessageEnvelope;
         try {
-//            File file = new File("D:\\Projects\\LSF\\Axis2\\Axis1.0\\modules\\samples/test-resources\\SOAP12Testing\\ReplyMessages\\SOAP12ResT"
+ testNumber + ".xml");
-            File file = new File("test-resources\\SOAP12Testing\\ReplyMessages\\SOAP12ResT"
+ testNumber + ".xml");
+            File file = new File(TEST_MAIN_DIR+"test-resources/SOAP12Testing/ReplyMessages/SOAP12ResT"
+ testNumber + ".xml");
 
             HTTPTransportReceiver receiver = new HTTPTransportReceiver();
             Map map = receiver.parseTheHeaders(replyMessage, false);

Modified: webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/SOAP12TestClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/SOAP12TestClient.java?rev=226341&r1=226340&r2=226341&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/SOAP12TestClient.java
(original)
+++ webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/SOAP12TestClient.java
Fri Jul 29 03:23:12 2005
@@ -16,14 +16,14 @@
 
 package org.apache.axis2.soap12testing.client;
 
-import org.apache.axis2.soap.impl.llom.soap12.SOAP12Constants;
-import org.apache.axis2.transport.http.HTTPConstants;
-
-import java.net.HttpURLConnection;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.net.MalformedURLException;
+import java.net.Socket;
 import java.net.URL;
-import java.net.*;
-import java.io.*;
-import java.util.Iterator;
 
 public class SOAP12TestClient {
     public String getReply(int port, String webserviceName,String testNumber) {
@@ -75,6 +75,7 @@
             System.out.println("Message: " + requestMessage);
             out.println(requestMessage);
             out.flush();
+            socket.shutdownOutput();
             return socket.getInputStream();
         } catch (MalformedURLException e) {
             e.printStackTrace();

Modified: webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/SOAPCreater.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/SOAPCreater.java?rev=226341&r1=226340&r2=226341&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/SOAPCreater.java
(original)
+++ webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/SOAPCreater.java
Fri Jul 29 03:23:12 2005
@@ -16,53 +16,54 @@
 
 package org.apache.axis2.soap12testing.client;
 
+import java.io.BufferedInputStream;
+import java.io.DataInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.net.URL;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.axis2.om.OMXMLParserWrapper;
 import org.apache.axis2.soap.SOAPEnvelope;
 import org.apache.axis2.soap.impl.llom.builder.StAXSOAPModelBuilder;
 import org.apache.axis2.soap.impl.llom.soap12.SOAP12Constants;
-import org.apache.axis2.soap.impl.llom.soap11.SOAP11Constants;
-import org.apache.axis2.om.OMXMLParserWrapper;
 import org.apache.axis2.transport.http.HTTPConstants;
 
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLInputFactory;
-import java.io.*;
-import java.net.URL;
-
 public class SOAPCreater {
-    public String getStringFromSOAPMessage(String testNumber , URL url) {
-        //D:\Projects\LSF\Axis2\Axis1.0\modules\samples\target\Repository
-//        File file = new File("D:\\Projects\\LSF\\Axis2\\Axis1.0\\modules\\samples/test-resources\\SOAP12Testing\\RequestMessages\\SOAP12ReqT"
+ testNumber + ".xml");
-        File file = new File("./test-resources\\SOAP12Testing\\RequestMessages\\SOAP12ReqT"
+ testNumber + ".xml");
-        try {
-            FileInputStream stream = new FileInputStream(file);
-            BufferedInputStream bf = new BufferedInputStream(stream);
-            DataInputStream ds = new DataInputStream(bf);
-            StringBuffer sb = new StringBuffer();
-
-            sb.append(HTTPConstants.HEADER_POST).append(" ");
-            sb.append(url.getFile()).append(" ").append(HTTPConstants.HEADER_PROTOCOL_10).append(
-                    "\n");
-            sb.append(HTTPConstants.HEADER_CONTENT_TYPE).append(": ")
-                    .append(SOAP12Constants.SOAP_12_CONTENT_TYPE);
-            sb.append("; charset=utf-8\n");
-            sb.append("\n");
-
-            String record;
-            while ((record = ds.readLine()) != null) {
-                sb.append(record.trim());
-            }
-            return sb.toString();
-        } catch (Exception e) {
-            return "";
+    public String getStringFromSOAPMessage(String testNumber, URL url) throws IOException
{
+        File file =
+            new File(
+                MessageComparator.TEST_MAIN_DIR + "test-resources/SOAP12Testing/RequestMessages/SOAP12ReqT"
+ testNumber + ".xml");
+        FileInputStream stream = new FileInputStream(file);
+        BufferedInputStream bf = new BufferedInputStream(stream);
+        DataInputStream ds = new DataInputStream(bf);
+        StringBuffer sb = new StringBuffer();
+
+        sb.append(HTTPConstants.HEADER_POST).append(" ");
+        sb.append(url.getFile()).append(" ").append(HTTPConstants.HEADER_PROTOCOL_10).append("\n");
+        sb.append(HTTPConstants.HEADER_CONTENT_TYPE).append(": ").append(
+            SOAP12Constants.SOAP_12_CONTENT_TYPE);
+        sb.append("; charset=utf-8\n");
+        sb.append("\n");
+
+        String record;
+        while ((record = ds.readLine()) != null) {
+            sb.append(record.trim());
         }
+        return sb.toString();
     }
 
     public SOAPEnvelope getEnvelopeFromSOAPMessage(String pathAndFileName) {
         File file = new File(pathAndFileName);
         try {
-            XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(new
FileReader(file));
-            OMXMLParserWrapper builder = new StAXSOAPModelBuilder(parser,null);
-            return (SOAPEnvelope) builder.getDocumentElement();            
+            XMLStreamReader parser =
+                XMLInputFactory.newInstance().createXMLStreamReader(new FileReader(file));
+            OMXMLParserWrapper builder = new StAXSOAPModelBuilder(parser, null);
+            return (SOAPEnvelope) builder.getDocumentElement();
         } catch (Exception e) {
             e.printStackTrace();
         }

Modified: webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/server/SimpleServer.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/server/SimpleServer.java?rev=226341&r1=226340&r2=226341&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/server/SimpleServer.java
(original)
+++ webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/server/SimpleServer.java
Fri Jul 29 03:23:12 2005
@@ -16,12 +16,13 @@
 
 package org.apache.axis2.soap12testing.server;
 
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.transport.http.SimpleHTTPServer;
-
 import java.io.File;
 import java.net.ServerSocket;
 
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.soap12testing.client.MessageComparator;
+import org.apache.axis2.transport.http.SimpleHTTPServer;
+
 public class SimpleServer {
     private int port;
 
@@ -37,8 +38,11 @@
         try {
             ServerSocket serverSoc = null;
             serverSoc = new ServerSocket(port);
-            SimpleHTTPServer reciver = new SimpleHTTPServer("./target/Repository", serverSoc);
-//            SimpleHTTPServer reciver = new SimpleHTTPServer("D:\\Projects\\LSF\\Axis2\\Axis1.0\\modules\\samples\\target\\Repository",
serverSoc);
+            File file = new File(MessageComparator.TEST_MAIN_DIR+ "target/Repository");
+            if(!file.exists()){
+                throw new AxisFault(file.getAbsolutePath() + " File does not exisits");
+            }
+            SimpleHTTPServer reciver = new SimpleHTTPServer(file.getAbsolutePath(), serverSoc);
             Thread thread = new Thread(reciver);
             thread.setDaemon(true);
             thread.start();

Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/soap12testing/soap12testsuite/SOAP12Test.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/soap12testing/soap12testsuite/SOAP12Test.java?rev=226341&r1=226340&r2=226341&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/soap12testing/soap12testsuite/SOAP12Test.java
(original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/soap12testing/soap12testsuite/SOAP12Test.java
Fri Jul 29 03:23:12 2005
@@ -17,11 +17,10 @@
 package org.apache.axis2.soap12testing.soap12testsuite;
 
 import junit.framework.TestCase;
-import org.apache.axis2.soap12testing.server.SimpleServer;
-import org.apache.axis2.soap12testing.client.SOAP12TestClient;
-import org.apache.axis2.soap12testing.client.MessageComparator;
 
-import java.io.InputStream;
+import org.apache.axis2.soap12testing.client.MessageComparator;
+import org.apache.axis2.soap12testing.client.SOAP12TestClient;
+import org.apache.axis2.soap12testing.server.SimpleServer;
 
 public class SOAP12Test extends TestCase {
     private SimpleServer server;



Mime
View raw message