You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by na...@apache.org on 2008/09/24 09:42:57 UTC
svn commit: r698453 -
/webservices/axis2/trunk/java/modules/mtompolicy/test/org/apache/axis2/policy/model/MTOMAssertionTest.java
Author: nandana
Date: Wed Sep 24 00:42:57 2008
New Revision: 698453
URL: http://svn.apache.org/viewvc?rev=698453&view=rev
Log:
AXIS2-4046 added a test to check wsp:Optional attribute processing
Modified:
webservices/axis2/trunk/java/modules/mtompolicy/test/org/apache/axis2/policy/model/MTOMAssertionTest.java
Modified: webservices/axis2/trunk/java/modules/mtompolicy/test/org/apache/axis2/policy/model/MTOMAssertionTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/mtompolicy/test/org/apache/axis2/policy/model/MTOMAssertionTest.java?rev=698453&r1=698452&r2=698453&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/mtompolicy/test/org/apache/axis2/policy/model/MTOMAssertionTest.java (original)
+++ webservices/axis2/trunk/java/modules/mtompolicy/test/org/apache/axis2/policy/model/MTOMAssertionTest.java Wed Sep 24 00:42:57 2008
@@ -58,6 +58,30 @@
fail(e.getMessage());
}
}
+
+ public void testOptionalAttribute() {
+ try {
+ Policy p = this.getPolicy(System.getProperty("basedir", ".") +
+ "/test-resources/policy-mtom-optional.xml");
+ List assertions = (List)p.getAlternatives().next();
+
+ for (Iterator iter = assertions.iterator(); iter.hasNext();) {
+ Assertion assertion = (Assertion)iter.next();
+ if (assertion instanceof MTOMAssertion) {
+ MTOMAssertion mtomModel = (MTOMAssertion)assertion;
+ assertEquals("wsp:Optional attribute is not processed", true,
+ mtomModel.isOptional());
+ System.out.println(mtomModel.isOptional());
+ }
+
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail(e.getMessage());
+ }
+
+ }
private Policy getPolicy(String filePath) throws Exception {