axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdani...@apache.org
Subject svn commit: r749065 - in /webservices/axis2/trunk/java: ./ modules/addressing/ modules/addressing/test/org/apache/axis2/handlers/addressing/
Date Sun, 01 Mar 2009 17:38:16 GMT
Author: gdaniels
Date: Sun Mar  1 17:38:16 2009
New Revision: 749065

URL: http://svn.apache.org/viewvc?rev=749065&view=rev
Log:
Merge over changes from 1.5 branch:

Remove unnecessary transport dependency from addresing module, adjust unit tests to use empty
ConfigurationContext, reformat code.

Modified:
    webservices/axis2/trunk/java/   (props changed)
    webservices/axis2/trunk/java/modules/addressing/pom.xml
    webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingFinalInHandlerTest.java
    webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInFaultHandlerTest.java
    webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInHandlerTestBase.java
    webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingOutHandlerTest.java
    webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingSubmissionInHandlerTest.java
    webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingValidationHandlerTest.java

Propchange: webservices/axis2/trunk/java/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Mar  1 17:38:16 2009
@@ -1 +1 @@
-/webservices/axis2/branches/java/1_5:745088
+/webservices/axis2/branches/java/1_5:745088,749052,749058

Modified: webservices/axis2/trunk/java/modules/addressing/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/pom.xml?rev=749065&r1=749064&r2=749065&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/pom.xml (original)
+++ webservices/axis2/trunk/java/modules/addressing/pom.xml Sun Mar  1 17:38:16 2009
@@ -38,18 +38,6 @@
             <artifactId>axis2-kernel</artifactId>
             <version>${version}</version>
         </dependency>
-         <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>axis2-transport-http</artifactId>
-        </dependency>
-         <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>axis2-transport-tcp</artifactId>
-        </dependency>
-         <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>axis2-transport-local</artifactId>
-        </dependency>
     </dependencies>
     <build>
         <sourceDirectory>src</sourceDirectory>

Modified: webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingFinalInHandlerTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingFinalInHandlerTest.java?rev=749065&r1=749064&r2=749065&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingFinalInHandlerTest.java
(original)
+++ webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingFinalInHandlerTest.java
Sun Mar  1 17:38:16 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,10 +234,10 @@
         }
     }
 
-    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());
+        mc.setConfigurationContext(ConfigurationContextFactory.createEmptyConfigurationContext());
         mc.setServerSide(true);
         try {
             mc.setSoapAction("http://ws.apache.org/tests/differentAction");
@@ -247,10 +249,10 @@
         }
     }
 
-    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());
+        mc.setConfigurationContext(ConfigurationContextFactory.createEmptyConfigurationContext());
         mc.setServerSide(true);
         try {
             mc.setSoapAction("http://ws.apache.org/tests/action");
@@ -263,10 +265,10 @@
         }
     }
 
-    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());
+        mc.setConfigurationContext(ConfigurationContextFactory.createEmptyConfigurationContext());
         try {
             mc.setSoapAction("");
             basicExtractAddressingInformationFromHeaders(testfile, mc);
@@ -278,10 +280,10 @@
         }
     }
 
-    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());
+        mc.setConfigurationContext(ConfigurationContextFactory.createEmptyConfigurationContext());
         try {
             mc.setSoapAction(null);
             basicExtractAddressingInformationFromHeaders(testfile, mc);

Modified: webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInFaultHandlerTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInFaultHandlerTest.java?rev=749065&r1=749064&r2=749065&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInFaultHandlerTest.java
(original)
+++ webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInFaultHandlerTest.java
Sun Mar  1 17:38:16 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.createEmptyConfigurationContext());
         msgContext.setEnvelope(envelope);
         AddressingInHandler afih = new AddressingInHandler();
         afih.invoke(msgContext);

Modified: webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInHandlerTestBase.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInHandlerTestBase.java?rev=749065&r1=749064&r2=749065&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInHandlerTestBase.java
(original)
+++ webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInHandlerTestBase.java
Sun Mar  1 17:38:16 2009
@@ -69,52 +69,57 @@
                                                                 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();
+        final ConfigurationContext context =
+                ConfigurationContextFactory.createEmptyConfigurationContext();
+        mc.setConfigurationContext(context);
+        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.createEmptyConfigurationContext());
             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());
@@ -166,7 +171,7 @@
                 "omitted-header-messages/" + versionDirectory + "/" + testName + "Message.xml";
 
         MessageContext mc = new MessageContext();
-        ConfigurationContext cc = ConfigurationContextFactory.createDefaultConfigurationContext();
+        ConfigurationContext cc = ConfigurationContextFactory.createEmptyConfigurationContext();
         mc.setConfigurationContext(cc);
         basicExtractAddressingInformationFromHeaders(testfile, mc);
 

Modified: webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingOutHandlerTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingOutHandlerTest.java?rev=749065&r1=749064&r2=749065&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingOutHandlerTest.java
(original)
+++ webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingOutHandlerTest.java
Sun Mar  1 17:38:16 2009
@@ -73,8 +73,8 @@
         SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
         SOAPEnvelope defaultEnvelope = factory.getDefaultEnvelope();
 
