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 2011/10/23 12:46:45 UTC
svn commit: r1187861 - in
/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts:
SOAPTestSuiteBuilder.java soap12/factory/
soap12/factory/TestCreateSOAPFaultSubCode.java
Author: veithen
Date: Sun Oct 23 10:46:44 2011
New Revision: 1187861
URL: http://svn.apache.org/viewvc?rev=1187861&view=rev
Log:
Added a test case for createSOAPFaultSubCode.
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/factory/
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/factory/TestCreateSOAPFaultSubCode.java (with props)
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/SOAPTestSuiteBuilder.java
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/SOAPTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/SOAPTestSuiteBuilder.java?rev=1187861&r1=1187860&r2=1187861&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/SOAPTestSuiteBuilder.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/SOAPTestSuiteBuilder.java Sun Oct 23 10:46:44 2011
@@ -113,6 +113,7 @@ public class SOAPTestSuiteBuilder extend
addTest(new org.apache.axiom.ts.soap12.envelope.TestBuildWithAttachments(metaFactory));
addTest(new org.apache.axiom.ts.soap12.envelope.TestMTOMForwardStreaming(metaFactory, true));
addTest(new org.apache.axiom.ts.soap12.envelope.TestMTOMForwardStreaming(metaFactory, false));
+ addTest(new org.apache.axiom.ts.soap12.factory.TestCreateSOAPFaultSubCode(metaFactory));
addTest(new org.apache.axiom.ts.soap12.fault.TestGetNode(metaFactory));
addTest(new org.apache.axiom.ts.soap12.fault.TestGetNodeWithParser(metaFactory));
addTest(new org.apache.axiom.ts.soap12.fault.TestMoreChildrenAddition(metaFactory));
Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/factory/TestCreateSOAPFaultSubCode.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/factory/TestCreateSOAPFaultSubCode.java?rev=1187861&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/factory/TestCreateSOAPFaultSubCode.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/factory/TestCreateSOAPFaultSubCode.java Sun Oct 23 10:46:44 2011
@@ -0,0 +1,57 @@
+/*
+ * 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.soap12.factory;
+
+import java.util.Iterator;
+
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAP12Constants;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPFault;
+import org.apache.axiom.soap.SOAPFaultCode;
+import org.apache.axiom.soap.SOAPFaultSubCode;
+import org.apache.axiom.soap.SOAPFaultValue;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+/**
+ * Tests {@link SOAPFactory#createSOAPFaultSubCode(SOAPFaultCode)}.
+ */
+public class TestCreateSOAPFaultSubCode extends SOAPTestCase {
+ public TestCreateSOAPFaultSubCode(OMMetaFactory metaFactory) {
+ super(metaFactory, SOAPSpec.SOAP12);
+ }
+
+ protected void runTest() throws Throwable {
+ SOAPEnvelope envelope = soapFactory.getDefaultFaultEnvelope();
+ SOAPFault fault = envelope.getBody().getFault();
+ SOAPFaultCode code = fault.getCode();
+ SOAPFaultSubCode subCode = soapFactory.createSOAPFaultSubCode(code);
+ assertEquals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI, subCode.getNamespaceURI());
+ assertEquals(SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME, subCode.getLocalName());
+ assertSame(code, subCode.getParent());
+ Iterator it = code.getChildren();
+ assertTrue(it.hasNext());
+ assertTrue(it.next() instanceof SOAPFaultValue);
+ assertTrue(it.hasNext());
+ assertSame(subCode, it.next());
+ assertFalse(it.hasNext());
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/factory/TestCreateSOAPFaultSubCode.java
------------------------------------------------------------------------------
svn:eol-style = native