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 2017/12/26 10:35:30 UTC

svn commit: r1819279 - in /webservices/axiom/trunk/testing/axiom-testsuite/src/main: java/org/apache/axiom/ts/om/ java/org/apache/axiom/ts/om/builder/ resources/org/apache/axiom/ts/om/builder/ xsd/

Author: veithen
Date: Tue Dec 26 10:35:29 2017
New Revision: 1819279

URL: http://svn.apache.org/viewvc?rev=1819279&view=rev
Log:
Recycle the test case for AXIS2-479 and transform it into a test case for Axiom. It is no longer relevant for Axis2 itself because XmlBeans objects are now serialized using SAX.

Added:
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateStAXOMBuilderFromXmlBeansPullParser.java   (with props)
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/resources/org/apache/axiom/ts/om/builder/xmlvend.xml   (with props)
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/xsd/xmlvend.xsd
      - copied unchanged from r1819262, axis/axis2/java/core/trunk/modules/integration/test-resources/xsd/type-test.xsd
Modified:
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java

Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java?rev=1819279&r1=1819278&r2=1819279&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java Tue Dec 26 10:35:29 2017
@@ -128,6 +128,7 @@ public class OMTestSuiteBuilder extends
             addTest(new org.apache.axiom.ts.om.builder.TestCreateOMBuilderXOP(metaFactory, sample, true));
         }
         addTest(new org.apache.axiom.ts.om.builder.TestCreateStAXOMBuilderFromFragment(metaFactory));
+        addTest(new org.apache.axiom.ts.om.builder.TestCreateStAXOMBuilderFromXmlBeansPullParser(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));

Added: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateStAXOMBuilderFromXmlBeansPullParser.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateStAXOMBuilderFromXmlBeansPullParser.java?rev=1819279&view=auto
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateStAXOMBuilderFromXmlBeansPullParser.java (added)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateStAXOMBuilderFromXmlBeansPullParser.java Tue Dec 26 10:35:29 2017
@@ -0,0 +1,49 @@
+/*
+ * 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.builder;
+
+import static com.google.common.truth.Truth.assertAbout;
+import static org.apache.axiom.truth.xml.XMLTruth.xml;
+
+import java.net.URL;
+
+import org.apache.axiom.om.OMDocument;
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.om.OMXMLBuilderFactory;
+import org.apache.axiom.ts.AxiomTestCase;
+
+import za.co.eskom.nrs.xmlvend.base.x20.schema.AdviceReqDocument;
+
+public class TestCreateStAXOMBuilderFromXmlBeansPullParser extends AxiomTestCase {
+    public TestCreateStAXOMBuilderFromXmlBeansPullParser(OMMetaFactory metaFactory) {
+        super(metaFactory);
+    }
+
+    @Override
+    protected void runTest() throws Throwable {
+        URL inputUrl = TestCreateStAXOMBuilderFromXmlBeansPullParser.class.getResource("xmlvend.xml");
+        AdviceReqDocument adviceReq = AdviceReqDocument.Factory.parse(inputUrl);
+        OMDocument doc = OMXMLBuilderFactory.createStAXOMBuilder(
+                metaFactory.getOMFactory(), adviceReq.newXMLStreamReader()).getDocument();
+        assertAbout(xml())
+                .that(xml(OMDocument.class, doc))
+                .ignoringElementContentWhitespace()
+                .hasSameContentAs(inputUrl);
+    }
+}

Propchange: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateStAXOMBuilderFromXmlBeansPullParser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: webservices/axiom/trunk/testing/axiom-testsuite/src/main/resources/org/apache/axiom/ts/om/builder/xmlvend.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/resources/org/apache/axiom/ts/om/builder/xmlvend.xml?rev=1819279&view=auto
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/resources/org/apache/axiom/ts/om/builder/xmlvend.xml (added)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/resources/org/apache/axiom/ts/om/builder/xmlvend.xml Tue Dec 26 10:35:29 2017
@@ -0,0 +1,4 @@
+<sch:adviceReq xsi:type="sch:ConfirmationAdviceReq" xmlns:sch="http://www.nrs.eskom.co.za/xmlvend/base/2.0/schema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <sch:clientID/>
+  <sch:adviceReqMsgID uniqueNumber="11"/>
+</sch:adviceReq>

Propchange: webservices/axiom/trunk/testing/axiom-testsuite/src/main/resources/org/apache/axiom/ts/om/builder/xmlvend.xml
------------------------------------------------------------------------------
    svn:eol-style = native