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 gd...@apache.org on 2008/08/10 05:51:39 UTC

svn commit: r684405 - /webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/SoapMessageMUProviderTests.java

Author: gdaniels
Date: Sat Aug  9 20:51:39 2008
New Revision: 684405

URL: http://svn.apache.org/viewvc?rev=684405&view=rev
Log:
Don't swallow exceptions, as we'd really like to see the stack trace.

Modified:
    webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/SoapMessageMUProviderTests.java

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/SoapMessageMUProviderTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/SoapMessageMUProviderTests.java?rev=684405&r1=684404&r2=684405&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/SoapMessageMUProviderTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/SoapMessageMUProviderTests.java Sat Aug  9 20:51:39 2008
@@ -52,7 +52,7 @@
     /**
      * Test soap message with no MU headers
      */
-    public void testNoMustUnderstandHeaders() {
+    public void testNoMustUnderstandHeaders() throws Exception {
         System.out.println("testNoMustUnderstandHeaders");
         // create a service
         Service svc = Service.create(serviceName);
@@ -68,22 +68,18 @@
 
         SOAPMessage message = AttachmentUtil.toSOAPMessage(AttachmentUtil.msgEnvPlain);
 
-        try {
-            SOAPMessage response = dispatch.invoke(message);
+        SOAPMessage response = dispatch.invoke(message);
 
-            String string = AttachmentUtil.toString(response);
-            assertTrue(string.equalsIgnoreCase(AttachmentUtil.XML_HEADER
-                    + AttachmentUtil.msgEnvPlain));
+        String string = AttachmentUtil.toString(response);
+        assertTrue(string.equalsIgnoreCase(AttachmentUtil.XML_HEADER
+                                           + AttachmentUtil.msgEnvPlain));
             
-            // Try a second time
-            response = dispatch.invoke(message);
+        // Try a second time
+        response = dispatch.invoke(message);
 
-            string = AttachmentUtil.toString(response);
-            assertTrue(string.equalsIgnoreCase(AttachmentUtil.XML_HEADER
-                    + AttachmentUtil.msgEnvPlain));
-        } catch (Exception e) {
-            fail("Unexpected Exception: " + e.getMessage());
-        }
+        string = AttachmentUtil.toString(response);
+        assertTrue(string.equalsIgnoreCase(AttachmentUtil.XML_HEADER
+                                           + AttachmentUtil.msgEnvPlain));
     }
 
     /**
@@ -167,7 +163,7 @@
      * outbound soap message for headers that should be understood.  Should not cause an 
      * exception.
      */
-    public void testClientRequestUnderstoodHeaders() {
+    public void testClientRequestUnderstoodHeaders() throws Exception {
         System.out.println("testClientRequestUnderstoodHeaders");
         // create a service
         Service svc = Service.create(serviceName);
@@ -184,18 +180,10 @@
 
         SOAPMessage message = AttachmentUtil.toSOAPMessage(AttachmentUtil.msgEnvMU_understood);
 
-        try {
-            dispatch.invoke(message);
-        } catch (Exception e) {
-            fail("Should not have received fault for headers that were understood.  " + e.getMessage());
-        }
-        
+        dispatch.invoke(message);
+
         // Try a second time
-        try {
-            dispatch.invoke(message);
-        } catch (Exception e) {
-            fail("Should not have received fault for headers that were understood.  " + e.getMessage());
-        }
+        dispatch.invoke(message);
     }
 
     /**
@@ -203,7 +191,7 @@
      * outbound soap message (i.e. the inbound response to the client) for headers that
      * are understood.  Should not cause an exception.
      */
-    public void testClientResponseUnderstoodHeaders() {
+    public void testClientResponseUnderstoodHeaders() throws Exception {
         System.out.println("testClientResponseUnderstoodHeaders");
         // create a service
         Service svc = Service.create(serviceName);
@@ -220,17 +208,9 @@
 
         SOAPMessage message = AttachmentUtil.toSOAPMessage(AttachmentUtil.msgEnv_understood);
 
-        try {
-            dispatch.invoke(message);
-        } catch (Exception e) {
-            fail("Should not have received fault for headers that were understood.  " + e.getMessage());
-        }
-        
+        dispatch.invoke(message);
+
         // Try a second time
-        try {
-            dispatch.invoke(message);
-        } catch (Exception e) {
-            fail("Should not have received fault for headers that were understood.  " + e.getMessage());
-        }
+        dispatch.invoke(message);
     }
 }