axis-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1029125 [2/2] - in /axis/axis2/java/core/branches/1_5: ./ modules/distribution/ modules/kernel/src/org/apache/axis2/transport/http/util/ modules/kernel/test/org/apache/axis2/transport/http/util/ modules/parent/ modules/saaj/ modules/saaj/s...
Date Sat, 30 Oct 2010 17:26:28 GMT
Modified: axis/axis2/java/core/branches/1_5/modules/saaj/test/org/apache/axis2/saaj/SOAPFaultTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/1_5/modules/saaj/test/org/apache/axis2/saaj/SOAPFaultTest.java?rev=1029125&r1=1029124&r2=1029125&view=diff
==============================================================================
--- axis/axis2/java/core/branches/1_5/modules/saaj/test/org/apache/axis2/saaj/SOAPFaultTest.java (original)
+++ axis/axis2/java/core/branches/1_5/modules/saaj/test/org/apache/axis2/saaj/SOAPFaultTest.java Sat Oct 30 17:26:27 2010
@@ -155,27 +155,22 @@ public class SOAPFaultTest extends TestC
         assertTrue(xml.indexOf("<faultactor>http://gizmos.com/order</faultactor>") != -1);
     }
 
-    public void testAddDetailsTwice() {
-        try {
-            MessageFactory fac = MessageFactory.newInstance();
+    public void testAddDetailsTwice() throws Exception {
+        MessageFactory fac = MessageFactory.newInstance();
 
-            //Create the response to the message
-            SOAPMessage soapMessage = fac.createMessage();
-            SOAPPart soapPart = soapMessage.getSOAPPart();
-            SOAPEnvelope envelope = soapPart.getEnvelope();
-            envelope.addNamespaceDeclaration("cwmp", "http://cwmp.com");
-            SOAPBody body = envelope.getBody();
-
-            body.addFault().addDetail();
-            try {
-                body.getFault().addDetail();
-                fail("Expected Exception did not occur");
-            } catch (SOAPException e) {
-                assertTrue(true);
-            }
+        //Create the response to the message
+        SOAPMessage soapMessage = fac.createMessage();
+        SOAPPart soapPart = soapMessage.getSOAPPart();
+        SOAPEnvelope envelope = soapPart.getEnvelope();
+        envelope.addNamespaceDeclaration("cwmp", "http://cwmp.com");
+        SOAPBody body = envelope.getBody();
 
+        body.addFault().addDetail();
+        try {
+            body.getFault().addDetail();
+            fail("Expected Exception did not occur");
         } catch (SOAPException e) {
-            fail("Unexpected Exception Occurred : " + e);
+            assertTrue(true);
         }
     }
 
@@ -199,96 +194,84 @@ public class SOAPFaultTest extends TestC
         assertTrue(xml.indexOf("Hello") != -1);
     }
 
-    public void testFaults() {
-        try {
-            MessageFactory messageFactory = MessageFactory.newInstance();
-            SOAPFactory soapFactory = SOAPFactory.newInstance();
-            SOAPMessage message = messageFactory.createMessage();
-            SOAPBody body = message.getSOAPBody();
-            SOAPFault fault = body.addFault();
-
-            Name faultName =
-                    soapFactory.createName("Client", "",
-                                           SOAPConstants.URI_NS_SOAP_ENVELOPE);
-            fault.setFaultCode(faultName);
-
-            fault.setFaultString("Message does not have necessary info");
-            fault.setFaultActor("http://gizmos.com/order");
-
-            Detail detail = fault.addDetail();
-
-            Name entryName =
-                    soapFactory.createName("order", "PO",
-                                           "http://gizmos.com/orders/");
-            DetailEntry entry = detail.addDetailEntry(entryName);
-            entry.addTextNode("Quantity element does not have a value");
-
-            Name entryName2 =
-                    soapFactory.createName("confirmation", "PO",
-                                           "http://gizmos.com/confirm");
-            DetailEntry entry2 = detail.addDetailEntry(entryName2);
-            entry2.addTextNode("Incomplete address: " + "no zip code");
-
-            message.saveChanges();
-            //message.writeTo(System.out);
-
-            // Now retrieve the SOAPFault object and
-            // its contents, after checking to see that
-            // there is one
-            if (body.hasFault()) {
-                SOAPFault newFault = body.getFault();
-
-                // Get the qualified name of the fault code
-                assertNotNull(newFault.getFaultCodeAsName());
-                assertNotNull(newFault.getFaultString());
-                assertNotNull(newFault.getFaultActor());
-                Detail newDetail = newFault.getDetail();
-
-                if (newDetail != null) {
-                    Iterator entries = newDetail.getDetailEntries();
-
-                    while (entries.hasNext()) {
-                        DetailEntry newEntry = (DetailEntry)entries.next();
-                        String value = newEntry.getValue();
-                        assertNotNull(value);
-                    }
+    public void testFaults() throws Exception {
+        MessageFactory messageFactory = MessageFactory.newInstance();
+        SOAPFactory soapFactory = SOAPFactory.newInstance();
+        SOAPMessage message = messageFactory.createMessage();
+        SOAPBody body = message.getSOAPBody();
+        SOAPFault fault = body.addFault();
+
+        Name faultName =
+                soapFactory.createName("Client", "",
+                                       SOAPConstants.URI_NS_SOAP_ENVELOPE);
+        fault.setFaultCode(faultName);
+
+        fault.setFaultString("Message does not have necessary info");
+        fault.setFaultActor("http://gizmos.com/order");
+
+        Detail detail = fault.addDetail();
+
+        Name entryName =
+                soapFactory.createName("order", "PO",
+                                       "http://gizmos.com/orders/");
+        DetailEntry entry = detail.addDetailEntry(entryName);
+        entry.addTextNode("Quantity element does not have a value");
+
+        Name entryName2 =
+                soapFactory.createName("confirmation", "PO",
+                                       "http://gizmos.com/confirm");
+        DetailEntry entry2 = detail.addDetailEntry(entryName2);
+        entry2.addTextNode("Incomplete address: " + "no zip code");
+
+        message.saveChanges();
+        //message.writeTo(System.out);
+
+        // Now retrieve the SOAPFault object and
+        // its contents, after checking to see that
+        // there is one
+        if (body.hasFault()) {
+            SOAPFault newFault = body.getFault();
+
+            // Get the qualified name of the fault code
+            assertNotNull(newFault.getFaultCodeAsName());
+            assertNotNull(newFault.getFaultString());
+            assertNotNull(newFault.getFaultActor());
+            Detail newDetail = newFault.getDetail();
+
+            if (newDetail != null) {
+                Iterator entries = newDetail.getDetailEntries();
+
+                while (entries.hasNext()) {
+                    DetailEntry newEntry = (DetailEntry)entries.next();
+                    String value = newEntry.getValue();
+                    assertNotNull(value);
                 }
             }
-        } catch (Exception e) {
-            fail("Unexpected Exception : " + e);
         }
     }
 
-    public void testGetFaultActor() {
-        try {
-            SOAPMessage msg = MessageFactory.newInstance().createMessage();
-            SOAPFault sf = msg.getSOAPBody().addFault();
-            sf.setFaultActor("/faultActorURI");
-            sf.setFaultActor("/faultActorURI2");
-            String result = sf.getFaultActor();
+    public void testGetFaultActor() throws Exception {
+        SOAPMessage msg = MessageFactory.newInstance().createMessage();
+        SOAPFault sf = msg.getSOAPBody().addFault();
+        sf.setFaultActor("/faultActorURI");
+        sf.setFaultActor("/faultActorURI2");
+        String result = sf.getFaultActor();
 
-            if (!result.equals("/faultActorURI2")) {
-                fail("Fault Actor not properly set");
-            }
-        } catch (Exception e) {
-            fail("Unexpected Exception : " + e);
+        if (!result.equals("/faultActorURI2")) {
+            fail("Fault Actor not properly set");
         }
     }
 
-    public void testGetFaultString() {
-        try {
-            SOAPMessage msg = MessageFactory.newInstance().createMessage();
-            SOAPFault sf = msg.getSOAPBody().addFault();
+    public void testGetFaultString() throws Exception {
+        SOAPMessage msg = MessageFactory.newInstance().createMessage();
+        SOAPFault sf = msg.getSOAPBody().addFault();
 
-            sf.setFaultString("1st Fault String");
-            sf.setFaultString("2nd Fault String");
-            String result = sf.getFaultString();
+        sf.setFaultString("1st Fault String");
+        sf.setFaultString("2nd Fault String");
+        String result = sf.getFaultString();
 
-            if (!result.equals("2nd Fault String")) {
-                fail("Fault String not properly set");
-            }
-        } catch (Exception e) {
-            fail("Unexpected Exception : " + e);
+        if (!result.equals("2nd Fault String")) {
+            fail("Fault String not properly set");
         }
     }
 
@@ -373,109 +356,90 @@ public class SOAPFaultTest extends TestC
         }
     }
 
-    public void _testGetFaultReasonTexts() {
-        try {
-            MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
-
-            SOAPMessage soapMessage = fac.createMessage();
-            SOAPPart soapPart = soapMessage.getSOAPPart();
+    public void _testGetFaultReasonTexts() throws Exception {
+        MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
 
-            SOAPEnvelope envelope = soapPart.getEnvelope();
-            envelope.addNamespaceDeclaration("cwmp", "http://cwmp.com");
-            SOAPBody body = envelope.getBody();
-            SOAPFault soapFault = body.addFault();
-            soapFault.addFaultReasonText("myReason", new Locale("en"));
-            soapFault.addFaultReasonText("de-myReason", new Locale("de"));
-            soapFault.addFaultReasonText("si-myReason", new Locale("si"));
-            soapMessage.saveChanges();
-            Iterator reasonTexts = soapFault.getFaultReasonTexts();
-            while (reasonTexts.hasNext()) {
-                String reasonText = (String)reasonTexts.next();
-                assertNotNull(reasonText);
-            }
+        SOAPMessage soapMessage = fac.createMessage();
+        SOAPPart soapPart = soapMessage.getSOAPPart();
 
-        } catch (Exception e) {
-            fail("Unexpected Exception : " + e);
+        SOAPEnvelope envelope = soapPart.getEnvelope();
+        envelope.addNamespaceDeclaration("cwmp", "http://cwmp.com");
+        SOAPBody body = envelope.getBody();
+        SOAPFault soapFault = body.addFault();
+        soapFault.addFaultReasonText("myReason", new Locale("en"));
+        soapFault.addFaultReasonText("de-myReason", new Locale("de"));
+        soapFault.addFaultReasonText("si-myReason", new Locale("si"));
+        soapMessage.saveChanges();
+        Iterator reasonTexts = soapFault.getFaultReasonTexts();
+        while (reasonTexts.hasNext()) {
+            String reasonText = (String)reasonTexts.next();
+            assertNotNull(reasonText);
         }
     }
 
-    public void _testAddFaultReasonText1() {
-        try {
-            MessageFactory fac = MessageFactory.newInstance();
-            SOAPMessage soapMessage = fac.createMessage();
-            SOAPPart soapPart = soapMessage.getSOAPPart();
-
-            SOAPEnvelope envelope = soapPart.getEnvelope();
-            envelope.addNamespaceDeclaration("cwmp", "http://cwmp.com");
-            SOAPBody body = envelope.getBody();
-            SOAPFault soapFault = body.addFault();
-            soapFault.addFaultReasonText("myReason", Locale.ENGLISH);
-            soapMessage.saveChanges();
+    public void _testAddFaultReasonText1() throws Exception {
+        MessageFactory fac = MessageFactory.newInstance();
+        SOAPMessage soapMessage = fac.createMessage();
+        SOAPPart soapPart = soapMessage.getSOAPPart();
 
-        } catch (SOAPException e) {
-            fail("Unexpected Exception Occurred : " + e);
-        }
+        SOAPEnvelope envelope = soapPart.getEnvelope();
+        envelope.addNamespaceDeclaration("cwmp", "http://cwmp.com");
+        SOAPBody body = envelope.getBody();
+        SOAPFault soapFault = body.addFault();
+        soapFault.addFaultReasonText("myReason", Locale.ENGLISH);
+        soapMessage.saveChanges();
     }
 
-    public void testAddFaultReasonText2() {
-        try {
-            MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
-            SOAPMessage soapMessage = fac.createMessage();
-            SOAPPart soapPart = soapMessage.getSOAPPart();
-
-            SOAPEnvelope envelope = soapPart.getEnvelope();
-            envelope.addNamespaceDeclaration("cwmp", "http://cwmp.com");
-            SOAPBody body = envelope.getBody();
-            SOAPFault soapFault = body.addFault();
-            soapFault.addFaultReasonText("myReason", new Locale("en"));
-            soapFault.addFaultReasonText("de-myReason", new Locale("de"));
-            soapFault.addFaultReasonText("si-myReason", new Locale("si"));
-            soapMessage.saveChanges();
+    public void testAddFaultReasonText2() throws Exception {
+        MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
+        SOAPMessage soapMessage = fac.createMessage();
+        SOAPPart soapPart = soapMessage.getSOAPPart();
 
-        } catch (SOAPException e) {
-            fail("Unexpected Exception Occurred : " + e);
-        }
+        SOAPEnvelope envelope = soapPart.getEnvelope();
+        envelope.addNamespaceDeclaration("cwmp", "http://cwmp.com");
+        SOAPBody body = envelope.getBody();
+        SOAPFault soapFault = body.addFault();
+        soapFault.addFaultReasonText("myReason", new Locale("en"));
+        soapFault.addFaultReasonText("de-myReason", new Locale("de"));
+        soapFault.addFaultReasonText("si-myReason", new Locale("si"));
+        soapMessage.saveChanges();
     }
 
-    public void testAddFaultReasonText3() {
-        try {
-            MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
-            SOAPMessage soapMessage = fac.createMessage();
-            SOAPPart soapPart = soapMessage.getSOAPPart();
-
-            SOAPEnvelope envelope = soapPart.getEnvelope();
-            SOAPBody body = envelope.getBody();
-            SOAPFault sf = body.addFault();
-            
-            String expected = "Its my fault again";
-            boolean found = false;
-            sf.addFaultReasonText("Its my fault", Locale.ENGLISH);
-            sf.addFaultReasonText(expected, Locale.ENGLISH);
-            Iterator i = sf.getFaultReasonTexts();
-            int j = 0;
-            while (i.hasNext()) {
-                Object o = i.next();
-                if (o != null && o instanceof String) {
-                    String actual = (String)o;
-                    if (actual.equals(expected)) {
-                        if (!found) {
-                            found = true;
-                        }
+    public void testAddFaultReasonText3() throws Exception {
+        MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
+        SOAPMessage soapMessage = fac.createMessage();
+        SOAPPart soapPart = soapMessage.getSOAPPart();
+
+        SOAPEnvelope envelope = soapPart.getEnvelope();
+        SOAPBody body = envelope.getBody();
+        SOAPFault sf = body.addFault();
+        
+        String expected = "Its my fault again";
+        boolean found = false;
+        sf.addFaultReasonText("Its my fault", Locale.ENGLISH);
+        sf.addFaultReasonText(expected, Locale.ENGLISH);
+        Iterator i = sf.getFaultReasonTexts();
+        int j = 0;
+        while (i.hasNext()) {
+            Object o = i.next();
+            if (o != null && o instanceof String) {
+                String actual = (String)o;
+                if (actual.equals(expected)) {
+                    if (!found) {
+                        found = true;
                     }
                 }
-                j++;
             }
-            if (j < 1) {
-                fail("No reason text was returned");
-            }
-            if (j > 1) {
-                fail("More than one reason text was returned");
-            }
-            if (!found) {
-                fail("The following Reason text was not received: '" + expected + "'");
-            }
-        } catch (SOAPException e) {
-            fail("Unexpected Exception Occurred : " + e);
+            j++;
+        }
+        if (j < 1) {
+            fail("No reason text was returned");
+        }
+        if (j > 1) {
+            fail("More than one reason text was returned");
+        }
+        if (!found) {
+            fail("The following Reason text was not received: '" + expected + "'");
         }
     }
 
@@ -528,339 +492,279 @@ public class SOAPFaultTest extends TestC
     }
 
 
-    public void testSetFaultRole() {
-        try {
-            MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
-
-            SOAPMessage soapMessage = fac.createMessage();
-            SOAPPart soapPart = soapMessage.getSOAPPart();
+    public void testSetFaultRole() throws Exception {
+        MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
 
-            SOAPEnvelope envelope = soapPart.getEnvelope();
-            envelope.addNamespaceDeclaration("cwmp", "http://cwmp.com");
-            SOAPBody body = envelope.getBody();
-            SOAPFault soapFault = body.addFault();
-            soapFault.setFaultRole("test");
-            soapMessage.saveChanges();
+        SOAPMessage soapMessage = fac.createMessage();
+        SOAPPart soapPart = soapMessage.getSOAPPart();
 
-        } catch (SOAPException e) {
-            fail("Unexpected Exception Occurred : " + e);
-        }
+        SOAPEnvelope envelope = soapPart.getEnvelope();
+        envelope.addNamespaceDeclaration("cwmp", "http://cwmp.com");
+        SOAPBody body = envelope.getBody();
+        SOAPFault soapFault = body.addFault();
+        soapFault.setFaultRole("test");
+        soapMessage.saveChanges();
     }
 
-    public void testSetFaultNode() {
-        try {
-            MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
-
-            SOAPMessage soapMessage = fac.createMessage();
-            SOAPPart soapPart = soapMessage.getSOAPPart();
+    public void testSetFaultNode() throws Exception {
+        MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
 
-            SOAPEnvelope envelope = soapPart.getEnvelope();
-            envelope.addNamespaceDeclaration("cwmp", "http://cwmp.com");
-            SOAPBody body = envelope.getBody();
-            SOAPFault soapFault = body.addFault();
-            soapFault.setFaultNode("test");
-            soapMessage.saveChanges();
+        SOAPMessage soapMessage = fac.createMessage();
+        SOAPPart soapPart = soapMessage.getSOAPPart();
 
-        } catch (SOAPException e) {
-            fail("Unexpected Exception Occurred : " + e);
-        }
+        SOAPEnvelope envelope = soapPart.getEnvelope();
+        envelope.addNamespaceDeclaration("cwmp", "http://cwmp.com");
+        SOAPBody body = envelope.getBody();
+        SOAPFault soapFault = body.addFault();
+        soapFault.setFaultNode("test");
+        soapMessage.saveChanges();
     }
 
-    public void _testGetFaultReasonText() {
-        try {
-            MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
+    public void _testGetFaultReasonText() throws Exception {
+        MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
 
-            SOAPMessage soapMessage = fac.createMessage();
-            SOAPPart soapPart = soapMessage.getSOAPPart();
+        SOAPMessage soapMessage = fac.createMessage();
+        SOAPPart soapPart = soapMessage.getSOAPPart();
 
-            SOAPEnvelope envelope = soapPart.getEnvelope();
-            envelope.addNamespaceDeclaration("cwmp", "http://cwmp.com");
-            SOAPBody body = envelope.getBody();
-            SOAPFault soapFault = body.addFault();
-            soapFault.addFaultReasonText("myReason", new Locale("en"));
-            soapFault.addFaultReasonText("de-myReason", new Locale("de"));
-            soapFault.addFaultReasonText("si-myReason", new Locale("si"));
-            soapMessage.saveChanges();
+        SOAPEnvelope envelope = soapPart.getEnvelope();
+        envelope.addNamespaceDeclaration("cwmp", "http://cwmp.com");
+        SOAPBody body = envelope.getBody();
+        SOAPFault soapFault = body.addFault();
+        soapFault.addFaultReasonText("myReason", new Locale("en"));
+        soapFault.addFaultReasonText("de-myReason", new Locale("de"));
+        soapFault.addFaultReasonText("si-myReason", new Locale("si"));
+        soapMessage.saveChanges();
 
-            String faultReasonText = soapFault.getFaultReasonText(new Locale("si"));
-            assertNotNull(faultReasonText);
-            faultReasonText = soapFault.getFaultReasonText(new Locale("ja"));
-            assertNull(faultReasonText);
-            
-        } catch (Exception e) {
-            fail("Unexpected Exception : " + e);
-        }
+        String faultReasonText = soapFault.getFaultReasonText(new Locale("si"));
+        assertNotNull(faultReasonText);
+        faultReasonText = soapFault.getFaultReasonText(new Locale("ja"));
+        assertNull(faultReasonText);
     }
 
 
-    public void _testGetFaultCodeAsQName() {
-        try {
-            //MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
-            MessageFactory fac = MessageFactory.newInstance();
-
-            SOAPMessage soapMessage = fac.createMessage();
-            SOAPPart soapPart = soapMessage.getSOAPPart();
+    public void _testGetFaultCodeAsQName() throws Exception {
+        //MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
+        MessageFactory fac = MessageFactory.newInstance();
 
-            SOAPEnvelope envelope = soapPart.getEnvelope();
-            envelope.addNamespaceDeclaration("cwmp", "http://cwmp.com");
-            SOAPBody body = envelope.getBody();
-            SOAPFault soapFault = body.addFault();
-            soapFault.addFaultReasonText("myReason", new Locale("en"));
-            soapFault.setFaultCode("mycode");
-            soapMessage.saveChanges();
+        SOAPMessage soapMessage = fac.createMessage();
+        SOAPPart soapPart = soapMessage.getSOAPPart();
 
-            QName qname = soapFault.getFaultCodeAsQName();
-            assertNotNull(qname);
+        SOAPEnvelope envelope = soapPart.getEnvelope();
+        envelope.addNamespaceDeclaration("cwmp", "http://cwmp.com");
+        SOAPBody body = envelope.getBody();
+        SOAPFault soapFault = body.addFault();
+        soapFault.addFaultReasonText("myReason", new Locale("en"));
+        soapFault.setFaultCode("mycode");
+        soapMessage.saveChanges();
 
-        } catch (Exception e) {
-            fail("Unexpected Exception : " + e);
-        }
+        QName qname = soapFault.getFaultCodeAsQName();
+        assertNotNull(qname);
     }
 
-    public void testHasDetail() {
-        try {
-            MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
-            //MessageFactory fac = MessageFactory.newInstance();
+    public void testHasDetail() throws Exception {
+        MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
+        //MessageFactory fac = MessageFactory.newInstance();
 
-            SOAPMessage soapMessage = fac.createMessage();
-            SOAPPart soapPart = soapMessage.getSOAPPart();
+        SOAPMessage soapMessage = fac.createMessage();
+        SOAPPart soapPart = soapMessage.getSOAPPart();
 
-            SOAPEnvelope envelope = soapPart.getEnvelope();
-            envelope.addNamespaceDeclaration("cwmp", "http://cwmp.com");
-            SOAPBody body = envelope.getBody();
-            SOAPFault soapFault = body.addFault();
-            Detail detail = soapFault.addDetail();
-            detail.setAttribute("test", "myvalue");
-            soapMessage.saveChanges();
-        } catch (Exception e) {
-            fail("Unexpected Exception : " + e);
-        }
+        SOAPEnvelope envelope = soapPart.getEnvelope();
+        envelope.addNamespaceDeclaration("cwmp", "http://cwmp.com");
+        SOAPBody body = envelope.getBody();
+        SOAPFault soapFault = body.addFault();
+        Detail detail = soapFault.addDetail();
+        detail.setAttribute("test", "myvalue");
+        soapMessage.saveChanges();
     }
 
-    public void testFaultReasonLocales() {
-        try {
-            MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
-            SOAPMessage soapMessage = fac.createMessage();
-            SOAPPart soapPart = soapMessage.getSOAPPart();
-            SOAPEnvelope envelope = soapPart.getEnvelope();
-            SOAPBody body = envelope.getBody();
-            //SOAPFault sf = body.addFault();
-            
-            Locale expected1 = Locale.ENGLISH;
-            Locale expected2 = Locale.UK;
-            Locale expected3 = Locale.GERMAN;
-            boolean found1 = false;
-            boolean found2 = false;
-            boolean found3 = false;
-
-            SOAPFault sf = body.addFault(SOAPConstants.SOAP_RECEIVER_FAULT, "Its my fault1", expected1);
-            sf.addFaultReasonText("Its my fault1", expected1);
-            sf.addFaultReasonText("Its my fault2", expected2);
-            sf.addFaultReasonText("Its my fault3", expected3);
-            Iterator i = sf.getFaultReasonLocales();
-
-            int localeCount = 0;
-            while (i.hasNext()) {
-                localeCount++;
-                i.next();
-            }
+    public void testFaultReasonLocales() throws Exception  {
+        MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
+        SOAPMessage soapMessage = fac.createMessage();
+        SOAPPart soapPart = soapMessage.getSOAPPart();
+        SOAPEnvelope envelope = soapPart.getEnvelope();
+        SOAPBody body = envelope.getBody();
+        //SOAPFault sf = body.addFault();
+        
+        Locale expected1 = Locale.ENGLISH;
+        Locale expected2 = Locale.UK;
+        Locale expected3 = Locale.GERMAN;
+        boolean found1 = false;
+        boolean found2 = false;
+        boolean found3 = false;
 
-            i = sf.getFaultReasonLocales();
-            int j = 0;
-            while (i.hasNext()) {
-                Object o = i.next();
-                if (o instanceof Locale) {
-                    Locale actual = (Locale)o;
-                    if (actual != null) {
-                        if (actual.equals(expected1)) {
-                            if (!found1) {
-                                found1 = true;
-                            }
-                        } else if (actual.equals(expected2)) {
-                            if (!found2) {
-                                found2 = true;
-                            }
-                        } else if (actual.equals(expected3)) {
-                            if (!found3) {
-                                found3 = true;
-                            }
+        SOAPFault sf = body.addFault(SOAPConstants.SOAP_RECEIVER_FAULT, "Its my fault1", expected1);
+        sf.addFaultReasonText("Its my fault1", expected1);
+        sf.addFaultReasonText("Its my fault2", expected2);
+        sf.addFaultReasonText("Its my fault3", expected3);
+        Iterator i = sf.getFaultReasonLocales();
+
+        int localeCount = 0;
+        while (i.hasNext()) {
+            localeCount++;
+            i.next();
+        }
+
+        i = sf.getFaultReasonLocales();
+        int j = 0;
+        while (i.hasNext()) {
+            Object o = i.next();
+            if (o instanceof Locale) {
+                Locale actual = (Locale)o;
+                if (actual != null) {
+                    if (actual.equals(expected1)) {
+                        if (!found1) {
+                            found1 = true;
+                        }
+                    } else if (actual.equals(expected2)) {
+                        if (!found2) {
+                            found2 = true;
+                        }
+                    } else if (actual.equals(expected3)) {
+                        if (!found3) {
+                            found3 = true;
                         }
                     }
                 }
-                j++;
-            }
-            if (j < 1) {
-                fail("No reason text was returned");
-            }
-            if (j > 3) {
-                fail("More than 3 Locales were returned");
-            }
-            if (!found1) {
-                fail("The following Locale was not received: '" + expected1 + "'");
             }
-            if (!found2) {
-                fail("The following Locale was not received: '" + expected2 + "'");
-            }
-            if (!found3) {
-                fail("The following Locale was not received: '" + expected3 + "'");
-            }
-        } catch (Exception e) {
-            fail("Exception: " + e);
+            j++;
+        }
+        if (j < 1) {
+            fail("No reason text was returned");
+        }
+        if (j > 3) {
+            fail("More than 3 Locales were returned");
+        }
+        if (!found1) {
+            fail("The following Locale was not received: '" + expected1 + "'");
+        }
+        if (!found2) {
+            fail("The following Locale was not received: '" + expected2 + "'");
+        }
+        if (!found3) {
+            fail("The following Locale was not received: '" + expected3 + "'");
         }
     }
 
-    public void testFaultStringLocale() {
-        try {
-            MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
-            //MessageFactory fac = MessageFactory.newInstance();
-            SOAPMessage soapMessage = fac.createMessage();
-            SOAPPart soapPart = soapMessage.getSOAPPart();
-            SOAPEnvelope envelope = soapPart.getEnvelope();
-            SOAPBody body = envelope.getBody();
-            SOAPFault sf = body.addFault();
+    public void testFaultStringLocale() throws Exception {
+        MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
+        //MessageFactory fac = MessageFactory.newInstance();
+        SOAPMessage soapMessage = fac.createMessage();
+        SOAPPart soapPart = soapMessage.getSOAPPart();
+        SOAPEnvelope envelope = soapPart.getEnvelope();
+        SOAPBody body = envelope.getBody();
+        SOAPFault sf = body.addFault();
 
-            //Setting fault string with no Locale
-            sf.setFaultString("this is the fault string");
-            Locale result = sf.getFaultStringLocale();
-            assertNotNull(result);
-        } catch (Exception e) {
-            fail("Exception: " + e);
-        }
+        //Setting fault string with no Locale
+        sf.setFaultString("this is the fault string");
+        Locale result = sf.getFaultStringLocale();
+        assertNotNull(result);
     }
 
 
-    public void testFaultStringLocale2() {
-        try {
-            MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
-            //MessageFactory fac = MessageFactory.newInstance();
-            SOAPMessage soapMessage = fac.createMessage();
-            SOAPPart soapPart = soapMessage.getSOAPPart();
-            SOAPEnvelope envelope = soapPart.getEnvelope();
-            SOAPBody body = envelope.getBody();
-            SOAPFault sf = body.addFault();
+    public void testFaultStringLocale2() throws Exception {
+        MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
+        //MessageFactory fac = MessageFactory.newInstance();
+        SOAPMessage soapMessage = fac.createMessage();
+        SOAPPart soapPart = soapMessage.getSOAPPart();
+        SOAPEnvelope envelope = soapPart.getEnvelope();
+        SOAPBody body = envelope.getBody();
+        SOAPFault sf = body.addFault();
 
-            sf.setFaultString("this is the fault string");
-            Locale result = sf.getFaultStringLocale();
-            assertNotNull(result);
-            assertTrue(result.equals(Locale.getDefault()));
-        }
-        catch (Exception e) {
-            fail("Exception: " + e);
-        }
+        sf.setFaultString("this is the fault string");
+        Locale result = sf.getFaultStringLocale();
+        assertNotNull(result);
+        assertTrue(result.equals(Locale.getDefault()));
     }
 
-    public void testSetFaultStringLocale() {
-        try {
-            MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
-            //MessageFactory fac = MessageFactory.newInstance();
-            SOAPMessage soapMessage = fac.createMessage();
-            SOAPPart soapPart = soapMessage.getSOAPPart();
-            SOAPEnvelope envelope = soapPart.getEnvelope();
-            SOAPBody body = envelope.getBody();
-            SOAPFault sf = body.addFault();
-
-            Locale expected = Locale.ENGLISH;
-            sf.setFaultString("this is the fault string", expected);
-            Locale result = sf.getFaultStringLocale();
-            assertNotNull(result);
-            assertTrue(result.equals(expected));
-        } catch (Exception e) {
-            fail("Exception: " + e);
-        }
+    public void testSetFaultStringLocale() throws Exception {
+        MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
+        //MessageFactory fac = MessageFactory.newInstance();
+        SOAPMessage soapMessage = fac.createMessage();
+        SOAPPart soapPart = soapMessage.getSOAPPart();
+        SOAPEnvelope envelope = soapPart.getEnvelope();
+        SOAPBody body = envelope.getBody();
+        SOAPFault sf = body.addFault();
+
+        Locale expected = Locale.ENGLISH;
+        sf.setFaultString("this is the fault string", expected);
+        Locale result = sf.getFaultStringLocale();
+        assertNotNull(result);
+        assertTrue(result.equals(expected));
     }
 
 
-    public void testFaultCodeWithPrefix1() {
-        try {
-            MessageFactory fac = MessageFactory.newInstance();
-            SOAPMessage soapMessage = fac.createMessage();
-            SOAPPart soapPart = soapMessage.getSOAPPart();
-            SOAPEnvelope envelope = soapPart.getEnvelope();
-            SOAPBody body = envelope.getBody();
-            SOAPFault sf = body.addFault();
+    public void testFaultCodeWithPrefix1() throws Exception {
+        MessageFactory fac = MessageFactory.newInstance();
+        SOAPMessage soapMessage = fac.createMessage();
+        SOAPPart soapPart = soapMessage.getSOAPPart();
+        SOAPEnvelope envelope = soapPart.getEnvelope();
+        SOAPBody body = envelope.getBody();
+        SOAPFault sf = body.addFault();
 
-            String prefix = "wso2";
-            sf.setFaultCode(prefix + ":Server");
-            String result = sf.getFaultCode();
+        String prefix = "wso2";
+        sf.setFaultCode(prefix + ":Server");
+        String result = sf.getFaultCode();
 
-            assertNotNull(result);
-            assertEquals(prefix + ":Server", result);
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+        assertNotNull(result);
+        assertEquals(prefix + ":Server", result);
     }
 
-    public void testFaultCodeWithPrefix2() {
-        try {
-            MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
-            SOAPMessage soapMessage = fac.createMessage();
-            SOAPPart soapPart = soapMessage.getSOAPPart();
-            SOAPEnvelope envelope = soapPart.getEnvelope();
-            SOAPBody body = envelope.getBody();
-            SOAPFault sf = body.addFault();
+    public void testFaultCodeWithPrefix2() throws Exception {
+        MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
+        SOAPMessage soapMessage = fac.createMessage();
+        SOAPPart soapPart = soapMessage.getSOAPPart();
+        SOAPEnvelope envelope = soapPart.getEnvelope();
+        SOAPBody body = envelope.getBody();
+        SOAPFault sf = body.addFault();
 
-            String prefix = "wso2";
-            sf.setFaultCode(prefix + ":Server");
-            String result = sf.getFaultCode();
+        String prefix = "wso2";
+        sf.setFaultCode(prefix + ":Server");
+        String result = sf.getFaultCode();
 
-            assertNotNull(result);
-            assertEquals(prefix + ":Server", result);
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+        assertNotNull(result);
+        assertEquals(prefix + ":Server", result);
     }
 
-    public void testSetGetFaultCodeAsName1() {
-        try {
-            SOAPFactory fac = SOAPFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
-            SOAPFault sf = fac.createFault();
+    public void testSetGetFaultCodeAsName1() throws Exception {
+        SOAPFactory fac = SOAPFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
+        SOAPFault sf = fac.createFault();
 
-            Name name = fac.createName("myfault", "flt", "http://example.com");
-            sf.setFaultCode(name);
-            
-            Name name2 = sf.getFaultCodeAsName();            
-            assertNotNull(name2);
-            assertEquals(name.getLocalName(), name2.getLocalName());
-            assertEquals(name.getPrefix(), name2.getPrefix());
-            assertEquals(name.getURI(), name2.getURI());
-            
-            QName name3 = sf.getFaultCodeAsQName();            
-            assertNotNull(name3);
-            assertEquals(name.getLocalName(), name3.getLocalPart());
-            assertEquals(name.getPrefix(), name3.getPrefix());
-            assertEquals(name.getURI(), name3.getNamespaceURI());
-            
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+        Name name = fac.createName("myfault", "flt", "http://example.com");
+        sf.setFaultCode(name);
+        
+        Name name2 = sf.getFaultCodeAsName();            
+        assertNotNull(name2);
+        assertEquals(name.getLocalName(), name2.getLocalName());
+        assertEquals(name.getPrefix(), name2.getPrefix());
+        assertEquals(name.getURI(), name2.getURI());
+        
+        QName name3 = sf.getFaultCodeAsQName();            
+        assertNotNull(name3);
+        assertEquals(name.getLocalName(), name3.getLocalPart());
+        assertEquals(name.getPrefix(), name3.getPrefix());
+        assertEquals(name.getURI(), name3.getNamespaceURI());
     }
 
 
-    public void testSetGetFaultCodeAsName2() {
-        try {
-            QName qname = SOAPConstants.SOAP_SENDER_FAULT;
-            SOAPFactory fac = SOAPFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
-            Name name = fac.createName(qname.getLocalPart(),
-                                       qname.getPrefix(), qname.getNamespaceURI());
-            SOAPFault sf = fac.createFault();
-            sf.setFaultCode(name);
-            
-            Name name2 = sf.getFaultCodeAsName();            
-            assertNotNull(name2);
-            assertEquals(name.getLocalName(), name2.getLocalName());
-            assertEquals(name.getPrefix(), name2.getPrefix());
-            assertEquals(name.getURI(), name2.getURI());
-            
-            QName name3 = sf.getFaultCodeAsQName();            
-            assertNotNull(name3);
-            assertEquals(name.getLocalName(), name3.getLocalPart());
-            assertEquals(name.getPrefix(), name3.getPrefix());
-            assertEquals(name.getURI(), name3.getNamespaceURI());
-                      
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-
+    public void testSetGetFaultCodeAsName2() throws Exception {
+        QName qname = SOAPConstants.SOAP_SENDER_FAULT;
+        SOAPFactory fac = SOAPFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
+        Name name = fac.createName(qname.getLocalPart(),
+                                   qname.getPrefix(), qname.getNamespaceURI());
+        SOAPFault sf = fac.createFault();
+        sf.setFaultCode(name);
+        
+        Name name2 = sf.getFaultCodeAsName();            
+        assertNotNull(name2);
+        assertEquals(name.getLocalName(), name2.getLocalName());
+        assertEquals(name.getPrefix(), name2.getPrefix());
+        assertEquals(name.getURI(), name2.getURI());
+        
+        QName name3 = sf.getFaultCodeAsQName();            
+        assertNotNull(name3);
+        assertEquals(name.getLocalName(), name3.getLocalPart());
+        assertEquals(name.getPrefix(), name3.getPrefix());
+        assertEquals(name.getURI(), name3.getNamespaceURI());
     }
 
 
@@ -885,54 +789,42 @@ public class SOAPFaultTest extends TestC
     }
 
 
-    public void testSetGetFaultCodeAsQName2() {
-        try {
-            QName name = SOAPConstants.SOAP_SENDER_FAULT;
-            SOAPFactory fac = SOAPFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
-            SOAPFault sf = fac.createFault();
-            sf.setFaultCode(name);
-            
-            QName name2 = sf.getFaultCodeAsQName();
-            assertNotNull(name2);
-            assertEquals(name.getLocalPart(), name2.getLocalPart());
-            assertEquals(name.getPrefix(), name2.getPrefix());
-            assertEquals(name.getNamespaceURI(), name2.getNamespaceURI());
-            
-            Name name3 = sf.getFaultCodeAsName();
-            assertNotNull(name3);
-            assertEquals(name.getLocalPart(), name3.getLocalName());
-            assertEquals(name.getPrefix(), name3.getPrefix());
-            assertEquals(name.getNamespaceURI(), name3.getURI());
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+    public void testSetGetFaultCodeAsQName2() throws Exception {
+        QName name = SOAPConstants.SOAP_SENDER_FAULT;
+        SOAPFactory fac = SOAPFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
+        SOAPFault sf = fac.createFault();
+        sf.setFaultCode(name);
+        
+        QName name2 = sf.getFaultCodeAsQName();
+        assertNotNull(name2);
+        assertEquals(name.getLocalPart(), name2.getLocalPart());
+        assertEquals(name.getPrefix(), name2.getPrefix());
+        assertEquals(name.getNamespaceURI(), name2.getNamespaceURI());
+        
+        Name name3 = sf.getFaultCodeAsName();
+        assertNotNull(name3);
+        assertEquals(name.getLocalPart(), name3.getLocalName());
+        assertEquals(name.getPrefix(), name3.getPrefix());
+        assertEquals(name.getNamespaceURI(), name3.getURI());
     }
 
-    public void testFault12Defaults() {
-        try {
-            MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
-            SOAPMessage message = messageFactory.createMessage();
-            SOAPBody body = message.getSOAPBody();
-            SOAPFault fault = body.addFault();
-            assertNotNull(fault.getFaultCodeAsQName());
-            assertNotNull(fault.getFaultString());
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-    }
+    public void testFault12Defaults() throws Exception {
+        MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
+        SOAPMessage message = messageFactory.createMessage();
+        SOAPBody body = message.getSOAPBody();
+        SOAPFault fault = body.addFault();
+        assertNotNull(fault.getFaultCodeAsQName());
+        assertNotNull(fault.getFaultString());
+    }
+
+    public void testFault11Defaults() throws Exception {
+        MessageFactory messageFactory = MessageFactory.newInstance();
+        SOAPMessage message = messageFactory.createMessage();
+        SOAPBody body = message.getSOAPBody();
+        SOAPFault fault = body.addFault();
 
-    public void testFault11Defaults() {
-        try {
-            MessageFactory messageFactory = MessageFactory.newInstance();
-            SOAPMessage message = messageFactory.createMessage();
-            SOAPBody body = message.getSOAPBody();
-            SOAPFault fault = body.addFault();
-
-            assertNotNull(fault.getFaultCodeAsQName());
-            assertNotNull(fault.getFaultString());
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+        assertNotNull(fault.getFaultCodeAsQName());
+        assertNotNull(fault.getFaultString());
     }
 
 

Modified: axis/axis2/java/core/branches/1_5/modules/saaj/test/org/apache/axis2/saaj/SOAPPartTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/1_5/modules/saaj/test/org/apache/axis2/saaj/SOAPPartTest.java?rev=1029125&r1=1029124&r2=1029125&view=diff
==============================================================================
--- axis/axis2/java/core/branches/1_5/modules/saaj/test/org/apache/axis2/saaj/SOAPPartTest.java (original)
+++ axis/axis2/java/core/branches/1_5/modules/saaj/test/org/apache/axis2/saaj/SOAPPartTest.java Sat Oct 30 17:26:27 2010
@@ -115,12 +115,10 @@ public class SOAPPartTest extends TestCa
 
 
     public void testAddSource2() throws Exception {
-        javax.xml.soap.SOAPMessage soapMessage =
-                javax.xml.soap.MessageFactory.newInstance().createMessage();
-        javax.xml.soap.SOAPEnvelope soapEnv =
-                soapMessage.getSOAPPart().getEnvelope();
-        javax.xml.soap.SOAPHeader header = soapEnv.getHeader();
-        javax.xml.soap.SOAPBody body = soapEnv.getBody();
+        SOAPMessage soapMessage = MessageFactory.newInstance().createMessage();
+        SOAPEnvelope soapEnv = soapMessage.getSOAPPart().getEnvelope();
+        SOAPHeader header = soapEnv.getHeader();
+        SOAPBody body = soapEnv.getBody();
 
         assertTrue(header.addChildElement("ebxmlms1", "ch2",
                                           "http://test.apache.org") instanceof SOAPHeaderElement);
@@ -132,8 +130,7 @@ public class SOAPPartTest extends TestCa
         body.addChildElement("bodyEle1", "ele1", "http://ws.apache.org");
         soapMessage.saveChanges();
 
-        javax.xml.soap.SOAPMessage soapMessage2 =
-                javax.xml.soap.MessageFactory.newInstance().createMessage();
+        SOAPMessage soapMessage2 = MessageFactory.newInstance().createMessage();
         SOAPPart soapPart = soapMessage2.getSOAPPart();
         soapPart.setContent(soapMessage.getSOAPPart().getContent());
         soapMessage2.saveChanges();
@@ -141,12 +138,10 @@ public class SOAPPartTest extends TestCa
     }
 
     public void testAddSource3() throws Exception {
-        javax.xml.soap.SOAPMessage soapMessage =
-                javax.xml.soap.MessageFactory.newInstance().createMessage();
-        javax.xml.soap.SOAPEnvelope soapEnv =
-                soapMessage.getSOAPPart().getEnvelope();
-        javax.xml.soap.SOAPHeader header = soapEnv.getHeader();
-        javax.xml.soap.SOAPBody body = soapEnv.getBody();
+        SOAPMessage soapMessage = MessageFactory.newInstance().createMessage();
+        SOAPEnvelope soapEnv = soapMessage.getSOAPPart().getEnvelope();
+        SOAPHeader header = soapEnv.getHeader();
+        SOAPBody body = soapEnv.getBody();
 
         assertTrue(header.addChildElement("ebxmlms1", "ch2",
                                           "http://test.apache.org") instanceof SOAPHeaderElement);
@@ -158,8 +153,7 @@ public class SOAPPartTest extends TestCa
         body.addChildElement("bodyEle1", "ele1", "http://ws.apache.org");
         soapMessage.saveChanges();
 
-        javax.xml.soap.SOAPMessage soapMessage2 =
-                javax.xml.soap.MessageFactory.newInstance().createMessage();
+        SOAPMessage soapMessage2 = MessageFactory.newInstance().createMessage();
         SOAPPart soapPart = soapMessage2.getSOAPPart();
         soapPart.setContent(soapMessage.getSOAPPart().getContent());
         soapMessage2.saveChanges();

Modified: axis/axis2/java/core/branches/1_5/modules/saaj/test/org/apache/axis2/saaj/integration/IntegrationTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/1_5/modules/saaj/test/org/apache/axis2/saaj/integration/IntegrationTest.java?rev=1029125&r1=1029124&r2=1029125&view=diff
==============================================================================
--- axis/axis2/java/core/branches/1_5/modules/saaj/test/org/apache/axis2/saaj/integration/IntegrationTest.java (original)
+++ axis/axis2/java/core/branches/1_5/modules/saaj/test/org/apache/axis2/saaj/integration/IntegrationTest.java Sat Oct 30 17:26:27 2010
@@ -23,8 +23,13 @@ import junit.extensions.TestSetup;
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
-import org.apache.axis2.description.AxisService;
+import org.apache.axiom.attachments.Attachments;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.description.Parameter;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.engine.MessageReceiver;
+import org.apache.axis2.receivers.AbstractInOutMessageReceiver;
 import org.apache.axis2.util.Utils;
 
 import javax.activation.DataHandler;
@@ -76,9 +81,10 @@ public class IntegrationTest extends Tes
         return new TestSetup(new TestSuite(IntegrationTest.class)) {
             public void setUp() throws Exception {
                 port = UtilServer.start(SAAJ_REPO);
-                Parameter eneblemtom = new Parameter("enableMTOM", "true");
-                UtilServer.getConfigurationContext().getAxisConfiguration()
-                        .addParameter(eneblemtom);
+                AxisConfiguration axisCfg =
+                        UtilServer.getConfigurationContext().getAxisConfiguration();
+                axisCfg.addParameter(new Parameter("enableMTOM", "optional"));
+                axisCfg.addParameter(new Parameter("enableSwA", "optional"));
             }
 
             public void tearDown() throws Exception {
@@ -88,10 +94,26 @@ public class IntegrationTest extends Tes
     }
 
     protected void setUp() throws Exception {
-        final AxisService service = Utils.createSimpleService(SERVICE_NAME,
-                                                              EchoService.class.getName(),
-                                                              OPERATION_NAME);
-        UtilServer.deployService(service);
+        MessageReceiver mr = new AbstractInOutMessageReceiver() {
+            @Override
+            public void invokeBusinessLogic(MessageContext inMessage, MessageContext outMessage)
+                    throws AxisFault {
+                
+                outMessage.setEnvelope(inMessage.getEnvelope());
+                Attachments inAttachments = inMessage.getAttachmentMap();
+                Attachments outAttachments = outMessage.getAttachmentMap();
+                for (String contentId : inAttachments.getAllContentIDs()) {
+                    if (!contentId.equals(inAttachments.getSOAPPartContentID())) {
+                        outAttachments.addDataHandler(contentId,
+                                inAttachments.getDataHandler(contentId));
+                    }
+                }
+                outMessage.setDoingSwA(inMessage.isDoingSwA());
+                outMessage.setDoingMTOM(inMessage.isDoingMTOM());
+            }
+        };
+        UtilServer.deployService(
+                Utils.createSimpleService(SERVICE_NAME, mr, null, OPERATION_NAME));
     }
 
     protected void tearDown() throws Exception {
@@ -195,8 +217,7 @@ public class IntegrationTest extends Tes
         SOAPConnection sCon = SOAPConnectionFactory.newInstance().createConnection();
         SOAPMessage response = sCon.call(request, getAddress());
 
-        int attachmentCount = response.countAttachments();
-        assertTrue(attachmentCount == 2);
+        assertEquals(2, response.countAttachments());
 
         Iterator attachIter = response.getAttachments();
 
@@ -253,8 +274,7 @@ public class IntegrationTest extends Tes
         SOAPConnection sCon = SOAPConnectionFactory.newInstance().createConnection();
         SOAPMessage response = sCon.call(request, getAddress());
 
-        int attachmentCount = response.countAttachments();
-        assertTrue(attachmentCount == 2);
+        assertEquals(2, response.countAttachments());
 
         Iterator attachIter = response.getAttachments();
 

Propchange: axis/axis2/java/core/branches/1_5/modules/soapmonitor/module/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 17:26:27 2010
@@ -1,2 +1,2 @@
 /axis/axis2/java/core/trunk/modules/soapmonitor/module:922983,965032,965056,966401,987783,987832,987873,987883,987913,987935,990350,990369,990377,990384,990394,990398,990404,990434,990449,1001279,1001452
-/webservices/axis2/trunk/java/modules/soapmonitor/module:728674,731798,751964,778060,780546,795431,805578,806085,806331,807512,816804,816812,817965,821686,821689,902271
+/webservices/axis2/trunk/java/modules/soapmonitor/module:728674,731798,732539,732541,732873,732877,733293,733295,733304,733306,733348,733354,733394,733399,733463-733464,733533,733676,751964,778060,780546,795431,805578,806085,806331,807512,816804,816812,817965,821686,821689,902271

Propchange: axis/axis2/java/core/branches/1_5/modules/soapmonitor/module/pom.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 17:26:27 2010
@@ -1,3 +1,3 @@
 /axis/axis2/java/core/trunk/modules/soapmonitor/module/pom.xml:922914,922983,965032,965056,966401,987783,987832,987873,987883,987913,987935,990350,990369,990377,990384,990394,990398,990404,990434,990449,1001279,1001452
 /webservices/axis2/branches/java/1_5/modules/soapmonitor/pom.xml:745088,749052,749058,751161,751271,760467,765840
-/webservices/axis2/trunk/java/modules/soapmonitor/module/pom.xml:728674,731798,751964,778060,780546,795431,805578,806085,806331,807160,807512,816804,816812,817965,821686,821689,902271
+/webservices/axis2/trunk/java/modules/soapmonitor/module/pom.xml:728674,731798,732539,732541,732873,732877,733293,733295,733304,733306,733348,733354,733394,733399,733463-733464,733533,733676,751964,778060,780546,795431,805578,806085,806331,807160,807512,816804,816812,817965,821686,821689,902271

Propchange: axis/axis2/java/core/branches/1_5/modules/soapmonitor/module/src/main/java/org/apache/axis2/handlers/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 17:26:27 2010
@@ -1,3 +1,3 @@
 /axis/axis2/java/core/trunk/modules/soapmonitor/module/src/main/java/org/apache/axis2/handlers:922914,922983,965032,965056,966401,987783,987832,987873,987883,987913,987935,990350,990369,990377,990384,990394,990398,990404,990434,990449,1001279,1001452
 /webservices/axis2/branches/java/1_5/modules/soapmonitor/src/org/apache/axis2/handlers:745088,749052,749058,751161,751271,760467,765840
-/webservices/axis2/trunk/java/modules/soapmonitor/module/src/main/java/org/apache/axis2/handlers:728674,731798,751964,777648,778060,780546,795431,805578,806085,806331,807160,807512,816804,816812,817965,821686,821689,902271
+/webservices/axis2/trunk/java/modules/soapmonitor/module/src/main/java/org/apache/axis2/handlers:728674,731798,732539,732541,732873,732877,733293,733295,733304,733306,733348,733354,733394,733399,733463-733464,733533,733676,751964,777648,778060,780546,795431,805578,806085,806331,807160,807512,816804,816812,817965,821686,821689,902271

Propchange: axis/axis2/java/core/branches/1_5/modules/soapmonitor/module/src/main/resources/META-INF/module.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 17:26:27 2010
@@ -1,3 +1,3 @@
 /axis/axis2/java/core/trunk/modules/soapmonitor/module/src/main/resources/META-INF/module.xml:922914,922983,965032,965056,966401,987783,987832,987873,987883,987913,987935,990350,990369,990377,990384,990394,990398,990404,990434,990449,1001279,1001452
 /webservices/axis2/branches/java/1_5/modules/soapmonitor/src/META-INF/module.xml:745088,749052,749058,751161,751271,760467,765840
-/webservices/axis2/trunk/java/modules/soapmonitor/module/src/main/resources/META-INF/module.xml:728674,731798,751964,778060,780546,795431,805578,806085,806331,807160,807512,816804,816812,817965,821686,821689,902271
+/webservices/axis2/trunk/java/modules/soapmonitor/module/src/main/resources/META-INF/module.xml:728674,731798,732539,732541,732873,732877,733293,733295,733304,733306,733348,733354,733394,733399,733463-733464,733533,733676,751964,778060,780546,795431,805578,806085,806331,807160,807512,816804,816812,817965,821686,821689,902271

Propchange: axis/axis2/java/core/branches/1_5/modules/soapmonitor/servlet/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 17:26:27 2010
@@ -1,2 +1,2 @@
 /axis/axis2/java/core/trunk/modules/soapmonitor/servlet:922914,965032,965056,965213,987783,987832,987873,987883,987913,987935,990350,990369,990377,990384,990394,990398,990404,990434,990449,1001279,1001452
-/webservices/axis2/trunk/java/modules/soapmonitor/servlet:728674,731798,751964,778060,780546,795431,805578,806085,806331,807512,816804,816812,817965,821686,821689,902271
+/webservices/axis2/trunk/java/modules/soapmonitor/servlet:728674,731798,732539,732541,732873,732877,733293,733295,733304,733306,733348,733354,733394,733399,733463-733464,733533,733676,751964,778060,780546,795431,805578,806085,806331,807512,816804,816812,817965,821686,821689,902271

Propchange: axis/axis2/java/core/branches/1_5/modules/soapmonitor/servlet/src/main/java/org/apache/axis2/soapmonitor/applet/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 17:26:27 2010
@@ -1,3 +1,3 @@
 /axis/axis2/java/core/trunk/modules/soapmonitor/servlet/src/main/java/org/apache/axis2/soapmonitor/applet:922914,965032,965056,965213,987783,987832,987873,987883,987913,987935,990350,990369,990377,990384,990394,990398,990404,990434,990449,1001279,1001452
 /webservices/axis2/branches/java/1_5/modules/soapmonitor/src/org/apache/axis2/soapmonitor/applet:745088,749052,749058,751161,751271,760467,765840
-/webservices/axis2/trunk/java/modules/soapmonitor/servlet/src/main/java/org/apache/axis2/soapmonitor/applet:728674,731798,751964,777648,778060,780546,795431,805578,806085,806331,807160,807512,816804,816812,817965,821686,821689,902271
+/webservices/axis2/trunk/java/modules/soapmonitor/servlet/src/main/java/org/apache/axis2/soapmonitor/applet:728674,731798,732539,732541,732873,732877,733293,733295,733304,733306,733348,733354,733394,733399,733463-733464,733533,733676,751964,777648,778060,780546,795431,805578,806085,806331,807160,807512,816804,816812,817965,821686,821689,902271

Propchange: axis/axis2/java/core/branches/1_5/modules/soapmonitor/servlet/src/main/java/org/apache/axis2/soapmonitor/servlet/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 17:26:27 2010
@@ -1,3 +1,3 @@
 /axis/axis2/java/core/trunk/modules/soapmonitor/servlet/src/main/java/org/apache/axis2/soapmonitor/servlet:922914,965032,965056,965213,987783,987832,987873,987883,987913,987935,990350,990369,990377,990384,990394,990398,990404,990434,990449,1001279,1001452
 /webservices/axis2/branches/java/1_5/modules/soapmonitor/src/org/apache/axis2/soapmonitor/servlet:745088,749052,749058,751161,751271,760467,765840
-/webservices/axis2/trunk/java/modules/soapmonitor/servlet/src/main/java/org/apache/axis2/soapmonitor/servlet:728674,731798,751964,777648,778060,780546,795431,805578,806085,806331,807160,807512,816804,816812,817965,821686,821689,902271
+/webservices/axis2/trunk/java/modules/soapmonitor/servlet/src/main/java/org/apache/axis2/soapmonitor/servlet:728674,731798,732539,732541,732873,732877,733293,733295,733304,733306,733348,733354,733394,733399,733463-733464,733533,733676,751964,777648,778060,780546,795431,805578,806085,806331,807160,807512,816804,816812,817965,821686,821689,902271

Propchange: axis/axis2/java/core/branches/1_5/modules/transport/http/pom.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 17:26:27 2010
@@ -1,2 +1,2 @@
 /axis/axis2/java/core/trunk/modules/transport/http/pom.xml:922914,922941,922983,935169,935174,935338,944347,944915,951385,960693,960976,960978,960984,960995,961012,961964,962844,963081,963147,965032,965036,965056,965068,965074,965213,965268,965277,965302,965454,966371,966401,966428,979882-979883,979886,981036,981038,981095,981188,981220-981221,981237,981262,981278,981293,981306,981311,981985,982387,982393,982795,982800,983101,983110,983114,983119-983120,983128,983185,983236,983270,983276,983280,983316,983363,983370,983372,985458,985464,985626,985634,985661,985715,985717,985744,985748,985752,985763,985791,985796,985851,986844,986889,987313,987712-987715,987783,987832,987873,987883,987913,987935,990350,990369,990377,990384,990394,990398,990404,990434,990449,1001279,1001452
-/webservices/axis2/trunk/java/modules/transport/http/pom.xml:728674,731798,733539,751964,771051,777648,777882,777897,777934,778060,780546,783479,795431,801630,803725,805578,805981,805999,806085,806331,807160,807487,807512,816740,816804,816812,816891,817965,821686,821689,834058,834175,902271,904660,904780,905980
+/webservices/axis2/trunk/java/modules/transport/http/pom.xml:728674,731798,732539,732541,732873,732877,733293,733295,733304,733306,733348,733354,733394,733399,733463-733464,733533,733539,733676,751964,771051,777648,777882,777897,777934,778060,780546,783479,795431,801630,803725,805578,805981,805999,806085,806331,807160,807487,807512,816740,816804,816812,816891,817965,821686,821689,834058,834175,902271,904660,904780,905980

Propchange: axis/axis2/java/core/branches/1_5/modules/transport/http/src/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 17:26:27 2010
@@ -1,2 +1,2 @@
 /axis/axis2/java/core/trunk/modules/transport/http/src:922914,922941,922983,935169,935174,935338,944347,944915,951385,960693,960976,960978,960984,960995,961012,961964,962844,963081,963147,965032,965036,965056,965068,965074,965213,965268,965277,965302,965454,966371,966401,966428,979882-979883,979886,981036,981038,981095,981188,981220-981221,981237,981262,981278,981293,981306,981311,981985,982387,982393,982795,982800,983101,983110,983114,983119-983120,983128,983185,983236,983270,983276,983280,983316,983363,983370,983372,985458,985464,985626,985634,985661,985715,985717,985744,985748,985752,985763,985791,985796,985851,986844,986889,987313,987712-987715,987783,987832,987873,987883,987913,987935,990350,990369,990377,990384,990394,990398,990404,990434,990449,1001279,1001452
-/webservices/axis2/trunk/java/modules/transport/http/src:728674,731798,733539,751964,771051,777648,777882,777897,777934,778060,780546,783479,795431,801630,803725,805578,805981,805999,806085,806331,807160,807487,807512,816740,816804,816812,816891,817965,821686,821689,834058,834175,902271,904660,904780,905980
+/webservices/axis2/trunk/java/modules/transport/http/src:728674,731798,732539,732541,732873,732877,733293,733295,733304,733306,733348,733354,733394,733399,733463-733464,733533,733539,733676,751964,771051,777648,777882,777897,777934,778060,780546,783479,795431,801630,803725,805578,805981,805999,806085,806331,807160,807487,807512,816740,816804,816812,816891,817965,821686,821689,834058,834175,902271,904660,904780,905980

Propchange: axis/axis2/java/core/branches/1_5/modules/transport/local/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 17:26:27 2010
@@ -1,2 +1,2 @@
 /axis/axis2/java/core/trunk/modules/transport/local:922914,922941,922983,935169,935174,935338,944347,944915,951385,960693,960976,960978,960984,960995,961012,961964,962844,963081,963147,965032,965036,965056,965068,965074,965213,965268,965277,965302,965454,966371,966401,966428,979882-979883,979886,981036,981038,981095,981188,981220-981221,981237,981262,981278,981293,981306,981311,981985,982387,982393,982795,982800,983101,983110,983114,983119-983120,983128,983185,983236,983270,983276,983280,983316,983363,983370,983372,985458,985464,985626,985634,985661,985715,985717,985744,985748,985752,985763,985791,985796,985851,986844,986889,987313,987712-987715,987783,987832,987873,987883,987913,987935,990350,990369,990377,990384,990394,990398,990404,990434,990449,1001279,1001452
-/webservices/axis2/trunk/java/modules/transport/local:728674,731798,733539,751964,771051,777648,777882,777897,777934,778060,780546,783479,795431,801630,803725,805578,805981,805999,806085,806331,807160,807487,807512,816740,816804,816812,816891,817965,821686,821689,834058,834175,902271,904660,904780,905980
+/webservices/axis2/trunk/java/modules/transport/local:728674,731798,732539,732541,732873,732877,733293,733295,733304,733306,733348,733354,733394,733399,733463-733464,733533,733539,733676,751964,771051,777648,777882,777897,777934,778060,780546,783479,795431,801630,803725,805578,805981,805999,806085,806331,807160,807487,807512,816740,816804,816812,816891,817965,821686,821689,834058,834175,902271,904660,904780,905980

Propchange: axis/axis2/java/core/branches/1_5/modules/webapp/src/main/java/org/apache/axis2/webapp/AdminAgent.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 17:26:27 2010
@@ -1,2 +1,2 @@
 /axis/axis2/java/core/trunk/modules/webapp/src/main/java/org/apache/axis2/webapp/AdminAgent.java:922914,922941,922983,935169,935174,935338,944347,944915,951385,960693,960976,960978,960984,960995,961012,961964,962844,963081,963147,965032,965036,965056,965068,965074,965213,965268,965277,965302,965454,966371,966401,966428,979882-979883,979886,981036,981038,981095,981188,981220-981221,981237,981262,981278,981293,981306,981311,981985,982387,982393,982795,982800,983101,983110,983114,983119-983120,983128,983185,983236,983270,983276,983280,983316,983363,983370,983372,985458,985464,985626,985634,985661,985715,985717,985744,985748,985752,985763,985791,985796,985851,986844,986889,987313,987712-987715,987783,987832,987873,987883,987913,987935,990350,990369,990377,990384,990394,990398,990404,990434,990449,1001279,1001452
-/webservices/axis2/trunk/java/modules/webapp/src/main/java/org/apache/axis2/webapp/AdminAgent.java:728674,731798,733539,751964,761709,771051,777648,777882,777897,777934,778060,780546,783479,795431,801630,803725,805578,805981,805999,806085,806331,807160,807487,807512,816740,816804,816812,816891,817965,821686,821689,834058,834175,902271,904660,904780,905980
+/webservices/axis2/trunk/java/modules/webapp/src/main/java/org/apache/axis2/webapp/AdminAgent.java:728674,731798,732539,732541,732873,732877,733293,733295,733304,733306,733348,733354,733394,733399,733463-733464,733533,733539,733676,751964,761709,771051,777648,777882,777897,777934,778060,780546,783479,795431,801630,803725,805578,805981,805999,806085,806331,807160,807487,807512,816740,816804,816812,816891,817965,821686,821689,834058,834175,902271,904660,904780,905980

Propchange: axis/axis2/java/core/branches/1_5/modules/webapp/src/main/java/org/apache/axis2/webapp/AxisAdminServlet.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 17:26:27 2010
@@ -1,2 +1,2 @@
 /axis/axis2/java/core/trunk/modules/webapp/src/main/java/org/apache/axis2/webapp/AxisAdminServlet.java:922914,922941,922983,935169,935174,935338,944347,944915,951385,960693,960976,960978,960984,960995,961012,961964,962844,963081,963147,965032,965036,965056,965068,965074,965213,965268,965277,965302,965454,966371,966401,966428,979882-979883,979886,981036,981038,981095,981188,981220-981221,981237,981262,981278,981293,981306,981311,981985,982387,982393,982795,982800,983101,983110,983114,983119-983120,983128,983185,983236,983270,983276,983280,983316,983363,983370,983372,985458,985464,985626,985634,985661,985715,985717,985744,985748,985752,985763,985791,985796,985851,986844,986889,987313,987712-987715,987783,987832,987873,987883,987913,987935,990350,990369,990377,990384,990394,990398,990404,990434,990449,1001279,1001452
-/webservices/axis2/trunk/java/modules/webapp/src/main/java/org/apache/axis2/webapp/AxisAdminServlet.java:728674,731798,733539,751964,761709,771051,777648,777882,777897,777934,778060,780546,783479,795431,801630,803725,805578,805981,805999,806085,806331,807160,807487,807512,816740,816804,816812,816891,817965,821686,821689,834058,834175,902271,904660,904780,905980
+/webservices/axis2/trunk/java/modules/webapp/src/main/java/org/apache/axis2/webapp/AxisAdminServlet.java:728674,731798,732539,732541,732873,732877,733293,733295,733304,733306,733348,733354,733394,733399,733463-733464,733533,733539,733676,751964,761709,771051,777648,777882,777897,777934,778060,780546,783479,795431,801630,803725,805578,805981,805999,806085,806331,807160,807487,807512,816740,816804,816812,816891,817965,821686,821689,834058,834175,902271,904660,904780,905980



Mime
View raw message