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/01/30 09:52:57 UTC

svn commit: r1727688 - in /webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap: SOAPTestSuiteBuilder.java body/TestGetFirstElementLocalNameWithParser2.java

Author: veithen
Date: Sat Jan 30 08:52:57 2016
New Revision: 1727688

URL: http://svn.apache.org/viewvc?rev=1727688&view=rev
Log:
Increase test coverage for AXIOM-282.

Added:
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestGetFirstElementLocalNameWithParser2.java   (with props)
Modified:
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java

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=1727688&r1=1727687&r2=1727688&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 Sat Jan 30 08:52:57 2016
@@ -115,6 +115,8 @@ public class SOAPTestSuiteBuilder extend
             addTest(new org.apache.axiom.ts.soap.body.TestGetFirstElementNSWithParser(metaFactory, spec,
                     qname, supportsBodyElementNameOptimization));
         }
+        addTest(new org.apache.axiom.ts.soap.body.TestGetFirstElementLocalNameWithParser2(metaFactory, spec, false));
+        addTest(new org.apache.axiom.ts.soap.body.TestGetFirstElementLocalNameWithParser2(metaFactory, spec, true));
         addTest(new org.apache.axiom.ts.soap.body.TestGetFirstElementLocalNameWithParserNoLookahead(metaFactory, spec));
         for (int i=0; i<noFaultQNames.length; i++) {
             QName qname = noFaultQNames[i];

Added: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestGetFirstElementLocalNameWithParser2.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestGetFirstElementLocalNameWithParser2.java?rev=1727688&view=auto
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestGetFirstElementLocalNameWithParser2.java (added)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestGetFirstElementLocalNameWithParser2.java Sat Jan 30 08:52:57 2016
@@ -0,0 +1,47 @@
+/*
+ * 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.body;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPBody;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.ts.soap.SOAPSampleSet;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
+
+public class TestGetFirstElementLocalNameWithParser2 extends SampleBasedSOAPTestCase {
+    private final boolean buildPayload;
+    
+    public TestGetFirstElementLocalNameWithParser2(OMMetaFactory metaFactory, SOAPSpec spec, boolean buildPayload) {
+        super(metaFactory, spec, SOAPSampleSet.NO_HEADER);
+        this.buildPayload = buildPayload;
+        addTestParameter("buildPayload", "false");
+    }
+
+    @Override
+    protected void runTest(SOAPEnvelope envelope) throws Throwable {
+        SOAPBody body = envelope.getBody();
+        if (buildPayload) {
+            body.getFirstElement().build();
+        }
+        assertThat(body.getFirstElementLocalName()).isEqualTo("test");
+    }
+}

Propchange: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestGetFirstElementLocalNameWithParser2.java
------------------------------------------------------------------------------
    svn:eol-style = native