Author: veithen
Date: Mon Dec 22 13:04:27 2008
New Revision: 728773

URL: http://svn.apache.org/viewvc?rev=728773&view=rev
Log:
WSCOMMONS-419: Reorganized OMDocument tests.

Added:
    
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/OMDocumentTestBase.java
      - copied, changed from r728762, 
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMDocumentTest.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/DOMTestUtil.java
      - copied unchanged from r728762, 
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/dom/DOMTestUtil.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/DocumentImplTest.java
      - copied, changed from r728762, 
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/dom/DocumentImplTest.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMDocumentImplTest.java
   (with props)
Removed:
    
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMDocumentTest.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/dom/DOMTestUtil.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/dom/DocumentImplTest.java
Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-dom/pom.xml
    webservices/commons/trunk/modules/axiom/modules/axiom-impl/pom.xml
    webservices/commons/trunk/modules/axiom/modules/axiom-tests/pom.xml

Copied: 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/OMDocumentTestBase.java
 (from r728762, 
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMDocumentTest.java)
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/OMDocumentTestBase.java?p2=webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/OMDocumentTestBase.java&p1=webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMDocumentTest.java&r1=728762&r2=728773&rev=728773&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMDocumentTest.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/OMDocumentTestBase.java
 Mon Dec 22 13:04:27 2008
@@ -29,13 +29,19 @@
 import java.io.StringReader;
 import java.util.Iterator;
 
-public class OMDocumentTest extends TestCase {
+public class OMDocumentTestBase extends TestCase {
     private String sampleXML = "<?xml version='1.0' encoding='utf-8'?>" +
             "<!--This is some comments at the start of the document-->" +
             "<?PITarget PIData?>" +
             "<Axis2>" +
             "    <ProjectName>The Apache Web Sevices Project</ProjectName>" +
             "</Axis2>";
+    
+    private final OMImplementation omImplementation;
+    
+    public OMDocumentTestBase(OMImplementation omImplementation) {
+        this.omImplementation = omImplementation;
+    }
 
     public void testOMDocument() throws XMLStreamException {
         // read the string in to the builder
@@ -87,7 +93,8 @@
         try {
             XMLStreamReader xmlStreamReader =
                     XMLInputFactory.newInstance().createXMLStreamReader(new 
StringReader(xml));
-            StAXOMBuilder builder = new StAXOMBuilder(xmlStreamReader);
+            StAXOMBuilder builder =
+                    new StAXOMBuilder(omImplementation.getOMFactory(), 
xmlStreamReader);
             return builder.getDocument();
         } catch (XMLStreamException e) {
             throw new UnsupportedOperationException();

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom/pom.xml
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/pom.xml?rev=728773&r1=728772&r2=728773&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/pom.xml (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/pom.xml Mon Dec 
22 13:04:27 2008
@@ -44,6 +44,10 @@
             <artifactId>geronimo-javamail_1.4_spec</artifactId>
         </dependency>
         <dependency>
+            <groupId>${stax.impl.groupid}</groupId>
+            <artifactId>${stax.impl.artifact}</artifactId>
+        </dependency>
+        <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
         </dependency>
@@ -103,6 +107,18 @@
                     </archive>
                 </configuration>
             </plugin>
+            <!-- Attach a JAR with the test classes so that we can reuse them 
in other modules
+                 (see 
http://maven.apache.org/guides/mini/guide-attached-tests.html). -->
+            <plugin>
+                <artifactId>maven-jar-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>test-jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
             <plugin>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>

Copied: 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/DocumentImplTest.java
 (from r728762, 
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/dom/DocumentImplTest.java)
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/DocumentImplTest.java?p2=webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/DocumentImplTest.java&p1=webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/dom/DocumentImplTest.java&r1=728762&r2=728773&rev=728773&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/dom/DocumentImplTest.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/DocumentImplTest.java
 Mon Dec 22 13:04:27 2008
@@ -20,8 +20,10 @@
 package org.apache.axiom.om.impl.dom;
 
 import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.stream.XMLStreamException;
 
-import junit.framework.TestCase;
+import org.apache.axiom.om.OMDocumentTestBase;
+import org.apache.axiom.om.impl.dom.factory.OMDOMImplementation;
 import org.w3c.dom.Attr;
 import org.w3c.dom.DOMException;
 import org.w3c.dom.Document;
@@ -29,7 +31,15 @@
 import org.w3c.dom.Node;
 import org.w3c.dom.Text;
 
-public class DocumentImplTest extends TestCase {
+public class DocumentImplTest extends OMDocumentTestBase {
+    public DocumentImplTest() {
+        super(new OMDOMImplementation());
+    }
+
+    public void testOMDocument() throws XMLStreamException {
+        // TODO: temporarily skip this; doesn't work yet
+    }
+
     public void testCreateElement() throws Exception {
         DOMTestUtil.execute(new DOMTestUtil.Test() {
             public void execute(DocumentBuilderFactory dbf) throws Exception {

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/pom.xml
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/pom.xml?rev=728773&r1=728772&r2=728773&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/pom.xml 
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/pom.xml Mon Dec 
22 13:04:27 2008
@@ -107,6 +107,18 @@
                     </archive>
                 </configuration>
             </plugin>
+            <!-- Attach a JAR with the test classes so that we can reuse them 
in other modules
+                 (see 
http://maven.apache.org/guides/mini/guide-attached-tests.html). -->
+            <plugin>
+                <artifactId>maven-jar-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>test-jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
 </project>

Added: 
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMDocumentImplTest.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMDocumentImplTest.java?rev=728773&view=auto
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMDocumentImplTest.java
 (added)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMDocumentImplTest.java
 Mon Dec 22 13:04:27 2008
@@ -0,0 +1,29 @@
+/*
+ * 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.om.impl.llom;
+
+import org.apache.axiom.om.OMDocumentTestBase;
+import org.apache.axiom.om.impl.llom.factory.OMLinkedListImplementation;
+
+public class OMDocumentImplTest extends OMDocumentTestBase {
+    public OMDocumentImplTest() {
+        super(new OMLinkedListImplementation());
+    }
+}

Propchange: 
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMDocumentImplTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/pom.xml
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/pom.xml?rev=728773&r1=728772&r2=728773&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/pom.xml 
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/pom.xml Mon Dec 
22 13:04:27 2008
@@ -102,6 +102,20 @@
             <groupId>${stax.impl.groupid}</groupId>
             <artifactId>${stax.impl.artifact}</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.ws.commons.axiom</groupId>
+            <artifactId>axiom-impl</artifactId>
+            <classifier>tests</classifier>
+            <version>${axiom.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ws.commons.axiom</groupId>
+            <artifactId>axiom-dom</artifactId>
+            <classifier>tests</classifier>
+            <version>${axiom.version}</version>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
     <build>
         <plugins>


Reply via email to