You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ch...@apache.org on 2005/08/05 08:33:38 UTC

svn commit: r230404 - in /webservices/axis/trunk/java/modules/xml: src/org/apache/axis2/soap/impl/llom/ test/org/apache/axis2/om/ test/org/apache/axis2/soap/

Author: chinthaka
Date: Thu Aug  4 23:33:12 2005
New Revision: 230404

URL: http://svn.apache.org/viewcvs?rev=230404&view=rev
Log:
- overriding detach method from SOAPBody
- adding test cases for that

Removed:
    webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/OMChildrenQNameIteratorTest.java
    webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/SOAPFaultTest.java
Modified:
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPBodyImpl.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPElement.java
    webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/soap/SOAPBodyTest.java

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPBodyImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPBodyImpl.java?rev=230404&r1=230403&r2=230404&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPBodyImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPBodyImpl.java Thu Aug  4 23:33:12 2005
@@ -15,10 +15,7 @@
  */
 package org.apache.axis2.soap.impl.llom;
 
-import org.apache.axis2.om.OMConstants;
-import org.apache.axis2.om.OMElement;
-import org.apache.axis2.om.OMException;
-import org.apache.axis2.om.OMXMLParserWrapper;
+import org.apache.axis2.om.*;
 import org.apache.axis2.soap.SOAPBody;
 import org.apache.axis2.soap.SOAPEnvelope;
 import org.apache.axis2.soap.SOAPFault;
@@ -145,5 +142,9 @@
             throw new SOAPProcessingException(
                     "Expecting an implementation of SOAP Envelope as the parent. But received some other implementation");
         }
+    }
+
+    public OMNode detach() throws OMException {
+        throw new SOAPProcessingException("Can not detach SOAP Body, SOAP Envelope must have a Body !!");
     }
 }

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPElement.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPElement.java?rev=230404&r1=230403&r2=230404&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPElement.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPElement.java Thu Aug  4 23:33:12 2005
@@ -76,4 +76,7 @@
      */
     protected abstract void checkParent(OMElement parent) throws SOAPProcessingException;
 
+
+    
+
 }

Modified: webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/soap/SOAPBodyTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/soap/SOAPBodyTest.java?rev=230404&r1=230403&r2=230404&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/soap/SOAPBodyTest.java (original)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/soap/SOAPBodyTest.java Thu Aug  4 23:33:12 2005
@@ -17,6 +17,7 @@
 package org.apache.axis2.soap;
 
 import org.apache.axis2.soap.impl.llom.SOAPConstants;
+import org.apache.axis2.om.OMException;
 
 public class SOAPBodyTest extends SOAPBodyTestCase {
 
@@ -134,5 +135,21 @@
                 "SOAP 1.2 Body Test With parser : - SOAP fault name mismatch",
                 soap12BodyWithParser.getFault().getLocalName().equals(
                         SOAPConstants.SOAPFAULT_LOCAL_NAME));
+    }
+
+    public void testSOAPBodyDetachment(){
+        try {
+            soap11Body.detach();
+            fail("Detachment of SOAP Body is not allowed !!");
+        } catch (OMException e) {
+            assertTrue(true);
+        }
+
+        try {
+            soap12Body.detach();
+            fail("Detachment of SOAP Body is not allowed !!");
+        } catch (OMException e) {
+            assertTrue(true);
+        }
     }
 }