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 2014/05/06 23:55:27 UTC

svn commit: r1592900 - in /webservices/axiom/trunk/modules: axiom-tests/src/test/java/org/apache/axiom/om/impl/llom/ axiom-testsuite/src/main/java/org/apache/axiom/ts/om/ axiom-testsuite/src/main/java/org/apache/axiom/ts/om/attribute/

Author: veithen
Date: Tue May  6 21:55:26 2014
New Revision: 1592900

URL: http://svn.apache.org/r1592900
Log:
AXIOM-311: Refactored testDefaultAttributeType.

Added:
    webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/attribute/TestGetAttributeTypeDefault.java
Modified:
    webservices/axiom/trunk/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/llom/OMAttributeTest.java
    webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java

Modified: webservices/axiom/trunk/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/llom/OMAttributeTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/llom/OMAttributeTest.java?rev=1592900&r1=1592899&r2=1592900&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/llom/OMAttributeTest.java (original)
+++ webservices/axiom/trunk/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/llom/OMAttributeTest.java Tue May  6 21:55:26 2014
@@ -69,14 +69,6 @@ public class OMAttributeTest extends Tes
         assertEquals(addAttributeMethod1(xmlString), addAttributeMethod2(xmlString));
     }
 
-    public void testDefaultAttributeType() throws Exception {
-        OMFactory factory = OMAbstractFactory.getOMFactory();
-        OMNamespace ns = factory.createOMNamespace("http://www.me.com", "axiom");
-        OMAttribute at = factory.createOMAttribute("id", ns, "value");
-
-        assertEquals(at.getAttributeType(), "CDATA");
-    }
-
     private String addAttributeMethod1(String xmlString) throws Exception {
         OMXMLParserWrapper builder2 = OMXMLBuilderFactory.createOMBuilder(new StringReader(xmlString));
         OMElement doc = builder2.getDocumentElement();

Modified: webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java?rev=1592900&r1=1592899&r2=1592900&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java (original)
+++ webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java Tue May  6 21:55:26 2014
@@ -72,6 +72,7 @@ public class OMTestSuiteBuilder extends 
         addTest(new org.apache.axiom.ts.om.attribute.TestDigestWithNamespace(metaFactory));
         addTest(new org.apache.axiom.ts.om.attribute.TestDigestWithoutNamespace(metaFactory));
         addTest(new org.apache.axiom.ts.om.attribute.TestEqualsHashCode(metaFactory));
+        addTest(new org.apache.axiom.ts.om.attribute.TestGetAttributeTypeDefault(metaFactory));
         addTest(new org.apache.axiom.ts.om.attribute.TestGetNamespaceNormalized(metaFactory));
         addTest(new org.apache.axiom.ts.om.attribute.TestGetNamespaceURIWithNamespace(metaFactory));
         addTest(new org.apache.axiom.ts.om.attribute.TestGetNamespaceURIWithoutNamespace(metaFactory));

Added: webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/attribute/TestGetAttributeTypeDefault.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/attribute/TestGetAttributeTypeDefault.java?rev=1592900&view=auto
==============================================================================
--- webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/attribute/TestGetAttributeTypeDefault.java (added)
+++ webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/attribute/TestGetAttributeTypeDefault.java Tue May  6 21:55:26 2014
@@ -0,0 +1,41 @@
+/*
+ * 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.attribute;
+
+import org.apache.axiom.om.OMAttribute;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.ts.AxiomTestCase;
+
+/**
+ * Tests that the default attribute type for programmatically created attributes is <tt>CDATA</tt>.
+ */
+public class TestGetAttributeTypeDefault extends AxiomTestCase {
+    public TestGetAttributeTypeDefault(OMMetaFactory metaFactory) {
+        super(metaFactory);
+    }
+
+    protected void runTest() throws Throwable {
+        OMFactory factory = metaFactory.getOMFactory();
+        OMNamespace ns = factory.createOMNamespace("http://www.me.com", "axiom");
+        OMAttribute at = factory.createOMAttribute("id", ns, "value");
+        assertEquals("CDATA", at.getAttributeType());
+    }
+}