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 2007/05/03 14:14:01 UTC

svn commit: r534814 - /webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/context/ContextHierarchyTest.java

Author: gdaniels
Date: Thu May  3 05:14:00 2007
New Revision: 534814

URL: http://svn.apache.org/viewvc?view=rev&rev=534814
Log:
Fix spelling errors, factor up common vars into fields, and add an explicit test for accessing ServiceContext properties from MessageContext.

Modified:
    webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/context/ContextHierarchyTest.java

Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/context/ContextHierarchyTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/context/ContextHierarchyTest.java?view=diff&rev=534814&r1=534813&r2=534814
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/context/ContextHierarchyTest.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/context/ContextHierarchyTest.java Thu May  3 05:14:00 2007
@@ -29,14 +29,10 @@
 
 public class ContextHierarchyTest extends TestCase {
     private AxisOperation axisOperation;
-
     private AxisService axisService;
-
     private AxisConfiguration axisConfiguration;
-
-    public ContextHierarchyTest(String arg0) {
-        super(arg0);
-    }
+    private ConfigurationContext configurationContext;
+    private MessageContext msgctx;
 
     protected void setUp() throws Exception {
         axisOperation = new InOutAxisOperation(new QName("Temp"));
@@ -44,16 +40,15 @@
         axisConfiguration = new AxisConfiguration();
         axisService.addOperation(axisOperation);
         axisConfiguration.addService(axisService);
+        configurationContext = new ConfigurationContext(axisConfiguration);
+        msgctx = ContextFactory.createMessageContext(configurationContext);
     }
 
-    public void testCompleteHiracy() throws AxisFault {
-        ConfigurationContext configurationContext = new ConfigurationContext(
-                axisConfiguration);
+    public void testCompleteHierarchy() throws AxisFault {
         ServiceGroupContext serviceGroupContext = ContextFactory.createServiceGroupContext(
                 configurationContext, (AxisServiceGroup) axisService.getParent());
         ServiceContext serviceContext =
                 ContextFactory.createServiceContext(serviceGroupContext, axisService);
-        MessageContext msgctx = ContextFactory.createMessageContext(configurationContext);
         OperationContext opContext = axisOperation.findOperationContext(msgctx,
                                                                         serviceContext);
         axisOperation.registerOperationContext(msgctx, opContext);
@@ -69,6 +64,7 @@
         String value2 = "value2";
         String key2 = "key2";
         String value3 = "value";
+        String key3 = "key3";
 
         configurationContext.setProperty(key1, value1);
         assertEquals(value1, msgctx.getProperty(key1));
@@ -78,16 +74,12 @@
 
         opContext.setProperty(key1, value3);
         assertEquals(value3, msgctx.getProperty(key1));
-        opContext.getConfigurationContext();
 
+        serviceContext.setProperty(key3, value3);
+        assertEquals(value3, msgctx.getProperty(key3));
     }
 
-    public void testDisconntectedHiracy() throws AxisFault {
-        ConfigurationContext configurationContext = new ConfigurationContext(
-                axisConfiguration);
-
-        MessageContext msgctx = ContextFactory.createMessageContext(configurationContext);
-
+    public void testDisconntectedHierarchy() throws AxisFault {
         // test the complete Hierarchy built
         assertEquals(msgctx.getParent(), null);
 
@@ -102,8 +94,4 @@
         axisConfiguration.addParameter(new Parameter(key2, value2));
         assertEquals(value2, msgctx.getParameter(key2).getValue());
     }
-
-    protected void tearDown() throws Exception {
-    }
-
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org