Author: davidillsley
Date: Wed Aug 2 08:05:38 2006
New Revision: 428015
URL: http://svn.apache.org/viewvc?rev=428015&view=rev
Log:
Added integration test for <wsaw:UsingAddressing required="true" />
Modified:
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/addressing/AddressingServiceTest.java
Modified:
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/addressing/AddressingServiceTest.java
URL:
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/addressing/AddressingServiceTest.java?rev=428015&r1=428014&r2=428015&view=diff
==============================================================================
---
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/addressing/AddressingServiceTest.java
(original)
+++
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/addressing/AddressingServiceTest.java
Wed Aug 2 08:05:38 2006
@@ -11,6 +11,7 @@
import org.apache.axiom.om.OMNamespace;
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.AddressingConstants.Final;
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.context.ConfigurationContext;
@@ -212,6 +213,48 @@
sender.setOptions(options);
sender.engageModule(new QName("addressing"));
+ return sender;
+ }
+
+ public void testUsingAddressingRequired() throws Exception{
+ echoService.setWSAddressingFlag("required");
+
+ OMElement method = createEchoOMElement("this message should cause a
fault.");
+ ServiceClient sender = null;
+
+ try {
+ sender = createNoAddressingServiceClient();
+ try{
+ sender.sendReceive(operationName,method);
+ fail("Should have received a specific fault");
+ }catch(AxisFault af){
+ af.printStackTrace();
+ assertEquals("WS-Addressing required but not found.",
af.getMessage());
+ }
+ }finally {
+ if (sender != null)
+ sender.finalizeInvoke();
+ }
+ }
+
+ private ServiceClient createNoAddressingServiceClient() throws AxisFault{
+ AxisService service =
+ Utils.createSimpleServiceforClient(serviceName,
+ Echo.class.getName(),
+ operationName);
+
+ ConfigurationContext configcontext =
UtilServer.createClientConfigurationContext();
+ ServiceClient sender = null;
+
+ Options options = new Options();
+ options.setTo(targetEPR);
+ options.setAction(operationName.getLocalPart());
+
options.setProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES,
Boolean.TRUE);
+ options.setProperty(Constants.Configuration.DISABLE_SOAP_ACTION,
Boolean.TRUE);
+
+ sender = new ServiceClient(configcontext, service);
+ sender.setOptions(options);
+
return sender;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]