You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by gd...@apache.org on 2009/03/01 17:22:29 UTC
svn commit: r749052 -
/webservices/axis2/branches/java/1_5/modules/addressing/test/org/apache/axis2/handlers/addressing/
Author: gdaniels
Date: Sun Mar 1 16:22:29 2009
New Revision: 749052
URL: http://svn.apache.org/viewvc?rev=749052&view=rev
Log:
Reformat code (no functional changes)
Modified:
webservices/axis2/branches/java/1_5/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingFinalInHandlerTest.java
webservices/axis2/branches/java/1_5/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInFaultHandlerTest.java
webservices/axis2/branches/java/1_5/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInHandlerTestBase.java
webservices/axis2/branches/java/1_5/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingOutHandlerTest.java
webservices/axis2/branches/java/1_5/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingSubmissionInHandlerTest.java
Modified: webservices/axis2/branches/java/1_5/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingFinalInHandlerTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_5/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingFinalInHandlerTest.java?rev=749052&r1=749051&r2=749052&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_5/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingFinalInHandlerTest.java (original)
+++ webservices/axis2/branches/java/1_5/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingFinalInHandlerTest.java Sun Mar 1 16:22:29 2009
@@ -75,19 +75,20 @@
fail(" An Exception has occured " + e.getMessage());
}
}
-
- public void testExtractAddressingInformationFromHeadersCustomRole() throws Exception{
- testFileName = "soapmessage.customrole.xml";
- Options options = extractAddressingInformationFromHeaders(new RolePlayer(){
- public List getRoles() {
- ArrayList al = new ArrayList();
- al.add("http://my/custom/role");
- return al;
- }
- public boolean isUltimateDestination() {
- return false;
- }
- });
+
+ public void testExtractAddressingInformationFromHeadersCustomRole() throws Exception {
+ testFileName = "soapmessage.customrole.xml";
+ Options options = extractAddressingInformationFromHeaders(new RolePlayer() {
+ public List getRoles() {
+ ArrayList al = new ArrayList();
+ al.add("http://my/custom/role");
+ return al;
+ }
+
+ public boolean isUltimateDestination() {
+ return false;
+ }
+ });
assertNotNull(options);
assertNotNull(options.getTo());
@@ -96,19 +97,20 @@
assertEPRHasCorrectMetadata(options.getReplyTo());
}
-
- public void testExtractAddressingInformationFromHeadersCustomRoleSOAP12() throws Exception{
- testFileName = "soapmessage.customrole.soap12.xml";
- Options options = extractAddressingInformationFromHeaders(new RolePlayer(){
- public List getRoles() {
- ArrayList al = new ArrayList();
- al.add("http://my/custom/role");
- return al;
- }
- public boolean isUltimateDestination() {
- return false;
- }
- });
+
+ public void testExtractAddressingInformationFromHeadersCustomRoleSOAP12() throws Exception {
+ testFileName = "soapmessage.customrole.soap12.xml";
+ Options options = extractAddressingInformationFromHeaders(new RolePlayer() {
+ public List getRoles() {
+ ArrayList al = new ArrayList();
+ al.add("http://my/custom/role");
+ return al;
+ }
+
+ public boolean isUltimateDestination() {
+ return false;
+ }
+ });
assertNotNull(options);
assertNotNull(options.getTo());
@@ -232,7 +234,7 @@
}
}
- public void testDifferentSoapActionProcessing() throws Exception{
+ public void testDifferentSoapActionProcessing() throws Exception {
String testfile = "valid-messages/" + versionDirectory + "/soapmessage.xml";
MessageContext mc = new MessageContext();
mc.setConfigurationContext(ConfigurationContextFactory.createDefaultConfigurationContext());
@@ -247,7 +249,7 @@
}
}
- public void testSameSoapAction() throws Exception{
+ public void testSameSoapAction() throws Exception {
String testfile = "valid-messages/" + versionDirectory + "/soapmessage.xml";
MessageContext mc = new MessageContext();
mc.setConfigurationContext(ConfigurationContextFactory.createDefaultConfigurationContext());
@@ -263,7 +265,7 @@
}
}
- public void testEmptySoapAction() throws Exception{
+ public void testEmptySoapAction() throws Exception {
String testfile = "valid-messages/" + versionDirectory + "/soapmessage.xml";
MessageContext mc = new MessageContext();
mc.setConfigurationContext(ConfigurationContextFactory.createDefaultConfigurationContext());
@@ -278,7 +280,7 @@
}
}
- public void testNullSoapAction() throws Exception{
+ public void testNullSoapAction() throws Exception {
String testfile = "valid-messages/" + versionDirectory + "/soapmessage.xml";
MessageContext mc = new MessageContext();
mc.setConfigurationContext(ConfigurationContextFactory.createDefaultConfigurationContext());
Modified: webservices/axis2/branches/java/1_5/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInFaultHandlerTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_5/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInFaultHandlerTest.java?rev=749052&r1=749051&r2=749052&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_5/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInFaultHandlerTest.java (original)
+++ webservices/axis2/branches/java/1_5/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInFaultHandlerTest.java Sun Mar 1 16:22:29 2009
@@ -85,7 +85,8 @@
StAXSOAPModelBuilder omBuilder = testUtil.getOMBuilder(testfile);
SOAPEnvelope envelope = ((SOAPEnvelope)omBuilder.getDocumentElement());
MessageContext msgContext = new MessageContext();
- msgContext.setConfigurationContext(ConfigurationContextFactory.createDefaultConfigurationContext());
+ msgContext.setConfigurationContext(
+ ConfigurationContextFactory.createDefaultConfigurationContext());
msgContext.setEnvelope(envelope);
AddressingInHandler afih = new AddressingInHandler();
afih.invoke(msgContext);
Modified: webservices/axis2/branches/java/1_5/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInHandlerTestBase.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_5/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInHandlerTestBase.java?rev=749052&r1=749051&r2=749052&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_5/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInHandlerTestBase.java (original)
+++ webservices/axis2/branches/java/1_5/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInHandlerTestBase.java Sun Mar 1 16:22:29 2009
@@ -69,52 +69,55 @@
MessageContext mc)
throws Exception {
StAXSOAPModelBuilder omBuilder = testUtil.getOMBuilder(testMessagePath);
- SOAPEnvelope envelope = (SOAPEnvelope) omBuilder.getDocumentElement();
+ SOAPEnvelope envelope = (SOAPEnvelope)omBuilder.getDocumentElement();
mc.setEnvelope(envelope);
inHandler.invoke(mc);
}
- protected Options extractAddressingInformationFromHeaders(RolePlayer rolePlayer) throws Exception{
- String testfile = "valid-messages/" + versionDirectory + "/" + testFileName;
+ protected Options extractAddressingInformationFromHeaders(RolePlayer rolePlayer)
+ throws Exception {
+ String testfile = "valid-messages/" + versionDirectory + "/" + testFileName;
- MessageContext mc = new MessageContext();
- mc.setConfigurationContext(ConfigurationContextFactory.createDefaultConfigurationContext());
- if(rolePlayer != null){
- mc.getConfigurationContext().getAxisConfiguration().addParameter(Constants.SOAP_ROLE_PLAYER_PARAMETER, rolePlayer);
- }
- basicExtractAddressingInformationFromHeaders(testfile, mc);
+ MessageContext mc = new MessageContext();
+ mc.setConfigurationContext(ConfigurationContextFactory.createDefaultConfigurationContext());
+ if (rolePlayer != null) {
+ mc.getConfigurationContext().getAxisConfiguration()
+ .addParameter(Constants.SOAP_ROLE_PLAYER_PARAMETER, rolePlayer);
+ }
+ basicExtractAddressingInformationFromHeaders(testfile, mc);
- Options options = mc.getOptions();
+ Options options = mc.getOptions();
- if (options == null) {
- fail("Addressing Information Headers have not been retrieved properly");
- }
- assertEquals("action header is not correct", action, options.getAction());
- assertActionHasExtensibilityAttribute(mc);
- assertEquals("message id header is not correct",
- options.getMessageId().trim(),
- messageID.trim());
- assertMessageIDHasExtensibilityAttribute(mc);
-
- assertFullFromEPR(options.getFrom());
- assertFullFaultEPR(options.getFaultTo());
- assertFullReplyToEPR(options.getReplyTo());
+ if (options == null) {
+ fail("Addressing Information Headers have not been retrieved properly");
+ }
+ assertEquals("action header is not correct", action, options.getAction());
+ assertActionHasExtensibilityAttribute(mc);
+ assertEquals("message id header is not correct",
+ options.getMessageId().trim(),
+ messageID.trim());
+ assertMessageIDHasExtensibilityAttribute(mc);
+
+ assertFullFromEPR(options.getFrom());
+ assertFullFaultEPR(options.getFaultTo());
+ assertFullReplyToEPR(options.getReplyTo());
- assertRelationships(options);
+ assertRelationships(options);
- return options;
+ return options;
}
private void testExtractAddressingInformationFromHeadersInvalidCardinality(String headerName) {
String testfile = "invalid-cardinality-messages/" + versionDirectory +
- "/invalidCardinality" + headerName + "Message.xml";
+ "/invalidCardinality" + headerName + "Message.xml";
try {
MessageContext mc = new MessageContext();
- mc.setConfigurationContext(ConfigurationContextFactory.createDefaultConfigurationContext());
+ mc.setConfigurationContext(
+ ConfigurationContextFactory.createDefaultConfigurationContext());
try {
basicExtractAddressingInformationFromHeaders(testfile, mc);
fail("An AxisFault should have been thrown due to 2 wsa:" + headerName +
- " headers.");
+ " headers.");
} catch (AxisFault af) {
if (headerName.equals(AddressingConstants.WSA_REPLY_TO)) {
assertNull("No ReplyTo should be set on the MessageContext", mc.getReplyTo());
Modified: webservices/axis2/branches/java/1_5/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingOutHandlerTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_5/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingOutHandlerTest.java?rev=749052&r1=749051&r2=749052&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_5/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingOutHandlerTest.java (original)
+++ webservices/axis2/branches/java/1_5/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingOutHandlerTest.java Sun Mar 1 16:22:29 2009
@@ -73,7 +73,7 @@
SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
SOAPEnvelope defaultEnvelope = factory.getDefaultEnvelope();
- ConfigurationContext configCtx =
+ ConfigurationContext configCtx =
ConfigurationContextFactory.createDefaultConfigurationContext();
MessageContext msgCtxt = configCtx.createMessageContext();
msgCtxt.setProperty(WS_ADDRESSING_VERSION, Submission.WSA_NAMESPACE);
@@ -238,7 +238,7 @@
testUtil.getOMBuilder("soap11roleTest.xml")
.getDocumentElement()));
}
-
+
public void testSOAP12RoleSupport() throws Exception {
ConfigurationContext cfgCtx =
ConfigurationContextFactory.createDefaultConfigurationContext();
@@ -283,7 +283,7 @@
testUtil.getOMBuilder("soap12roleTest.xml")
.getDocumentElement()));
}
-
+
public void testDuplicateHeaders() throws Exception {
// this will check whether we can add to epr, if there is one already.
Modified: webservices/axis2/branches/java/1_5/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingSubmissionInHandlerTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_5/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingSubmissionInHandlerTest.java?rev=749052&r1=749051&r2=749052&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_5/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingSubmissionInHandlerTest.java (original)
+++ webservices/axis2/branches/java/1_5/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingSubmissionInHandlerTest.java Sun Mar 1 16:22:29 2009
@@ -48,25 +48,26 @@
secondRelationshipType = "axis2:some.custom.relationship";
}
- public void testExtractAddressingInformationFromHeaders() throws Exception{
- Options options = extractAddressingInformationFromHeaders(null);
+ public void testExtractAddressingInformationFromHeaders() throws Exception {
+ Options options = extractAddressingInformationFromHeaders(null);
assertNotNull(options);
assertNotNull(options.getTo());
}
-
- public void testExtractAddressingInformationFromHeadersCustomRole() throws Exception{
- testFileName = "soapmessage.customrole.xml";
- extractAddressingInformationFromHeaders(new RolePlayer(){
- public List getRoles() {
- ArrayList al = new ArrayList();
- al.add("http://my/custom/role");
- return al;
- }
- public boolean isUltimateDestination() {
- return false;
- }
- });
+
+ public void testExtractAddressingInformationFromHeadersCustomRole() throws Exception {
+ testFileName = "soapmessage.customrole.xml";
+ extractAddressingInformationFromHeaders(new RolePlayer() {
+ public List getRoles() {
+ ArrayList al = new ArrayList();
+ al.add("http://my/custom/role");
+ return al;
+ }
+
+ public boolean isUltimateDestination() {
+ return false;
+ }
+ });
}
public void testMessageWithOmittedAction() {