-        ConfigurationContext configCtx = 
-                ConfigurationContextFactory.createDefaultConfigurationContext();
+        ConfigurationContext configCtx =
+                ConfigurationContextFactory.createEmptyConfigurationContext();
         MessageContext msgCtxt = configCtx.createMessageContext();
         msgCtxt.setProperty(WS_ADDRESSING_VERSION, Submission.WSA_NAMESPACE);
         msgCtxt.setTo(epr);
@@ -109,7 +109,7 @@
 
     public void testHeaderCreationFromMsgCtxtInformation() throws Exception {
         ConfigurationContext cfgCtx =
-                ConfigurationContextFactory.createDefaultConfigurationContext();
+                ConfigurationContextFactory.createEmptyConfigurationContext();
         msgCtxt = cfgCtx.createMessageContext();
 
         EndpointReference epr = new EndpointReference("http://www.from.org/service/");
@@ -151,7 +151,7 @@
 
     public void testMustUnderstandSupport() throws Exception {
         ConfigurationContext cfgCtx =
-                ConfigurationContextFactory.createDefaultConfigurationContext();
+                ConfigurationContextFactory.createEmptyConfigurationContext();
         msgCtxt = cfgCtx.createMessageContext();
 
         msgCtxt.setProperty(AddressingConstants.ADD_MUST_UNDERSTAND_TO_ADDRESSING_HEADERS,
@@ -196,7 +196,7 @@
 
     public void testSOAPRoleSupport() throws Exception {
         ConfigurationContext cfgCtx =
-                ConfigurationContextFactory.createDefaultConfigurationContext();
+                ConfigurationContextFactory.createEmptyConfigurationContext();
         msgCtxt = cfgCtx.createMessageContext();
 
         msgCtxt.setProperty(AddressingConstants.SOAP_ROLE_FOR_ADDRESSING_HEADERS,
@@ -238,10 +238,10 @@
                                       testUtil.getOMBuilder("soap11roleTest.xml")
                                               .getDocumentElement()));
     }
-    
+
     public void testSOAP12RoleSupport() throws Exception {
         ConfigurationContext cfgCtx =
-                ConfigurationContextFactory.createDefaultConfigurationContext();
+                ConfigurationContextFactory.createEmptyConfigurationContext();
         msgCtxt = cfgCtx.createMessageContext();
 
         msgCtxt.setProperty(AddressingConstants.SOAP_ROLE_FOR_ADDRESSING_HEADERS,
@@ -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.
@@ -291,7 +291,7 @@
         EndpointReference duplicateEpr = new EndpointReference("http://whatever.duplicate.org");
         RelatesTo reply = new RelatesTo("urn:id");
         ConfigurationContext cfgCtx =
-                ConfigurationContextFactory.createDefaultConfigurationContext();
+                ConfigurationContextFactory.createEmptyConfigurationContext();
         msgCtxt = cfgCtx.createMessageContext();
         SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
         SOAPEnvelope defaultEnvelope = factory.getDefaultEnvelope();
@@ -325,7 +325,7 @@
         EndpointReference eprOne = new EndpointReference("http://whatever.org");
         RelatesTo custom = new RelatesTo("urn:id", "customRelationship");
         ConfigurationContext cfgCtx =
-                ConfigurationContextFactory.createDefaultConfigurationContext();
+                ConfigurationContextFactory.createEmptyConfigurationContext();
         msgCtxt = cfgCtx.createMessageContext();
         SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
         SOAPEnvelope defaultEnvelope = factory.getDefaultEnvelope();
@@ -368,7 +368,7 @@
         EndpointReference eprOne = new EndpointReference("http://whatever.org");
         RelatesTo custom = new RelatesTo("urn:id", "customRelationship");
         ConfigurationContext cfgCtx =
-                ConfigurationContextFactory.createDefaultConfigurationContext();
+                ConfigurationContextFactory.createEmptyConfigurationContext();
         msgCtxt = cfgCtx.createMessageContext();
         SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
         SOAPEnvelope defaultEnvelope = factory.getDefaultEnvelope();

Modified: webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingSubmissionInHandlerTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingSubmissionInHandlerTest.java?rev=749065&r1=749064&r2=749065&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingSubmissionInHandlerTest.java
(original)
+++ webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingSubmissionInHandlerTest.java
Sun Mar  1 17:38:16 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() {

Modified: webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingValidationHandlerTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingValidationHandlerTest.java?rev=749065&r1=749064&r2=749065&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingValidationHandlerTest.java
(original)
+++ webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingValidationHandlerTest.java
Sun Mar  1 17:38:16 2009
@@ -49,7 +49,7 @@
         String testfile = directory + "/" + versionDirectory + "/" + testName;
 
         MessageContext mc = new MessageContext();
-        mc.setConfigurationContext(ConfigurationContextFactory.createDefaultConfigurationContext());
+        mc.setConfigurationContext(ConfigurationContextFactory.createEmptyConfigurationContext());
         StAXSOAPModelBuilder omBuilder = testUtil.getOMBuilder(testfile);
         mc.setEnvelope(omBuilder.getSOAPEnvelope());
 



Mime
View raw message