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 2016/02/28 13:26:19 UTC
svn commit: r1732727 - in /webservices/axiom/trunk:
src/site/markdown/release-notes/
testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/
testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/
Author: veithen
Date: Sun Feb 28 12:26:19 2016
New Revision: 1732727
URL: http://svn.apache.org/viewvc?rev=1732727&view=rev
Log:
Add regression test for AXIOM-474.
Added:
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestSerializeAsChild.java (with props)
Modified:
webservices/axiom/trunk/src/site/markdown/release-notes/1.3.0.md
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java
Modified: webservices/axiom/trunk/src/site/markdown/release-notes/1.3.0.md
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/src/site/markdown/release-notes/1.3.0.md?rev=1732727&r1=1732726&r2=1732727&view=diff
==============================================================================
--- webservices/axiom/trunk/src/site/markdown/release-notes/1.3.0.md (original)
+++ webservices/axiom/trunk/src/site/markdown/release-notes/1.3.0.md Sun Feb 28 12:26:19 2016
@@ -137,9 +137,12 @@ Changes in this release
design. This special serialization logic has been removed in Axiom 1.3 and
`SOAPMessage` and `SOAPEnvelope` now have the same behavior as any other
`OMDocument` and `OMElement`. The main implication is that the serialization
- of a `SOAPEnvelope` no longer generates an XML declaration.
+ of a `SOAPEnvelope` no longer generates an XML declaration. This change also
+ fixes [AXIOM-474][].
* In Axiom 1.3.0, the `getBuilder` method always returns `null` for document
and elements that are (locally) complete, i.e. for which the end event has
been processed. That means that after completion, nodes created by a builder
will be indistinguishable from programmatically created nodes.
+
+[AXIOM-474]: https://issues.apache.org/jira/browse/AXIOM-474
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java?rev=1732727&r1=1732726&r2=1732727&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java Sun Feb 28 12:26:19 2016
@@ -165,6 +165,7 @@ public class SOAPTestSuiteBuilder extend
if (supportsOMSourcedElement) {
addTest(new org.apache.axiom.ts.soap.envelope.TestSerializeAndConsumeWithOMSEInBody(metaFactory, spec));
}
+ addTest(new org.apache.axiom.ts.soap.envelope.TestSerializeAsChild(metaFactory, spec));
addTest(new org.apache.axiom.ts.soap.factory.TestCreateDefaultSOAPMessage(metaFactory, spec));
addTest(new org.apache.axiom.ts.soap.factory.TestCreateSOAPEnvelopeWithCustomPrefix(metaFactory, spec));
for (SOAPElementType type : SOAPElementType.getAll()) {
Added: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestSerializeAsChild.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestSerializeAsChild.java?rev=1732727&view=auto
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestSerializeAsChild.java (added)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestSerializeAsChild.java Sun Feb 28 12:26:19 2016
@@ -0,0 +1,55 @@
+/*
+ * 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.envelope;
+
+import static com.google.common.truth.Truth.assertAbout;
+import static org.apache.axiom.truth.xml.XMLTruth.xml;
+
+import java.io.OutputStream;
+
+import org.apache.axiom.blob.Blobs;
+import org.apache.axiom.blob.MemoryBlob;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+/**
+ * Regression test for <a href="https://issues.apache.org/jira/browse/AXIOM-474">AXIOM-474</a>.
+ */
+public class TestSerializeAsChild extends SOAPTestCase {
+ public TestSerializeAsChild(OMMetaFactory metaFactory, SOAPSpec spec) {
+ super(metaFactory, spec);
+ }
+
+ @Override
+ protected void runTest() throws Throwable {
+ SOAPEnvelope envelope = soapFactory.createDefaultSOAPMessage().getSOAPEnvelope();
+ soapFactory.createOMElement("echo", soapFactory.createOMNamespace("urn:test", "p"), envelope.getBody());
+ OMElement log = soapFactory.createOMElement("log", null);
+ OMElement entry = soapFactory.createOMElement("entry", null, log);
+ entry.addChild(envelope);
+ MemoryBlob blob = Blobs.createMemoryBlob();
+ OutputStream out = blob.getOutputStream();
+ envelope.serialize(out);
+ out.close();
+ assertAbout(xml()).that(blob.getInputStream()).hasSameContentAs(xml(OMElement.class, envelope));
+ }
+}
Propchange: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestSerializeAsChild.java
------------------------------------------------------------------------------
svn:eol-style = native