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/05/14 22:57:48 UTC
svn commit: r1338399 - in
/webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap:
./ fault/ headerblock/
Author: veithen
Date: Mon May 14 20:57:47 2012
New Revision: 1338399
URL: http://svn.apache.org/viewvc?rev=1338399&view=rev
Log:
Added test cases that provide evidence for the issue.
Added:
webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestWrongParent1.java (with props)
webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestWrongParent2.java (with props)
webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestWrongParent3.java (with props)
webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestWrongParent1.java (with props)
webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestWrongParent2.java (with props)
webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestWrongParent3.java (with props)
Modified:
webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java
Modified: webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java?rev=1338399&r1=1338398&r2=1338399&view=diff
==============================================================================
--- webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java (original)
+++ webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java Mon May 14 20:57:47 2012
@@ -118,6 +118,9 @@ public class SOAPTestSuiteBuilder extend
addTest(new org.apache.axiom.ts.soap.fault.TestSetException(metaFactory, spec));
addTest(new org.apache.axiom.ts.soap.fault.TestSetReason(metaFactory, spec));
addTest(new org.apache.axiom.ts.soap.fault.TestSetRole(metaFactory, spec));
+ 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.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));
@@ -145,6 +148,9 @@ public class SOAPTestSuiteBuilder extend
addTest(new org.apache.axiom.ts.soap.headerblock.TestSetMustUnderstandString01(metaFactory, spec));
addTest(new org.apache.axiom.ts.soap.headerblock.TestSetMustUnderstandWithInvalidValue(metaFactory, spec));
addTest(new org.apache.axiom.ts.soap.headerblock.TestSetRole(metaFactory, spec));
+ addTest(new org.apache.axiom.ts.soap.headerblock.TestWrongParent1(metaFactory, spec));
+ addTest(new org.apache.axiom.ts.soap.headerblock.TestWrongParent2(metaFactory, spec));
+ addTest(new org.apache.axiom.ts.soap.headerblock.TestWrongParent3(metaFactory, spec));
addTest(new org.apache.axiom.ts.soap.xpath.TestXPathAppliedToSOAPEnvelope(metaFactory, spec, true));
addTest(new org.apache.axiom.ts.soap.xpath.TestXPathAppliedToSOAPEnvelope(metaFactory, spec, false));
}
Added: webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestWrongParent1.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestWrongParent1.java?rev=1338399&view=auto
==============================================================================
--- webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestWrongParent1.java (added)
+++ webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestWrongParent1.java Mon May 14 20:57:47 2012
@@ -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.soap.fault;
+
+import org.apache.axiom.om.OMContainer;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.om.OMNode;
+import org.apache.axiom.soap.SOAPFault;
+import org.apache.axiom.soap.SOAPProcessingException;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+/**
+ * Tests that {@link OMContainer#addChild(OMNode)} throws an exception if an attempt is made to add
+ * a {@link SOAPFault} to a plain {@link OMElement}.
+ */
+public class TestWrongParent1 extends SOAPTestCase {
+ public TestWrongParent1(OMMetaFactory metaFactory, SOAPSpec spec) {
+ super(metaFactory, spec);
+ }
+
+ protected void runTest() throws Throwable {
+ OMElement parent = soapFactory.createOMElement("parent", null);
+ SOAPFault fault = soapFactory.createSOAPFault();
+ try {
+ parent.addChild(fault);
+ fail("Expected SOAPProcessingException");
+ } catch (SOAPProcessingException ex) {
+ // Expected
+ }
+ }
+}
Propchange: webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestWrongParent1.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestWrongParent2.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestWrongParent2.java?rev=1338399&view=auto
==============================================================================
--- webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestWrongParent2.java (added)
+++ webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestWrongParent2.java Mon May 14 20:57:47 2012
@@ -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.soap.fault;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.om.OMNode;
+import org.apache.axiom.soap.SOAPFault;
+import org.apache.axiom.soap.SOAPProcessingException;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+/**
+ * Tests that {@link OMNode#insertSiblingAfter(OMNode)} throws an exception if an attempt is made to
+ * add a {@link SOAPFault} as a child of a plain {@link OMElement}.
+ */
+public class TestWrongParent2 extends SOAPTestCase {
+ public TestWrongParent2(OMMetaFactory metaFactory, SOAPSpec spec) {
+ super(metaFactory, spec);
+ }
+
+ protected void runTest() throws Throwable {
+ OMElement parent = soapFactory.createOMElement("parent", null);
+ OMElement child1 = soapFactory.createOMElement("child1", null, parent);
+ SOAPFault fault = soapFactory.createSOAPFault();
+ try {
+ child1.insertSiblingAfter(fault);
+ fail("Expected SOAPProcessingException");
+ } catch (SOAPProcessingException ex) {
+ // Expected
+ }
+ }
+}
Propchange: webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestWrongParent2.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestWrongParent3.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestWrongParent3.java?rev=1338399&view=auto
==============================================================================
--- webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestWrongParent3.java (added)
+++ webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestWrongParent3.java Mon May 14 20:57:47 2012
@@ -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.soap.fault;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.om.OMNode;
+import org.apache.axiom.soap.SOAPFault;
+import org.apache.axiom.soap.SOAPProcessingException;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+/**
+ * Tests that {@link OMNode#insertSiblingBefore(OMNode)} throws an exception if an attempt is made to
+ * add a {@link SOAPFault} as a child of a plain {@link OMElement}.
+ */
+public class TestWrongParent3 extends SOAPTestCase {
+ public TestWrongParent3(OMMetaFactory metaFactory, SOAPSpec spec) {
+ super(metaFactory, spec);
+ }
+
+ protected void runTest() throws Throwable {
+ OMElement parent = soapFactory.createOMElement("parent", null);
+ OMElement child1 = soapFactory.createOMElement("child1", null, parent);
+ SOAPFault fault = soapFactory.createSOAPFault();
+ try {
+ child1.insertSiblingBefore(fault);
+ fail("Expected SOAPProcessingException");
+ } catch (SOAPProcessingException ex) {
+ // Expected
+ }
+ }
+}
Propchange: webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestWrongParent3.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestWrongParent1.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestWrongParent1.java?rev=1338399&view=auto
==============================================================================
--- webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestWrongParent1.java (added)
+++ webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestWrongParent1.java Mon May 14 20:57:47 2012
@@ -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.soap.headerblock;
+
+import org.apache.axiom.om.OMContainer;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.om.OMNode;
+import org.apache.axiom.soap.SOAPHeaderBlock;
+import org.apache.axiom.soap.SOAPProcessingException;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+/**
+ * Tests that {@link OMContainer#addChild(OMNode)} throws an exception if an attempt is made to add
+ * a {@link SOAPHeaderBlock} to a plain {@link OMElement}.
+ */
+public class TestWrongParent1 extends SOAPTestCase {
+ public TestWrongParent1(OMMetaFactory metaFactory, SOAPSpec spec) {
+ super(metaFactory, spec);
+ }
+
+ protected void runTest() throws Throwable {
+ OMElement parent = soapFactory.createOMElement("parent", null);
+ SOAPHeaderBlock hb = soapFactory.createSOAPHeaderBlock("MyHeader", soapFactory.createOMNamespace("urn:test", "p"));
+ try {
+ parent.addChild(hb);
+ fail("Expected SOAPProcessingException");
+ } catch (SOAPProcessingException ex) {
+ // Expected
+ }
+ }
+}
Propchange: webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestWrongParent1.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestWrongParent2.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestWrongParent2.java?rev=1338399&view=auto
==============================================================================
--- webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestWrongParent2.java (added)
+++ webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestWrongParent2.java Mon May 14 20:57:47 2012
@@ -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.soap.headerblock;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.om.OMNode;
+import org.apache.axiom.soap.SOAPHeaderBlock;
+import org.apache.axiom.soap.SOAPProcessingException;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+/**
+ * Tests that {@link OMNode#insertSiblingAfter(OMNode)} throws an exception if an attempt is made to
+ * add a {@link SOAPHeaderBlock} as a child of a plain {@link OMElement}.
+ */
+public class TestWrongParent2 extends SOAPTestCase {
+ public TestWrongParent2(OMMetaFactory metaFactory, SOAPSpec spec) {
+ super(metaFactory, spec);
+ }
+
+ protected void runTest() throws Throwable {
+ OMElement parent = soapFactory.createOMElement("parent", null);
+ OMElement child1 = soapFactory.createOMElement("child1", null, parent);
+ SOAPHeaderBlock hb = soapFactory.createSOAPHeaderBlock("MyHeader", soapFactory.createOMNamespace("urn:test", "p"));
+ try {
+ child1.insertSiblingAfter(hb);
+ fail("Expected SOAPProcessingException");
+ } catch (SOAPProcessingException ex) {
+ // Expected
+ }
+ }
+}
Propchange: webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestWrongParent2.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestWrongParent3.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestWrongParent3.java?rev=1338399&view=auto
==============================================================================
--- webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestWrongParent3.java (added)
+++ webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestWrongParent3.java Mon May 14 20:57:47 2012
@@ -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.soap.headerblock;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.om.OMNode;
+import org.apache.axiom.soap.SOAPHeaderBlock;
+import org.apache.axiom.soap.SOAPProcessingException;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+/**
+ * Tests that {@link OMNode#insertSiblingBefore(OMNode)} throws an exception if an attempt is made to
+ * add a {@link SOAPHeaderBlock} as a child of a plain {@link OMElement}.
+ */
+public class TestWrongParent3 extends SOAPTestCase {
+ public TestWrongParent3(OMMetaFactory metaFactory, SOAPSpec spec) {
+ super(metaFactory, spec);
+ }
+
+ protected void runTest() throws Throwable {
+ OMElement parent = soapFactory.createOMElement("parent", null);
+ OMElement child1 = soapFactory.createOMElement("child1", null, parent);
+ SOAPHeaderBlock hb = soapFactory.createSOAPHeaderBlock("MyHeader", soapFactory.createOMNamespace("urn:test", "p"));
+ try {
+ child1.insertSiblingBefore(hb);
+ fail("Expected SOAPProcessingException");
+ } catch (SOAPProcessingException ex) {
+ // Expected
+ }
+ }
+}
Propchange: webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestWrongParent3.java
------------------------------------------------------------------------------
svn:eol-style = native