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 ve...@apache.org on 2009/01/27 13:33:51 UTC

svn commit: r738071 - /webservices/axis2/trunk/java/modules/saaj/test/org/apache/axis2/saaj/integration/IntegrationTest.java

Author: veithen
Date: Tue Jan 27 12:33:51 2009
New Revision: 738071

URL: http://svn.apache.org/viewvc?rev=738071&view=rev
Log:
Added test case for AXIS2-1014.

Modified:
    webservices/axis2/trunk/java/modules/saaj/test/org/apache/axis2/saaj/integration/IntegrationTest.java

Modified: webservices/axis2/trunk/java/modules/saaj/test/org/apache/axis2/saaj/integration/IntegrationTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/saaj/test/org/apache/axis2/saaj/integration/IntegrationTest.java?rev=738071&r1=738070&r2=738071&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/test/org/apache/axis2/saaj/integration/IntegrationTest.java (original)
+++ webservices/axis2/trunk/java/modules/saaj/test/org/apache/axis2/saaj/integration/IntegrationTest.java Tue Jan 27 12:33:51 2009
@@ -34,6 +34,7 @@
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -73,6 +74,8 @@
     public static final String SAAJ_REPO =
             System.getProperty("basedir", ".") + "/" + "target/test-resources/saaj-repo";
 
+    private String lastSoapAction; // Stores the last SOAP action received by the server
+
     protected static String getAddress() {
         return "http://127.0.0.1:" +
                 port +
@@ -100,6 +103,7 @@
             public void invokeBusinessLogic(MessageContext inMessage, MessageContext outMessage)
                     throws AxisFault {
                 
+                lastSoapAction = inMessage.getSoapAction();
                 outMessage.setEnvelope(inMessage.getEnvelope());
                 Attachments inAttachments = inMessage.getAttachmentMap();
                 Attachments outAttachments = outMessage.getAttachmentMap();
@@ -383,4 +387,21 @@
         assertTrue(responseStr.indexOf("echo") != -1);
         sCon.close();
     }    
+
+    @Validated @Test @Ignore("AXIS2-1014")
+    public void testCallWithSOAPAction() throws Exception {
+        MessageFactory mf = MessageFactory.newInstance();
+        SOAPMessage request = mf.createMessage();
+
+        String soapAction = "urn:test:echo";
+        
+        request.getSOAPPart().getEnvelope().getBody().addBodyElement(new QName("urn:test", "echo"));
+        request.getMimeHeaders().addHeader("SOAPAction", soapAction);
+
+        SOAPConnection sCon = SOAPConnectionFactory.newInstance().createConnection();
+        sCon.call(request, getAddress());
+        sCon.close();
+        
+        assertEquals(soapAction, lastSoapAction);
+    }
 }