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 2012/12/20 16:55:27 UTC
svn commit: r1424548 [4/5] - in /webservices/axiom/branches/AXIOM-201: ./
etc/ legal/ modules/axiom-all/ modules/axiom-api/
modules/axiom-api/src/main/java/org/apache/axiom/om/
modules/axiom-api/src/main/java/org/apache/axiom/om/dom/
modules/axiom-api/...
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java Thu Dec 20 15:55:24 2012
@@ -117,9 +117,7 @@ public abstract class NodeImpl implement
}
public void setPrefix(String prefix) throws DOMException {
- throw new DOMException(DOMException.NAMESPACE_ERR, DOMMessageFormatter
- .formatMessage(DOMMessageFormatter.DOM_DOMAIN, DOMException.NAMESPACE_ERR,
- null));
+ throw DOMUtil.newDOMException(DOMException.NAMESPACE_ERR);
}
/**
@@ -211,8 +209,7 @@ public abstract class NodeImpl implement
// This is not yet implemented. In the meantime, we throw a DOMException
// and not an UnsupportedOperationException, since this works better with
// some other libraries (such as Saxon 8.9).
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, DOMMessageFormatter
- .formatMessage(DOMMessageFormatter.DOM_DOMAIN, DOMException.NOT_SUPPORTED_ERR, null));
+ throw DOMUtil.newDOMException(DOMException.NOT_SUPPORTED_ERR);
}
public String getTextContent() throws DOMException {
@@ -246,11 +243,6 @@ public abstract class NodeImpl implement
throw new UnsupportedOperationException("TODO");
}
- public String lookupNamespaceURI(String prefix) {
- // TODO TODO
- throw new UnsupportedOperationException("TODO");
- }
-
/**
* Tests whether two nodes are equal. <br>This method tests for equality of nodes, not sameness
* (i.e., whether the two nodes are references to the same object) which can be tested with
@@ -514,10 +506,7 @@ public abstract class NodeImpl implement
if (ownerDocument() != (otherNode instanceof AttrImpl
? ((AttrImpl)otherNode).getOwnerDocument()
: ((NodeImpl)otherNode).ownerDocument())) {
- throw new DOMException(DOMException.WRONG_DOCUMENT_ERR,
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- DOMException.WRONG_DOCUMENT_ERR, null));
+ throw DOMUtil.newDOMException(DOMException.WRONG_DOCUMENT_ERR);
}
}
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java Thu Dec 20 15:55:24 2012
@@ -217,10 +217,7 @@ public abstract class ParentNode extends
}
if (isAncestorOrSelf(newChild)) {
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- DOMException.HIERARCHY_REQUEST_ERR, null));
+ throw DOMUtil.newDOMException(DOMException.HIERARCHY_REQUEST_ERR);
}
if (newDomChild.parentNode() != null) {
@@ -232,10 +229,7 @@ public abstract class ParentNode extends
if (newDomChild instanceof ElementImpl) {
if (((DocumentImpl) this).getOMDocumentElement(false) != null) {
// Throw exception since there cannot be two document elements
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- DOMException.HIERARCHY_REQUEST_ERR, null));
+ throw DOMUtil.newDOMException(DOMException.HIERARCHY_REQUEST_ERR);
}
if (newDomChild.parentNode() == null) {
newDomChild.setParent(this, useDomSemantics);
@@ -244,10 +238,7 @@ public abstract class ParentNode extends
|| newDomChild instanceof ProcessingInstructionImpl
|| newDomChild instanceof DocumentFragmentImpl
|| newDomChild instanceof DocumentTypeImpl)) {
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- DOMException.HIERARCHY_REQUEST_ERR, null));
+ throw DOMUtil.newDOMException(DOMException.HIERARCHY_REQUEST_ERR);
}
}
@@ -350,10 +341,7 @@ public abstract class ParentNode extends
}
if (!found) {
- throw new DOMException(DOMException.NOT_FOUND_ERR,
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- DOMException.NOT_FOUND_ERR, null));
+ throw DOMUtil.newDOMException(DOMException.NOT_FOUND_ERR);
}
if (newDomChild.parentNode() == null) {
@@ -379,10 +367,7 @@ public abstract class ParentNode extends
}
if (isAncestorOrSelf(newChild)) {
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- DOMException.HIERARCHY_REQUEST_ERR, null));
+ throw DOMUtil.newDOMException(DOMException.HIERARCHY_REQUEST_ERR);
}
checkSameOwnerDocument(newDomChild);
@@ -391,7 +376,7 @@ public abstract class ParentNode extends
boolean found = false;
while (!found && children.hasNext()) {
NodeImpl tempNode = (NodeImpl) children.next();
- if (tempNode.equals(oldChild)) {
+ if (tempNode == oldChild) {
NodeImpl head; // The first child to insert
NodeImpl tail; // The last child to insert
@@ -416,37 +401,25 @@ public abstract class ParentNode extends
newDomChild.setParent(this, true);
}
- if (this.firstChild == oldDomChild) {
-
- if (this.firstChild.internalGetNextSibling() != null) {
- this.firstChild.internalGetNextSibling().internalSetPreviousSibling(tail);
- tail.internalSetNextSibling(this.firstChild.internalGetNextSibling());
- }
-
- //Cleanup the current first child
- this.firstChild.setParent(null, true);
- this.firstChild.internalSetNextSibling(null);
-
- //Set the new first child
+ // We use getNextSibling here to force bulding the node if necessary
+ NodeImpl nextSibling = (NodeImpl)oldDomChild.getNextSibling();
+ NodeImpl previousSibling = oldDomChild.internalGetPreviousSibling();
+
+ tail.internalSetNextSibling(nextSibling);
+ head.internalSetPreviousSibling(previousSibling);
+
+ if (previousSibling != null) {
+ previousSibling.internalSetNextSibling(head);
+ } else {
this.firstChild = head;
-
+ }
+ if (nextSibling != null) {
+ nextSibling.internalSetPreviousSibling(tail);
} else {
- // We use getNextSibling here to force bulding the node if necessary
- tail.internalSetNextSibling((NodeImpl)oldDomChild.getNextSibling());
- head.internalSetPreviousSibling(oldDomChild.internalGetPreviousSibling());
-
- oldDomChild.internalGetPreviousSibling().internalSetNextSibling(head);
-
- // If the old child is not the last
- if (oldDomChild.internalGetNextSibling() != null) {
- oldDomChild.internalGetNextSibling().internalSetPreviousSibling(tail);
- } else {
- this.lastChild = newDomChild;
- }
-
+ this.lastChild = tail;
}
-
+
found = true;
// remove the old child's references to this tree
@@ -457,10 +430,7 @@ public abstract class ParentNode extends
}
if (!found)
- throw new DOMException(DOMException.NOT_FOUND_ERR,
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN, DOMException.NOT_FOUND_ERR,
- null));
+ throw DOMUtil.newDOMException(DOMException.NOT_FOUND_ERR);
return oldChild;
}
@@ -471,10 +441,7 @@ public abstract class ParentNode extends
((NodeImpl)oldChild).detach(true);
return oldChild;
} else {
- throw new DOMException(DOMException.NOT_FOUND_ERR,
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN, DOMException.NOT_FOUND_ERR,
- null));
+ throw DOMUtil.newDOMException(DOMException.NOT_FOUND_ERR);
}
}
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextNodeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextNodeImpl.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextNodeImpl.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextNodeImpl.java Thu Dec 20 15:55:24 2012
@@ -40,7 +40,6 @@ import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
import java.io.IOException;
-import java.io.InputStream;
public abstract class TextNodeImpl extends CharacterImpl implements Text, OMText {
private String mimeType;
@@ -190,10 +189,7 @@ public abstract class TextNodeImpl exten
*/
public Text splitText(int offset) throws DOMException {
if (offset < 0 || offset > this.textValue.length()) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR,
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN, DOMException.INDEX_SIZE_ERR,
- null));
+ throw DOMUtil.newDOMException(DOMException.INDEX_SIZE_ERR);
}
String newValue = this.textValue.substring(offset);
this.deleteData(offset, this.textValue.length());
@@ -272,7 +268,17 @@ public abstract class TextNodeImpl exten
}
public char[] getTextCharacters() {
- return charArray != null ? charArray : this.textValue.toCharArray();
+ if (charArray != null) {
+ return charArray;
+ } else if (textValue != null) {
+ return textValue.toCharArray();
+ } else {
+ try {
+ return Base64Utils.encodeToCharArray((DataHandler)getDataHandler());
+ } catch (IOException ex) {
+ throw new OMException(ex);
+ }
+ }
}
public boolean isCharacters() {
@@ -352,26 +358,6 @@ public abstract class TextNodeImpl exten
}
}
- public java.io.InputStream getInputStream() throws OMException {
- if (isBinary) {
- if (dataHandlerObject == null) {
- getDataHandler();
- }
- InputStream inStream;
- javax.activation.DataHandler dataHandler =
- (javax.activation.DataHandler) dataHandlerObject;
- try {
- inStream = dataHandler.getDataSource().getInputStream();
- } catch (IOException e) {
- throw new OMException(
- "Cannot get InputStream from DataHandler.", e);
- }
- return inStream;
- } else {
- throw new OMException("Unsupported Operation");
- }
- }
-
public void internalSerialize(XMLStreamWriter writer, boolean cache)
throws XMLStreamException {
if (!this.isBinary) {
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java Thu Dec 20 15:55:24 2012
@@ -359,6 +359,10 @@ public class OMDOMFactory implements OMF
return new DocumentImpl(builder, this);
}
+ public OMEntityReference createOMEntityReference(OMContainer parent, String name) {
+ return createOMEntityReference(parent, name, null, false);
+ }
+
public OMEntityReference createOMEntityReference(OMContainer parent, String name, String replacementText, boolean fromBuilder) {
EntityReferenceImpl node = new EntityReferenceImpl(name, replacementText, this);
if (parent != null) {
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPFaultCodeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPFaultCodeImpl.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPFaultCodeImpl.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPFaultCodeImpl.java Thu Dec 20 15:55:24 2012
@@ -51,10 +51,6 @@ public abstract class SOAPFaultCodeImpl
ElementHelper.setNewElement(this, value, value);
}
- public SOAPFaultValue getValue() {
- return (SOAPFaultValue)getFirstChildWithName(SOAP12Constants.QNAME_FAULT_VALUE);
- }
-
public void setSubCode(SOAPFaultSubCode value) throws SOAPProcessingException {
ElementHelper.setNewElement(this, getSubCode(), value);
}
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultCodeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultCodeImpl.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultCodeImpl.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultCodeImpl.java Thu Dec 20 15:55:24 2012
@@ -105,10 +105,18 @@ public class SOAP11FaultCodeImpl extends
return SOAP11Constants.SOAP_FAULT_CODE_LOCAL_NAME;
}
+ public SOAPFaultValue getValue() {
+ return null;
+ }
+
public void setValue(QName value) {
setText(value);
}
+ public QName getValueAsQName() {
+ return getTextAsQName();
+ }
+
protected OMElement createClone(OMCloneOptions options, ParentNode targetParent,
boolean generateNSDecl) {
return new SOAP11FaultCodeImpl(targetParent, namespace, null, factory, generateNSDecl);
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultSubCodeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultSubCodeImpl.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultSubCodeImpl.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultSubCodeImpl.java Thu Dec 20 15:55:24 2012
@@ -90,6 +90,11 @@ public class SOAP11FaultSubCodeImpl exte
throw new UnsupportedOperationException();
}
+ public QName getValueAsQName() {
+ // TODO: AXIOM-394: SOAPFaultSubCode should not exist for SOAP 1.1
+ throw new UnsupportedOperationException();
+ }
+
protected OMElement createClone(OMCloneOptions options, ParentNode targetParent,
boolean generateNSDecl) {
return new SOAP11FaultSubCodeImpl(targetParent, namespace, null, factory, generateNSDecl);
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/SOAP12FaultCodeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/SOAP12FaultCodeImpl.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/SOAP12FaultCodeImpl.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/SOAP12FaultCodeImpl.java Thu Dec 20 15:55:24 2012
@@ -25,6 +25,7 @@ import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axiom.om.impl.dom.ParentNode;
+import org.apache.axiom.soap.SOAP12Constants;
import org.apache.axiom.soap.SOAPFactory;
import org.apache.axiom.soap.SOAPFault;
import org.apache.axiom.soap.SOAPFaultSubCode;
@@ -66,10 +67,9 @@ public class SOAP12FaultCodeImpl extends
super.setValue(value);
}
-
+ // TODO: For compatibility with Axiom 1.2.x; remove in Axiom 1.3
public QName getTextAsQName() {
- SOAPFaultValue value = getValue();
- return value == null ? null : value.getTextAsQName();
+ return getValueAsQName();
}
protected void checkParent(OMElement parent) throws SOAPProcessingException {
@@ -80,6 +80,10 @@ public class SOAP12FaultCodeImpl extends
}
}
+ public SOAPFaultValue getValue() {
+ return (SOAPFaultValue)getFirstChildWithName(SOAP12Constants.QNAME_FAULT_VALUE);
+ }
+
public void setValue(QName value) {
SOAPFaultValue valueElement = getValue();
if (valueElement == null) {
@@ -88,6 +92,11 @@ public class SOAP12FaultCodeImpl extends
valueElement.setText(value);
}
+ public QName getValueAsQName() {
+ SOAPFaultValue value = getValue();
+ return value == null ? null : value.getTextAsQName();
+ }
+
protected OMElement createClone(OMCloneOptions options, ParentNode targetParent,
boolean generateNSDecl) {
return new SOAP12FaultCodeImpl(targetParent, namespace, null, factory, generateNSDecl);
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/SOAP12FaultSubCodeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/SOAP12FaultSubCodeImpl.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/SOAP12FaultSubCodeImpl.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/SOAP12FaultSubCodeImpl.java Thu Dec 20 15:55:24 2012
@@ -89,6 +89,11 @@ public class SOAP12FaultSubCodeImpl exte
valueElement.setText(value);
}
+ public QName getValueAsQName() {
+ SOAPFaultValue value = getValue();
+ return value == null ? null : value.getTextAsQName();
+ }
+
protected OMElement createClone(OMCloneOptions options, ParentNode targetParent,
boolean generateNSDecl) {
return new SOAP12FaultSubCodeImpl(targetParent, namespace, null, factory, generateNSDecl);
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java Thu Dec 20 15:55:24 2012
@@ -23,8 +23,7 @@ import junit.framework.TestSuite;
import org.apache.axiom.om.impl.dom.factory.OMDOMMetaFactory;
import org.apache.axiom.ts.om.OMTestSuiteBuilder;
-import org.apache.axiom.ts.om.builder.TestCreateOMBuilderFromDOMSource;
-import org.apache.axiom.ts.om.container.TestGetXMLStreamReader;
+import org.apache.axiom.ts.om.builder.TestCreateOMBuilderFromDOM;
import org.apache.axiom.ts.om.container.TestSerialize;
import org.apache.axiom.ts.om.document.TestClone;
import org.apache.axiom.ts.om.document.TestDigest;
@@ -51,7 +50,7 @@ public class OMImplementationTest extend
// TODO: this case is not working because Axiom generates an XML declaration
// but uses another charset encoding to serialize the document
builder.exclude(TestSerialize.class, "(&(file=iso-8859-1.xml)(container=document))");
- builder.exclude(TestCreateOMBuilderFromDOMSource.class, "(file=iso-8859-1.xml)");
+ builder.exclude(TestCreateOMBuilderFromDOM.class, "(file=iso-8859-1.xml)");
builder.exclude(TestClone.class, "(file=iso-8859-1.xml)");
// TODO: investigate why this is not working with DOOM
@@ -63,9 +62,6 @@ public class OMImplementationTest extend
// TODO
builder.exclude(TestSerializationWithTwoNonBuiltOMElements.class);
- // TODO
- builder.exclude(TestGetXMLStreamReader.class, "(&(source=dom)(|(file=entity-reference-external-subset.xml)(file=entity-reference-internal-subset.xml)))");
-
return builder.build();
}
}
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-impl/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-impl/pom.xml?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-impl/pom.xml (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-impl/pom.xml Thu Dec 20 15:55:24 2012
@@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-parent</artifactId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>1.2.15-SNAPSHOT</version>
<relativePath>../axiom-parent/pom.xml</relativePath>
</parent>
<artifactId>axiom-impl</artifactId>
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMTextImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMTextImpl.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMTextImpl.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMTextImpl.java Thu Dec 20 15:55:24 2012
@@ -39,7 +39,6 @@ import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
import java.io.IOException;
-import java.io.InputStream;
public class OMTextImpl extends OMLeafNode implements OMText, OMConstants {
/** Field nameSpace used when serializing Binary stuff as MTOM optimized. */
@@ -255,7 +254,17 @@ public class OMTextImpl extends OMLeafNo
}
public char[] getTextCharacters() {
- return charArray != null ? charArray : value.toCharArray();
+ if (charArray != null) {
+ return charArray;
+ } else if (value != null) {
+ return value.toCharArray();
+ } else {
+ try {
+ return Base64Utils.encodeToCharArray((DataHandler)getDataHandler());
+ } catch (IOException ex) {
+ throw new OMException(ex);
+ }
+ }
}
public boolean isCharacters() {
@@ -354,26 +363,6 @@ public class OMTextImpl extends OMLeafNo
}
}
- public java.io.InputStream getInputStream() throws OMException {
- if (isBinary) {
- if (dataHandlerObject == null) {
- getDataHandler();
- }
- InputStream inStream;
- javax.activation.DataHandler dataHandler =
- (javax.activation.DataHandler) dataHandlerObject;
- try {
- inStream = dataHandler.getDataSource().getInputStream();
- } catch (IOException e) {
- throw new OMException(
- "Cannot get InputStream from DataHandler.", e);
- }
- return inStream;
- } else {
- throw new OMException("Unsupported Operation");
- }
- }
-
public String getContentID() {
if (contentID == null) {
contentID = UIDGenerator.generateContentId();
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java Thu Dec 20 15:55:24 2012
@@ -353,6 +353,10 @@ public class OMLinkedListImplFactory imp
return new OMDocumentImpl(builder, this);
}
+ public OMEntityReference createOMEntityReference(OMContainer parent, String name) {
+ return createOMEntityReference(parent, name, null, false);
+ }
+
public OMEntityReference createOMEntityReference(OMContainer parent, String name, String replacementText, boolean fromBuilder) {
return new OMEntityReferenceImpl(parent, name, replacementText, this, fromBuilder);
}
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11FaultCodeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11FaultCodeImpl.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11FaultCodeImpl.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11FaultCodeImpl.java Thu Dec 20 15:55:24 2012
@@ -91,7 +91,6 @@ public class SOAP11FaultCodeImpl extends
public SOAPFaultValue getValue() {
return null;
-// throw new UnsupportedOperationException("getValue() not supported for SOAP 1.1 faults");
}
public SOAPFaultSubCode getSubCode() {
@@ -102,4 +101,8 @@ public class SOAP11FaultCodeImpl extends
public void setValue(QName value) {
setText(value);
}
+
+ public QName getValueAsQName() {
+ return getTextAsQName();
+ }
}
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11FaultSubCodeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11FaultSubCodeImpl.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11FaultSubCodeImpl.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11FaultSubCodeImpl.java Thu Dec 20 15:55:24 2012
@@ -95,4 +95,9 @@ public class SOAP11FaultSubCodeImpl exte
// TODO: AXIOM-394: SOAPFaultSubCode should not exist for SOAP 1.1
throw new UnsupportedOperationException();
}
+
+ public QName getValueAsQName() {
+ // TODO: AXIOM-394: SOAPFaultSubCode should not exist for SOAP 1.1
+ throw new UnsupportedOperationException();
+ }
}
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12FaultCodeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12FaultCodeImpl.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12FaultCodeImpl.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12FaultCodeImpl.java Thu Dec 20 15:55:24 2012
@@ -76,9 +76,9 @@ public class SOAP12FaultCodeImpl extends
}
}
- // Overridden so that we can have a single interface to reliably get the faultcode's value
+ // TODO: For compatibility with Axiom 1.2.x; remove in Axiom 1.3
public QName getTextAsQName() {
- return getValue().getTextAsQName();
+ return getValueAsQName();
}
public SOAPFaultValue getValue() {
@@ -96,4 +96,9 @@ public class SOAP12FaultCodeImpl extends
}
valueElement.setText(value);
}
+
+ public QName getValueAsQName() {
+ SOAPFaultValue value = getValue();
+ return value == null ? null : value.getTextAsQName();
+ }
}
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12FaultSubCodeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12FaultSubCodeImpl.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12FaultSubCodeImpl.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12FaultSubCodeImpl.java Thu Dec 20 15:55:24 2012
@@ -96,4 +96,9 @@ public class SOAP12FaultSubCodeImpl exte
}
valueElement.setText(value);
}
+
+ public QName getValueAsQName() {
+ SOAPFaultValue value = getValue();
+ return value == null ? null : value.getTextAsQName();
+ }
}
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMImplementationTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMImplementationTest.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMImplementationTest.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMImplementationTest.java Thu Dec 20 15:55:24 2012
@@ -23,8 +23,7 @@ import junit.framework.TestSuite;
import org.apache.axiom.om.impl.llom.factory.OMLinkedListMetaFactory;
import org.apache.axiom.ts.om.OMTestSuiteBuilder;
-import org.apache.axiom.ts.om.builder.TestCreateOMBuilderFromDOMSource;
-import org.apache.axiom.ts.om.container.TestGetXMLStreamReader;
+import org.apache.axiom.ts.om.builder.TestCreateOMBuilderFromDOM;
import org.apache.axiom.ts.om.container.TestSerialize;
import org.apache.axiom.ts.om.document.TestClone;
import org.apache.axiom.ts.om.document.TestDigest;
@@ -45,15 +44,12 @@ public class OMImplementationTest extend
// TODO: this case is not working because Axiom generates an XML declaration
// but uses another charset encoding to serialize the document
builder.exclude(TestSerialize.class, "(&(file=iso-8859-1.xml)(container=document))");
- builder.exclude(TestCreateOMBuilderFromDOMSource.class, "(file=iso-8859-1.xml)");
+ builder.exclude(TestCreateOMBuilderFromDOM.class, "(file=iso-8859-1.xml)");
builder.exclude(TestClone.class, "(file=iso-8859-1.xml)");
// TODO: if there is a comment node surrounded by text, then these text nodes need to be merged
builder.exclude(TestDigest.class, "(|(file=digest3.xml)(file=digest4.xml))");
- // TODO
- builder.exclude(TestGetXMLStreamReader.class, "(&(source=dom)(|(file=entity-reference-external-subset.xml)(file=entity-reference-internal-subset.xml)))");
-
return builder.build();
}
}
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-integration/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-integration/pom.xml?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-integration/pom.xml (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-integration/pom.xml Thu Dec 20 15:55:24 2012
@@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-parent</artifactId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>1.2.15-SNAPSHOT</version>
<relativePath>../axiom-parent/pom.xml</relativePath>
</parent>
<artifactId>axiom-integration</artifactId>
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-jaxb/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-jaxb/pom.xml?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-jaxb/pom.xml (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-jaxb/pom.xml Thu Dec 20 15:55:24 2012
@@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-parent</artifactId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>1.2.15-SNAPSHOT</version>
<relativePath>../axiom-parent/pom.xml</relativePath>
</parent>
<artifactId>axiom-jaxb</artifactId>
@@ -50,6 +50,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-jaxen-testsuite/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-jaxen-testsuite/pom.xml?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-jaxen-testsuite/pom.xml (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-jaxen-testsuite/pom.xml Thu Dec 20 15:55:24 2012
@@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-parent</artifactId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>1.2.15-SNAPSHOT</version>
<relativePath>../axiom-parent/pom.xml</relativePath>
</parent>
<artifactId>axiom-jaxen-testsuite</artifactId>
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-osgi-tests/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-osgi-tests/pom.xml?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-osgi-tests/pom.xml (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-osgi-tests/pom.xml Thu Dec 20 15:55:24 2012
@@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-parent</artifactId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>1.2.15-SNAPSHOT</version>
<relativePath>../axiom-parent/pom.xml</relativePath>
</parent>
<artifactId>axiom-osgi-tests</artifactId>
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-parent/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-parent/pom.xml?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-parent/pom.xml (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-parent/pom.xml Thu Dec 20 15:55:24 2012
@@ -27,7 +27,7 @@
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-parent</artifactId>
<name>Axiom Parent POM</name>
- <version>1.2.14-SNAPSHOT</version>
+ <version>1.2.15-SNAPSHOT</version>
<packaging>pom</packaging>
<description>Axiom Parent POM</description>
<url>http://ws.apache.org/axiom/</url>
@@ -249,6 +249,16 @@
<name>java.awt.headless</name>
<value>true</value>
</property>
+ <!-- Uncomment this to test with the StAX implementation in Java 7 -->
+ <!-- property>
+ <name>javax.xml.stream.XMLInputFactory</name>
+ <value>com.sun.xml.internal.stream.XMLInputFactoryImpl</value>
+ </property>
+ <property>
+ <name>javax.xml.stream.XMLOutputFactory</name>
+ <value>com.sun.xml.internal.stream.XMLOutputFactoryImpl</value>
+ </property -->
+ <!-- Uncomment this to test with BEA's reference implementation -->
<!-- property>
<name>javax.xml.stream.XMLInputFactory</name>
<value>com.bea.xml.stream.MXParserFactory</value>
@@ -392,53 +402,21 @@
<groupId>stax</groupId>
<artifactId>stax-api</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>javax.xml.stream</groupId>
+ <artifactId>stax-api</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
- <version>1.1.3</version>
- <exclusions>
- <exclusion>
- <artifactId>dom4j</artifactId>
- <groupId>dom4j</groupId>
- </exclusion>
- <exclusion>
- <artifactId>xom</artifactId>
- <groupId>xom</groupId>
- </exclusion>
- <exclusion>
- <artifactId>jdom</artifactId>
- <groupId>jdom</groupId>
- </exclusion>
- <exclusion>
- <groupId>xerces</groupId>
- <artifactId>xmlParserAPIs</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- </exclusion>
- <!-- No, this is not a mistake: Jaxen 1.1.3 indeed has dependencies
- on these plugins in scope compile! -->
- <exclusion>
- <groupId>maven-plugins</groupId>
- <artifactId>maven-cobertura-plugin</artifactId>
- </exclusion>
- <exclusion>
- <groupId>maven-plugins</groupId>
- <artifactId>maven-findbugs-plugin</artifactId>
- </exclusion>
- </exclusions>
+ <version>1.1.4</version>
</dependency>
<dependency>
<groupId>org.apache.james</groupId>
<artifactId>apache-mime4j-core</artifactId>
- <version>0.8-SNAPSHOT</version>
+ <version>0.7.2</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
@@ -468,7 +446,13 @@
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
- <version>2.9.1</version>
+ <version>2.10.0</version>
+ </dependency>
+ <dependency>
+ <!-- Recent versions of Xerces require this (because they need org.w3c.dom.ElementTraversal) -->
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ <version>1.4.01</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
@@ -507,7 +491,7 @@
<osgi.version>4.2.0</osgi.version>
<stax.impl.groupid>org.codehaus.woodstox</stax.impl.groupid>
<stax.impl.artifact>woodstox-core-asl</stax.impl.artifact>
- <stax.impl.version>4.1.3</stax.impl.version>
+ <stax.impl.version>4.1.4</stax.impl.version>
<failIfNoTests>false</failIfNoTests>
<!--
<stax.impl.groupid>com.sun.xml.stream</stax.impl.groupid>
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-samples/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-samples/pom.xml?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-samples/pom.xml (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-samples/pom.xml Thu Dec 20 15:55:24 2012
@@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-parent</artifactId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>1.2.15-SNAPSHOT</version>
<relativePath>../axiom-parent/pom.xml</relativePath>
</parent>
<artifactId>axiom-samples</artifactId>
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-samples/src/test/java/org/apache/axiom/samples/FragmentsSample.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-samples/src/test/java/org/apache/axiom/samples/FragmentsSample.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-samples/src/test/java/org/apache/axiom/samples/FragmentsSample.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-samples/src/test/java/org/apache/axiom/samples/FragmentsSample.java Thu Dec 20 15:55:24 2012
@@ -41,7 +41,7 @@ public class FragmentsSample extends Tes
// A matching START_ELEMENT event was found. Build a corresponding OMElement.
OMElement element =
OMXMLBuilderFactory.createStAXOMBuilder(reader).getDocumentElement();
- // Make sure that all events belonging to the element are consumed so that
+ // Make sure that all events belonging to the element are consumed so
// that the XMLStreamReader points to a well defined location (namely the
// event immediately following the END_ELEMENT event).
element.build();
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-tests/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-tests/pom.xml?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-tests/pom.xml (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-tests/pom.xml Thu Dec 20 15:55:24 2012
@@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-parent</artifactId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>1.2.15-SNAPSHOT</version>
<relativePath>../axiom-parent/pom.xml</relativePath>
</parent>
<artifactId>axiom-tests</artifactId>
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-tests/src/test/java/org/apache/axiom/om/StaxParserTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-tests/src/test/java/org/apache/axiom/om/StaxParserTest.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-tests/src/test/java/org/apache/axiom/om/StaxParserTest.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-tests/src/test/java/org/apache/axiom/om/StaxParserTest.java Thu Dec 20 15:55:24 2012
@@ -54,8 +54,8 @@ public class StaxParserTest extends Abst
//try to find the children of the document element. This should produce an
//error since the underlying stream is fully consumed without building the object tree
- Iterator childElements = documentElement.getChildElements();
try {
+ Iterator childElements = documentElement.getChildElements();
while (childElements.hasNext()) {
childElements.next();
}
@@ -122,7 +122,6 @@ public class StaxParserTest extends Abst
//try to find the children of the document element. This should produce an
//error since the underlying stream is fully consumed without building the object tree
- Iterator childElements = documentElement.getChildElements();
try {
XMLStreamWriter writer = StAXUtils.createXMLStreamWriter(System.out);
documentElement.serializeAndConsume(writer);
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultValueTestBase.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultValueTestBase.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultValueTestBase.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultValueTestBase.java Thu Dec 20 15:55:24 2012
@@ -89,7 +89,7 @@ public class SOAPFaultValueTestBase exte
public void testSOAP11GetTextWithParser() {
assertEquals(
"SOAP 1.1 Fault Value Test with parser : - value text mismatch",
- "env:Sender", soap11FaultValueWithParser.trim());
+ "soapenv:Sender", soap11FaultValueWithParser.trim());
}
//SOAP 1.2 Fault Value(In Fault Code) Test (With Parser)
@@ -103,7 +103,7 @@ public class SOAPFaultValueTestBase exte
public void testSOAP12setTextWithParserInFaultSubCode() {
assertEquals(
"SOAP 1.2 Fault Value Test with parser in Fault SubCode : - value text mismatch",
- "m:MessageTimeout In First Subcode",
+ "m:MessageTimeout_In_First_Subcode",
soap12FaultValueInFaultSubCodeWithParser.getText());
}
}
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/pom.xml?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/pom.xml (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/pom.xml Thu Dec 20 15:55:24 2012
@@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-parent</artifactId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>1.2.15-SNAPSHOT</version>
<relativePath>../axiom-parent/pom.xml</relativePath>
</parent>
<artifactId>axiom-testsuite</artifactId>
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/ConformanceTestCase.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/ConformanceTestCase.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/ConformanceTestCase.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/ConformanceTestCase.java Thu Dec 20 15:55:24 2012
@@ -24,7 +24,7 @@ import org.apache.axiom.testutils.confor
/**
* Base class for test cases that are executed against the files from the conformance test set.
*
- * @see org.apache.axiom.om.AbstractTestCase#getConformanceTestFiles()
+ * @see ConformanceTestFile#getConformanceTestFiles()
*/
public abstract class ConformanceTestCase extends AxiomTestCase {
protected final ConformanceTestFile file;
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java Thu Dec 20 15:55:24 2012
@@ -39,7 +39,8 @@ import org.apache.axiom.ts.om.xpath.Test
public class OMTestSuiteBuilder extends TestSuiteBuilder {
private static final BuilderFactory[] builderFactories = {
BuilderFactory.PARSER,
- BuilderFactory.DOM };
+ BuilderFactory.DOM,
+ BuilderFactory.SAX };
private static final OMContainerFactory[] containerFactories = {
OMContainerFactory.DOCUMENT,
@@ -82,21 +83,23 @@ public class OMTestSuiteBuilder extends
for (int i=0; i<conformanceFiles.length; i++) {
ConformanceTestFile file = conformanceFiles[i];
if (file.hasEntityReferences()) {
- addTest(new org.apache.axiom.ts.om.builder.TestCreateOMBuilderFromDOMSource(metaFactory, file, Boolean.TRUE));
- addTest(new org.apache.axiom.ts.om.builder.TestCreateOMBuilderFromDOMSource(metaFactory, file, Boolean.FALSE));
+ addTest(new org.apache.axiom.ts.om.builder.TestCreateOMBuilderFromDOM(metaFactory, file, Boolean.TRUE));
+ addTest(new org.apache.axiom.ts.om.builder.TestCreateOMBuilderFromDOM(metaFactory, file, Boolean.FALSE));
addTest(new org.apache.axiom.ts.om.builder.TestCreateOMBuilderFromSAXSource(metaFactory, file, Boolean.TRUE));
addTest(new org.apache.axiom.ts.om.builder.TestCreateOMBuilderFromSAXSource(metaFactory, file, Boolean.FALSE));
} else {
- addTest(new org.apache.axiom.ts.om.builder.TestCreateOMBuilderFromDOMSource(metaFactory, file, null));
+ addTest(new org.apache.axiom.ts.om.builder.TestCreateOMBuilderFromDOM(metaFactory, file, null));
addTest(new org.apache.axiom.ts.om.builder.TestCreateOMBuilderFromSAXSource(metaFactory, file, null));
}
}
+ addTest(new org.apache.axiom.ts.om.builder.TestCreateOMBuilderFromDOMElement(metaFactory));
addTest(new org.apache.axiom.ts.om.builder.TestCreateStAXOMBuilderFromFragment(metaFactory));
addTest(new org.apache.axiom.ts.om.builder.TestCreateStAXOMBuilderIncorrectState(metaFactory));
addTest(new org.apache.axiom.ts.om.builder.TestCreateStAXOMBuilderNamespaceRepairing(metaFactory));
addTest(new org.apache.axiom.ts.om.builder.TestCreateStAXOMBuilderNamespaceRepairing2(metaFactory));
addTest(new org.apache.axiom.ts.om.builder.TestGetDocumentElement(metaFactory));
addTest(new org.apache.axiom.ts.om.builder.TestGetDocumentElementWithDiscardDocument(metaFactory));
+ addTest(new org.apache.axiom.ts.om.builder.TestGetDocumentElementWithDiscardDocumentIllFormedEpilog(metaFactory));
addTest(new org.apache.axiom.ts.om.builder.TestGetDocumentElementWithIllFormedDocument(metaFactory));
addTest(new org.apache.axiom.ts.om.builder.TestInvalidXML(metaFactory));
addTest(new org.apache.axiom.ts.om.builder.TestIOExceptionInGetText(metaFactory));
@@ -226,6 +229,8 @@ public class OMTestSuiteBuilder extends
addTest(new org.apache.axiom.ts.om.element.TestGetDescendants(metaFactory, false));
addTest(new org.apache.axiom.ts.om.element.TestGetFirstChildWithName(metaFactory));
addTest(new org.apache.axiom.ts.om.element.TestGetFirstChildWithNameOnIncompleteElement(metaFactory));
+ addTest(new org.apache.axiom.ts.om.element.TestGetFirstOMChildAfterConsume(metaFactory));
+ addTest(new org.apache.axiom.ts.om.element.TestGetFirstOMChildAfterDiscard(metaFactory));
addTest(new org.apache.axiom.ts.om.element.TestGetNamespaceContext(metaFactory, false));
addTest(new org.apache.axiom.ts.om.element.TestGetNamespaceContext(metaFactory, true));
addTest(new org.apache.axiom.ts.om.element.TestGetNamespaceNormalized(metaFactory, true));
@@ -255,8 +260,17 @@ public class OMTestSuiteBuilder extends
addTest(new org.apache.axiom.ts.om.element.TestGetTextWithMixedOMTextChildren(metaFactory));
addTest(new org.apache.axiom.ts.om.element.TestGetXMLStreamReaderCDATAEventFromElement(metaFactory));
addTest(new org.apache.axiom.ts.om.element.TestGetXMLStreamReaderCDATAEventFromParser(metaFactory));
- addTest(new org.apache.axiom.ts.om.element.TestGetXMLStreamReaderCommentEvent(metaFactory));
+ for (int i=0; i<builderFactories.length; i++) {
+ BuilderFactory bf = builderFactories[i];
+ addTest(new org.apache.axiom.ts.om.element.TestGetXMLStreamReaderCommentEvent(metaFactory, bf, true));
+ addTest(new org.apache.axiom.ts.om.element.TestGetXMLStreamReaderCommentEvent(metaFactory, bf, false));
+ }
addTest(new org.apache.axiom.ts.om.element.TestGetXMLStreamReaderGetElementText(metaFactory));
+ for (int i=0; i<builderFactories.length; i++) {
+ BuilderFactory bf = builderFactories[i];
+ addTest(new org.apache.axiom.ts.om.element.TestGetXMLStreamReaderGetElementTextFromParser(metaFactory, bf, true));
+ addTest(new org.apache.axiom.ts.om.element.TestGetXMLStreamReaderGetElementTextFromParser(metaFactory, bf, false));
+ }
addTest(new org.apache.axiom.ts.om.element.TestGetXMLStreamReaderGetNamespaceContext(metaFactory, true));
addTest(new org.apache.axiom.ts.om.element.TestGetXMLStreamReaderGetNamespaceContext(metaFactory, false));
addTest(new org.apache.axiom.ts.om.element.TestGetXMLStreamReaderNextTag(metaFactory));
@@ -352,6 +366,8 @@ public class OMTestSuiteBuilder extends
addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithNullOMDataSource2(metaFactory));
}
addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithNullURIAndPrefix(metaFactory));
+ addTest(new org.apache.axiom.ts.om.factory.TestCreateOMEntityReference(metaFactory));
+ addTest(new org.apache.axiom.ts.om.factory.TestCreateOMEntityReferenceWithNullParent(metaFactory));
addTest(new org.apache.axiom.ts.om.factory.TestCreateOMNamespace(metaFactory));
addTest(new org.apache.axiom.ts.om.factory.TestCreateOMNamespaceWithNullURI(metaFactory));
addTest(new org.apache.axiom.ts.om.factory.TestCreateOMProcessingInstructionWithoutParent(metaFactory));
@@ -458,8 +474,10 @@ public class OMTestSuiteBuilder extends
addTest(new org.apache.axiom.ts.om.sourcedelement.push.TestWriteStartElementWithDefaultNamespaceDeclaredOnParent(metaFactory));
}
addTest(new org.apache.axiom.ts.om.pi.TestDigest(metaFactory));
- addTest(new org.apache.axiom.ts.om.text.TestBase64Streaming(metaFactory));
+ addTest(new org.apache.axiom.ts.om.text.TestBase64StreamingWithGetSAXSource(metaFactory));
+ addTest(new org.apache.axiom.ts.om.text.TestBase64StreamingWithSerialize(metaFactory));
addTest(new org.apache.axiom.ts.om.text.TestDigest(metaFactory));
+ addTest(new org.apache.axiom.ts.om.text.TestGetTextCharactersFromDataHandler(metaFactory));
Method[] methods = AXIOMXPathTestCase.class.getMethods();
for (int i=0; i<methods.length; i++) {
String methodName = methods[i].getName();
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromSAXSource.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromSAXSource.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromSAXSource.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromSAXSource.java Thu Dec 20 15:55:24 2012
@@ -31,8 +31,6 @@ import org.apache.axiom.om.OMXMLParserWr
import org.apache.axiom.testutils.XMLAssertEx;
import org.apache.axiom.testutils.conformance.ConformanceTestFile;
import org.apache.axiom.ts.ConformanceTestCase;
-import org.custommonkey.xmlunit.XMLAssert;
-import org.custommonkey.xmlunit.XMLUnit;
import org.xml.sax.InputSource;
public class TestCreateOMBuilderFromSAXSource extends ConformanceTestCase {
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestGetDocumentElementWithDiscardDocument.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestGetDocumentElementWithDiscardDocument.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestGetDocumentElementWithDiscardDocument.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestGetDocumentElementWithDiscardDocument.java Thu Dec 20 15:55:24 2012
@@ -26,6 +26,7 @@ import org.apache.axiom.om.OMMetaFactory
import org.apache.axiom.om.OMXMLBuilderFactory;
import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axiom.ts.AxiomTestCase;
+import org.custommonkey.xmlunit.XMLAssert;
/**
* Tests the behavior of {@link OMXMLParserWrapper#getDocumentElement(boolean)} with
@@ -49,5 +50,13 @@ public class TestGetDocumentElementWithD
OMElement newParent = factory.createOMElement("newParent", null);
newParent.addChild(element);
assertFalse(element.isComplete());
+ assertFalse(builder.isCompleted());
+ XMLAssert.assertXMLEqual("<newParent><root/></newParent>", newParent.toString());
+ assertTrue(element.isComplete());
+ // Since we discarded the document, the nodes in the epilog will not be accessible.
+ // Therefore we expect that when the document element changes its completion status,
+ // the builder will consume the epilog and change its completion status as well.
+ // This gives the underlying parser a chance to release some resources.
+ assertTrue(builder.isCompleted());
}
}
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/BuilderFactory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/BuilderFactory.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/BuilderFactory.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/BuilderFactory.java Thu Dec 20 15:55:24 2012
@@ -19,11 +19,14 @@
package org.apache.axiom.ts.om.container;
import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.transform.dom.DOMSource;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.sax.SAXSource;
import org.apache.axiom.om.OMMetaFactory;
import org.apache.axiom.om.OMXMLBuilderFactory;
import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.testutils.stax.XMLStreamReaderComparator;
import org.apache.axiom.ts.AxiomTestCase;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
@@ -37,6 +40,9 @@ public interface BuilderFactory {
* instantiate an appropriate parser.
*/
BuilderFactory PARSER = new BuilderFactory() {
+ public void configureXMLStreamReaderComparator(XMLStreamReaderComparator comparator) {
+ }
+
public void addTestProperties(AxiomTestCase testCase) {
testCase.addTestProperty("source", "parser");
}
@@ -48,10 +54,17 @@ public interface BuilderFactory {
};
/**
- * Creates an {@link OMXMLParserWrapper} by parsing the input using DOM and passing it as a
- * {@link DOMSource} to Axiom.
+ * Creates an {@link OMXMLParserWrapper} by parsing the input using DOM and passing it as a DOM
+ * tree to Axiom.
*/
BuilderFactory DOM = new BuilderFactory() {
+ public void configureXMLStreamReaderComparator(XMLStreamReaderComparator comparator) {
+ // DOM gives access to the parsed replacement value (via the Entity interface), but Axiom
+ // stores the unparsed replacement value. Therefore OMEntityReference#getReplacementText()
+ // returns null for nodes created from a DOM tree.
+ comparator.setCompareEntityReplacementValue(false);
+ }
+
public void addTestProperties(AxiomTestCase testCase) {
testCase.addTestProperty("source", "dom");
}
@@ -61,10 +74,36 @@ public interface BuilderFactory {
dbf.setNamespaceAware(true);
dbf.setExpandEntityReferences(false);
Document document = dbf.newDocumentBuilder().parse(inputSource);
- return OMXMLBuilderFactory.createOMBuilder(metaFactory.getOMFactory(), new DOMSource(document), false);
+ return OMXMLBuilderFactory.createOMBuilder(metaFactory.getOMFactory(), document, false);
+ }
+ };
+
+ /**
+ * Creates an {@link OMXMLParserWrapper} by passing a {@link SAXSource} to Axiom.
+ */
+ BuilderFactory SAX = new BuilderFactory() {
+ public void configureXMLStreamReaderComparator(XMLStreamReaderComparator comparator) {
+ // SAX doesn't provide this information
+ comparator.setCompareCharacterEncodingScheme(false);
+ comparator.setCompareEncoding(false);
+ }
+
+ public void addTestProperties(AxiomTestCase testCase) {
+ testCase.addTestProperty("source", "sax");
+ }
+
+ public OMXMLParserWrapper getBuilder(OMMetaFactory metaFactory, InputSource inputSource) throws Exception {
+ SAXParserFactory factory = SAXParserFactory.newInstance();
+ factory.setNamespaceAware(true);
+ factory.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
+ SAXParser parser = factory.newSAXParser();
+ SAXSource source = new SAXSource(parser.getXMLReader(), inputSource);
+ return OMXMLBuilderFactory.createOMBuilder(metaFactory.getOMFactory(), source, false);
}
};
+ void configureXMLStreamReaderComparator(XMLStreamReaderComparator comparator);
+
void addTestProperties(AxiomTestCase testCase);
OMXMLParserWrapper getBuilder(OMMetaFactory metaFactory, InputSource inputSource) throws Exception;
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/TestGetXMLStreamReader.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/TestGetXMLStreamReader.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/TestGetXMLStreamReader.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/TestGetXMLStreamReader.java Thu Dec 20 15:55:24 2012
@@ -59,7 +59,9 @@ public class TestGetXMLStreamReader exte
OMXMLParserWrapper builder = builderFactory.getBuilder(metaFactory, new InputSource(file.getUrl().toString()));
try {
XMLStreamReader actual = containerFactory.getContainer(builder).getXMLStreamReader(cache);
- new XMLStreamReaderComparator(containerFactory.filter(expected), containerFactory.filter(actual)).compare();
+ XMLStreamReaderComparator comparator = new XMLStreamReaderComparator(containerFactory.filter(expected), containerFactory.filter(actual));
+ builderFactory.configureXMLStreamReaderComparator(comparator);
+ comparator.compare();
} finally {
builder.close();
}
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetXMLStreamReaderCommentEvent.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetXMLStreamReaderCommentEvent.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetXMLStreamReaderCommentEvent.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetXMLStreamReaderCommentEvent.java Thu Dec 20 15:55:24 2012
@@ -18,22 +18,33 @@
*/
package org.apache.axiom.ts.om.element;
+import java.io.StringReader;
+
import javax.xml.stream.XMLStreamReader;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMMetaFactory;
-import org.apache.axiom.om.util.AXIOMUtil;
+import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axiom.ts.AxiomTestCase;
+import org.apache.axiom.ts.om.container.BuilderFactory;
+import org.xml.sax.InputSource;
public class TestGetXMLStreamReaderCommentEvent extends AxiomTestCase {
- public TestGetXMLStreamReaderCommentEvent(OMMetaFactory metaFactory) {
+ private final BuilderFactory builderFactory;
+ private final boolean cache;
+
+ public TestGetXMLStreamReaderCommentEvent(OMMetaFactory metaFactory, BuilderFactory builderFactory, boolean cache) {
super(metaFactory);
+ this.builderFactory = builderFactory;
+ this.cache = cache;
+ builderFactory.addTestProperties(this);
+ addTestProperty("cache", Boolean.toString(cache));
}
protected void runTest() throws Throwable {
- OMElement element = AXIOMUtil.stringToOM(metaFactory.getOMFactory(),
- "<a><!--comment text--></a>");
- XMLStreamReader reader = element.getXMLStreamReader();
+ OMXMLParserWrapper builder = builderFactory.getBuilder(metaFactory, new InputSource(new StringReader("<a><!--comment text--></a>")));
+ OMElement element = builder.getDocumentElement();
+ XMLStreamReader reader = element.getXMLStreamReader(cache);
assertEquals(XMLStreamReader.START_ELEMENT, reader.next());
assertEquals(XMLStreamReader.COMMENT, reader.next());
assertEquals("comment text", reader.getText());
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/OMDOMTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/OMDOMTestSuiteBuilder.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/OMDOMTestSuiteBuilder.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/OMDOMTestSuiteBuilder.java Thu Dec 20 15:55:24 2012
@@ -48,8 +48,10 @@ public class OMDOMTestSuiteBuilder exten
addTest(new org.apache.axiom.ts.omdom.element.TestGetNamespaceNormalized(metaFactory));
addTest(new org.apache.axiom.ts.omdom.element.TestInsertBeforeIncomplete(metaFactory));
addTest(new org.apache.axiom.ts.omdom.element.TestRemoveAttribute(metaFactory));
+ addTest(new org.apache.axiom.ts.omdom.element.TestRemoveAttributeNSNamespaceDeclaration(metaFactory));
addTest(new org.apache.axiom.ts.omdom.element.TestRemoveChildIncomplete(metaFactory));
- addTest(new org.apache.axiom.ts.omdom.element.TestReplaceChildIncomplete(metaFactory));
+ addTest(new org.apache.axiom.ts.omdom.element.TestReplaceChildFirstIncomplete(metaFactory));
+ addTest(new org.apache.axiom.ts.omdom.element.TestReplaceChildMiddleIncomplete(metaFactory));
addTest(new org.apache.axiom.ts.omdom.factory.TestCreateOMAttribute(metaFactory));
addTest(new org.apache.axiom.ts.omdom.factory.TestCreateOMTextCDATASection(metaFactory));
addTest(new org.apache.axiom.ts.omdom.factory.TestCreateOMTextCDATASectionWithParent(metaFactory));
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java Thu Dec 20 15:55:24 2012
@@ -32,12 +32,13 @@ public class SOAPTestSuiteBuilder extend
private static final String[] badSOAPFiles = { "wrongSoapNs.xml", "notnamespaceQualified.xml", "soap11/twoheaders.xml", "soap11/twoBodymessage.xml",
"soap11/envelopeMissing.xml", "soap11/haederBodyWrongOrder.xml", "soap11/invalid-faultcode.xml", "soap11/invalid-faultstring.xml",
"soap11/invalid-faultactor.xml", "soap11/processing-instruction.xml", "soap11/entity-reference.xml",
- "soap12/header-bad-case.xml", "soap12/header-no-namespace.xml", "soap12/processing-instruction.xml", "soap12/entity-reference.xml" };
+ "soap12/header-bad-case.xml", "soap12/header-no-namespace.xml", "soap12/processing-instruction.xml", "soap12/entity-reference.xml",
+ "soap12/additional-element-after-body.xml"};
private static final String[] goodSOAPFiles = { TestConstants.WHITESPACE_MESSAGE,
TestConstants.MINIMAL_MESSAGE, TestConstants.REALLY_BIG_MESSAGE,
TestConstants.EMPTY_BODY_MESSAGE, "soap/soap11/soapfault.xml", "soap/soap11/bodyNotQualified.xml",
- "soap/soap11/faultstring-with-comment.xml"};
+ "soap/soap11/faultstring-with-comment.xml", "soap/soap11/additional-element-after-body.xml"};
private static final QName[] generalQNames = {
new QName("root"),
@@ -160,6 +161,8 @@ public class SOAPTestSuiteBuilder extend
addTest(new org.apache.axiom.ts.soap.fault.TestWrongParent1(metaFactory, spec));
addTest(new org.apache.axiom.ts.soap.fault.TestWrongParent2(metaFactory, spec));
addTest(new org.apache.axiom.ts.soap.fault.TestWrongParent3(metaFactory, spec));
+ addTest(new org.apache.axiom.ts.soap.faultcode.TestGetValueAsQName(metaFactory, spec));
+ addTest(new org.apache.axiom.ts.soap.faultcode.TestGetValueAsQNameWithParser(metaFactory, spec));
addTest(new org.apache.axiom.ts.soap.faultdetail.TestAddDetailEntry(metaFactory, spec));
addTest(new org.apache.axiom.ts.soap.faultdetail.TestDetailEntriesUsingDefaultNamespaceWithParser(metaFactory, spec));
addTest(new org.apache.axiom.ts.soap.faultdetail.TestGetAllDetailEntries(metaFactory, spec));
@@ -223,6 +226,8 @@ public class SOAPTestSuiteBuilder extend
addTest(new org.apache.axiom.ts.soap11.envelope.TestAddElementAfterBody(metaFactory));
addTest(new org.apache.axiom.ts.soap11.fault.TestGetNode(metaFactory));
addTest(new org.apache.axiom.ts.soap11.fault.TestSetNode(metaFactory));
+ addTest(new org.apache.axiom.ts.soap11.faultcode.TestGetValue(metaFactory));
+ addTest(new org.apache.axiom.ts.soap11.faultcode.TestGetValueWithParser(metaFactory));
addTest(new org.apache.axiom.ts.soap11.faultcode.TestSetValueFromQName(metaFactory));
addTest(new org.apache.axiom.ts.soap11.faultreason.TestAddSOAPText(metaFactory));
addTest(new org.apache.axiom.ts.soap11.faultreason.TestGetFirstSOAPText(metaFactory));
@@ -243,7 +248,6 @@ public class SOAPTestSuiteBuilder extend
addTest(new org.apache.axiom.ts.soap12.fault.TestMoreChildrenAddition(metaFactory));
addTest(new org.apache.axiom.ts.soap12.fault.TestSetNode(metaFactory));
addTest(new org.apache.axiom.ts.soap12.faultcode.TestGetSubCodeWithParser(metaFactory));
- addTest(new org.apache.axiom.ts.soap12.faultcode.TestGetTextAsQNameWithParser(metaFactory));
addTest(new org.apache.axiom.ts.soap12.faultcode.TestGetValueWithParser(metaFactory));
addTest(new org.apache.axiom.ts.soap12.faultcode.TestSetValueFromQName(metaFactory));
addTest(new org.apache.axiom.ts.soap12.faultcode.TestSetValueFromQNameWithExistingValue(metaFactory));
@@ -251,6 +255,11 @@ public class SOAPTestSuiteBuilder extend
addTest(new org.apache.axiom.ts.soap12.faultreason.TestAddSOAPTextWithSOAPVersionMismatch(metaFactory));
addTest(new org.apache.axiom.ts.soap12.faultreason.TestGetFirstSOAPText(metaFactory));
addTest(new org.apache.axiom.ts.soap12.faultreason.TestGetFirstSOAPTextWithParser(metaFactory));
+ addTest(new org.apache.axiom.ts.soap12.faultsubcode.TestGetSubCodeNestedWithParser(metaFactory));
+ addTest(new org.apache.axiom.ts.soap12.faultsubcode.TestGetSubCodeWithParser(metaFactory));
+ addTest(new org.apache.axiom.ts.soap12.faultsubcode.TestGetValueNestedWithParser(metaFactory));
+ addTest(new org.apache.axiom.ts.soap12.faultsubcode.TestGetValueAsQNameWithParser(metaFactory));
+ addTest(new org.apache.axiom.ts.soap12.faultsubcode.TestGetValueWithParser(metaFactory));
addTest(new org.apache.axiom.ts.soap12.faulttext.TestGetLangWithParser(metaFactory));
addTest(new org.apache.axiom.ts.soap12.header.TestExamineAllHeaderBlocksWithParser(metaFactory));
addTest(new org.apache.axiom.ts.soap12.header.TestExamineHeaderBlocksWithParser(metaFactory));
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestHasFaultAfterReplace.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestHasFaultAfterReplace.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestHasFaultAfterReplace.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestHasFaultAfterReplace.java Thu Dec 20 15:55:24 2012
@@ -21,6 +21,7 @@ package org.apache.axiom.ts.soap.body;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMMetaFactory;
import org.apache.axiom.soap.SOAPBody;
+import org.apache.axiom.soap.SOAPFault;
import org.apache.axiom.ts.soap.SOAPSpec;
import org.apache.axiom.ts.soap.SOAPTestCase;
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/pom.xml?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/pom.xml (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/pom.xml Thu Dec 20 15:55:24 2012
@@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-parent</artifactId>
- <version>1.2.14-SNAPSHOT</version>
+ <version>1.2.15-SNAPSHOT</version>
<relativePath>../axiom-parent/pom.xml</relativePath>
</parent>
<artifactId>axiom-testutils</artifactId>
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/activation/RandomDataSource.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/activation/RandomDataSource.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/activation/RandomDataSource.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/activation/RandomDataSource.java Thu Dec 20 15:55:24 2012
@@ -30,20 +30,20 @@ public class RandomDataSource implements
private final long seed;
private final int rangeStart;
private final int rangeEnd;
- private final int length;
+ private final long length;
- public RandomDataSource(long seed, int rangeStart, int rangeEnd, int length) {
+ public RandomDataSource(long seed, int rangeStart, int rangeEnd, long length) {
this.seed = seed;
this.rangeStart = rangeStart;
this.rangeEnd = rangeEnd;
this.length = length;
}
- public RandomDataSource(long seed, int length) {
+ public RandomDataSource(long seed, long length) {
this(seed, 0, 256, length);
}
- public RandomDataSource(int length) {
+ public RandomDataSource(long length) {
this(System.currentTimeMillis(), length);
}
@@ -58,7 +58,7 @@ public class RandomDataSource implements
public InputStream getInputStream() throws IOException {
final Random random = new Random(seed);
return new InputStream() {
- private int position;
+ private long position;
public int read() throws IOException {
if (position == length) {
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/conformance/ConformanceTestFile.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/conformance/ConformanceTestFile.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/conformance/ConformanceTestFile.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/conformance/ConformanceTestFile.java Thu Dec 20 15:55:24 2012
@@ -33,6 +33,8 @@ import javax.xml.transform.stream.Stream
import org.codehaus.stax2.DTDInfo;
+import com.ctc.wstx.stax.WstxInputFactory;
+
public final class ConformanceTestFile {
private static ConformanceTestFile[] instances;
@@ -91,7 +93,10 @@ public final class ConformanceTestFile {
BufferedReader in = new BufferedReader(new InputStreamReader(
ConformanceTestFile.class.getResourceAsStream("filelist")));
List result = new ArrayList(10);
- XMLInputFactory inputFactory = XMLInputFactory.newInstance();
+ // We make use of Woodstox' DTDInfo interface here, but we want to be able to use system properties
+ // to specify the StAX implementation to be used by the tests. Therefore we need to create
+ // an instance of the Woodstox InputFactory implementation directly.
+ XMLInputFactory inputFactory = new WstxInputFactory();
inputFactory.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, Boolean.FALSE);
String name;
while ((name = in.readLine()) != null) {
Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/stax/Normalizer.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/stax/Normalizer.java?rev=1424548&r1=1424547&r2=1424548&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/stax/Normalizer.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/stax/Normalizer.java Thu Dec 20 15:55:24 2012
@@ -40,8 +40,13 @@ public interface Normalizer {
Normalizer DTD = new Normalizer() {
public Object normalize(Object value) throws Exception {
- return DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(
- new InputSource(new StringReader("<!DOCTYPE root [" + value + "]><root/>"))).getDoctype().getInternalSubset();
+ String content = (String)value;
+ if (content == null || content.trim().length() == 0) {
+ return null;
+ } else {
+ return DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(
+ new InputSource(new StringReader("<!DOCTYPE root [" + content + "]><root/>"))).getDoctype().getInternalSubset();
+ }
}
};