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/07/07 01:40:40 UTC
svn commit: r1358471 - in /webservices/commons/trunk/modules/axiom/modules:
axiom-tests/src/test/java/org/apache/axiom/om/
axiom-testsuite/src/main/java/org/apache/axiom/ts/om/
axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/
Author: veithen
Date: Fri Jul 6 23:40:40 2012
New Revision: 1358471
URL: http://svn.apache.org/viewvc?rev=1358471&view=rev
Log:
AXIOM-311: Refactored OMDiscardTest.
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestDiscard.java
- copied, changed from r1358466, webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMDiscardTest.java
Removed:
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMDiscardTest.java
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java?rev=1358471&r1=1358470&r2=1358471&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java Fri Jul 6 23:40:40 2012
@@ -152,6 +152,7 @@ public class OMTestSuiteBuilder extends
addTest(new org.apache.axiom.ts.om.element.TestDeclareNamespaceWithGeneratedPrefix3(metaFactory));
addTest(new org.apache.axiom.ts.om.element.TestDigestWithNamespace(metaFactory));
addTest(new org.apache.axiom.ts.om.element.TestDigestWithoutNamespace(metaFactory));
+ addTest(new org.apache.axiom.ts.om.element.TestDiscard(metaFactory));
addTest(new org.apache.axiom.ts.om.element.TestFindNamespaceByNamespaceURIMasked(metaFactory));
addTest(new org.apache.axiom.ts.om.element.TestFindNamespaceByPrefix(metaFactory));
addTest(new org.apache.axiom.ts.om.element.TestFindNamespaceCaseSensitivity(metaFactory));
Copied: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestDiscard.java (from r1358466, webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMDiscardTest.java)
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestDiscard.java?p2=webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestDiscard.java&p1=webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMDiscardTest.java&r1=1358466&r2=1358471&rev=1358471&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMDiscardTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestDiscard.java Fri Jul 6 23:40:40 2012
@@ -16,18 +16,31 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.axiom.om;
+package org.apache.axiom.ts.om.element;
+
+import org.apache.axiom.om.AbstractTestCase;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.om.OMXMLBuilderFactory;
+import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.om.TestConstants;
+import org.apache.axiom.ts.AxiomTestCase;
/**
*Test the discard method
*/
-public class OMDiscardTest extends AbstractTestCase {
- public void testDiscard(){
+public class TestDiscard extends AxiomTestCase {
+ public TestDiscard(OMMetaFactory metaFactory) {
+ super(metaFactory);
+ }
+
+ protected void runTest() throws Throwable {
OMElement documentElement = null;
try {
// first build the OM tree without caching and see whether we can discard
// an element from it
- OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(getTestResource(TestConstants.SOAP_SOAPMESSAGE));
+ OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(metaFactory.getOMFactory(),
+ AbstractTestCase.getTestResource(TestConstants.SOAP_SOAPMESSAGE));
documentElement = builder.getDocumentElement();
documentElement.getFirstElement().discard();