You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2013/01/10 19:25:35 UTC
svn commit: r1431544 - in /webservices/commons/trunk/modules/axiom:
modules/axiom-api/src/main/java/org/apache/axiom/om/
modules/axiom-api/src/main/java/org/apache/axiom/soap/
modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/
mod...
Author: veithen
Date: Thu Jan 10 18:25:34 2013
New Revision: 1431544
URL: http://svn.apache.org/viewvc?rev=1431544&view=rev
Log:
* AXIOM-444: Fixed incompatibility with Spring-WS 2.1.2.
* Fixed a couple of other issues discovered while implementing this.
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/document/TestAddChildWithExistingDocumentElement.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/message/TestSetOMDocumentElement.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/message/TestSetOMDocumentElementNonSOAPEnvelope.java (with props)
webservices/commons/trunk/modules/axiom/systests/spring-ws-tests/ (with props)
webservices/commons/trunk/modules/axiom/systests/spring-ws-tests/pom.xml (with props)
webservices/commons/trunk/modules/axiom/systests/spring-ws-tests/src/
webservices/commons/trunk/modules/axiom/systests/spring-ws-tests/src/test/
webservices/commons/trunk/modules/axiom/systests/spring-ws-tests/src/test/java/
webservices/commons/trunk/modules/axiom/systests/spring-ws-tests/src/test/java/org/
webservices/commons/trunk/modules/axiom/systests/spring-ws-tests/src/test/java/org/apache/
webservices/commons/trunk/modules/axiom/systests/spring-ws-tests/src/test/java/org/apache/axiom/
webservices/commons/trunk/modules/axiom/systests/spring-ws-tests/src/test/java/org/apache/axiom/systest/
webservices/commons/trunk/modules/axiom/systests/spring-ws-tests/src/test/java/org/apache/axiom/systest/springws/
webservices/commons/trunk/modules/axiom/systests/spring-ws-tests/src/test/java/org/apache/axiom/systest/springws/AxiomSoapMessageFactoryTest.java (with props)
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMContainer.java
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMDocument.java
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/SOAPFactory.java
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/SOAPMessage.java
webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/IContainer.java
webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerHelper.java
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentFragmentImpl.java
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPEnvelopeImpl.java
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPMessageImpl.java
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocumentImpl.java
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPEnvelopeImpl.java
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPMessageImpl.java
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11Factory.java
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12Factory.java
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java
webservices/commons/trunk/modules/axiom/systests/pom.xml
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMContainer.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMContainer.java?rev=1431544&r1=1431543&r2=1431544&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMContainer.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMContainer.java Thu Jan 10 18:25:34 2013
@@ -49,6 +49,9 @@ public interface OMContainer extends OMS
/**
* Adds the given node as the last child of this container.
+ * <p>
+ * The method may throw an {@link OMException} if the node is not allowed at this position of
+ * the document.
*
* @param omNode
* the node to be added to this container
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMDocument.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMDocument.java?rev=1431544&r1=1431543&r2=1431544&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMDocument.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMDocument.java Thu Jan 10 18:25:34 2013
@@ -40,6 +40,9 @@ public interface OMDocument extends OMCo
* the new document element will be appended as the last child. If the document already has a
* document element, then it will be replaced by the new one and the position of the other
* children relative to the document element is preserved.
+ * <p>
+ * Some models (such as SOAP) may throw an exception if the specified element is not allowed as
+ * a root element.
*
* @param documentElement
* the new document element; must not be <code>null</code>
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/SOAPFactory.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/SOAPFactory.java?rev=1431544&r1=1431543&r2=1431544&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/SOAPFactory.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/SOAPFactory.java Thu Jan 10 18:25:34 2013
@@ -23,6 +23,7 @@ import org.apache.axiom.om.OMDataSource;
import org.apache.axiom.om.OMDocument;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.OMXMLParserWrapper;
public interface SOAPFactory extends OMFactory {
@@ -33,6 +34,12 @@ public interface SOAPFactory extends OMF
SOAPMessage createSOAPMessage();
/**
+ * @deprecated This method only exists for compatibility with Spring-WS and should not be used
+ * by application code.
+ */
+ SOAPMessage createSOAPMessage(OMXMLParserWrapper builder);
+
+ /**
* Create a SOAP envelope. The returned element will have the namespace URI specified by the
* SOAP version that this factory represents. It will have the prefix given by
* {@link SOAPConstants#SOAP_DEFAULT_NAMESPACE_PREFIX}. It will also have a corresponding
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/SOAPMessage.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/SOAPMessage.java?rev=1431544&r1=1431543&r2=1431544&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/SOAPMessage.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/SOAPMessage.java Thu Jan 10 18:25:34 2013
@@ -20,11 +20,18 @@
package org.apache.axiom.soap;
import org.apache.axiom.om.OMDocument;
+import org.apache.axiom.om.OMElement;
public interface SOAPMessage extends OMDocument {
SOAPEnvelope getSOAPEnvelope() throws SOAPProcessingException;
- void setSOAPEnvelope(SOAPEnvelope envelope) throws SOAPProcessingException;
-
+ /**
+ * Sets the SOAP envelope for this message. This method has the same effect as
+ * {@link OMDocument#setOMDocumentElement(OMElement)}.
+ *
+ * @param envelope
+ * the envelope to be set as the root element for this message
+ */
+ void setSOAPEnvelope(SOAPEnvelope envelope);
}
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/IContainer.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/IContainer.java?rev=1431544&r1=1431543&r2=1431544&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/IContainer.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/IContainer.java Thu Jan 10 18:25:34 2013
@@ -18,11 +18,22 @@
*/
package org.apache.axiom.om.impl.common;
+import org.apache.axiom.om.OMException;
import org.apache.axiom.om.OMNode;
import org.apache.axiom.om.impl.OMContainerEx;
public interface IContainer extends OMContainerEx, IParentNode {
/**
+ * Check if the node can be added as a child of this container.
+ *
+ * @param child
+ * the child that will be added
+ * @throws OMException
+ * if the node is not allowed as a child of the container
+ */
+ void checkChild(OMNode child);
+
+ /**
* forcefully set the first element in this parent element
* @param omNode
*/
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerHelper.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerHelper.java?rev=1431544&r1=1431543&r2=1431544&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerHelper.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerHelper.java Thu Jan 10 18:25:34 2013
@@ -112,6 +112,7 @@ public final class OMContainerHelper {
// We don't need to detach and re-add it.
return;
}
+ container.checkChild(omNode);
}
if (child.getParent() != null) {
child.detach();
@@ -163,17 +164,17 @@ public final class OMContainerHelper {
public static void buildNext(IParentNode that) {
OMXMLParserWrapper builder = that.getBuilder();
- if (builder != null) {
- if (((StAXOMBuilder)builder).isClosed()) {
- throw new OMException("The builder has already been closed");
- } else if (!builder.isCompleted()) {
- builder.next();
- } else {
- // If the builder is suddenly complete, but the completion status of the node
- // doesn't change, then this means that we built the wrong nodes
- throw new IllegalStateException("Builder is already complete");
- }
- }
+ if (builder == null) {
+ throw new IllegalStateException("The node has no builder");
+ } else if (((StAXOMBuilder)builder).isClosed()) {
+ throw new OMException("The builder has already been closed");
+ } else if (!builder.isCompleted()) {
+ builder.next();
+ } else {
+ // If the builder is suddenly complete, but the completion status of the node
+ // doesn't change, then this means that we built the wrong nodes
+ throw new IllegalStateException("Builder is already complete");
+ }
}
public static OMNode getFirstOMChild(IParentNode that) {
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentFragmentImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentFragmentImpl.java?rev=1431544&r1=1431543&r2=1431544&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentFragmentImpl.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentFragmentImpl.java Thu Jan 10 18:25:34 2013
@@ -21,6 +21,7 @@ package org.apache.axiom.om.impl.dom;
import org.apache.axiom.om.OMCloneOptions;
import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNode;
import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axiom.om.impl.common.IContainer;
import org.apache.axiom.om.impl.common.OMContainerHelper;
@@ -125,4 +126,7 @@ public class DocumentFragmentImpl extend
public final String lookupNamespaceURI(String specifiedPrefix) {
return null;
}
+
+ public final void checkChild(OMNode child) {
+ }
}
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java?rev=1431544&r1=1431543&r2=1431544&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java Thu Jan 10 18:25:34 2013
@@ -22,6 +22,7 @@ package org.apache.axiom.om.impl.dom;
import org.apache.axiom.om.OMCloneOptions;
import org.apache.axiom.om.OMDocument;
import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMException;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
import org.apache.axiom.om.OMNode;
@@ -628,4 +629,17 @@ public class DocumentImpl extends RootNo
return documentElement == null ? null
: documentElement.lookupNamespaceURI(specifiedPrefix);
}
+
+ public final void checkChild(OMNode child) {
+ if (child instanceof OMElement) {
+ if (getOMDocumentElement() != null) {
+ throw new OMException("Document element already exists");
+ } else {
+ checkDocumentElement((OMElement)child);
+ }
+ }
+ }
+
+ protected void checkDocumentElement(OMElement element) {
+ }
}
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java?rev=1431544&r1=1431543&r2=1431544&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java Thu Jan 10 18:25:34 2013
@@ -1236,4 +1236,7 @@ public class ElementImpl extends ParentN
ParentNode parent = parentNode();
return parent == null || parent instanceof Document ? null : parent.lookupNamespaceURI(specifiedPrefix);
}
+
+ public final void checkChild(OMNode child) {
+ }
}
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPEnvelopeImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPEnvelopeImpl.java?rev=1431544&r1=1431543&r2=1431544&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPEnvelopeImpl.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPEnvelopeImpl.java Thu Jan 10 18:25:34 2013
@@ -90,7 +90,8 @@ public class SOAPEnvelopeImpl extends SO
*
* @param child
*/
- private void checkChild(OMNode child) {
+ // TODO: this should be integrated into the checkChild API
+ private void internalCheckChild(OMNode child) {
if ((child instanceof OMElement)
&& !(child instanceof SOAPHeader || child instanceof SOAPBody)) {
throw new SOAPProcessingException(
@@ -103,7 +104,7 @@ public class SOAPEnvelopeImpl extends SO
// SOAP 1.1 allows for arbitrary elements after SOAPBody so do NOT check for
// node types when appending to SOAP 1.1 envelope.
if (getVersion() instanceof SOAP12Version) {
- checkChild(child);
+ internalCheckChild(child);
}
if (child instanceof SOAPHeader) {
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPMessageImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPMessageImpl.java?rev=1431544&r1=1431543&r2=1431544&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPMessageImpl.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPMessageImpl.java Thu Jan 10 18:25:34 2013
@@ -20,6 +20,8 @@
package org.apache.axiom.soap.impl.dom;
import org.apache.axiom.om.OMCloneOptions;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMException;
import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axiom.om.impl.OMNodeEx;
import org.apache.axiom.om.impl.dom.DocumentImpl;
@@ -46,9 +48,14 @@ public class SOAPMessageImpl extends Doc
return (SOAPEnvelope) getOMDocumentElement();
}
- public void setSOAPEnvelope(SOAPEnvelope envelope)
- throws SOAPProcessingException {
- this.addChild(envelope, true);
+ public void setSOAPEnvelope(SOAPEnvelope envelope) {
+ setOMDocumentElement(envelope);
+ }
+
+ protected void checkDocumentElement(OMElement element) {
+ if (!(element instanceof SOAPEnvelope)) {
+ throw new OMException("Child not allowed; must be a SOAPEnvelope");
+ }
}
protected void internalSerialize(XMLStreamWriter writer, boolean cache,
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocumentImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocumentImpl.java?rev=1431544&r1=1431543&r2=1431544&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocumentImpl.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocumentImpl.java Thu Jan 10 18:25:34 2013
@@ -149,12 +149,22 @@ public class OMDocumentImpl extends OMSe
}
public void addChild(OMNode omNode, boolean fromBuilder) {
- if (!fromBuilder && omNode instanceof OMElement && getOMDocumentElement() != null) {
- throw new OMException("Document element already exists");
- }
OMContainerHelper.addChild(this, omNode, fromBuilder);
}
+ public final void checkChild(OMNode child) {
+ if (child instanceof OMElement) {
+ if (getOMDocumentElement() != null) {
+ throw new OMException("Document element already exists");
+ } else {
+ checkDocumentElement((OMElement)child);
+ }
+ }
+ }
+
+ protected void checkDocumentElement(OMElement element) {
+ }
+
/**
* Returns a collection of this element. Children can be of types OMElement, OMText.
*
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java?rev=1431544&r1=1431543&r2=1431544&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java Thu Jan 10 18:25:34 2013
@@ -225,6 +225,9 @@ public class OMElementImpl extends OMNod
OMContainerHelper.addChild(this, omNode, fromBuilder);
}
+ public void checkChild(OMNode child) {
+ }
+
/**
* Searches for children with a given QName and returns an iterator to traverse through the
* OMNodes. This QName can contain any combination of prefix, localname and URI.
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java?rev=1431544&r1=1431543&r2=1431544&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java Thu Jan 10 18:25:34 2013
@@ -844,6 +844,10 @@ public class OMSourcedElementImpl extend
super.addChild(omNode, fromBuilder);
}
+ public void checkChild(OMNode child) {
+ super.checkChild(child);
+ }
+
public Iterator getChildrenWithName(QName elementQName) {
forceExpand();
return super.getChildrenWithName(elementQName);
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPEnvelopeImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPEnvelopeImpl.java?rev=1431544&r1=1431543&r2=1431544&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPEnvelopeImpl.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPEnvelopeImpl.java Thu Jan 10 18:25:34 2013
@@ -101,7 +101,8 @@ public class SOAPEnvelopeImpl extends SO
*
* @param child
*/
- private void checkChild(OMNode child) {
+ // TODO: this should be integrated into the checkChild API
+ private void internalCheckChild(OMNode child) {
if ((child instanceof OMElement)
&& !(child instanceof SOAPHeader || child instanceof SOAPBody)) {
throw new SOAPProcessingException(
@@ -118,7 +119,7 @@ public class SOAPEnvelopeImpl extends SO
// SOAP 1.1 allows for arbitrary elements after SOAPBody so do NOT check for
// node types when appending to SOAP 1.1 envelope.
if (getVersion() instanceof SOAP12Version) {
- checkChild(child);
+ internalCheckChild(child);
}
if (child instanceof SOAPHeader) {
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPMessageImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPMessageImpl.java?rev=1431544&r1=1431543&r2=1431544&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPMessageImpl.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPMessageImpl.java Thu Jan 10 18:25:34 2013
@@ -22,6 +22,7 @@ package org.apache.axiom.soap.impl.llom;
import org.apache.axiom.om.OMCloneOptions;
import org.apache.axiom.om.OMDocument;
import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMException;
import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axiom.om.impl.OMNodeEx;
import org.apache.axiom.om.impl.llom.OMDocumentImpl;
@@ -49,13 +50,14 @@ public class SOAPMessageImpl extends OMD
return (SOAPEnvelope) getOMDocumentElement();
}
- public void setSOAPEnvelope(SOAPEnvelope envelope) throws SOAPProcessingException {
- super.addChild(envelope, true);
+ public void setSOAPEnvelope(SOAPEnvelope envelope) {
+ setOMDocumentElement(envelope);
}
- public void setOMDocumentElement(OMElement rootElement) {
- throw new UnsupportedOperationException(
- "This is not allowed. Use set SOAPEnvelope instead");
+ protected void checkDocumentElement(OMElement element) {
+ if (!(element instanceof SOAPEnvelope)) {
+ throw new OMException("Child not allowed; must be a SOAPEnvelope");
+ }
}
protected void internalSerialize(XMLStreamWriter writer, boolean cache,
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11Factory.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11Factory.java?rev=1431544&r1=1431543&r2=1431544&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11Factory.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11Factory.java Thu Jan 10 18:25:34 2013
@@ -324,7 +324,12 @@ public class SOAP11Factory extends OMLin
}
public SOAPMessage createSOAPMessage(OMXMLParserWrapper builder) {
- return new SOAPMessageImpl(builder, this);
+ if (builder == null) {
+ // For Spring-WS compatibility
+ return createSOAPMessage();
+ } else {
+ return new SOAPMessageImpl(builder, this);
+ }
}
public SOAPEnvelope createSOAPEnvelope(SOAPMessage message, OMXMLParserWrapper builder) {
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12Factory.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12Factory.java?rev=1431544&r1=1431543&r2=1431544&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12Factory.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12Factory.java Thu Jan 10 18:25:34 2013
@@ -327,7 +327,12 @@ public class SOAP12Factory extends OMLin
}
public SOAPMessage createSOAPMessage(OMXMLParserWrapper builder) {
- return new SOAPMessageImpl(builder, this);
+ if (builder == null) {
+ // For Spring-WS compatibility
+ return createSOAPMessage();
+ } else {
+ return new SOAPMessageImpl(builder, this);
+ }
}
public SOAPEnvelope createSOAPEnvelope(SOAPMessage message, OMXMLParserWrapper builder) {
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java?rev=1431544&r1=1431543&r2=1431544&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java Thu Jan 10 18:25:34 2013
@@ -132,6 +132,7 @@ public class OMTestSuiteBuilder extends
}
}
addTest(new org.apache.axiom.ts.om.document.TestAddChildIncomplete(metaFactory));
+ addTest(new org.apache.axiom.ts.om.document.TestAddChildWithExistingDocumentElement(metaFactory));
for (int i=0; i<conformanceFiles.length; i++) {
addTest(new org.apache.axiom.ts.om.document.TestClone(metaFactory, conformanceFiles[i]));
}
Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/document/TestAddChildWithExistingDocumentElement.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/document/TestAddChildWithExistingDocumentElement.java?rev=1431544&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/document/TestAddChildWithExistingDocumentElement.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/document/TestAddChildWithExistingDocumentElement.java Thu Jan 10 18:25:34 2013
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.ts.om.document;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMContainer;
+import org.apache.axiom.om.OMDocument;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMException;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.om.OMNode;
+import org.apache.axiom.ts.AxiomTestCase;
+
+/**
+ * Tests that an attempt to use {@link OMContainer#addChild(OMNode)} to add an {@link OMElement} to
+ * an {@link OMDocument} that already has a document element results in an exception.
+ */
+public class TestAddChildWithExistingDocumentElement extends AxiomTestCase {
+ public TestAddChildWithExistingDocumentElement(OMMetaFactory metaFactory) {
+ super(metaFactory);
+ }
+
+ protected void runTest() throws Throwable {
+ OMFactory factory = metaFactory.getOMFactory();
+ OMDocument document = factory.createOMDocument();
+ document.addChild(factory.createOMElement(new QName("root1")));
+ try {
+ document.addChild(factory.createOMElement(new QName("root2")));
+ fail("Expected OMException");
+ } catch (OMException ex) {
+ // Expected
+ }
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/document/TestAddChildWithExistingDocumentElement.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java?rev=1431544&r1=1431543&r2=1431544&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java Thu Jan 10 18:25:34 2013
@@ -201,6 +201,8 @@ public class SOAPTestSuiteBuilder extend
addTest(new org.apache.axiom.ts.soap.message.TestCloneIncomplete(metaFactory, spec, false));
addTest(new org.apache.axiom.ts.soap.message.TestGetCharsetEncodingWithParser(metaFactory, spec));
addTest(new org.apache.axiom.ts.soap.message.TestGetOMFactoryWithParser(metaFactory, spec));
+ addTest(new org.apache.axiom.ts.soap.message.TestSetOMDocumentElement(metaFactory, spec));
+ addTest(new org.apache.axiom.ts.soap.message.TestSetOMDocumentElementNonSOAPEnvelope(metaFactory, spec));
addTest(new org.apache.axiom.ts.soap.xpath.TestXPathAppliedToSOAPEnvelope(metaFactory, spec, true));
addTest(new org.apache.axiom.ts.soap.xpath.TestXPathAppliedToSOAPEnvelope(metaFactory, spec, false));
}
Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/message/TestSetOMDocumentElement.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/message/TestSetOMDocumentElement.java?rev=1431544&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/message/TestSetOMDocumentElement.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/message/TestSetOMDocumentElement.java Thu Jan 10 18:25:34 2013
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.ts.soap.message;
+
+import org.apache.axiom.om.OMDocument;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPMessage;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+/**
+ * Tests the behavior of {@link OMDocument#setOMDocumentElement(OMElement)} when used to set a
+ * {@link SOAPEnvelope} as the root element of a {@link SOAPMessage}.
+ */
+public class TestSetOMDocumentElement extends SOAPTestCase {
+ public TestSetOMDocumentElement(OMMetaFactory metaFactory, SOAPSpec spec) {
+ super(metaFactory, spec);
+ }
+
+ protected void runTest() throws Throwable {
+ SOAPMessage message = soapFactory.createSOAPMessage();
+ OMElement envelope = soapFactory.getDefaultEnvelope();
+ message.setOMDocumentElement(envelope);
+ assertSame(envelope, message.getFirstOMChild());
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/message/TestSetOMDocumentElement.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/message/TestSetOMDocumentElementNonSOAPEnvelope.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/message/TestSetOMDocumentElementNonSOAPEnvelope.java?rev=1431544&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/message/TestSetOMDocumentElementNonSOAPEnvelope.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/message/TestSetOMDocumentElementNonSOAPEnvelope.java Thu Jan 10 18:25:34 2013
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.ts.soap.message;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMDocument;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMException;
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPMessage;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+/**
+ * Tests the behavior of {@link OMDocument#setOMDocumentElement(OMElement)} when an attempt is made
+ * to set an {@link OMElement} that is not a {@link SOAPEnvelope} as the root element of a
+ * {@link SOAPMessage}. In this case, an exception should be thrown.
+ */
+public class TestSetOMDocumentElementNonSOAPEnvelope extends SOAPTestCase {
+ public TestSetOMDocumentElementNonSOAPEnvelope(OMMetaFactory metaFactory, SOAPSpec spec) {
+ super(metaFactory, spec);
+ }
+
+ protected void runTest() throws Throwable {
+ SOAPMessage message = soapFactory.createSOAPMessage();
+ OMElement element = soapFactory.createOMElement(new QName("test"));
+ try {
+ message.setOMDocumentElement(element);
+ fail("Expected OMException");
+ } catch (OMException ex) {
+ // Expected
+ }
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/message/TestSetOMDocumentElementNonSOAPEnvelope.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/commons/trunk/modules/axiom/systests/pom.xml
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/systests/pom.xml?rev=1431544&r1=1431543&r2=1431544&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/systests/pom.xml (original)
+++ webservices/commons/trunk/modules/axiom/systests/pom.xml Thu Jan 10 18:25:34 2013
@@ -48,5 +48,6 @@
<modules>
<module>jboss-tests</module>
<module>osgi-tests</module>
+ <module>spring-ws-tests</module>
</modules>
</project>
Propchange: webservices/commons/trunk/modules/axiom/systests/spring-ws-tests/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Jan 10 18:25:34 2013
@@ -0,0 +1,4 @@
+.settings
+target
+.classpath
+.project
Added: webservices/commons/trunk/modules/axiom/systests/spring-ws-tests/pom.xml
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/systests/spring-ws-tests/pom.xml?rev=1431544&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/systests/spring-ws-tests/pom.xml (added)
+++ webservices/commons/trunk/modules/axiom/systests/spring-ws-tests/pom.xml Thu Jan 10 18:25:34 2013
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.ws.commons.axiom</groupId>
+ <artifactId>systests</artifactId>
+ <version>1.2.15-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>spring-ws-tests</artifactId>
+ <name>Spring WS Tests</name>
+ <description>
+ Tests interoperability with recent Spring Web Services releases.
+ </description>
+ <packaging>jar</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.ws</groupId>
+ <artifactId>spring-ws-core</artifactId>
+ <version>2.1.2.RELEASE</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>axiom-impl</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
Propchange: webservices/commons/trunk/modules/axiom/systests/spring-ws-tests/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/systests/spring-ws-tests/src/test/java/org/apache/axiom/systest/springws/AxiomSoapMessageFactoryTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/systests/spring-ws-tests/src/test/java/org/apache/axiom/systest/springws/AxiomSoapMessageFactoryTest.java?rev=1431544&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/systests/spring-ws-tests/src/test/java/org/apache/axiom/systest/springws/AxiomSoapMessageFactoryTest.java (added)
+++ webservices/commons/trunk/modules/axiom/systests/spring-ws-tests/src/test/java/org/apache/axiom/systest/springws/AxiomSoapMessageFactoryTest.java Thu Jan 10 18:25:34 2013
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.systest.springws;
+
+import junit.framework.TestCase;
+
+import org.apache.axiom.soap.SOAPMessage;
+import org.springframework.ws.soap.axiom.AxiomSoapMessage;
+import org.springframework.ws.soap.axiom.AxiomSoapMessageFactory;
+
+public class AxiomSoapMessageFactoryTest extends TestCase {
+ /**
+ * Regression test for <a href="https://issues.apache.org/jira/browse/AXIOM-444">AXIOM-444</a>.
+ *
+ * @throws Exception
+ */
+ public void testCreateWebServiceMessage() throws Exception {
+ AxiomSoapMessageFactory mf = new AxiomSoapMessageFactory();
+ mf.afterPropertiesSet();
+ AxiomSoapMessage swsMessage = mf.createWebServiceMessage();
+ SOAPMessage message = swsMessage.getAxiomMessage();
+ // Spring-WS uses SOAPFactory#createSOAPMessage(OMXMLParserWrapper) with a null argument.
+ // We need to make sure that we nevertheless get a SOAPMessage that is in state complete.
+ assertTrue(message.isComplete());
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/systests/spring-ws-tests/src/test/java/org/apache/axiom/systest/springws/AxiomSoapMessageFactoryTest.java
------------------------------------------------------------------------------
svn:eol-style = native