You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by ve...@apache.org on 2012/05/06 12:02:20 UTC
svn commit: r1334585 -
/axis/axis2/java/core/trunk/modules/adb-codegen/test/org/apache/axis2/schema/AbstractTestCase.java
Author: veithen
Date: Sun May 6 10:02:20 2012
New Revision: 1334585
URL: http://svn.apache.org/viewvc?rev=1334585&view=rev
Log:
Modified the ADB unit tests so that they test the expansion of an OMSourcedElement created from ADB.
Modified:
axis/axis2/java/core/trunk/modules/adb-codegen/test/org/apache/axis2/schema/AbstractTestCase.java
Modified: axis/axis2/java/core/trunk/modules/adb-codegen/test/org/apache/axis2/schema/AbstractTestCase.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb-codegen/test/org/apache/axis2/schema/AbstractTestCase.java?rev=1334585&r1=1334584&r2=1334585&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/adb-codegen/test/org/apache/axis2/schema/AbstractTestCase.java (original)
+++ axis/axis2/java/core/trunk/modules/adb-codegen/test/org/apache/axis2/schema/AbstractTestCase.java Sun May 6 10:02:20 2012
@@ -288,12 +288,12 @@ public abstract class AbstractTestCase e
public static void testSerializeDeserialize(ADBBean bean, ADBBean expectedResult) throws Exception {
testSerializeDeserializeUsingStAX(bean, expectedResult);
testSerializeDeserializeUsingOMStAXWrapper(bean, expectedResult);
-
testSerializeDeserializeWrapped(bean, expectedResult);
testSerializeDeserializeUsingMTOM(bean, expectedResult, true);
testSerializeDeserializeUsingMTOM(bean, expectedResult, false);
testSerializeDeserializeUsingMTOMWithoutOptimize(bean, expectedResult);
testSerializeDeserializePrettified(bean, expectedResult);
+ testReconstructFromGetXMLStreamReader(bean, expectedResult);
try {
Class.forName("helper." + bean.getClass().getName());
@@ -312,6 +312,7 @@ public abstract class AbstractTestCase e
testSerializeDeserializeUsingMTOM(helperModeBean, helperModeExpectedResult, false);
testSerializeDeserializeUsingMTOMWithoutOptimize(helperModeBean, helperModeExpectedResult);
testSerializeDeserializePrettified(helperModeBean, helperModeExpectedResult);
+ testReconstructFromGetXMLStreamReader(helperModeBean, helperModeExpectedResult);
}
// Deserialization approach 1: use an XMLStreamReader produced by the StAX parser.
@@ -395,6 +396,11 @@ public abstract class AbstractTestCase e
StAXUtils.createXMLStreamReader(new ByteArrayInputStream(baos.toByteArray()))));
}
+ private static void testReconstructFromGetXMLStreamReader(Object bean, Object expectedResult) throws Exception {
+ OMElement omElement = ADBBeanUtil.getOMElement(bean);
+ assertBeanEquals(expectedResult, ADBBeanUtil.parse(bean.getClass(), omElement.getXMLStreamReader()));
+ }
+
/**
* Assert that serializing the given bean should result in an {@link ADBException}.
*