ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1748027 [1/2] - in /webservices/axiom/trunk: ./ apidocs/ axiom-all/ axiom-compat/src/main/java/org/apache/axiom/om/util/jaxb/ axiom-compat/src/main/java/org/apache/axiom/util/jaxb/ axiom-jaxb/ code-coverage/ distribution/ src/site/markdown...
Date Sun, 12 Jun 2016 16:27:16 GMT
Author: veithen
Date: Sun Jun 12 16:27:16 2016
New Revision: 1748027

URL: http://svn.apache.org/viewvc?rev=1748027&view=rev
Log:
Eliminate axiom-jaxb as a separate artifact.

Added:
    webservices/axiom/trunk/axiom-compat/src/main/java/org/apache/axiom/om/util/jaxb/
      - copied from r1747986, webservices/axiom/trunk/axiom-jaxb/src/main/java/org/apache/axiom/om/util/jaxb/
    webservices/axiom/trunk/axiom-compat/src/main/java/org/apache/axiom/om/util/jaxb/JAXBUtils.java
      - copied, changed from r1748020, webservices/axiom/trunk/axiom-jaxb/src/main/java/org/apache/axiom/om/util/jaxb/JAXBUtils.java
    webservices/axiom/trunk/axiom-compat/src/main/java/org/apache/axiom/util/jaxb/
      - copied from r1747986, webservices/axiom/trunk/axiom-jaxb/src/main/java/org/apache/axiom/util/jaxb/
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/jaxb/
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/jaxb/beans/
      - copied from r1747986, webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/ds/jaxb/beans/
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestUnmarshalWithDataHandler.java
      - copied, changed from r1747986, webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/util/jaxb/JAXBUtilsTest.java
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/ExceptionXMLStreamWriterWrapper.java
      - copied, changed from r1747986, webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/ds/jaxb/ExceptionXMLStreamWriterWrapper.java
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/TestDataHandlerExpansion.java
      - copied, changed from r1747986, webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/ds/jaxb/JAXBOMDataSourceTest.java
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/TestDataHandlerSerializationWithMTOM.java
      - copied, changed from r1747986, webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/ds/jaxb/JAXBOMDataSourceTest.java
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/TestDataHandlerSerializationWithoutMTOM.java
      - copied, changed from r1747986, webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/ds/jaxb/JAXBOMDataSourceTest.java
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/TestExceptionDuringSerialization.java
      - copied, changed from r1747986, webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/ds/jaxb/JAXBOMDataSourceTest.java
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/TestGetNameFromJAXBElement.java
      - copied, changed from r1747986, webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/ds/jaxb/JAXBOMDataSourceTest.java
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/TestGetNameFromPlainObject.java
      - copied, changed from r1747986, webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/ds/jaxb/JAXBOMDataSourceTest.java
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/schemas/
      - copied from r1747986, webservices/axiom/trunk/axiom-jaxb/src/test/schemas/
Removed:
    webservices/axiom/trunk/axiom-jaxb/
Modified:
    webservices/axiom/trunk/apidocs/pom.xml
    webservices/axiom/trunk/axiom-all/pom.xml
    webservices/axiom/trunk/axiom-compat/src/main/java/org/apache/axiom/util/jaxb/JAXBUtils.java
    webservices/axiom/trunk/axiom-compat/src/main/java/org/apache/axiom/util/jaxb/UnmarshallerAdapter.java
    webservices/axiom/trunk/code-coverage/pom.xml
    webservices/axiom/trunk/distribution/pom.xml
    webservices/axiom/trunk/pom.xml
    webservices/axiom/trunk/src/site/markdown/release-notes/1.3.0.md
    webservices/axiom/trunk/systests/osgi-tests/pom.xml
    webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/JAXBTest.java
    webservices/axiom/trunk/testing/axiom-testsuite/pom.xml
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/jaxb/beans/DocumentBean.java
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/jaxb/beans/MyBean.java
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/jaxb/beans/package-info.java
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java

Modified: webservices/axiom/trunk/apidocs/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/apidocs/pom.xml?rev=1748027&r1=1748026&r2=1748027&view=diff
==============================================================================
--- webservices/axiom/trunk/apidocs/pom.xml (original)
+++ webservices/axiom/trunk/apidocs/pom.xml Sun Jun 12 16:27:16 2016
@@ -41,11 +41,6 @@
             <artifactId>axiom-api</artifactId>
             <version>${project.version}</version>
         </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>axiom-jaxb</artifactId>
-            <version>${project.version}</version>
-        </dependency>
         <!-- These are artifacts that are optional/provided dependencies of the above artifacts.
              We need them to process the sources. -->
         <dependency>

Modified: webservices/axiom/trunk/axiom-all/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-all/pom.xml?rev=1748027&r1=1748026&r2=1748027&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-all/pom.xml (original)
+++ webservices/axiom/trunk/axiom-all/pom.xml Sun Jun 12 16:27:16 2016
@@ -63,11 +63,6 @@
         </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
-            <artifactId>axiom-jaxb</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
             <artifactId>axiom-c14n</artifactId>
             <version>${project.version}</version>
         </dependency>

Copied: webservices/axiom/trunk/axiom-compat/src/main/java/org/apache/axiom/om/util/jaxb/JAXBUtils.java (from r1748020, webservices/axiom/trunk/axiom-jaxb/src/main/java/org/apache/axiom/om/util/jaxb/JAXBUtils.java)
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-compat/src/main/java/org/apache/axiom/om/util/jaxb/JAXBUtils.java?p2=webservices/axiom/trunk/axiom-compat/src/main/java/org/apache/axiom/om/util/jaxb/JAXBUtils.java&p1=webservices/axiom/trunk/axiom-jaxb/src/main/java/org/apache/axiom/om/util/jaxb/JAXBUtils.java&r1=1748020&r2=1748027&rev=1748027&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-jaxb/src/main/java/org/apache/axiom/om/util/jaxb/JAXBUtils.java (original)
+++ webservices/axiom/trunk/axiom-compat/src/main/java/org/apache/axiom/om/util/jaxb/JAXBUtils.java Sun Jun 12 16:27:16 2016
@@ -27,6 +27,8 @@ import org.apache.axiom.om.UnmarshallerC
 
 /**
  * Contains utility methods that integrate JAXB with Axiom.
+ * 
+ * @deprecated
  */
 public final class JAXBUtils {
     private JAXBUtils() {}

Modified: webservices/axiom/trunk/axiom-compat/src/main/java/org/apache/axiom/util/jaxb/JAXBUtils.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-compat/src/main/java/org/apache/axiom/util/jaxb/JAXBUtils.java?rev=1748027&r1=1747986&r2=1748027&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-compat/src/main/java/org/apache/axiom/util/jaxb/JAXBUtils.java (original)
+++ webservices/axiom/trunk/axiom-compat/src/main/java/org/apache/axiom/util/jaxb/JAXBUtils.java Sun Jun 12 16:27:16 2016
@@ -29,6 +29,8 @@ import org.apache.axiom.util.stax.xop.XO
 /**
  * Contains low level utility methods that integrate JAXB with some of the Axiom specific StAX
  * extensions.
+ * 
+ * @deprecated
  */
 public final class JAXBUtils {
     private JAXBUtils() {}

Modified: webservices/axiom/trunk/axiom-compat/src/main/java/org/apache/axiom/util/jaxb/UnmarshallerAdapter.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-compat/src/main/java/org/apache/axiom/util/jaxb/UnmarshallerAdapter.java?rev=1748027&r1=1747986&r2=1748027&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-compat/src/main/java/org/apache/axiom/util/jaxb/UnmarshallerAdapter.java (original)
+++ webservices/axiom/trunk/axiom-compat/src/main/java/org/apache/axiom/util/jaxb/UnmarshallerAdapter.java Sun Jun 12 16:27:16 2016
@@ -29,6 +29,8 @@ import org.apache.axiom.ext.stax.datahan
  * {@link XMLStreamReader} that exposes the {@link DataHandlerReader} extension.
  * 
  * @see JAXBUtils#getUnmarshallerAdapter(XMLStreamReader)
+ * 
+ * @deprecated
  */
 public class UnmarshallerAdapter {
     private final XMLStreamReader reader;

Modified: webservices/axiom/trunk/code-coverage/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/code-coverage/pom.xml?rev=1748027&r1=1748026&r2=1748027&view=diff
==============================================================================
--- webservices/axiom/trunk/code-coverage/pom.xml (original)
+++ webservices/axiom/trunk/code-coverage/pom.xml Sun Jun 12 16:27:16 2016
@@ -142,25 +142,6 @@
         
         <dependency>
             <groupId>${project.groupId}</groupId>
-            <artifactId>axiom-jaxb</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>axiom-jaxb</artifactId>
-            <version>${project.version}</version>
-            <classifier>sources</classifier>
-        </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>axiom-jaxb</artifactId>
-            <version>${project.version}</version>
-            <classifier>jacoco</classifier>
-            <type>exec</type>
-        </dependency>
-
-        <dependency>
-            <groupId>${project.groupId}</groupId>
             <artifactId>fom-aspects</artifactId>
             <version>${project.version}</version>
         </dependency>

Modified: webservices/axiom/trunk/distribution/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/distribution/pom.xml?rev=1748027&r1=1748026&r2=1748027&view=diff
==============================================================================
--- webservices/axiom/trunk/distribution/pom.xml (original)
+++ webservices/axiom/trunk/distribution/pom.xml Sun Jun 12 16:27:16 2016
@@ -58,11 +58,6 @@
         </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
-            <artifactId>axiom-jaxb</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
             <artifactId>axiom-c14n</artifactId>
             <version>${project.version}</version>
         </dependency>

Modified: webservices/axiom/trunk/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/pom.xml?rev=1748027&r1=1748026&r2=1748027&view=diff
==============================================================================
--- webservices/axiom/trunk/pom.xml (original)
+++ webservices/axiom/trunk/pom.xml Sun Jun 12 16:27:16 2016
@@ -210,7 +210,6 @@
         <module>buildutils</module>
         <module>axiom-api</module>
         <module>axiom-compat</module>
-        <module>axiom-jaxb</module>
         <module>axiom-c14n</module>
         <module>axiom-all</module>
         <module>samples</module>

Modified: webservices/axiom/trunk/src/site/markdown/release-notes/1.3.0.md
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/src/site/markdown/release-notes/1.3.0.md?rev=1748027&r1=1748026&r2=1748027&view=diff
==============================================================================
--- webservices/axiom/trunk/src/site/markdown/release-notes/1.3.0.md (original)
+++ webservices/axiom/trunk/src/site/markdown/release-notes/1.3.0.md Sun Jun 12 16:27:16 2016
@@ -4,11 +4,13 @@ Apache Axiom 1.3.0 Release Note
 Changes in this release
 -----------------------
 
-*   Axiom now requires at least Java 6. Explicit dependencies on APIs that were
-    not part of the JRE in Java 5 (Activation, StAX and JAXB) have been removed.
+*   Axiom now requires at least Java 6:
 
-*   The public API now uses generics. Note that this should in general not have
-    impact on binary compatibility with Axiom 1.2.x.
+    *   Explicit dependencies on APIs that were not part of the JRE in Java 5
+        (Activation, StAX and JAXB) have been removed.
+    *   The public API now uses generics. Note that this should in general not
+        have impact on binary compatibility with Axiom 1.2.x.
+    *   `axiom-jaxb` no longer exists as a separate artifact.
 
 *   In Axiom 1.2.x several APIs were using `Object` as argument/return type
     although they expect/return a `DataHandler`. This is a legacy of Axis 1.x

Modified: webservices/axiom/trunk/systests/osgi-tests/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/systests/osgi-tests/pom.xml?rev=1748027&r1=1748026&r2=1748027&view=diff
==============================================================================
--- webservices/axiom/trunk/systests/osgi-tests/pom.xml (original)
+++ webservices/axiom/trunk/systests/osgi-tests/pom.xml Sun Jun 12 16:27:16 2016
@@ -50,12 +50,6 @@
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>axiom-jaxb</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
         
         <dependency>
             <groupId>org.apache.felix</groupId>

Modified: webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/JAXBTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/JAXBTest.java?rev=1748027&r1=1748026&r2=1748027&view=diff
==============================================================================
--- webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/JAXBTest.java (original)
+++ webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/JAXBTest.java Sun Jun 12 16:27:16 2016
@@ -39,7 +39,7 @@ import org.ops4j.pax.exam.spi.reactors.E
 import org.ops4j.pax.exam.spi.reactors.PerClass;
 
 /**
- * Tests that the axiom-jaxb bundle can be loaded successfully and is operational.
+ * Tests that the APIs depending on JAXB can be used successfully.
  */
 @RunWith(PaxExam.class)
 @ExamReactorStrategy(PerClass.class)
@@ -50,7 +50,6 @@ public class JAXBTest {
                 url("link:classpath:org.apache.james.apache-mime4j-core.link"),
                 url("link:classpath:org.apache.ws.commons.axiom.axiom-api.link"),
                 url("link:classpath:org.apache.ws.commons.axiom.axiom-impl.link"),
-                url("link:classpath:org.apache.ws.commons.axiom.axiom-jaxb.link"),
                 junitBundles());
     }
     

Modified: webservices/axiom/trunk/testing/axiom-testsuite/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/pom.xml?rev=1748027&r1=1748026&r2=1748027&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/pom.xml (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/pom.xml Sun Jun 12 16:27:16 2016
@@ -114,6 +114,20 @@
                     </execution>
                 </executions>
             </plugin>
+            <plugin>
+                <groupId>org.jvnet.jaxb2.maven2</groupId>
+                <artifactId>maven-jaxb2-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                        <configuration>
+                            <schemaDirectory>src/main/schemas</schemaDirectory>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
 

Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/jaxb/beans/DocumentBean.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/jaxb/beans/DocumentBean.java?rev=1748027&r1=1747986&r2=1748027&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/jaxb/beans/DocumentBean.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/jaxb/beans/DocumentBean.java Sun Jun 12 16:27:16 2016
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.axiom.om.ds.jaxb.beans;
+package org.apache.axiom.ts.jaxb.beans;
 
 import javax.activation.DataHandler;
 import javax.xml.bind.annotation.XmlRootElement;

Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/jaxb/beans/MyBean.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/jaxb/beans/MyBean.java?rev=1748027&r1=1747986&r2=1748027&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/jaxb/beans/MyBean.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/jaxb/beans/MyBean.java Sun Jun 12 16:27:16 2016
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.axiom.om.ds.jaxb.beans;
+package org.apache.axiom.ts.jaxb.beans;
 
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;

Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/jaxb/beans/package-info.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/jaxb/beans/package-info.java?rev=1748027&r1=1747986&r2=1748027&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/jaxb/beans/package-info.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/jaxb/beans/package-info.java Sun Jun 12 16:27:16 2016
@@ -19,4 +19,4 @@
 @javax.xml.bind.annotation.XmlSchema(
         namespace = "http://ws.apache.org/axiom/test/jaxb",
         elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
-package org.apache.axiom.om.ds.jaxb.beans;
\ No newline at end of file
+package org.apache.axiom.ts.jaxb.beans;
\ No newline at end of file

Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java?rev=1748027&r1=1748026&r2=1748027&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java Sun Jun 12 16:27:16 2016
@@ -429,6 +429,7 @@ public class OMTestSuiteBuilder extends
         addTest(new org.apache.axiom.ts.om.element.TestSetTextQNameWithExistingChildren(metaFactory));
         addTest(new org.apache.axiom.ts.om.element.TestSetTextQNameWithoutNamespace(metaFactory));
         addTest(new org.apache.axiom.ts.om.element.TestUndeclarePrefix(metaFactory));
+        addTest(new org.apache.axiom.ts.om.element.TestUnmarshalWithDataHandler(metaFactory));
         addTest(new org.apache.axiom.ts.om.element.TestWriteTextTo(metaFactory));
         addTest(new org.apache.axiom.ts.om.element.TestWriteTextToWithNonTextNodes(metaFactory));
         addTest(new org.apache.axiom.ts.om.element.sr.TestCloseAndContinueBuilding(metaFactory, true));
@@ -619,6 +620,12 @@ public class OMTestSuiteBuilder extends
         addTest(new org.apache.axiom.ts.om.sourcedelement.TestSetLocalName(metaFactory, true));
         addTest(new org.apache.axiom.ts.om.sourcedelement.TestWrappedTextNodeOMDataSourceFromReader(metaFactory));
         addTest(new org.apache.axiom.ts.om.sourcedelement.TestWriteTextToWithNonDestructiveOMDataSource(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.jaxb.TestDataHandlerExpansion(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.jaxb.TestDataHandlerSerializationWithMTOM(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.jaxb.TestDataHandlerSerializationWithoutMTOM(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.jaxb.TestExceptionDuringSerialization(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.jaxb.TestGetNameFromJAXBElement(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.jaxb.TestGetNameFromPlainObject(metaFactory));
         addTest(new org.apache.axiom.ts.om.sourcedelement.sr.TestGetName(metaFactory));
         for (int events = 0; events < 7; events++) {
             addTest(new org.apache.axiom.ts.om.sourcedelement.sr.TestCloseWithoutCaching(metaFactory, events));

Copied: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestUnmarshalWithDataHandler.java (from r1747986, webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/util/jaxb/JAXBUtilsTest.java)
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestUnmarshalWithDataHandler.java?p2=webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestUnmarshalWithDataHandler.java&p1=webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/util/jaxb/JAXBUtilsTest.java&r1=1747986&r2=1748027&rev=1748027&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/util/jaxb/JAXBUtilsTest.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestUnmarshalWithDataHandler.java Sun Jun 12 16:27:16 2016
@@ -16,30 +16,32 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.axiom.om.util.jaxb;
-
-import static org.junit.Assert.assertEquals;
+package org.apache.axiom.ts.om.element;
 
 import javax.activation.DataHandler;
 import javax.xml.bind.JAXBContext;
 
-import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMMetaFactory;
 import org.apache.axiom.om.ds.jaxb.JAXBOMDataSource;
-import org.apache.axiom.om.ds.jaxb.beans.DocumentBean;
-import org.junit.Test;
+import org.apache.axiom.ts.AxiomTestCase;
+import org.apache.axiom.ts.jaxb.beans.DocumentBean;
+
+public class TestUnmarshalWithDataHandler extends AxiomTestCase {
+    public TestUnmarshalWithDataHandler(OMMetaFactory metaFactory) {
+        super(metaFactory);
+    }
 
-public class JAXBUtilsTest {
-    @Test
-    public void testUnmarshalWithDataHandler() throws Exception {
-        OMFactory factory = OMAbstractFactory.getOMFactory();
+    @Override
+    protected void runTest() throws Throwable {
+        OMFactory factory = metaFactory.getOMFactory();
         JAXBContext context = JAXBContext.newInstance(DocumentBean.class);
         DocumentBean orgBean = new DocumentBean();
         orgBean.setId("AB23498");
         orgBean.setContent(new DataHandler("test content", "text/plain"));
         OMElement element = factory.createOMElement(new JAXBOMDataSource(context, orgBean));
-        DocumentBean bean = (DocumentBean)JAXBUtils.unmarshal(context, element, true);
+        DocumentBean bean = (DocumentBean)element.unmarshal(context, null, true);
         assertEquals(orgBean.getId(), bean.getId());
         assertEquals(orgBean.getContent(), bean.getContent());
     }

Copied: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/ExceptionXMLStreamWriterWrapper.java (from r1747986, webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/ds/jaxb/ExceptionXMLStreamWriterWrapper.java)
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/ExceptionXMLStreamWriterWrapper.java?p2=webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/ExceptionXMLStreamWriterWrapper.java&p1=webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/ds/jaxb/ExceptionXMLStreamWriterWrapper.java&r1=1747986&r2=1748027&rev=1748027&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/ds/jaxb/ExceptionXMLStreamWriterWrapper.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/ExceptionXMLStreamWriterWrapper.java Sun Jun 12 16:27:16 2016
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.axiom.om.ds.jaxb;
+package org.apache.axiom.ts.om.sourcedelement.jaxb;
 
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;

Copied: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/TestDataHandlerExpansion.java (from r1747986, webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/ds/jaxb/JAXBOMDataSourceTest.java)
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/TestDataHandlerExpansion.java?p2=webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/TestDataHandlerExpansion.java&p1=webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/ds/jaxb/JAXBOMDataSourceTest.java&r1=1747986&r2=1748027&rev=1748027&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/ds/jaxb/JAXBOMDataSourceTest.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/TestDataHandlerExpansion.java Sun Jun 12 16:27:16 2016
@@ -16,53 +16,33 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.axiom.om.ds.jaxb;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
+package org.apache.axiom.ts.om.sourcedelement.jaxb;
 
 import javax.activation.DataHandler;
 import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.JAXBException;
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
 
-import org.apache.axiom.attachments.Attachments;
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMDataSource;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMOutputFormat;
+import org.apache.axiom.om.OMMetaFactory;
 import org.apache.axiom.om.OMSourcedElement;
 import org.apache.axiom.om.OMText;
-import org.apache.axiom.om.OMXMLBuilderFactory;
-import org.apache.axiom.om.ds.jaxb.beans.DocumentBean;
-import org.apache.axiom.om.ds.jaxb.beans.MyBean;
-import org.apache.axiom.om.util.StAXUtils;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.soap.SOAPFactory;
-import org.apache.commons.io.IOUtils;
-import org.example.identity.LinkIdentitiesType;
-import org.example.identity.ObjectFactory;
-import org.junit.Test;
+import org.apache.axiom.om.ds.jaxb.JAXBOMDataSource;
+import org.apache.axiom.ts.AxiomTestCase;
+import org.apache.axiom.ts.jaxb.beans.DocumentBean;
+
+/**
+ * Tests the expansion of an {@link OMSourcedElement} backed by a {@link JAXBOMDataSource} with
+ * a bean that has a {@link DataHandler}. The expansion should result in an {@link OMText} node
+ * linked to that {@link DataHandler}.
+ */
+public class TestDataHandlerExpansion extends AxiomTestCase {
+    public TestDataHandlerExpansion(OMMetaFactory metaFactory) {
+        super(metaFactory);
+    }
 
-public class JAXBOMDataSourceTest {
-    /**
-     * Tests the expansion of an {@link OMSourcedElement} backed by a {@link JAXBOMDataSource} with
-     * a bean that has a {@link DataHandler}. The expansion should result in an {@link OMText} node
-     * linked to that {@link DataHandler}.
-     */
-    @Test
-    public void testDataHandlerExpansion() throws Exception {
-        OMFactory factory = OMAbstractFactory.getOMFactory();
+    @Override
+    protected void runTest() throws Throwable {
+        OMFactory factory = metaFactory.getOMFactory();
         JAXBContext context = JAXBContext.newInstance(DocumentBean.class);
         DataHandler dh = new DataHandler("some content", "text/plain");
         DocumentBean object = new DocumentBean();
@@ -79,146 +59,4 @@ public class JAXBOMDataSourceTest {
         assertTrue(content.isOptimized());
         assertSame(dh, content.getDataHandler());
     }
-    
-    /**
-     * Tests that an {@link OMSourcedElement} backed by a {@link JAXBOMDataSource} with a bean
-     * containing a {@link DataHandler} is correctly serialized.
-     */
-    @Test
-    public void testDataHandlerSerializationWithoutMTOM() throws Exception{
-        SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
-        JAXBContext context = JAXBContext.newInstance(DocumentBean.class);
-        
-        // Construct the original message
-        DocumentBean orgObject = new DocumentBean();
-        orgObject.setId("123456");
-        orgObject.setContent(new DataHandler("some content", "text/plain; charset=utf-8"));
-        SOAPEnvelope orgEnvelope = factory.getDefaultEnvelope();
-        OMSourcedElement element = factory.createOMElement(new JAXBOMDataSource(context, orgObject));
-        orgEnvelope.getBody().addChild(element);
-        
-        // Serialize the message
-        ByteArrayOutputStream out = new ByteArrayOutputStream();
-        orgEnvelope.serialize(out);
-        assertFalse(element.isExpanded());
-        
-        SOAPEnvelope envelope = OMXMLBuilderFactory.createSOAPModelBuilder(
-                new ByteArrayInputStream(out.toByteArray()), null).getSOAPEnvelope();
-        DocumentBean object = (DocumentBean)context.createUnmarshaller().unmarshal(
-                envelope.getBody().getFirstElement().getXMLStreamReader(false));
-        assertEquals("some content", IOUtils.toString(object.getContent().getInputStream(), "utf-8"));
-    }
-    
-    /**
-     * Tests that an {@link OMSourcedElement} backed by a {@link JAXBOMDataSource} with a bean
-     * containing a {@link DataHandler} is correctly serialized to MTOM.
-     */
-    @Test
-    public void testDataHandlerSerializationWithMTOM() throws Exception {
-        SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
-        JAXBContext context = JAXBContext.newInstance(DocumentBean.class);
-        
-        // Construct the original message
-        DocumentBean object = new DocumentBean();
-        object.setId("123456");
-        object.setContent(new DataHandler("some content", "text/plain; charset=utf-8"));
-        SOAPEnvelope orgEnvelope = factory.getDefaultEnvelope();
-        OMSourcedElement element = factory.createOMElement(new JAXBOMDataSource(context, object));
-        orgEnvelope.getBody().addChild(element);
-        
-        // Serialize the message
-        OMOutputFormat format = new OMOutputFormat();
-        format.setDoOptimize(true);
-        ByteArrayOutputStream out = new ByteArrayOutputStream();
-        orgEnvelope.serialize(out, format);
-        assertFalse(element.isExpanded());
-        
-        // Parse the serialized message
-        Attachments att = new Attachments(new ByteArrayInputStream(out.toByteArray()), format.getContentType());
-        assertEquals(2, att.getAllContentIDs().length);
-        SOAPEnvelope envelope = OMXMLBuilderFactory.createSOAPModelBuilder(att).getSOAPEnvelope();
-        OMElement contentElement = envelope.getBody().getFirstElement().getFirstChildWithName(
-                new QName("http://ws.apache.org/axiom/test/jaxb", "content"));
-        OMText content = (OMText)contentElement.getFirstOMChild();
-        assertTrue(content.isBinary());
-        assertTrue(content.isOptimized());
-        DataHandler dh = content.getDataHandler();
-        assertEquals("some content", dh.getContent());
-    }
-    
-    /**
-     * Tests serialization using {@link OMDataSource#serialize(XMLStreamWriter)} to a standard
-     * {@link XMLStreamWriter}.
-     */
-    @Test
-    public void testSerializeDirect() throws Exception {
-        JAXBContext context = JAXBContext.newInstance(MyBean.class);
-        MyBean orgBean = new MyBean(3, 5);
-        JAXBOMDataSource ds = new JAXBOMDataSource(context, orgBean);
-        ByteArrayOutputStream out = new ByteArrayOutputStream();
-        XMLStreamWriter writer = StAXUtils.createXMLStreamWriter(out);
-        ds.serialize(writer);
-        writer.close();
-        MyBean bean = (MyBean)context.createUnmarshaller().unmarshal(
-                new ByteArrayInputStream(out.toByteArray()));
-        assertEquals(orgBean.getA(), bean.getA());
-        assertEquals(orgBean.getB(), bean.getB());
-    }
-    
-    /**
-     * Tests that {@link JAXBOMDataSource} backed by a plain Java bean is able to determine the
-     * namespace URI and local name of the element without expansion.
-     */
-    @Test
-    public void testGetNameFromPlainObject() throws Exception {
-        OMFactory omFactory = OMAbstractFactory.getOMFactory();
-        JAXBContext context = JAXBContext.newInstance(DocumentBean.class);
-        OMSourcedElement element = omFactory.createOMElement(new JAXBOMDataSource(context, new DocumentBean()));
-        assertEquals("http://ws.apache.org/axiom/test/jaxb", element.getNamespaceURI());
-        assertEquals("document", element.getLocalName());
-        assertFalse(element.isExpanded());
-        // Force expansion so that OMSourcedElement compares the namespace URI and local name
-        // provided by JAXBOMDataSource with the actual name of the element
-        element.getFirstOMChild();
-    }
-    
-    /**
-     * Tests that {@link JAXBOMDataSource} backed by a {@link JAXBElement} is able to determine the
-     * namespace URI and local name of the element without expansion.
-     */
-    @Test
-    public void testGetNameFromJAXBElement() throws Exception {
-        OMFactory omFactory = OMAbstractFactory.getOMFactory();
-        ObjectFactory objectFactory = new ObjectFactory();
-        JAXBContext context = JAXBContext.newInstance(ObjectFactory.class);
-        JAXBElement<LinkIdentitiesType> jaxbElement = objectFactory.createLinkIdentities(new LinkIdentitiesType());
-        OMSourcedElement element = omFactory.createOMElement(new JAXBOMDataSource(context, jaxbElement));
-        assertEquals("http://www.example.org/identity", element.getNamespaceURI());
-        assertEquals("LinkIdentities", element.getLocalName());
-        assertFalse(element.isExpanded());
-        // Force expansion so that OMSourcedElement compares the namespace URI and local name
-        // provided by JAXBOMDataSource with the actual name of the element
-        element.getFirstOMChild();
-    }
-    
-    /**
-     * Tests that an {@link XMLStreamException} thrown by the {@link XMLStreamWriter} during
-     * serialization is propagated without being wrapped. Note that this implies that the data must
-     * unwrap {@link JAXBException} to extract the cause.
-     */
-    @Test
-    public void testExceptionDuringSerialization() throws Exception {
-        OMFactory omFactory = OMAbstractFactory.getOMFactory();
-        JAXBContext context = JAXBContext.newInstance(DocumentBean.class);
-        DocumentBean object = new DocumentBean();
-        object.setId("test");
-        OMSourcedElement element = omFactory.createOMElement(new JAXBOMDataSource(context, object));
-        XMLStreamException exception = new XMLStreamException("TEST");
-        try {
-            element.serialize(new ExceptionXMLStreamWriterWrapper(StAXUtils.createXMLStreamWriter(new ByteArrayOutputStream()), exception));
-            fail("Expected XMLStreamException");
-        } catch (XMLStreamException ex) {
-            assertSame(exception, ex);
-        }
-    }
 }

Copied: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/TestDataHandlerSerializationWithMTOM.java (from r1747986, webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/ds/jaxb/JAXBOMDataSourceTest.java)
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/TestDataHandlerSerializationWithMTOM.java?p2=webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/TestDataHandlerSerializationWithMTOM.java&p1=webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/ds/jaxb/JAXBOMDataSourceTest.java&r1=1747986&r2=1748027&rev=1748027&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/ds/jaxb/JAXBOMDataSourceTest.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/TestDataHandlerSerializationWithMTOM.java Sun Jun 12 16:27:16 2016
@@ -16,106 +16,40 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.axiom.om.ds.jaxb;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+package org.apache.axiom.ts.om.sourcedelement.jaxb;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 
 import javax.activation.DataHandler;
 import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.JAXBException;
 import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
 
 import org.apache.axiom.attachments.Attachments;
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMDataSource;
 import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMMetaFactory;
 import org.apache.axiom.om.OMOutputFormat;
 import org.apache.axiom.om.OMSourcedElement;
 import org.apache.axiom.om.OMText;
 import org.apache.axiom.om.OMXMLBuilderFactory;
-import org.apache.axiom.om.ds.jaxb.beans.DocumentBean;
-import org.apache.axiom.om.ds.jaxb.beans.MyBean;
-import org.apache.axiom.om.util.StAXUtils;
+import org.apache.axiom.om.ds.jaxb.JAXBOMDataSource;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.soap.SOAPFactory;
-import org.apache.commons.io.IOUtils;
-import org.example.identity.LinkIdentitiesType;
-import org.example.identity.ObjectFactory;
-import org.junit.Test;
+import org.apache.axiom.ts.AxiomTestCase;
+import org.apache.axiom.ts.jaxb.beans.DocumentBean;
 
-public class JAXBOMDataSourceTest {
-    /**
-     * Tests the expansion of an {@link OMSourcedElement} backed by a {@link JAXBOMDataSource} with
-     * a bean that has a {@link DataHandler}. The expansion should result in an {@link OMText} node
-     * linked to that {@link DataHandler}.
-     */
-    @Test
-    public void testDataHandlerExpansion() throws Exception {
-        OMFactory factory = OMAbstractFactory.getOMFactory();
-        JAXBContext context = JAXBContext.newInstance(DocumentBean.class);
-        DataHandler dh = new DataHandler("some content", "text/plain");
-        DocumentBean object = new DocumentBean();
-        object.setId("123456");
-        object.setContent(dh);
-        OMElement element = factory.createOMElement(new JAXBOMDataSource(context, object));
-        OMElement child = (OMElement)element.getFirstOMChild();
-        assertEquals("id", child.getLocalName());
-        assertEquals("123456", child.getText());
-        child = (OMElement)child.getNextOMSibling();
-        assertEquals("content", child.getLocalName());
-        OMText content = (OMText)child.getFirstOMChild();
-        assertTrue(content.isBinary());
-        assertTrue(content.isOptimized());
-        assertSame(dh, content.getDataHandler());
-    }
-    
-    /**
-     * Tests that an {@link OMSourcedElement} backed by a {@link JAXBOMDataSource} with a bean
-     * containing a {@link DataHandler} is correctly serialized.
-     */
-    @Test
-    public void testDataHandlerSerializationWithoutMTOM() throws Exception{
-        SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
-        JAXBContext context = JAXBContext.newInstance(DocumentBean.class);
-        
-        // Construct the original message
-        DocumentBean orgObject = new DocumentBean();
-        orgObject.setId("123456");
-        orgObject.setContent(new DataHandler("some content", "text/plain; charset=utf-8"));
-        SOAPEnvelope orgEnvelope = factory.getDefaultEnvelope();
-        OMSourcedElement element = factory.createOMElement(new JAXBOMDataSource(context, orgObject));
-        orgEnvelope.getBody().addChild(element);
-        
-        // Serialize the message
-        ByteArrayOutputStream out = new ByteArrayOutputStream();
-        orgEnvelope.serialize(out);
-        assertFalse(element.isExpanded());
-        
-        SOAPEnvelope envelope = OMXMLBuilderFactory.createSOAPModelBuilder(
-                new ByteArrayInputStream(out.toByteArray()), null).getSOAPEnvelope();
-        DocumentBean object = (DocumentBean)context.createUnmarshaller().unmarshal(
-                envelope.getBody().getFirstElement().getXMLStreamReader(false));
-        assertEquals("some content", IOUtils.toString(object.getContent().getInputStream(), "utf-8"));
+/**
+ * Tests that an {@link OMSourcedElement} backed by a {@link JAXBOMDataSource} with a bean
+ * containing a {@link DataHandler} is correctly serialized to MTOM.
+ */
+public class TestDataHandlerSerializationWithMTOM extends AxiomTestCase {
+    public TestDataHandlerSerializationWithMTOM(OMMetaFactory metaFactory) {
+        super(metaFactory);
     }
-    
-    /**
-     * Tests that an {@link OMSourcedElement} backed by a {@link JAXBOMDataSource} with a bean
-     * containing a {@link DataHandler} is correctly serialized to MTOM.
-     */
-    @Test
-    public void testDataHandlerSerializationWithMTOM() throws Exception {
-        SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
+
+    @Override
+    protected void runTest() throws Throwable {
+        SOAPFactory factory = metaFactory.getSOAP11Factory();
         JAXBContext context = JAXBContext.newInstance(DocumentBean.class);
         
         // Construct the original message
@@ -145,80 +79,4 @@ public class JAXBOMDataSourceTest {
         DataHandler dh = content.getDataHandler();
         assertEquals("some content", dh.getContent());
     }
-    
-    /**
-     * Tests serialization using {@link OMDataSource#serialize(XMLStreamWriter)} to a standard
-     * {@link XMLStreamWriter}.
-     */
-    @Test
-    public void testSerializeDirect() throws Exception {
-        JAXBContext context = JAXBContext.newInstance(MyBean.class);
-        MyBean orgBean = new MyBean(3, 5);
-        JAXBOMDataSource ds = new JAXBOMDataSource(context, orgBean);
-        ByteArrayOutputStream out = new ByteArrayOutputStream();
-        XMLStreamWriter writer = StAXUtils.createXMLStreamWriter(out);
-        ds.serialize(writer);
-        writer.close();
-        MyBean bean = (MyBean)context.createUnmarshaller().unmarshal(
-                new ByteArrayInputStream(out.toByteArray()));
-        assertEquals(orgBean.getA(), bean.getA());
-        assertEquals(orgBean.getB(), bean.getB());
-    }
-    
-    /**
-     * Tests that {@link JAXBOMDataSource} backed by a plain Java bean is able to determine the
-     * namespace URI and local name of the element without expansion.
-     */
-    @Test
-    public void testGetNameFromPlainObject() throws Exception {
-        OMFactory omFactory = OMAbstractFactory.getOMFactory();
-        JAXBContext context = JAXBContext.newInstance(DocumentBean.class);
-        OMSourcedElement element = omFactory.createOMElement(new JAXBOMDataSource(context, new DocumentBean()));
-        assertEquals("http://ws.apache.org/axiom/test/jaxb", element.getNamespaceURI());
-        assertEquals("document", element.getLocalName());
-        assertFalse(element.isExpanded());
-        // Force expansion so that OMSourcedElement compares the namespace URI and local name
-        // provided by JAXBOMDataSource with the actual name of the element
-        element.getFirstOMChild();
-    }
-    
-    /**
-     * Tests that {@link JAXBOMDataSource} backed by a {@link JAXBElement} is able to determine the
-     * namespace URI and local name of the element without expansion.
-     */
-    @Test
-    public void testGetNameFromJAXBElement() throws Exception {
-        OMFactory omFactory = OMAbstractFactory.getOMFactory();
-        ObjectFactory objectFactory = new ObjectFactory();
-        JAXBContext context = JAXBContext.newInstance(ObjectFactory.class);
-        JAXBElement<LinkIdentitiesType> jaxbElement = objectFactory.createLinkIdentities(new LinkIdentitiesType());
-        OMSourcedElement element = omFactory.createOMElement(new JAXBOMDataSource(context, jaxbElement));
-        assertEquals("http://www.example.org/identity", element.getNamespaceURI());
-        assertEquals("LinkIdentities", element.getLocalName());
-        assertFalse(element.isExpanded());
-        // Force expansion so that OMSourcedElement compares the namespace URI and local name
-        // provided by JAXBOMDataSource with the actual name of the element
-        element.getFirstOMChild();
-    }
-    
-    /**
-     * Tests that an {@link XMLStreamException} thrown by the {@link XMLStreamWriter} during
-     * serialization is propagated without being wrapped. Note that this implies that the data must
-     * unwrap {@link JAXBException} to extract the cause.
-     */
-    @Test
-    public void testExceptionDuringSerialization() throws Exception {
-        OMFactory omFactory = OMAbstractFactory.getOMFactory();
-        JAXBContext context = JAXBContext.newInstance(DocumentBean.class);
-        DocumentBean object = new DocumentBean();
-        object.setId("test");
-        OMSourcedElement element = omFactory.createOMElement(new JAXBOMDataSource(context, object));
-        XMLStreamException exception = new XMLStreamException("TEST");
-        try {
-            element.serialize(new ExceptionXMLStreamWriterWrapper(StAXUtils.createXMLStreamWriter(new ByteArrayOutputStream()), exception));
-            fail("Expected XMLStreamException");
-        } catch (XMLStreamException ex) {
-            assertSame(exception, ex);
-        }
-    }
 }

Copied: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/TestDataHandlerSerializationWithoutMTOM.java (from r1747986, webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/ds/jaxb/JAXBOMDataSourceTest.java)
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/TestDataHandlerSerializationWithoutMTOM.java?p2=webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/TestDataHandlerSerializationWithoutMTOM.java&p1=webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/ds/jaxb/JAXBOMDataSourceTest.java&r1=1747986&r2=1748027&rev=1748027&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/ds/jaxb/JAXBOMDataSourceTest.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/TestDataHandlerSerializationWithoutMTOM.java Sun Jun 12 16:27:16 2016
@@ -16,77 +16,36 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.axiom.om.ds.jaxb;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+package org.apache.axiom.ts.om.sourcedelement.jaxb;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 
 import javax.activation.DataHandler;
 import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.JAXBException;
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
 
-import org.apache.axiom.attachments.Attachments;
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMDataSource;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMOutputFormat;
+import org.apache.axiom.om.OMMetaFactory;
 import org.apache.axiom.om.OMSourcedElement;
-import org.apache.axiom.om.OMText;
 import org.apache.axiom.om.OMXMLBuilderFactory;
-import org.apache.axiom.om.ds.jaxb.beans.DocumentBean;
-import org.apache.axiom.om.ds.jaxb.beans.MyBean;
-import org.apache.axiom.om.util.StAXUtils;
+import org.apache.axiom.om.ds.jaxb.JAXBOMDataSource;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.ts.AxiomTestCase;
+import org.apache.axiom.ts.jaxb.beans.DocumentBean;
 import org.apache.commons.io.IOUtils;
-import org.example.identity.LinkIdentitiesType;
-import org.example.identity.ObjectFactory;
-import org.junit.Test;
 
-public class JAXBOMDataSourceTest {
-    /**
-     * Tests the expansion of an {@link OMSourcedElement} backed by a {@link JAXBOMDataSource} with
-     * a bean that has a {@link DataHandler}. The expansion should result in an {@link OMText} node
-     * linked to that {@link DataHandler}.
-     */
-    @Test
-    public void testDataHandlerExpansion() throws Exception {
-        OMFactory factory = OMAbstractFactory.getOMFactory();
-        JAXBContext context = JAXBContext.newInstance(DocumentBean.class);
-        DataHandler dh = new DataHandler("some content", "text/plain");
-        DocumentBean object = new DocumentBean();
-        object.setId("123456");
-        object.setContent(dh);
-        OMElement element = factory.createOMElement(new JAXBOMDataSource(context, object));
-        OMElement child = (OMElement)element.getFirstOMChild();
-        assertEquals("id", child.getLocalName());
-        assertEquals("123456", child.getText());
-        child = (OMElement)child.getNextOMSibling();
-        assertEquals("content", child.getLocalName());
-        OMText content = (OMText)child.getFirstOMChild();
-        assertTrue(content.isBinary());
-        assertTrue(content.isOptimized());
-        assertSame(dh, content.getDataHandler());
+/**
+ * Tests that an {@link OMSourcedElement} backed by a {@link JAXBOMDataSource} with a bean
+ * containing a {@link DataHandler} is correctly serialized.
+ */
+public class TestDataHandlerSerializationWithoutMTOM extends AxiomTestCase {
+    public TestDataHandlerSerializationWithoutMTOM(OMMetaFactory metaFactory) {
+        super(metaFactory);
     }
-    
-    /**
-     * Tests that an {@link OMSourcedElement} backed by a {@link JAXBOMDataSource} with a bean
-     * containing a {@link DataHandler} is correctly serialized.
-     */
-    @Test
-    public void testDataHandlerSerializationWithoutMTOM() throws Exception{
-        SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
+
+    @Override
+    protected void runTest() throws Throwable {
+        SOAPFactory factory = metaFactory.getSOAP11Factory();
         JAXBContext context = JAXBContext.newInstance(DocumentBean.class);
         
         // Construct the original message
@@ -108,117 +67,4 @@ public class JAXBOMDataSourceTest {
                 envelope.getBody().getFirstElement().getXMLStreamReader(false));
         assertEquals("some content", IOUtils.toString(object.getContent().getInputStream(), "utf-8"));
     }
-    
-    /**
-     * Tests that an {@link OMSourcedElement} backed by a {@link JAXBOMDataSource} with a bean
-     * containing a {@link DataHandler} is correctly serialized to MTOM.
-     */
-    @Test
-    public void testDataHandlerSerializationWithMTOM() throws Exception {
-        SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
-        JAXBContext context = JAXBContext.newInstance(DocumentBean.class);
-        
-        // Construct the original message
-        DocumentBean object = new DocumentBean();
-        object.setId("123456");
-        object.setContent(new DataHandler("some content", "text/plain; charset=utf-8"));
-        SOAPEnvelope orgEnvelope = factory.getDefaultEnvelope();
-        OMSourcedElement element = factory.createOMElement(new JAXBOMDataSource(context, object));
-        orgEnvelope.getBody().addChild(element);
-        
-        // Serialize the message
-        OMOutputFormat format = new OMOutputFormat();
-        format.setDoOptimize(true);
-        ByteArrayOutputStream out = new ByteArrayOutputStream();
-        orgEnvelope.serialize(out, format);
-        assertFalse(element.isExpanded());
-        
-        // Parse the serialized message
-        Attachments att = new Attachments(new ByteArrayInputStream(out.toByteArray()), format.getContentType());
-        assertEquals(2, att.getAllContentIDs().length);
-        SOAPEnvelope envelope = OMXMLBuilderFactory.createSOAPModelBuilder(att).getSOAPEnvelope();
-        OMElement contentElement = envelope.getBody().getFirstElement().getFirstChildWithName(
-                new QName("http://ws.apache.org/axiom/test/jaxb", "content"));
-        OMText content = (OMText)contentElement.getFirstOMChild();
-        assertTrue(content.isBinary());
-        assertTrue(content.isOptimized());
-        DataHandler dh = content.getDataHandler();
-        assertEquals("some content", dh.getContent());
-    }
-    
-    /**
-     * Tests serialization using {@link OMDataSource#serialize(XMLStreamWriter)} to a standard
-     * {@link XMLStreamWriter}.
-     */
-    @Test
-    public void testSerializeDirect() throws Exception {
-        JAXBContext context = JAXBContext.newInstance(MyBean.class);
-        MyBean orgBean = new MyBean(3, 5);
-        JAXBOMDataSource ds = new JAXBOMDataSource(context, orgBean);
-        ByteArrayOutputStream out = new ByteArrayOutputStream();
-        XMLStreamWriter writer = StAXUtils.createXMLStreamWriter(out);
-        ds.serialize(writer);
-        writer.close();
-        MyBean bean = (MyBean)context.createUnmarshaller().unmarshal(
-                new ByteArrayInputStream(out.toByteArray()));
-        assertEquals(orgBean.getA(), bean.getA());
-        assertEquals(orgBean.getB(), bean.getB());
-    }
-    
-    /**
-     * Tests that {@link JAXBOMDataSource} backed by a plain Java bean is able to determine the
-     * namespace URI and local name of the element without expansion.
-     */
-    @Test
-    public void testGetNameFromPlainObject() throws Exception {
-        OMFactory omFactory = OMAbstractFactory.getOMFactory();
-        JAXBContext context = JAXBContext.newInstance(DocumentBean.class);
-        OMSourcedElement element = omFactory.createOMElement(new JAXBOMDataSource(context, new DocumentBean()));
-        assertEquals("http://ws.apache.org/axiom/test/jaxb", element.getNamespaceURI());
-        assertEquals("document", element.getLocalName());
-        assertFalse(element.isExpanded());
-        // Force expansion so that OMSourcedElement compares the namespace URI and local name
-        // provided by JAXBOMDataSource with the actual name of the element
-        element.getFirstOMChild();
-    }
-    
-    /**
-     * Tests that {@link JAXBOMDataSource} backed by a {@link JAXBElement} is able to determine the
-     * namespace URI and local name of the element without expansion.
-     */
-    @Test
-    public void testGetNameFromJAXBElement() throws Exception {
-        OMFactory omFactory = OMAbstractFactory.getOMFactory();
-        ObjectFactory objectFactory = new ObjectFactory();
-        JAXBContext context = JAXBContext.newInstance(ObjectFactory.class);
-        JAXBElement<LinkIdentitiesType> jaxbElement = objectFactory.createLinkIdentities(new LinkIdentitiesType());
-        OMSourcedElement element = omFactory.createOMElement(new JAXBOMDataSource(context, jaxbElement));
-        assertEquals("http://www.example.org/identity", element.getNamespaceURI());
-        assertEquals("LinkIdentities", element.getLocalName());
-        assertFalse(element.isExpanded());
-        // Force expansion so that OMSourcedElement compares the namespace URI and local name
-        // provided by JAXBOMDataSource with the actual name of the element
-        element.getFirstOMChild();
-    }
-    
-    /**
-     * Tests that an {@link XMLStreamException} thrown by the {@link XMLStreamWriter} during
-     * serialization is propagated without being wrapped. Note that this implies that the data must
-     * unwrap {@link JAXBException} to extract the cause.
-     */
-    @Test
-    public void testExceptionDuringSerialization() throws Exception {
-        OMFactory omFactory = OMAbstractFactory.getOMFactory();
-        JAXBContext context = JAXBContext.newInstance(DocumentBean.class);
-        DocumentBean object = new DocumentBean();
-        object.setId("test");
-        OMSourcedElement element = omFactory.createOMElement(new JAXBOMDataSource(context, object));
-        XMLStreamException exception = new XMLStreamException("TEST");
-        try {
-            element.serialize(new ExceptionXMLStreamWriterWrapper(StAXUtils.createXMLStreamWriter(new ByteArrayOutputStream()), exception));
-            fail("Expected XMLStreamException");
-        } catch (XMLStreamException ex) {
-            assertSame(exception, ex);
-        }
-    }
 }

Copied: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/TestExceptionDuringSerialization.java (from r1747986, webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/ds/jaxb/JAXBOMDataSourceTest.java)
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/TestExceptionDuringSerialization.java?p2=webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/TestExceptionDuringSerialization.java&p1=webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/ds/jaxb/JAXBOMDataSourceTest.java&r1=1747986&r2=1748027&rev=1748027&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/ds/jaxb/JAXBOMDataSourceTest.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/TestExceptionDuringSerialization.java Sun Jun 12 16:27:16 2016
@@ -16,199 +16,36 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.axiom.om.ds.jaxb;
+package org.apache.axiom.ts.om.sourcedelement.jaxb;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 
-import javax.activation.DataHandler;
 import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
 import javax.xml.bind.JAXBException;
-import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
 
-import org.apache.axiom.attachments.Attachments;
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMDataSource;
-import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMOutputFormat;
+import org.apache.axiom.om.OMMetaFactory;
 import org.apache.axiom.om.OMSourcedElement;
-import org.apache.axiom.om.OMText;
-import org.apache.axiom.om.OMXMLBuilderFactory;
-import org.apache.axiom.om.ds.jaxb.beans.DocumentBean;
-import org.apache.axiom.om.ds.jaxb.beans.MyBean;
+import org.apache.axiom.om.ds.jaxb.JAXBOMDataSource;
 import org.apache.axiom.om.util.StAXUtils;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.soap.SOAPFactory;
-import org.apache.commons.io.IOUtils;
-import org.example.identity.LinkIdentitiesType;
-import org.example.identity.ObjectFactory;
-import org.junit.Test;
+import org.apache.axiom.ts.AxiomTestCase;
+import org.apache.axiom.ts.jaxb.beans.DocumentBean;
 
-public class JAXBOMDataSourceTest {
-    /**
-     * Tests the expansion of an {@link OMSourcedElement} backed by a {@link JAXBOMDataSource} with
-     * a bean that has a {@link DataHandler}. The expansion should result in an {@link OMText} node
-     * linked to that {@link DataHandler}.
-     */
-    @Test
-    public void testDataHandlerExpansion() throws Exception {
-        OMFactory factory = OMAbstractFactory.getOMFactory();
-        JAXBContext context = JAXBContext.newInstance(DocumentBean.class);
-        DataHandler dh = new DataHandler("some content", "text/plain");
-        DocumentBean object = new DocumentBean();
-        object.setId("123456");
-        object.setContent(dh);
-        OMElement element = factory.createOMElement(new JAXBOMDataSource(context, object));
-        OMElement child = (OMElement)element.getFirstOMChild();
-        assertEquals("id", child.getLocalName());
-        assertEquals("123456", child.getText());
-        child = (OMElement)child.getNextOMSibling();
-        assertEquals("content", child.getLocalName());
-        OMText content = (OMText)child.getFirstOMChild();
-        assertTrue(content.isBinary());
-        assertTrue(content.isOptimized());
-        assertSame(dh, content.getDataHandler());
-    }
-    
-    /**
-     * Tests that an {@link OMSourcedElement} backed by a {@link JAXBOMDataSource} with a bean
-     * containing a {@link DataHandler} is correctly serialized.
-     */
-    @Test
-    public void testDataHandlerSerializationWithoutMTOM() throws Exception{
-        SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
-        JAXBContext context = JAXBContext.newInstance(DocumentBean.class);
-        
-        // Construct the original message
-        DocumentBean orgObject = new DocumentBean();
-        orgObject.setId("123456");
-        orgObject.setContent(new DataHandler("some content", "text/plain; charset=utf-8"));
-        SOAPEnvelope orgEnvelope = factory.getDefaultEnvelope();
-        OMSourcedElement element = factory.createOMElement(new JAXBOMDataSource(context, orgObject));
-        orgEnvelope.getBody().addChild(element);
-        
-        // Serialize the message
-        ByteArrayOutputStream out = new ByteArrayOutputStream();
-        orgEnvelope.serialize(out);
-        assertFalse(element.isExpanded());
-        
-        SOAPEnvelope envelope = OMXMLBuilderFactory.createSOAPModelBuilder(
-                new ByteArrayInputStream(out.toByteArray()), null).getSOAPEnvelope();
-        DocumentBean object = (DocumentBean)context.createUnmarshaller().unmarshal(
-                envelope.getBody().getFirstElement().getXMLStreamReader(false));
-        assertEquals("some content", IOUtils.toString(object.getContent().getInputStream(), "utf-8"));
-    }
-    
-    /**
-     * Tests that an {@link OMSourcedElement} backed by a {@link JAXBOMDataSource} with a bean
-     * containing a {@link DataHandler} is correctly serialized to MTOM.
-     */
-    @Test
-    public void testDataHandlerSerializationWithMTOM() throws Exception {
-        SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
-        JAXBContext context = JAXBContext.newInstance(DocumentBean.class);
-        
-        // Construct the original message
-        DocumentBean object = new DocumentBean();
-        object.setId("123456");
-        object.setContent(new DataHandler("some content", "text/plain; charset=utf-8"));
-        SOAPEnvelope orgEnvelope = factory.getDefaultEnvelope();
-        OMSourcedElement element = factory.createOMElement(new JAXBOMDataSource(context, object));
-        orgEnvelope.getBody().addChild(element);
-        
-        // Serialize the message
-        OMOutputFormat format = new OMOutputFormat();
-        format.setDoOptimize(true);
-        ByteArrayOutputStream out = new ByteArrayOutputStream();
-        orgEnvelope.serialize(out, format);
-        assertFalse(element.isExpanded());
-        
-        // Parse the serialized message
-        Attachments att = new Attachments(new ByteArrayInputStream(out.toByteArray()), format.getContentType());
-        assertEquals(2, att.getAllContentIDs().length);
-        SOAPEnvelope envelope = OMXMLBuilderFactory.createSOAPModelBuilder(att).getSOAPEnvelope();
-        OMElement contentElement = envelope.getBody().getFirstElement().getFirstChildWithName(
-                new QName("http://ws.apache.org/axiom/test/jaxb", "content"));
-        OMText content = (OMText)contentElement.getFirstOMChild();
-        assertTrue(content.isBinary());
-        assertTrue(content.isOptimized());
-        DataHandler dh = content.getDataHandler();
-        assertEquals("some content", dh.getContent());
-    }
-    
-    /**
-     * Tests serialization using {@link OMDataSource#serialize(XMLStreamWriter)} to a standard
-     * {@link XMLStreamWriter}.
-     */
-    @Test
-    public void testSerializeDirect() throws Exception {
-        JAXBContext context = JAXBContext.newInstance(MyBean.class);
-        MyBean orgBean = new MyBean(3, 5);
-        JAXBOMDataSource ds = new JAXBOMDataSource(context, orgBean);
-        ByteArrayOutputStream out = new ByteArrayOutputStream();
-        XMLStreamWriter writer = StAXUtils.createXMLStreamWriter(out);
-        ds.serialize(writer);
-        writer.close();
-        MyBean bean = (MyBean)context.createUnmarshaller().unmarshal(
-                new ByteArrayInputStream(out.toByteArray()));
-        assertEquals(orgBean.getA(), bean.getA());
-        assertEquals(orgBean.getB(), bean.getB());
-    }
-    
-    /**
-     * Tests that {@link JAXBOMDataSource} backed by a plain Java bean is able to determine the
-     * namespace URI and local name of the element without expansion.
-     */
-    @Test
-    public void testGetNameFromPlainObject() throws Exception {
-        OMFactory omFactory = OMAbstractFactory.getOMFactory();
-        JAXBContext context = JAXBContext.newInstance(DocumentBean.class);
-        OMSourcedElement element = omFactory.createOMElement(new JAXBOMDataSource(context, new DocumentBean()));
-        assertEquals("http://ws.apache.org/axiom/test/jaxb", element.getNamespaceURI());
-        assertEquals("document", element.getLocalName());
-        assertFalse(element.isExpanded());
-        // Force expansion so that OMSourcedElement compares the namespace URI and local name
-        // provided by JAXBOMDataSource with the actual name of the element
-        element.getFirstOMChild();
-    }
-    
-    /**
-     * Tests that {@link JAXBOMDataSource} backed by a {@link JAXBElement} is able to determine the
-     * namespace URI and local name of the element without expansion.
-     */
-    @Test
-    public void testGetNameFromJAXBElement() throws Exception {
-        OMFactory omFactory = OMAbstractFactory.getOMFactory();
-        ObjectFactory objectFactory = new ObjectFactory();
-        JAXBContext context = JAXBContext.newInstance(ObjectFactory.class);
-        JAXBElement<LinkIdentitiesType> jaxbElement = objectFactory.createLinkIdentities(new LinkIdentitiesType());
-        OMSourcedElement element = omFactory.createOMElement(new JAXBOMDataSource(context, jaxbElement));
-        assertEquals("http://www.example.org/identity", element.getNamespaceURI());
-        assertEquals("LinkIdentities", element.getLocalName());
-        assertFalse(element.isExpanded());
-        // Force expansion so that OMSourcedElement compares the namespace URI and local name
-        // provided by JAXBOMDataSource with the actual name of the element
-        element.getFirstOMChild();
+/**
+ * Tests that an {@link XMLStreamException} thrown by the {@link XMLStreamWriter} during
+ * serialization is propagated without being wrapped. Note that this implies that the data must
+ * unwrap {@link JAXBException} to extract the cause.
+ */
+public class TestExceptionDuringSerialization extends AxiomTestCase {
+    public TestExceptionDuringSerialization(OMMetaFactory metaFactory) {
+        super(metaFactory);
     }
-    
-    /**
-     * Tests that an {@link XMLStreamException} thrown by the {@link XMLStreamWriter} during
-     * serialization is propagated without being wrapped. Note that this implies that the data must
-     * unwrap {@link JAXBException} to extract the cause.
-     */
-    @Test
-    public void testExceptionDuringSerialization() throws Exception {
-        OMFactory omFactory = OMAbstractFactory.getOMFactory();
+
+    @Override
+    protected void runTest() throws Throwable {
+        OMFactory omFactory = metaFactory.getOMFactory();
         JAXBContext context = JAXBContext.newInstance(DocumentBean.class);
         DocumentBean object = new DocumentBean();
         object.setId("test");

Copied: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/TestGetNameFromJAXBElement.java (from r1747986, webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/ds/jaxb/JAXBOMDataSourceTest.java)
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/TestGetNameFromJAXBElement.java?p2=webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/TestGetNameFromJAXBElement.java&p1=webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/ds/jaxb/JAXBOMDataSourceTest.java&r1=1747986&r2=1748027&rev=1748027&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-jaxb/src/test/java/org/apache/axiom/om/ds/jaxb/JAXBOMDataSourceTest.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/jaxb/TestGetNameFromJAXBElement.java Sun Jun 12 16:27:16 2016
@@ -16,179 +16,31 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.axiom.om.ds.jaxb;
+package org.apache.axiom.ts.om.sourcedelement.jaxb;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-
-import javax.activation.DataHandler;
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBElement;
-import javax.xml.bind.JAXBException;
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
 
-import org.apache.axiom.attachments.Attachments;
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMDataSource;
-import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMOutputFormat;
+import org.apache.axiom.om.OMMetaFactory;
 import org.apache.axiom.om.OMSourcedElement;
-import org.apache.axiom.om.OMText;
-import org.apache.axiom.om.OMXMLBuilderFactory;
-import org.apache.axiom.om.ds.jaxb.beans.DocumentBean;
-import org.apache.axiom.om.ds.jaxb.beans.MyBean;
-import org.apache.axiom.om.util.StAXUtils;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.soap.SOAPFactory;
-import org.apache.commons.io.IOUtils;
+import org.apache.axiom.om.ds.jaxb.JAXBOMDataSource;
+import org.apache.axiom.ts.AxiomTestCase;
 import org.example.identity.LinkIdentitiesType;
 import org.example.identity.ObjectFactory;
-import org.junit.Test;
 
-public class JAXBOMDataSourceTest {
-    /**
-     * Tests the expansion of an {@link OMSourcedElement} backed by a {@link JAXBOMDataSource} with
-     * a bean that has a {@link DataHandler}. The expansion should result in an {@link OMText} node
-     * linked to that {@link DataHandler}.
-     */
-    @Test
-    public void testDataHandlerExpansion() throws Exception {
-        OMFactory factory = OMAbstractFactory.getOMFactory();
-        JAXBContext context = JAXBContext.newInstance(DocumentBean.class);
-        DataHandler dh = new DataHandler("some content", "text/plain");
-        DocumentBean object = new DocumentBean();
-        object.setId("123456");
-        object.setContent(dh);
-        OMElement element = factory.createOMElement(new JAXBOMDataSource(context, object));
-        OMElement child = (OMElement)element.getFirstOMChild();
-        assertEquals("id", child.getLocalName());
-        assertEquals("123456", child.getText());
-        child = (OMElement)child.getNextOMSibling();
-        assertEquals("content", child.getLocalName());
-        OMText content = (OMText)child.getFirstOMChild();
-        assertTrue(content.isBinary());
-        assertTrue(content.isOptimized());
-        assertSame(dh, content.getDataHandler());
-    }
-    
-    /**
-     * Tests that an {@link OMSourcedElement} backed by a {@link JAXBOMDataSource} with a bean
-     * containing a {@link DataHandler} is correctly serialized.
-     */
-    @Test
-    public void testDataHandlerSerializationWithoutMTOM() throws Exception{
-        SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
-        JAXBContext context = JAXBContext.newInstance(DocumentBean.class);
-        
-        // Construct the original message
-        DocumentBean orgObject = new DocumentBean();
-        orgObject.setId("123456");
-        orgObject.setContent(new DataHandler("some content", "text/plain; charset=utf-8"));
-        SOAPEnvelope orgEnvelope = factory.getDefaultEnvelope();
-        OMSourcedElement element = factory.createOMElement(new JAXBOMDataSource(context, orgObject));
-        orgEnvelope.getBody().addChild(element);
-        
-        // Serialize the message
-        ByteArrayOutputStream out = new ByteArrayOutputStream();
-        orgEnvelope.serialize(out);
-        assertFalse(element.isExpanded());
-        
-        SOAPEnvelope envelope = OMXMLBuilderFactory.createSOAPModelBuilder(
-                new ByteArrayInputStream(out.toByteArray()), null).getSOAPEnvelope();
-        DocumentBean object = (DocumentBean)context.createUnmarshaller().unmarshal(
-                envelope.getBody().getFirstElement().getXMLStreamReader(false));
-        assertEquals("some content", IOUtils.toString(object.getContent().getInputStream(), "utf-8"));
-    }
-    
-    /**
-     * Tests that an {@link OMSourcedElement} backed by a {@link JAXBOMDataSource} with a bean
-     * containing a {@link DataHandler} is correctly serialized to MTOM.
-     */
-    @Test
-    public void testDataHandlerSerializationWithMTOM() throws Exception {
-        SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
-        JAXBContext context = JAXBContext.newInstance(DocumentBean.class);
-        
-        // Construct the original message
-        DocumentBean object = new DocumentBean();
-        object.setId("123456");
-        object.setContent(new DataHandler("some content", "text/plain; charset=utf-8"));
-        SOAPEnvelope orgEnvelope = factory.getDefaultEnvelope();
-        OMSourcedElement element = factory.createOMElement(new JAXBOMDataSource(context, object));
-        orgEnvelope.getBody().addChild(element);
-        
-        // Serialize the message
-        OMOutputFormat format = new OMOutputFormat();
-        format.setDoOptimize(true);
-        ByteArrayOutputStream out = new ByteArrayOutputStream();
-        orgEnvelope.serialize(out, format);
-        assertFalse(element.isExpanded());
-        
-        // Parse the serialized message
-        Attachments att = new Attachments(new ByteArrayInputStream(out.toByteArray()), format.getContentType());
-        assertEquals(2, att.getAllContentIDs().length);
-        SOAPEnvelope envelope = OMXMLBuilderFactory.createSOAPModelBuilder(att).getSOAPEnvelope();
-        OMElement contentElement = envelope.getBody().getFirstElement().getFirstChildWithName(
-                new QName("http://ws.apache.org/axiom/test/jaxb", "content"));
-        OMText content = (OMText)contentElement.getFirstOMChild();
-        assertTrue(content.isBinary());
-        assertTrue(content.isOptimized());
-        DataHandler dh = content.getDataHandler();
-        assertEquals("some content", dh.getContent());
-    }
-    
-    /**
-     * Tests serialization using {@link OMDataSource#serialize(XMLStreamWriter)} to a standard
-     * {@link XMLStreamWriter}.
-     */
-    @Test
-    public void testSerializeDirect() throws Exception {
-        JAXBContext context = JAXBContext.newInstance(MyBean.class);
-        MyBean orgBean = new MyBean(3, 5);
-        JAXBOMDataSource ds = new JAXBOMDataSource(context, orgBean);
-        ByteArrayOutputStream out = new ByteArrayOutputStream();
-        XMLStreamWriter writer = StAXUtils.createXMLStreamWriter(out);
-        ds.serialize(writer);
-        writer.close();
-        MyBean bean = (MyBean)context.createUnmarshaller().unmarshal(
-                new ByteArrayInputStream(out.toByteArray()));
-        assertEquals(orgBean.getA(), bean.getA());
-        assertEquals(orgBean.getB(), bean.getB());
-    }
-    
-    /**
-     * Tests that {@link JAXBOMDataSource} backed by a plain Java bean is able to determine the
-     * namespace URI and local name of the element without expansion.
-     */
-    @Test
-    public void testGetNameFromPlainObject() throws Exception {
-        OMFactory omFactory = OMAbstractFactory.getOMFactory();
-        JAXBContext context = JAXBContext.newInstance(DocumentBean.class);
-        OMSourcedElement element = omFactory.createOMElement(new JAXBOMDataSource(context, new DocumentBean()));
-        assertEquals("http://ws.apache.org/axiom/test/jaxb", element.getNamespaceURI());
-        assertEquals("document", element.getLocalName());
-        assertFalse(element.isExpanded());
-        // Force expansion so that OMSourcedElement compares the namespace URI and local name
-        // provided by JAXBOMDataSource with the actual name of the element
-        element.getFirstOMChild();
+/**
+ * Tests that {@link JAXBOMDataSource} backed by a {@link JAXBElement} is able to determine the
+ * namespace URI and local name of the element without expansion.
+ */
+public class TestGetNameFromJAXBElement extends AxiomTestCase {
+    public TestGetNameFromJAXBElement(OMMetaFactory metaFactory) {
+        super(metaFactory);
     }
-    
-    /**
-     * Tests that {@link JAXBOMDataSource} backed by a {@link JAXBElement} is able to determine the
-     * namespace URI and local name of the element without expansion.
-     */
-    @Test
-    public void testGetNameFromJAXBElement() throws Exception {
-        OMFactory omFactory = OMAbstractFactory.getOMFactory();
+
+    @Override
+    protected void runTest() throws Throwable {
+        OMFactory omFactory = metaFactory.getOMFactory();
         ObjectFactory objectFactory = new ObjectFactory();
         JAXBContext context = JAXBContext.newInstance(ObjectFactory.class);
         JAXBElement<LinkIdentitiesType> jaxbElement = objectFactory.createLinkIdentities(new LinkIdentitiesType());
@@ -200,25 +52,4 @@ public class JAXBOMDataSourceTest {
         // provided by JAXBOMDataSource with the actual name of the element
         element.getFirstOMChild();
     }
-    
-    /**
-     * Tests that an {@link XMLStreamException} thrown by the {@link XMLStreamWriter} during
-     * serialization is propagated without being wrapped. Note that this implies that the data must
-     * unwrap {@link JAXBException} to extract the cause.
-     */
-    @Test
-    public void testExceptionDuringSerialization() throws Exception {
-        OMFactory omFactory = OMAbstractFactory.getOMFactory();
-        JAXBContext context = JAXBContext.newInstance(DocumentBean.class);
-        DocumentBean object = new DocumentBean();
-        object.setId("test");
-        OMSourcedElement element = omFactory.createOMElement(new JAXBOMDataSource(context, object));
-        XMLStreamException exception = new XMLStreamException("TEST");
-        try {
-            element.serialize(new ExceptionXMLStreamWriterWrapper(StAXUtils.createXMLStreamWriter(new ByteArrayOutputStream()), exception));
-            fail("Expected XMLStreamException");
-        } catch (XMLStreamException ex) {
-            assertSame(exception, ex);
-        }
-    }
 }



Mime
View raw message