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 pr...@apache.org on 2008/01/21 13:20:41 UTC

svn commit: r613867 [2/4] - in /webservices/axis2/branches/java/jaxws21/modules: adb-codegen/src/org/apache/axis2/schema/template/ addressing/src/META-INF/ addressing/src/org/apache/axis2/handlers/addressing/ addressing/test/org/apache/axis2/handlers/a...

Modified: webservices/axis2/branches/java/jaxws21/modules/clustering/test/org/apache/axis2/clustering/ContextReplicationTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/clustering/test/org/apache/axis2/clustering/ContextReplicationTest.java?rev=613867&r1=613866&r2=613867&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/clustering/test/org/apache/axis2/clustering/ContextReplicationTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/clustering/test/org/apache/axis2/clustering/ContextReplicationTest.java Mon Jan 21 04:20:38 2008
@@ -1,635 +1,639 @@
-/*                                                                             
- * Copyright 2004,2005 The Apache Software Foundation.                         
- *                                                                             
- * Licensed under the Apache License, Version 2.0 (the "License");             
- * you may not use this file except in compliance with the License.            
- * You may obtain a copy of the License at                                     
- *                                                                             
- *      http://www.apache.org/licenses/LICENSE-2.0                             
- *                                                                             
- * Unless required by applicable law or agreed to in writing, software         
- * distributed under the License is distributed on an "AS IS" BASIS,           
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.    
- * See the License for the specific language governing permissions and         
- * limitations under the License.                                              
- */
-package org.apache.axis2.clustering;
-
-import junit.framework.TestCase;
-import org.apache.axiom.om.util.UUIDGenerator;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.clustering.configuration.ConfigurationManager;
-import org.apache.axis2.clustering.configuration.DefaultConfigurationManager;
-import org.apache.axis2.clustering.configuration.DefaultConfigurationManagerListener;
-import org.apache.axis2.clustering.context.ContextManager;
-import org.apache.axis2.clustering.context.DefaultContextManager;
-import org.apache.axis2.clustering.context.DefaultContextManagerListener;
-import org.apache.axis2.clustering.tribes.TribesClusterManager;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.ConfigurationContextFactory;
-import org.apache.axis2.context.ServiceContext;
-import org.apache.axis2.context.ServiceGroupContext;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.AxisServiceGroup;
-import org.apache.axis2.description.Parameter;
-import org.apache.axis2.engine.AxisConfiguration;
-import org.apache.axis2.transport.http.server.HttpUtils;
-
-import java.io.IOException;
-import java.net.DatagramPacket;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.MulticastSocket;
-import java.net.ServerSocket;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Tests the replication of properties placed the ConfigurationContext, ServiceGroupContext &
- * ServiceContext
- */
-public class ContextReplicationTest extends TestCase {
-
-    private static final String TEST_SERVICE_NAME = "testService";
-
-    private static final Parameter domainParam =
-            new Parameter(ClusteringConstants.DOMAIN, "axis2.domain." + UUIDGenerator.getUUID());
-
-    // --------------- Cluster-1 ------------------------------------------------------
-    private ClusterManager clusterManager1;
-    private ContextManager ctxMan1;
-    private ConfigurationManager configMan1;
-    private ConfigurationContext configurationContext1;
-    private AxisServiceGroup serviceGroup1;
-    private AxisService service1;
-    //---------------------------------------------------------------------------------
-
-    // --------------- Cluster-2 ------------------------------------------------------
-    private ClusterManager clusterManager2;
-    private ContextManager ctxMan2;
-    private ConfigurationManager configMan2;
-    private ConfigurationContext configurationContext2;
-    private AxisServiceGroup serviceGroup2;
-    private AxisService service2;
-    //---------------------------------------------------------------------------------
-
-    private static boolean canMulticast;
-
-    private int getPort(int portStart, int retries) throws IOException {
-        InetSocketAddress addr = null;
-        ServerSocket socket = new ServerSocket();
-        int port = -1;
-        while (retries > 0) {
-            try {
-                addr = new InetSocketAddress(InetAddress.getByName(InetAddress.getLocalHost().getHostAddress()),
-                                             portStart);
-                socket.bind(addr);
-                port = portStart;
-                System.out.println("Can bind Server Socket to:" + addr);
-                socket.close();
-                break;
-            } catch (IOException x) {
-                retries--;
-                if (retries <= 0) {
-                    System.out.println("Unable to bind server socket to:" + addr +
-                                       " throwing error.");
-                    throw x;
-                }
-                portStart++;
-            }
-        }
-        return port;
-    }
-
-    private void checkMulticast() {
-
-        // Which port should we listen to
-        final int port;
-        try {
-            port = getPort(4000, 1000);
-        } catch (IOException e) {
-            e.printStackTrace();
-            canMulticast = false;
-            return;
-        }
-
-        // Which address
-        final String group = "225.4.5.6";
-
-        Thread receiver = new Thread() {
-            public void run() {
-                try {
-                    MulticastSocket s = new MulticastSocket(port);
-                    s.joinGroup(InetAddress.getByName(group));
-
-                    // Create a DatagramPacket and do a receive
-                    byte buf[] = new byte[1024];
-                    DatagramPacket pack = new DatagramPacket(buf, buf.length);
-                    s.receive(pack);
-                    System.out.println("Received data from: " + pack.getAddress().toString() +
-                                       ":" + pack.getPort() + " with length: " +
-                                       pack.getLength());
-                    s.leaveGroup(InetAddress.getByName(group));
-                    s.close();
-                    canMulticast = true;
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    canMulticast = false;
-                }
-            }
-        };
-        receiver.start();
-
-        Thread sender = new Thread() {
-            public void run() {
-                try {
-                    MulticastSocket s = new MulticastSocket();
-                    byte buf[] = new byte[10];
-                    for (int i = 0; i < buf.length; i++) {
-                        buf[i] = (byte) i;
-                    }
-                    DatagramPacket pack = new DatagramPacket(buf, buf.length,
-                                                             InetAddress.getByName(group), port);
-                    s.setTimeToLive(2);
-                    s.send(pack);
-                    System.out.println("Sent test data");
-                    s.close();
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    canMulticast = false;
-                }
-            }
-        };
-        sender.start();
-
-        // Join the receiver until we can verify whether multicasting can be done
-        try {
-            receiver.join(10000);
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
-    }
-
-    public static void main(String[] args) {
-        new ContextReplicationTest().checkMulticast();
-    }
-
-    protected void setUp() throws Exception {
-        checkMulticast();
-        if (!canMulticast) {
-            System.out.println("[WARNING] Aborting clustering test since multicasting cannot be carried out");
-            return;
-        }
-
-        System.setProperty(ClusteringConstants.LOCAL_IP_ADDRESS, HttpUtils.getIpAddress());
-
-        // First cluster
-        configurationContext1 =
-                ConfigurationContextFactory.createDefaultConfigurationContext();
-        serviceGroup1 = createAxisServiceGroup(configurationContext1);
-        service1 = createAxisService(serviceGroup1);
-        ctxMan1 = getContextManager();
-        configMan1 = getConfigurationManager();
-        clusterManager1 = getClusterManager(configurationContext1, ctxMan1, configMan1);
-        clusterManager1.addParameter(domainParam);
-        clusterManager1.init();
-        System.out.println("---------- ClusterManager-1 successfully initialized -----------");
-
-        // Second cluster
-        configurationContext2 =
-                ConfigurationContextFactory.createDefaultConfigurationContext();
-        serviceGroup2 = createAxisServiceGroup(configurationContext2);
-        service2 = createAxisService(serviceGroup2);
-        ctxMan2 = getContextManager();
-        configMan2 = getConfigurationManager();
-        clusterManager2 = getClusterManager(configurationContext2, ctxMan2, configMan2);
-        clusterManager2.addParameter(domainParam);
-        clusterManager2.init();
-        System.out.println("---------- ClusterManager-2 successfully initialized -----------");
-    }
-
-    protected ClusterManager getClusterManager(ConfigurationContext configCtx,
-                                               ContextManager contextManager,
-                                               ConfigurationManager configManager)
-            throws AxisFault {
-        ClusterManager clusterManager = new TribesClusterManager();
-        configCtx.getAxisConfiguration().setClusterManager(clusterManager);
-
-        configManager.
-                setConfigurationManagerListener(new DefaultConfigurationManagerListener());
-        clusterManager.setConfigurationManager(configManager);
-
-        contextManager.setContextManagerListener(new DefaultContextManagerListener());
-        clusterManager.setContextManager(contextManager);
-
-        clusterManager.setConfigurationContext(configCtx);
-
-        return clusterManager;
-    }
-
-    protected AxisServiceGroup createAxisServiceGroup(ConfigurationContext configCtx)
-            throws AxisFault {
-        AxisConfiguration axisConfig = configCtx.getAxisConfiguration();
-        AxisServiceGroup serviceGroup = new AxisServiceGroup(axisConfig);
-        axisConfig.addServiceGroup(serviceGroup);
-        return serviceGroup;
-    }
-
-    protected AxisService createAxisService(AxisServiceGroup serviceGroup) throws AxisFault {
-        AxisService service = new AxisService(TEST_SERVICE_NAME);
-        serviceGroup.addService(service);
-        return service;
-    }
-
-    protected ContextManager getContextManager() throws AxisFault {
-        ContextManager contextManager = new DefaultContextManager();
-        contextManager.setContextManagerListener(new DefaultContextManagerListener());
-        return contextManager;
-    }
-
-    protected ConfigurationManager getConfigurationManager() throws AxisFault {
-        ConfigurationManager contextManager = new DefaultConfigurationManager();
-        contextManager.setConfigurationManagerListener(new DefaultConfigurationManagerListener());
-        return contextManager;
-    }
-
-    public void testSetPropertyInConfigurationContext() throws Exception {
-        if (!canMulticast) {
-            return;
-        }
-
-        {
-            String key1 = "configCtxKey";
-            String val1 = "configCtxVal1";
-            configurationContext1.setProperty(key1, val1);
-            ctxMan1.updateContext(configurationContext1);
-            String value = (String) configurationContext2.getProperty(key1);
-            assertEquals(val1, value);
-        }
-
-        {
-            String key2 = "configCtxKey2";
-            String val2 = "configCtxVal1";
-            configurationContext2.setProperty(key2, val2);
-            ctxMan2.updateContext(configurationContext2);
-            Thread.sleep(1000);
-            String value = (String) configurationContext1.getProperty(key2);
-            assertEquals(val2, value);
-        }
-    }
-
-    public void testRemovePropertyFromConfigurationContext() throws Exception {
-        if (!canMulticast) {
-            return;
-        }
-
-        String key1 = "configCtxKey";
-        String val1 = "configCtxVal1";
-
-        // First set the property on a cluster 1 and replicate it
-        {
-            configurationContext1.setProperty(key1, val1);
-            ctxMan1.updateContext(configurationContext1);
-            String value = (String) configurationContext2.getProperty(key1);
-            assertEquals(val1, value);
-        }
-
-        // Next remove this property from cluster 2, replicate it, and check that it is unavailable in cluster 1
-        configurationContext2.removeProperty(key1);
-        ctxMan2.updateContext(configurationContext2);
-        String value = (String) configurationContext1.getProperty(key1);
-        assertNull(configurationContext2.getProperty(key1));
-        assertNull(value);
-    }
-
-    public void testSetPropertyInServiceGroupContext() throws Exception {
-        if (!canMulticast) {
-            return;
-        }
-
-        ServiceGroupContext serviceGroupContext1 =
-                configurationContext1.createServiceGroupContext(serviceGroup1);
-        serviceGroupContext1.setId(TEST_SERVICE_NAME);
-        configurationContext1.addServiceGroupContextIntoApplicationScopeTable(serviceGroupContext1);
-        assertNotNull(serviceGroupContext1);
-
-        ServiceGroupContext serviceGroupContext2 =
-                configurationContext2.createServiceGroupContext(serviceGroup2);
-        serviceGroupContext2.setId(TEST_SERVICE_NAME);
-        configurationContext2.addServiceGroupContextIntoApplicationScopeTable(serviceGroupContext2);
-        assertNotNull(serviceGroupContext2);
-
-        String key1 = "sgCtxKey";
-        String val1 = "sgCtxVal1";
-        serviceGroupContext1.setProperty(key1, val1);
-        ctxMan1.updateContext(serviceGroupContext1);
-        assertEquals(val1, serviceGroupContext2.getProperty(key1));
-    }
-
-    public void testRemovePropertyFromServiceGroupContext() throws Exception {
-        if (!canMulticast) {
-            return;
-        }
-
-        // Add the property
-        ServiceGroupContext serviceGroupContext1 =
-                configurationContext1.createServiceGroupContext(serviceGroup1);
-        serviceGroupContext1.setId(TEST_SERVICE_NAME);
-        configurationContext1.addServiceGroupContextIntoApplicationScopeTable(serviceGroupContext1);
-        assertNotNull(serviceGroupContext1);
-
-        ServiceGroupContext serviceGroupContext2 =
-                configurationContext2.createServiceGroupContext(serviceGroup2);
-        serviceGroupContext2.setId(TEST_SERVICE_NAME);
-        configurationContext2.addServiceGroupContextIntoApplicationScopeTable(serviceGroupContext2);
-        assertNotNull(serviceGroupContext2);
-
-        String key1 = "sgCtxKey";
-        String val1 = "sgCtxVal1";
-        serviceGroupContext1.setProperty(key1, val1);
-        ctxMan1.updateContext(serviceGroupContext1);
-        assertEquals(val1, serviceGroupContext2.getProperty(key1));
-
-        // Remove the property
-        serviceGroupContext2.removeProperty(key1);
-        assertNull(serviceGroupContext2.getProperty(key1));
-        ctxMan2.updateContext(serviceGroupContext2);
-        assertNull(serviceGroupContext1.getProperty(key1));
-    }
-
-    public void testSetPropertyInServiceGroupContext2() throws Exception {
-        if (!canMulticast) {
-            return;
-        }
-
-        String sgcID = UUIDGenerator.getUUID();
-
-        ServiceGroupContext serviceGroupContext1 =
-                configurationContext1.createServiceGroupContext(serviceGroup1);
-        serviceGroupContext1.setId(sgcID);
-        configurationContext1.addServiceGroupContextIntoSoapSessionTable(serviceGroupContext1);
-        assertNotNull(serviceGroupContext1);
-
-        ServiceGroupContext serviceGroupContext2 =
-                configurationContext2.createServiceGroupContext(serviceGroup2);
-        serviceGroupContext2.setId(sgcID);
-        configurationContext2.addServiceGroupContextIntoSoapSessionTable(serviceGroupContext2);
-        assertNotNull(serviceGroupContext2);
-
-        String key1 = "sgCtxKey";
-        String val1 = "sgCtxVal1";
-        serviceGroupContext1.setProperty(key1, val1);
-        ctxMan1.updateContext(serviceGroupContext1);
-
-        assertEquals(val1, serviceGroupContext2.getProperty(key1));
-    }
-
-    public void testRemovePropertyFromServiceGroupContext2() throws Exception {
-        if (!canMulticast) {
-            return;
-        }
-
-        // Add the property
-        String sgcID = UUIDGenerator.getUUID();
-
-        ServiceGroupContext serviceGroupContext1 =
-                configurationContext1.createServiceGroupContext(serviceGroup1);
-        serviceGroupContext1.setId(sgcID);
-        configurationContext1.addServiceGroupContextIntoSoapSessionTable(serviceGroupContext1);
-        assertNotNull(serviceGroupContext1);
-
-        ServiceGroupContext serviceGroupContext2 =
-                configurationContext2.createServiceGroupContext(serviceGroup2);
-        serviceGroupContext2.setId(sgcID);
-        configurationContext2.addServiceGroupContextIntoSoapSessionTable(serviceGroupContext2);
-        assertNotNull(serviceGroupContext2);
-
-        String key1 = "sgCtxKey";
-        String val1 = "sgCtxVal1";
-        serviceGroupContext1.setProperty(key1, val1);
-        ctxMan1.updateContext(serviceGroupContext1);
-
-        assertEquals(val1, serviceGroupContext2.getProperty(key1));
-
-        // Remove the property
-        serviceGroupContext2.removeProperty(key1);
-        assertNull(serviceGroupContext2.getProperty(key1));
-        ctxMan2.updateContext(serviceGroupContext2);
-        assertNull(serviceGroupContext1.getProperty(key1));
-    }
-
-    public void testSetPropertyInServiceContext() throws Exception {
-        if (!canMulticast) {
-            return;
-        }
-
-        ServiceGroupContext serviceGroupContext1 =
-                configurationContext1.createServiceGroupContext(serviceGroup1);
-        serviceGroupContext1.setId(TEST_SERVICE_NAME);
-        ServiceContext serviceContext1 = serviceGroupContext1.getServiceContext(service1);
-        configurationContext1.addServiceGroupContextIntoApplicationScopeTable(serviceGroupContext1);
-        assertNotNull(serviceGroupContext1);
-        assertNotNull(serviceContext1);
-
-        ServiceGroupContext serviceGroupContext2 =
-                configurationContext2.createServiceGroupContext(serviceGroup2);
-        serviceGroupContext2.setId(TEST_SERVICE_NAME);
-        ServiceContext serviceContext2 = serviceGroupContext2.getServiceContext(service2);
-        configurationContext2.addServiceGroupContextIntoApplicationScopeTable(serviceGroupContext2);
-        assertNotNull(serviceGroupContext2);
-        assertNotNull(serviceContext2);
-
-        String key1 = "sgCtxKey";
-        String val1 = "sgCtxVal1";
-        serviceContext1.setProperty(key1, val1);
-        ctxMan1.updateContext(serviceContext1);
-
-        assertEquals(val1, serviceContext2.getProperty(key1));
-    }
-
-    public void testSetPropertyInServiceContext2() throws Exception {
-        if (!canMulticast) {
-            return;
-        }
-
-        ServiceGroupContext serviceGroupContext1 =
-                configurationContext1.createServiceGroupContext(serviceGroup1);
-        serviceGroupContext1.setId(TEST_SERVICE_NAME);
-        ServiceContext serviceContext1 = serviceGroupContext1.getServiceContext(service1);
-        configurationContext1.addServiceGroupContextIntoSoapSessionTable(serviceGroupContext1);
-        assertNotNull(serviceGroupContext1);
-        assertNotNull(serviceContext1);
-
-        ServiceGroupContext serviceGroupContext2 =
-                configurationContext2.createServiceGroupContext(serviceGroup2);
-        serviceGroupContext2.setId(TEST_SERVICE_NAME);
-        ServiceContext serviceContext2 = serviceGroupContext2.getServiceContext(service2);
-        configurationContext2.addServiceGroupContextIntoSoapSessionTable(serviceGroupContext2);
-        assertNotNull(serviceGroupContext2);
-        assertNotNull(serviceContext2);
-
-        String key1 = "sgCtxKey";
-        String val1 = "sgCtxVal1";
-        serviceContext1.setProperty(key1, val1);
-        ctxMan1.updateContext(serviceContext1);
-
-        assertEquals(val1, serviceContext2.getProperty(key1));
-    }
-
-    public void testRemovePropertyFromServiceContext() throws Exception {
-        if (!canMulticast) {
-            return;
-        }
-
-        // Add the property
-        ServiceGroupContext serviceGroupContext1 =
-                configurationContext1.createServiceGroupContext(serviceGroup1);
-        serviceGroupContext1.setId(TEST_SERVICE_NAME);
-        ServiceContext serviceContext1 = serviceGroupContext1.getServiceContext(service1);
-        configurationContext1.addServiceGroupContextIntoApplicationScopeTable(serviceGroupContext1);
-        assertNotNull(serviceGroupContext1);
-        assertNotNull(serviceContext1);
-
-        ServiceGroupContext serviceGroupContext2 =
-                configurationContext2.createServiceGroupContext(serviceGroup2);
-        serviceGroupContext2.setId(TEST_SERVICE_NAME);
-        ServiceContext serviceContext2 = serviceGroupContext2.getServiceContext(service2);
-        configurationContext2.addServiceGroupContextIntoApplicationScopeTable(serviceGroupContext2);
-        assertNotNull(serviceGroupContext2);
-        assertNotNull(serviceContext2);
-
-        String key1 = "sgCtxKey";
-        String val1 = "sgCtxVal1";
-        serviceContext1.setProperty(key1, val1);
-        ctxMan1.updateContext(serviceContext1);
-
-        assertEquals(val1, serviceContext2.getProperty(key1));
-
-        // Remove the property
-        serviceContext2.removeProperty(key1);
-        assertNull(serviceContext2.getProperty(key1));
-        ctxMan2.updateContext(serviceContext2);
-        assertNull(serviceContext1.getProperty(key1));
-    }
-
-    public void testRemovePropertyFromServiceContext2() throws Exception {
-        if (!canMulticast) {
-            return;
-        }
-
-        // Add the property
-        ServiceGroupContext serviceGroupContext1 =
-                configurationContext1.createServiceGroupContext(serviceGroup1);
-        serviceGroupContext1.setId(TEST_SERVICE_NAME);
-        ServiceContext serviceContext1 = serviceGroupContext1.getServiceContext(service1);
-        configurationContext1.addServiceGroupContextIntoSoapSessionTable(serviceGroupContext1);
-        assertNotNull(serviceGroupContext1);
-        assertNotNull(serviceContext1);
-
-        ServiceGroupContext serviceGroupContext2 =
-                configurationContext2.createServiceGroupContext(serviceGroup2);
-        serviceGroupContext2.setId(TEST_SERVICE_NAME);
-        ServiceContext serviceContext2 = serviceGroupContext2.getServiceContext(service2);
-        configurationContext2.addServiceGroupContextIntoSoapSessionTable(serviceGroupContext2);
-        assertNotNull(serviceGroupContext2);
-        assertNotNull(serviceContext2);
-
-        String key1 = "sgCtxKey";
-        String val1 = "sgCtxVal1";
-        serviceContext1.setProperty(key1, val1);
-        ctxMan1.updateContext(serviceContext1);
-
-        assertEquals(val1, serviceContext2.getProperty(key1));
-
-        // Remove the property
-        serviceContext2.removeProperty(key1);
-        assertNull(serviceContext2.getProperty(key1));
-        ctxMan2.updateContext(serviceContext2);
-        assertNull(serviceContext1.getProperty(key1));
-    }
-
-    public void testReplicationExclusion1() throws Exception {
-        if (!canMulticast) {
-            return;
-        }
-
-        String key1 = "local_configCtxKey";
-        String val1 = "configCtxVal1";
-        configurationContext1.setProperty(key1, val1);
-        List exclusionPatterns = new ArrayList();
-        exclusionPatterns.add("local_*");
-        ctxMan1.setReplicationExcludePatterns("defaults", exclusionPatterns);
-        ctxMan1.updateContext(configurationContext1);
-
-        String value = (String) configurationContext2.getProperty(key1);
-        assertNull(value); // The property should not have gotten replicated
-    }
-
-    public void testReplicationExclusion2() throws Exception {
-        if (!canMulticast) {
-            return;
-        }
-
-        String key1 = "local_configCtxKey";
-        String val1 = "configCtxVal1";
-        configurationContext1.setProperty(key1, val1);
-        List exclusionPatterns = new ArrayList();
-        exclusionPatterns.add("local_*");
-        ctxMan1.setReplicationExcludePatterns("org.apache.axis2.context.ConfigurationContext",
-                                              exclusionPatterns);
-        ctxMan1.updateContext(configurationContext1);
-
-        String value = (String) configurationContext2.getProperty(key1);
-        assertNull(value); // The property should not have gotten replicated
-    }
-
-    public void testReplicationExclusion3() throws Exception {
-        if (!canMulticast) {
-            return;
-        }
-
-        String key1 = "local1_configCtxKey";
-        String val1 = "configCtxVal1";
-        configurationContext1.setProperty(key1, val1);
-
-        String key2 = "local2_configCtxKey";
-        String val2 = "configCtxVal2";
-        configurationContext1.setProperty(key2, val2);
-
-        String key3 = "local3_configCtxKey";
-        String val3 = "configCtxVal3";
-        configurationContext1.setProperty(key3, val3);
-
-        List exclusionPatterns1 = new ArrayList();
-        exclusionPatterns1.add("local1_*");
-        List exclusionPatterns2 = new ArrayList();
-        exclusionPatterns2.add("local2_*");
-        ctxMan1.setReplicationExcludePatterns("org.apache.axis2.context.ConfigurationContext",
-                                              exclusionPatterns1);
-        ctxMan1.setReplicationExcludePatterns("defaults",
-                                              exclusionPatterns2);
-        ctxMan1.updateContext(configurationContext1);
-
-        String value1 = (String) configurationContext2.getProperty(key1);
-        assertNull(value1); // The property should not have gotten replicated
-        String value2 = (String) configurationContext2.getProperty(key2);
-        assertNull(value2); // The property should not have gotten replicated
-        String value3 = (String) configurationContext2.getProperty(key3);
-        assertEquals(val3, value3); // The property should have gotten replicated
-
-    }
-
-    protected void tearDown() throws Exception {
-        super.tearDown();
-        if (clusterManager1 != null) {
-            clusterManager1.shutdown();
-            System.out.println("------ CLuster-1 shutdown complete ------");
-        }
-        if (clusterManager2 != null) {
-            clusterManager2.shutdown();
-            System.out.println("------ CLuster-2 shutdown complete ------");
-        }
-//        MembershipManager.removeAllMembers();
-        Thread.sleep(500);
-    }
-}
+/*                                                                             
+ * Copyright 2004,2005 The Apache Software Foundation.                         
+ *                                                                             
+ * Licensed under the Apache License, Version 2.0 (the "License");             
+ * you may not use this file except in compliance with the License.            
+ * You may obtain a copy of the License at                                     
+ *                                                                             
+ *      http://www.apache.org/licenses/LICENSE-2.0                             
+ *                                                                             
+ * Unless required by applicable law or agreed to in writing, software         
+ * distributed under the License is distributed on an "AS IS" BASIS,           
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.    
+ * See the License for the specific language governing permissions and         
+ * limitations under the License.                                              
+ */
+package org.apache.axis2.clustering;
+
+import junit.framework.TestCase;
+import org.apache.axiom.om.util.UUIDGenerator;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.clustering.configuration.ConfigurationManager;
+import org.apache.axis2.clustering.configuration.DefaultConfigurationManager;
+import org.apache.axis2.clustering.configuration.DefaultConfigurationManagerListener;
+import org.apache.axis2.clustering.context.ContextManager;
+import org.apache.axis2.clustering.context.DefaultContextManager;
+import org.apache.axis2.clustering.context.DefaultContextManagerListener;
+import org.apache.axis2.clustering.tribes.TribesClusterManager;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.context.ServiceContext;
+import org.apache.axis2.context.ServiceGroupContext;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.AxisServiceGroup;
+import org.apache.axis2.description.Parameter;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.transport.http.server.HttpUtils;
+
+import java.io.IOException;
+import java.net.DatagramPacket;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.MulticastSocket;
+import java.net.ServerSocket;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Tests the replication of properties placed the ConfigurationContext, ServiceGroupContext &
+ * ServiceContext
+ */
+public class ContextReplicationTest extends TestCase {
+
+    private static final String TEST_SERVICE_NAME = "testService";
+
+    private static final Parameter domainParam =
+            new Parameter(ClusteringConstants.DOMAIN, "axis2.domain." + UUIDGenerator.getUUID());
+
+    // --------------- Cluster-1 ------------------------------------------------------
+    private ClusterManager clusterManager1;
+    private ContextManager ctxMan1;
+    private ConfigurationManager configMan1;
+    private ConfigurationContext configurationContext1;
+    private AxisServiceGroup serviceGroup1;
+    private AxisService service1;
+    //---------------------------------------------------------------------------------
+
+    // --------------- Cluster-2 ------------------------------------------------------
+    private ClusterManager clusterManager2;
+    private ContextManager ctxMan2;
+    private ConfigurationManager configMan2;
+    private ConfigurationContext configurationContext2;
+    private AxisServiceGroup serviceGroup2;
+    private AxisService service2;
+    //---------------------------------------------------------------------------------
+
+    private static boolean canRunTests;
+
+    private int getPort(int portStart, int retries) throws IOException {
+        InetSocketAddress addr = null;
+        ServerSocket socket = new ServerSocket();
+        int port = -1;
+        while (retries > 0) {
+            try {
+                addr = new InetSocketAddress(InetAddress.getByName(InetAddress.getLocalHost().getHostAddress()),
+                                             portStart);
+                socket.bind(addr);
+                port = portStart;
+                System.out.println("Can bind Server Socket to:" + addr);
+                socket.close();
+                break;
+            } catch (IOException x) {
+                retries--;
+                if (retries <= 0) {
+                    System.out.println("Unable to bind server socket to:" + addr +
+                                       " throwing error.");
+                    throw x;
+                }
+                portStart++;
+            }
+        }
+        return port;
+    }
+
+    private void canRunTests() {
+        if(System.getProperty("run.clustering.tests", "false").equals("false")){
+            canRunTests = false;
+            return;
+        }
+
+        // Which port should we listen to
+        final int port;
+        try {
+            port = getPort(4000, 1000);
+        } catch (IOException e) {
+            e.printStackTrace();
+            canRunTests = false;
+            return;
+        }
+
+        // Which address
+        final String group = "225.4.5.6";
+
+        Thread receiver = new Thread() {
+            public void run() {
+                try {
+                    MulticastSocket s = new MulticastSocket(port);
+                    s.joinGroup(InetAddress.getByName(group));
+
+                    // Create a DatagramPacket and do a receive
+                    byte buf[] = new byte[1024];
+                    DatagramPacket pack = new DatagramPacket(buf, buf.length);
+                    s.receive(pack);
+                    System.out.println("Received data from: " + pack.getAddress().toString() +
+                                       ":" + pack.getPort() + " with length: " +
+                                       pack.getLength());
+                    s.leaveGroup(InetAddress.getByName(group));
+                    s.close();
+                    canRunTests = true;
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    canRunTests = false;
+                }
+            }
+        };
+        receiver.start();
+
+        Thread sender = new Thread() {
+            public void run() {
+                try {
+                    MulticastSocket s = new MulticastSocket();
+                    byte buf[] = new byte[10];
+                    for (int i = 0; i < buf.length; i++) {
+                        buf[i] = (byte) i;
+                    }
+                    DatagramPacket pack = new DatagramPacket(buf, buf.length,
+                                                             InetAddress.getByName(group), port);
+                    s.setTimeToLive(2);
+                    s.send(pack);
+                    System.out.println("Sent test data");
+                    s.close();
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    canRunTests = false;
+                }
+            }
+        };
+        sender.start();
+
+        // Join the receiver until we can verify whether multicasting can be done
+        try {
+            receiver.join(10000);
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static void main(String[] args) {
+        new ContextReplicationTest().canRunTests();
+    }
+
+    protected void setUp() throws Exception {
+        canRunTests();
+        if (!canRunTests) {
+            System.out.println("[WARNING] Aborting clustering tests");
+            return;
+        }
+
+        System.setProperty(ClusteringConstants.LOCAL_IP_ADDRESS, HttpUtils.getIpAddress());
+
+        // First cluster
+        configurationContext1 =
+                ConfigurationContextFactory.createDefaultConfigurationContext();
+        serviceGroup1 = createAxisServiceGroup(configurationContext1);
+        service1 = createAxisService(serviceGroup1);
+        ctxMan1 = getContextManager();
+        configMan1 = getConfigurationManager();
+        clusterManager1 = getClusterManager(configurationContext1, ctxMan1, configMan1);
+        clusterManager1.addParameter(domainParam);
+        clusterManager1.init();
+        System.out.println("---------- ClusterManager-1 successfully initialized -----------");
+
+        // Second cluster
+        configurationContext2 =
+                ConfigurationContextFactory.createDefaultConfigurationContext();
+        serviceGroup2 = createAxisServiceGroup(configurationContext2);
+        service2 = createAxisService(serviceGroup2);
+        ctxMan2 = getContextManager();
+        configMan2 = getConfigurationManager();
+        clusterManager2 = getClusterManager(configurationContext2, ctxMan2, configMan2);
+        clusterManager2.addParameter(domainParam);
+        clusterManager2.init();
+        System.out.println("---------- ClusterManager-2 successfully initialized -----------");
+    }
+
+    protected ClusterManager getClusterManager(ConfigurationContext configCtx,
+                                               ContextManager contextManager,
+                                               ConfigurationManager configManager)
+            throws AxisFault {
+        ClusterManager clusterManager = new TribesClusterManager();
+        configCtx.getAxisConfiguration().setClusterManager(clusterManager);
+
+        configManager.
+                setConfigurationManagerListener(new DefaultConfigurationManagerListener());
+        clusterManager.setConfigurationManager(configManager);
+
+        contextManager.setContextManagerListener(new DefaultContextManagerListener());
+        clusterManager.setContextManager(contextManager);
+
+        clusterManager.setConfigurationContext(configCtx);
+
+        return clusterManager;
+    }
+
+    protected AxisServiceGroup createAxisServiceGroup(ConfigurationContext configCtx)
+            throws AxisFault {
+        AxisConfiguration axisConfig = configCtx.getAxisConfiguration();
+        AxisServiceGroup serviceGroup = new AxisServiceGroup(axisConfig);
+        axisConfig.addServiceGroup(serviceGroup);
+        return serviceGroup;
+    }
+
+    protected AxisService createAxisService(AxisServiceGroup serviceGroup) throws AxisFault {
+        AxisService service = new AxisService(TEST_SERVICE_NAME);
+        serviceGroup.addService(service);
+        return service;
+    }
+
+    protected ContextManager getContextManager() throws AxisFault {
+        ContextManager contextManager = new DefaultContextManager();
+        contextManager.setContextManagerListener(new DefaultContextManagerListener());
+        return contextManager;
+    }
+
+    protected ConfigurationManager getConfigurationManager() throws AxisFault {
+        ConfigurationManager contextManager = new DefaultConfigurationManager();
+        contextManager.setConfigurationManagerListener(new DefaultConfigurationManagerListener());
+        return contextManager;
+    }
+
+    public void testSetPropertyInConfigurationContext() throws Exception {
+        if (!canRunTests) {
+            return;
+        }
+
+        {
+            String key1 = "configCtxKey";
+            String val1 = "configCtxVal1";
+            configurationContext1.setProperty(key1, val1);
+            ctxMan1.updateContext(configurationContext1);
+            String value = (String) configurationContext2.getProperty(key1);
+            assertEquals(val1, value);
+        }
+
+        {
+            String key2 = "configCtxKey2";
+            String val2 = "configCtxVal1";
+            configurationContext2.setProperty(key2, val2);
+            ctxMan2.updateContext(configurationContext2);
+            Thread.sleep(1000);
+            String value = (String) configurationContext1.getProperty(key2);
+            assertEquals(val2, value);
+        }
+    }
+
+    public void testRemovePropertyFromConfigurationContext() throws Exception {
+        if (!canRunTests) {
+            return;
+        }
+
+        String key1 = "configCtxKey";
+        String val1 = "configCtxVal1";
+
+        // First set the property on a cluster 1 and replicate it
+        {
+            configurationContext1.setProperty(key1, val1);
+            ctxMan1.updateContext(configurationContext1);
+            String value = (String) configurationContext2.getProperty(key1);
+            assertEquals(val1, value);
+        }
+
+        // Next remove this property from cluster 2, replicate it, and check that it is unavailable in cluster 1
+        configurationContext2.removeProperty(key1);
+        ctxMan2.updateContext(configurationContext2);
+        String value = (String) configurationContext1.getProperty(key1);
+        assertNull(configurationContext2.getProperty(key1));
+        assertNull(value);
+    }
+
+    public void testSetPropertyInServiceGroupContext() throws Exception {
+        if (!canRunTests) {
+            return;
+        }
+
+        ServiceGroupContext serviceGroupContext1 =
+                configurationContext1.createServiceGroupContext(serviceGroup1);
+        serviceGroupContext1.setId(TEST_SERVICE_NAME);
+        configurationContext1.addServiceGroupContextIntoApplicationScopeTable(serviceGroupContext1);
+        assertNotNull(serviceGroupContext1);
+
+        ServiceGroupContext serviceGroupContext2 =
+                configurationContext2.createServiceGroupContext(serviceGroup2);
+        serviceGroupContext2.setId(TEST_SERVICE_NAME);
+        configurationContext2.addServiceGroupContextIntoApplicationScopeTable(serviceGroupContext2);
+        assertNotNull(serviceGroupContext2);
+
+        String key1 = "sgCtxKey";
+        String val1 = "sgCtxVal1";
+        serviceGroupContext1.setProperty(key1, val1);
+        ctxMan1.updateContext(serviceGroupContext1);
+        assertEquals(val1, serviceGroupContext2.getProperty(key1));
+    }
+
+    public void testRemovePropertyFromServiceGroupContext() throws Exception {
+        if (!canRunTests) {
+            return;
+        }
+
+        // Add the property
+        ServiceGroupContext serviceGroupContext1 =
+                configurationContext1.createServiceGroupContext(serviceGroup1);
+        serviceGroupContext1.setId(TEST_SERVICE_NAME);
+        configurationContext1.addServiceGroupContextIntoApplicationScopeTable(serviceGroupContext1);
+        assertNotNull(serviceGroupContext1);
+
+        ServiceGroupContext serviceGroupContext2 =
+                configurationContext2.createServiceGroupContext(serviceGroup2);
+        serviceGroupContext2.setId(TEST_SERVICE_NAME);
+        configurationContext2.addServiceGroupContextIntoApplicationScopeTable(serviceGroupContext2);
+        assertNotNull(serviceGroupContext2);
+
+        String key1 = "sgCtxKey";
+        String val1 = "sgCtxVal1";
+        serviceGroupContext1.setProperty(key1, val1);
+        ctxMan1.updateContext(serviceGroupContext1);
+        assertEquals(val1, serviceGroupContext2.getProperty(key1));
+
+        // Remove the property
+        serviceGroupContext2.removeProperty(key1);
+        assertNull(serviceGroupContext2.getProperty(key1));
+        ctxMan2.updateContext(serviceGroupContext2);
+        assertNull(serviceGroupContext1.getProperty(key1));
+    }
+
+    public void testSetPropertyInServiceGroupContext2() throws Exception {
+        if (!canRunTests) {
+            return;
+        }
+
+        String sgcID = UUIDGenerator.getUUID();
+
+        ServiceGroupContext serviceGroupContext1 =
+                configurationContext1.createServiceGroupContext(serviceGroup1);
+        serviceGroupContext1.setId(sgcID);
+        configurationContext1.addServiceGroupContextIntoSoapSessionTable(serviceGroupContext1);
+        assertNotNull(serviceGroupContext1);
+
+        ServiceGroupContext serviceGroupContext2 =
+                configurationContext2.createServiceGroupContext(serviceGroup2);
+        serviceGroupContext2.setId(sgcID);
+        configurationContext2.addServiceGroupContextIntoSoapSessionTable(serviceGroupContext2);
+        assertNotNull(serviceGroupContext2);
+
+        String key1 = "sgCtxKey";
+        String val1 = "sgCtxVal1";
+        serviceGroupContext1.setProperty(key1, val1);
+        ctxMan1.updateContext(serviceGroupContext1);
+
+        assertEquals(val1, serviceGroupContext2.getProperty(key1));
+    }
+
+    public void testRemovePropertyFromServiceGroupContext2() throws Exception {
+        if (!canRunTests) {
+            return;
+        }
+
+        // Add the property
+        String sgcID = UUIDGenerator.getUUID();
+
+        ServiceGroupContext serviceGroupContext1 =
+                configurationContext1.createServiceGroupContext(serviceGroup1);
+        serviceGroupContext1.setId(sgcID);
+        configurationContext1.addServiceGroupContextIntoSoapSessionTable(serviceGroupContext1);
+        assertNotNull(serviceGroupContext1);
+
+        ServiceGroupContext serviceGroupContext2 =
+                configurationContext2.createServiceGroupContext(serviceGroup2);
+        serviceGroupContext2.setId(sgcID);
+        configurationContext2.addServiceGroupContextIntoSoapSessionTable(serviceGroupContext2);
+        assertNotNull(serviceGroupContext2);
+
+        String key1 = "sgCtxKey";
+        String val1 = "sgCtxVal1";
+        serviceGroupContext1.setProperty(key1, val1);
+        ctxMan1.updateContext(serviceGroupContext1);
+
+        assertEquals(val1, serviceGroupContext2.getProperty(key1));
+
+        // Remove the property
+        serviceGroupContext2.removeProperty(key1);
+        assertNull(serviceGroupContext2.getProperty(key1));
+        ctxMan2.updateContext(serviceGroupContext2);
+        assertNull(serviceGroupContext1.getProperty(key1));
+    }
+
+    public void testSetPropertyInServiceContext() throws Exception {
+        if (!canRunTests) {
+            return;
+        }
+
+        ServiceGroupContext serviceGroupContext1 =
+                configurationContext1.createServiceGroupContext(serviceGroup1);
+        serviceGroupContext1.setId(TEST_SERVICE_NAME);
+        ServiceContext serviceContext1 = serviceGroupContext1.getServiceContext(service1);
+        configurationContext1.addServiceGroupContextIntoApplicationScopeTable(serviceGroupContext1);
+        assertNotNull(serviceGroupContext1);
+        assertNotNull(serviceContext1);
+
+        ServiceGroupContext serviceGroupContext2 =
+                configurationContext2.createServiceGroupContext(serviceGroup2);
+        serviceGroupContext2.setId(TEST_SERVICE_NAME);
+        ServiceContext serviceContext2 = serviceGroupContext2.getServiceContext(service2);
+        configurationContext2.addServiceGroupContextIntoApplicationScopeTable(serviceGroupContext2);
+        assertNotNull(serviceGroupContext2);
+        assertNotNull(serviceContext2);
+
+        String key1 = "sgCtxKey";
+        String val1 = "sgCtxVal1";
+        serviceContext1.setProperty(key1, val1);
+        ctxMan1.updateContext(serviceContext1);
+
+        assertEquals(val1, serviceContext2.getProperty(key1));
+    }
+
+    public void testSetPropertyInServiceContext2() throws Exception {
+        if (!canRunTests) {
+            return;
+        }
+
+        ServiceGroupContext serviceGroupContext1 =
+                configurationContext1.createServiceGroupContext(serviceGroup1);
+        serviceGroupContext1.setId(TEST_SERVICE_NAME);
+        ServiceContext serviceContext1 = serviceGroupContext1.getServiceContext(service1);
+        configurationContext1.addServiceGroupContextIntoSoapSessionTable(serviceGroupContext1);
+        assertNotNull(serviceGroupContext1);
+        assertNotNull(serviceContext1);
+
+        ServiceGroupContext serviceGroupContext2 =
+                configurationContext2.createServiceGroupContext(serviceGroup2);
+        serviceGroupContext2.setId(TEST_SERVICE_NAME);
+        ServiceContext serviceContext2 = serviceGroupContext2.getServiceContext(service2);
+        configurationContext2.addServiceGroupContextIntoSoapSessionTable(serviceGroupContext2);
+        assertNotNull(serviceGroupContext2);
+        assertNotNull(serviceContext2);
+
+        String key1 = "sgCtxKey";
+        String val1 = "sgCtxVal1";
+        serviceContext1.setProperty(key1, val1);
+        ctxMan1.updateContext(serviceContext1);
+
+        assertEquals(val1, serviceContext2.getProperty(key1));
+    }
+
+    public void testRemovePropertyFromServiceContext() throws Exception {
+        if (!canRunTests) {
+            return;
+        }
+
+        // Add the property
+        ServiceGroupContext serviceGroupContext1 =
+                configurationContext1.createServiceGroupContext(serviceGroup1);
+        serviceGroupContext1.setId(TEST_SERVICE_NAME);
+        ServiceContext serviceContext1 = serviceGroupContext1.getServiceContext(service1);
+        configurationContext1.addServiceGroupContextIntoApplicationScopeTable(serviceGroupContext1);
+        assertNotNull(serviceGroupContext1);
+        assertNotNull(serviceContext1);
+
+        ServiceGroupContext serviceGroupContext2 =
+                configurationContext2.createServiceGroupContext(serviceGroup2);
+        serviceGroupContext2.setId(TEST_SERVICE_NAME);
+        ServiceContext serviceContext2 = serviceGroupContext2.getServiceContext(service2);
+        configurationContext2.addServiceGroupContextIntoApplicationScopeTable(serviceGroupContext2);
+        assertNotNull(serviceGroupContext2);
+        assertNotNull(serviceContext2);
+
+        String key1 = "sgCtxKey";
+        String val1 = "sgCtxVal1";
+        serviceContext1.setProperty(key1, val1);
+        ctxMan1.updateContext(serviceContext1);
+
+        assertEquals(val1, serviceContext2.getProperty(key1));
+
+        // Remove the property
+        serviceContext2.removeProperty(key1);
+        assertNull(serviceContext2.getProperty(key1));
+        ctxMan2.updateContext(serviceContext2);
+        assertNull(serviceContext1.getProperty(key1));
+    }
+
+    public void testRemovePropertyFromServiceContext2() throws Exception {
+        if (!canRunTests) {
+            return;
+        }
+
+        // Add the property
+        ServiceGroupContext serviceGroupContext1 =
+                configurationContext1.createServiceGroupContext(serviceGroup1);
+        serviceGroupContext1.setId(TEST_SERVICE_NAME);
+        ServiceContext serviceContext1 = serviceGroupContext1.getServiceContext(service1);
+        configurationContext1.addServiceGroupContextIntoSoapSessionTable(serviceGroupContext1);
+        assertNotNull(serviceGroupContext1);
+        assertNotNull(serviceContext1);
+
+        ServiceGroupContext serviceGroupContext2 =
+                configurationContext2.createServiceGroupContext(serviceGroup2);
+        serviceGroupContext2.setId(TEST_SERVICE_NAME);
+        ServiceContext serviceContext2 = serviceGroupContext2.getServiceContext(service2);
+        configurationContext2.addServiceGroupContextIntoSoapSessionTable(serviceGroupContext2);
+        assertNotNull(serviceGroupContext2);
+        assertNotNull(serviceContext2);
+
+        String key1 = "sgCtxKey";
+        String val1 = "sgCtxVal1";
+        serviceContext1.setProperty(key1, val1);
+        ctxMan1.updateContext(serviceContext1);
+
+        assertEquals(val1, serviceContext2.getProperty(key1));
+
+        // Remove the property
+        serviceContext2.removeProperty(key1);
+        assertNull(serviceContext2.getProperty(key1));
+        ctxMan2.updateContext(serviceContext2);
+        assertNull(serviceContext1.getProperty(key1));
+    }
+
+    public void testReplicationExclusion1() throws Exception {
+        if (!canRunTests) {
+            return;
+        }
+
+        String key1 = "local_configCtxKey";
+        String val1 = "configCtxVal1";
+        configurationContext1.setProperty(key1, val1);
+        List exclusionPatterns = new ArrayList();
+        exclusionPatterns.add("local_*");
+        ctxMan1.setReplicationExcludePatterns("defaults", exclusionPatterns);
+        ctxMan1.updateContext(configurationContext1);
+
+        String value = (String) configurationContext2.getProperty(key1);
+        assertNull(value); // The property should not have gotten replicated
+    }
+
+    public void testReplicationExclusion2() throws Exception {
+        if (!canRunTests) {
+            return;
+        }
+
+        String key1 = "local_configCtxKey";
+        String val1 = "configCtxVal1";
+        configurationContext1.setProperty(key1, val1);
+        List exclusionPatterns = new ArrayList();
+        exclusionPatterns.add("local_*");
+        ctxMan1.setReplicationExcludePatterns("org.apache.axis2.context.ConfigurationContext",
+                                              exclusionPatterns);
+        ctxMan1.updateContext(configurationContext1);
+
+        String value = (String) configurationContext2.getProperty(key1);
+        assertNull(value); // The property should not have gotten replicated
+    }
+
+    public void testReplicationExclusion3() throws Exception {
+        if (!canRunTests) {
+            return;
+        }
+
+        String key1 = "local1_configCtxKey";
+        String val1 = "configCtxVal1";
+        configurationContext1.setProperty(key1, val1);
+
+        String key2 = "local2_configCtxKey";
+        String val2 = "configCtxVal2";
+        configurationContext1.setProperty(key2, val2);
+
+        String key3 = "local3_configCtxKey";
+        String val3 = "configCtxVal3";
+        configurationContext1.setProperty(key3, val3);
+
+        List exclusionPatterns1 = new ArrayList();
+        exclusionPatterns1.add("local1_*");
+        List exclusionPatterns2 = new ArrayList();
+        exclusionPatterns2.add("local2_*");
+        ctxMan1.setReplicationExcludePatterns("org.apache.axis2.context.ConfigurationContext",
+                                              exclusionPatterns1);
+        ctxMan1.setReplicationExcludePatterns("defaults",
+                                              exclusionPatterns2);
+        ctxMan1.updateContext(configurationContext1);
+
+        String value1 = (String) configurationContext2.getProperty(key1);
+        assertNull(value1); // The property should not have gotten replicated
+        String value2 = (String) configurationContext2.getProperty(key2);
+        assertNull(value2); // The property should not have gotten replicated
+        String value3 = (String) configurationContext2.getProperty(key3);
+        assertEquals(val3, value3); // The property should have gotten replicated
+
+    }
+
+    protected void tearDown() throws Exception {
+        super.tearDown();
+        if (clusterManager1 != null) {
+            clusterManager1.shutdown();
+            System.out.println("------ CLuster-1 shutdown complete ------");
+        }
+        if (clusterManager2 != null) {
+            clusterManager2.shutdown();
+            System.out.println("------ CLuster-2 shutdown complete ------");
+        }
+//        MembershipManager.removeAllMembers();
+        Thread.sleep(500);
+    }
+}

Modified: webservices/axis2/branches/java/jaxws21/modules/integration/test-resources/BaseDataTypes.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/integration/test-resources/BaseDataTypes.wsdl?rev=613867&r1=613866&r2=613867&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/integration/test-resources/BaseDataTypes.wsdl (original)
+++ webservices/axis2/branches/java/jaxws21/modules/integration/test-resources/BaseDataTypes.wsdl Mon Jan 21 04:20:38 2008
@@ -17,9 +17,9 @@
   ~ specific language governing permissions and limitations
   ~ under the License.
   -->
-<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:ns0="http://tempuri.org" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://tempuri.org">
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:ns="http://tempuri.org" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://tempuri.org">
     <wsdl:types>
-        <xs:schema xmlns:ns="http://tempuri.org" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://tempuri.org">
+        <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://tempuri.org">
             <xs:element name="retBool">
                 <xs:complexType>
                     <xs:sequence>
@@ -331,228 +331,228 @@
         </xs:schema>
     </wsdl:types>
     <wsdl:message name="retUIntRequest">
-        <wsdl:part name="parameters" element="ns0:retUInt"/>
+        <wsdl:part name="parameters" element="ns:retUInt"/>
     </wsdl:message>
     <wsdl:message name="retUIntResponse">
-        <wsdl:part name="parameters" element="ns0:retUIntResponse"/>
+        <wsdl:part name="parameters" element="ns:retUIntResponse"/>
     </wsdl:message>
     <wsdl:message name="retSingleRequest">
-        <wsdl:part name="parameters" element="ns0:retSingle"/>
+        <wsdl:part name="parameters" element="ns:retSingle"/>
     </wsdl:message>
     <wsdl:message name="retSingleResponse">
-        <wsdl:part name="parameters" element="ns0:retSingleResponse"/>
+        <wsdl:part name="parameters" element="ns:retSingleResponse"/>
     </wsdl:message>
     <wsdl:message name="retTimeSpanRequest">
-        <wsdl:part name="parameters" element="ns0:retTimeSpan"/>
+        <wsdl:part name="parameters" element="ns:retTimeSpan"/>
     </wsdl:message>
     <wsdl:message name="retTimeSpanResponse">
-        <wsdl:part name="parameters" element="ns0:retTimeSpanResponse"/>
+        <wsdl:part name="parameters" element="ns:retTimeSpanResponse"/>
     </wsdl:message>
     <wsdl:message name="retDateTimeRequest">
-        <wsdl:part name="parameters" element="ns0:retDateTime"/>
+        <wsdl:part name="parameters" element="ns:retDateTime"/>
     </wsdl:message>
     <wsdl:message name="retDateTimeResponse">
-        <wsdl:part name="parameters" element="ns0:retDateTimeResponse"/>
+        <wsdl:part name="parameters" element="ns:retDateTimeResponse"/>
     </wsdl:message>
     <wsdl:message name="retGuidRequest">
-        <wsdl:part name="parameters" element="ns0:retGuid"/>
+        <wsdl:part name="parameters" element="ns:retGuid"/>
     </wsdl:message>
     <wsdl:message name="retGuidResponse">
-        <wsdl:part name="parameters" element="ns0:retGuidResponse"/>
+        <wsdl:part name="parameters" element="ns:retGuidResponse"/>
     </wsdl:message>
     <wsdl:message name="retByteArrayRequest">
-        <wsdl:part name="parameters" element="ns0:retByteArray"/>
+        <wsdl:part name="parameters" element="ns:retByteArray"/>
     </wsdl:message>
     <wsdl:message name="retByteArrayResponse">
-        <wsdl:part name="parameters" element="ns0:retByteArrayResponse"/>
+        <wsdl:part name="parameters" element="ns:retByteArrayResponse"/>
     </wsdl:message>
     <wsdl:message name="retByteRequest">
-        <wsdl:part name="parameters" element="ns0:retByte"/>
+        <wsdl:part name="parameters" element="ns:retByte"/>
     </wsdl:message>
     <wsdl:message name="retByteResponse">
-        <wsdl:part name="parameters" element="ns0:retByteResponse"/>
+        <wsdl:part name="parameters" element="ns:retByteResponse"/>
     </wsdl:message>
     <wsdl:message name="retSByteRequest">
-        <wsdl:part name="parameters" element="ns0:retSByte"/>
+        <wsdl:part name="parameters" element="ns:retSByte"/>
     </wsdl:message>
     <wsdl:message name="retSByteResponse">
-        <wsdl:part name="parameters" element="ns0:retSByteResponse"/>
+        <wsdl:part name="parameters" element="ns:retSByteResponse"/>
     </wsdl:message>
     <wsdl:message name="retShortRequest">
-        <wsdl:part name="parameters" element="ns0:retShort"/>
+        <wsdl:part name="parameters" element="ns:retShort"/>
     </wsdl:message>
     <wsdl:message name="retShortResponse">
-        <wsdl:part name="parameters" element="ns0:retShortResponse"/>
+        <wsdl:part name="parameters" element="ns:retShortResponse"/>
     </wsdl:message>
     <wsdl:message name="retUriRequest">
-        <wsdl:part name="parameters" element="ns0:retUri"/>
+        <wsdl:part name="parameters" element="ns:retUri"/>
     </wsdl:message>
     <wsdl:message name="retUriResponse">
-        <wsdl:part name="parameters" element="ns0:retUriResponse"/>
+        <wsdl:part name="parameters" element="ns:retUriResponse"/>
     </wsdl:message>
     <wsdl:message name="retQNameRequest">
-        <wsdl:part name="parameters" element="ns0:retQName"/>
+        <wsdl:part name="parameters" element="ns:retQName"/>
     </wsdl:message>
     <wsdl:message name="retQNameResponse">
-        <wsdl:part name="parameters" element="ns0:retQNameResponse"/>
+        <wsdl:part name="parameters" element="ns:retQNameResponse"/>
     </wsdl:message>
     <wsdl:message name="retFloatRequest">
-        <wsdl:part name="parameters" element="ns0:retFloat"/>
+        <wsdl:part name="parameters" element="ns:retFloat"/>
     </wsdl:message>
     <wsdl:message name="retFloatResponse">
-        <wsdl:part name="parameters" element="ns0:retFloatResponse"/>
+        <wsdl:part name="parameters" element="ns:retFloatResponse"/>
     </wsdl:message>
     <wsdl:message name="retObjectRequest">
-        <wsdl:part name="parameters" element="ns0:retObject"/>
+        <wsdl:part name="parameters" element="ns:retObject"/>
     </wsdl:message>
     <wsdl:message name="retObjectResponse">
-        <wsdl:part name="parameters" element="ns0:retObjectResponse"/>
+        <wsdl:part name="parameters" element="ns:retObjectResponse"/>
     </wsdl:message>
     <wsdl:message name="retBoolRequest">
-        <wsdl:part name="parameters" element="ns0:retBool"/>
+        <wsdl:part name="parameters" element="ns:retBool"/>
     </wsdl:message>
     <wsdl:message name="retBoolResponse">
-        <wsdl:part name="parameters" element="ns0:retBoolResponse"/>
+        <wsdl:part name="parameters" element="ns:retBoolResponse"/>
     </wsdl:message>
     <wsdl:message name="retDoubleRequest">
-        <wsdl:part name="parameters" element="ns0:retDouble"/>
+        <wsdl:part name="parameters" element="ns:retDouble"/>
     </wsdl:message>
     <wsdl:message name="retDoubleResponse">
-        <wsdl:part name="parameters" element="ns0:retDoubleResponse"/>
+        <wsdl:part name="parameters" element="ns:retDoubleResponse"/>
     </wsdl:message>
     <wsdl:message name="retDecimalRequest">
-        <wsdl:part name="parameters" element="ns0:retDecimal"/>
+        <wsdl:part name="parameters" element="ns:retDecimal"/>
     </wsdl:message>
     <wsdl:message name="retDecimalResponse">
-        <wsdl:part name="parameters" element="ns0:retDecimalResponse"/>
+        <wsdl:part name="parameters" element="ns:retDecimalResponse"/>
     </wsdl:message>
     <wsdl:message name="retLongRequest">
-        <wsdl:part name="parameters" element="ns0:retLong"/>
+        <wsdl:part name="parameters" element="ns:retLong"/>
     </wsdl:message>
     <wsdl:message name="retLongResponse">
-        <wsdl:part name="parameters" element="ns0:retLongResponse"/>
+        <wsdl:part name="parameters" element="ns:retLongResponse"/>
     </wsdl:message>
     <wsdl:message name="retIntRequest">
-        <wsdl:part name="parameters" element="ns0:retInt"/>
+        <wsdl:part name="parameters" element="ns:retInt"/>
     </wsdl:message>
     <wsdl:message name="retIntResponse">
-        <wsdl:part name="parameters" element="ns0:retIntResponse"/>
+        <wsdl:part name="parameters" element="ns:retIntResponse"/>
     </wsdl:message>
     <wsdl:message name="retCharRequest">
-        <wsdl:part name="parameters" element="ns0:retChar"/>
+        <wsdl:part name="parameters" element="ns:retChar"/>
     </wsdl:message>
     <wsdl:message name="retCharResponse">
-        <wsdl:part name="parameters" element="ns0:retCharResponse"/>
+        <wsdl:part name="parameters" element="ns:retCharResponse"/>
     </wsdl:message>
     <wsdl:message name="retStringRequest">
-        <wsdl:part name="parameters" element="ns0:retString"/>
+        <wsdl:part name="parameters" element="ns:retString"/>
     </wsdl:message>
     <wsdl:message name="retStringResponse">
-        <wsdl:part name="parameters" element="ns0:retStringResponse"/>
+        <wsdl:part name="parameters" element="ns:retStringResponse"/>
     </wsdl:message>
     <wsdl:message name="retUShortRequest">
-        <wsdl:part name="parameters" element="ns0:retUShort"/>
+        <wsdl:part name="parameters" element="ns:retUShort"/>
     </wsdl:message>
     <wsdl:message name="retUShortResponse">
-        <wsdl:part name="parameters" element="ns0:retUShortResponse"/>
+        <wsdl:part name="parameters" element="ns:retUShortResponse"/>
     </wsdl:message>
     <wsdl:message name="retULongRequest">
-        <wsdl:part name="parameters" element="ns0:retULong"/>
+        <wsdl:part name="parameters" element="ns:retULong"/>
     </wsdl:message>
     <wsdl:message name="retULongResponse">
-        <wsdl:part name="parameters" element="ns0:retULongResponse"/>
+        <wsdl:part name="parameters" element="ns:retULongResponse"/>
     </wsdl:message>
     <wsdl:portType name="BaseDataTypesPortType">
         <wsdl:operation name="retUInt">
-            <wsdl:input message="ns0:retUIntRequest" wsaw:Action="urn:retUInt"/>
-            <wsdl:output message="ns0:retUIntResponse" wsaw:Action="urn:retUIntResponse"/>
+            <wsdl:input message="ns:retUIntRequest" wsaw:Action="urn:retUInt"/>
+            <wsdl:output message="ns:retUIntResponse" wsaw:Action="urn:retUIntResponse"/>
         </wsdl:operation>
         <wsdl:operation name="retSingle">
-            <wsdl:input message="ns0:retSingleRequest" wsaw:Action="urn:retSingle"/>
-            <wsdl:output message="ns0:retSingleResponse" wsaw:Action="urn:retSingleResponse"/>
+            <wsdl:input message="ns:retSingleRequest" wsaw:Action="urn:retSingle"/>
+            <wsdl:output message="ns:retSingleResponse" wsaw:Action="urn:retSingleResponse"/>
         </wsdl:operation>
         <wsdl:operation name="retTimeSpan">
-            <wsdl:input message="ns0:retTimeSpanRequest" wsaw:Action="urn:retTimeSpan"/>
-            <wsdl:output message="ns0:retTimeSpanResponse" wsaw:Action="urn:retTimeSpanResponse"/>
+            <wsdl:input message="ns:retTimeSpanRequest" wsaw:Action="urn:retTimeSpan"/>
+            <wsdl:output message="ns:retTimeSpanResponse" wsaw:Action="urn:retTimeSpanResponse"/>
         </wsdl:operation>
         <wsdl:operation name="retDateTime">
-            <wsdl:input message="ns0:retDateTimeRequest" wsaw:Action="urn:retDateTime"/>
-            <wsdl:output message="ns0:retDateTimeResponse" wsaw:Action="urn:retDateTimeResponse"/>
+            <wsdl:input message="ns:retDateTimeRequest" wsaw:Action="urn:retDateTime"/>
+            <wsdl:output message="ns:retDateTimeResponse" wsaw:Action="urn:retDateTimeResponse"/>
         </wsdl:operation>
         <wsdl:operation name="retGuid">
-            <wsdl:input message="ns0:retGuidRequest" wsaw:Action="urn:retGuid"/>
-            <wsdl:output message="ns0:retGuidResponse" wsaw:Action="urn:retGuidResponse"/>
+            <wsdl:input message="ns:retGuidRequest" wsaw:Action="urn:retGuid"/>
+            <wsdl:output message="ns:retGuidResponse" wsaw:Action="urn:retGuidResponse"/>
         </wsdl:operation>
         <wsdl:operation name="retByteArray">
-            <wsdl:input message="ns0:retByteArrayRequest" wsaw:Action="urn:retByteArray"/>
-            <wsdl:output message="ns0:retByteArrayResponse" wsaw:Action="urn:retByteArrayResponse"/>
+            <wsdl:input message="ns:retByteArrayRequest" wsaw:Action="urn:retByteArray"/>
+            <wsdl:output message="ns:retByteArrayResponse" wsaw:Action="urn:retByteArrayResponse"/>
         </wsdl:operation>
         <wsdl:operation name="retByte">
-            <wsdl:input message="ns0:retByteRequest" wsaw:Action="urn:retByte"/>
-            <wsdl:output message="ns0:retByteResponse" wsaw:Action="urn:retByteResponse"/>
+            <wsdl:input message="ns:retByteRequest" wsaw:Action="urn:retByte"/>
+            <wsdl:output message="ns:retByteResponse" wsaw:Action="urn:retByteResponse"/>
         </wsdl:operation>
         <wsdl:operation name="retSByte">
-            <wsdl:input message="ns0:retSByteRequest" wsaw:Action="urn:retSByte"/>
-            <wsdl:output message="ns0:retSByteResponse" wsaw:Action="urn:retSByteResponse"/>
+            <wsdl:input message="ns:retSByteRequest" wsaw:Action="urn:retSByte"/>
+            <wsdl:output message="ns:retSByteResponse" wsaw:Action="urn:retSByteResponse"/>
         </wsdl:operation>
         <wsdl:operation name="retShort">
-            <wsdl:input message="ns0:retShortRequest" wsaw:Action="urn:retShort"/>
-            <wsdl:output message="ns0:retShortResponse" wsaw:Action="urn:retShortResponse"/>
+            <wsdl:input message="ns:retShortRequest" wsaw:Action="urn:retShort"/>
+            <wsdl:output message="ns:retShortResponse" wsaw:Action="urn:retShortResponse"/>
         </wsdl:operation>
         <wsdl:operation name="retUri">
-            <wsdl:input message="ns0:retUriRequest" wsaw:Action="urn:retUri"/>
-            <wsdl:output message="ns0:retUriResponse" wsaw:Action="urn:retUriResponse"/>
+            <wsdl:input message="ns:retUriRequest" wsaw:Action="urn:retUri"/>
+            <wsdl:output message="ns:retUriResponse" wsaw:Action="urn:retUriResponse"/>
         </wsdl:operation>
         <wsdl:operation name="retQName">
-            <wsdl:input message="ns0:retQNameRequest" wsaw:Action="urn:retQName"/>
-            <wsdl:output message="ns0:retQNameResponse" wsaw:Action="urn:retQNameResponse"/>
+            <wsdl:input message="ns:retQNameRequest" wsaw:Action="urn:retQName"/>
+            <wsdl:output message="ns:retQNameResponse" wsaw:Action="urn:retQNameResponse"/>
         </wsdl:operation>
         <wsdl:operation name="retFloat">
-            <wsdl:input message="ns0:retFloatRequest" wsaw:Action="urn:retFloat"/>
-            <wsdl:output message="ns0:retFloatResponse" wsaw:Action="urn:retFloatResponse"/>
+            <wsdl:input message="ns:retFloatRequest" wsaw:Action="urn:retFloat"/>
+            <wsdl:output message="ns:retFloatResponse" wsaw:Action="urn:retFloatResponse"/>
         </wsdl:operation>
         <wsdl:operation name="retObject">
-            <wsdl:input message="ns0:retObjectRequest" wsaw:Action="urn:retObject"/>
-            <wsdl:output message="ns0:retObjectResponse" wsaw:Action="urn:retObjectResponse"/>
+            <wsdl:input message="ns:retObjectRequest" wsaw:Action="urn:retObject"/>
+            <wsdl:output message="ns:retObjectResponse" wsaw:Action="urn:retObjectResponse"/>
         </wsdl:operation>
         <wsdl:operation name="retBool">
-            <wsdl:input message="ns0:retBoolRequest" wsaw:Action="urn:retBool"/>
-            <wsdl:output message="ns0:retBoolResponse" wsaw:Action="urn:retBoolResponse"/>
+            <wsdl:input message="ns:retBoolRequest" wsaw:Action="urn:retBool"/>
+            <wsdl:output message="ns:retBoolResponse" wsaw:Action="urn:retBoolResponse"/>
         </wsdl:operation>
         <wsdl:operation name="retDouble">
-            <wsdl:input message="ns0:retDoubleRequest" wsaw:Action="urn:retDouble"/>
-            <wsdl:output message="ns0:retDoubleResponse" wsaw:Action="urn:retDoubleResponse"/>
+            <wsdl:input message="ns:retDoubleRequest" wsaw:Action="urn:retDouble"/>
+            <wsdl:output message="ns:retDoubleResponse" wsaw:Action="urn:retDoubleResponse"/>
         </wsdl:operation>
         <wsdl:operation name="retDecimal">
-            <wsdl:input message="ns0:retDecimalRequest" wsaw:Action="urn:retDecimal"/>
-            <wsdl:output message="ns0:retDecimalResponse" wsaw:Action="urn:retDecimalResponse"/>
+            <wsdl:input message="ns:retDecimalRequest" wsaw:Action="urn:retDecimal"/>
+            <wsdl:output message="ns:retDecimalResponse" wsaw:Action="urn:retDecimalResponse"/>
         </wsdl:operation>
         <wsdl:operation name="retLong">
-            <wsdl:input message="ns0:retLongRequest" wsaw:Action="urn:retLong"/>
-            <wsdl:output message="ns0:retLongResponse" wsaw:Action="urn:retLongResponse"/>
+            <wsdl:input message="ns:retLongRequest" wsaw:Action="urn:retLong"/>
+            <wsdl:output message="ns:retLongResponse" wsaw:Action="urn:retLongResponse"/>
         </wsdl:operation>
         <wsdl:operation name="retInt">
-            <wsdl:input message="ns0:retIntRequest" wsaw:Action="urn:retInt"/>
-            <wsdl:output message="ns0:retIntResponse" wsaw:Action="urn:retIntResponse"/>
+            <wsdl:input message="ns:retIntRequest" wsaw:Action="urn:retInt"/>
+            <wsdl:output message="ns:retIntResponse" wsaw:Action="urn:retIntResponse"/>
         </wsdl:operation>
         <wsdl:operation name="retChar">
-            <wsdl:input message="ns0:retCharRequest" wsaw:Action="urn:retChar"/>
-            <wsdl:output message="ns0:retCharResponse" wsaw:Action="urn:retCharResponse"/>
+            <wsdl:input message="ns:retCharRequest" wsaw:Action="urn:retChar"/>
+            <wsdl:output message="ns:retCharResponse" wsaw:Action="urn:retCharResponse"/>
         </wsdl:operation>
         <wsdl:operation name="retString">
-            <wsdl:input message="ns0:retStringRequest" wsaw:Action="urn:retString"/>
-            <wsdl:output message="ns0:retStringResponse" wsaw:Action="urn:retStringResponse"/>
+            <wsdl:input message="ns:retStringRequest" wsaw:Action="urn:retString"/>
+            <wsdl:output message="ns:retStringResponse" wsaw:Action="urn:retStringResponse"/>
         </wsdl:operation>
         <wsdl:operation name="retUShort">
-            <wsdl:input message="ns0:retUShortRequest" wsaw:Action="urn:retUShort"/>
-            <wsdl:output message="ns0:retUShortResponse" wsaw:Action="urn:retUShortResponse"/>
+            <wsdl:input message="ns:retUShortRequest" wsaw:Action="urn:retUShort"/>
+            <wsdl:output message="ns:retUShortResponse" wsaw:Action="urn:retUShortResponse"/>
         </wsdl:operation>
         <wsdl:operation name="retULong">
-            <wsdl:input message="ns0:retULongRequest" wsaw:Action="urn:retULong"/>
-            <wsdl:output message="ns0:retULongResponse" wsaw:Action="urn:retULongResponse"/>
+            <wsdl:input message="ns:retULongRequest" wsaw:Action="urn:retULong"/>
+            <wsdl:output message="ns:retULongResponse" wsaw:Action="urn:retULongResponse"/>
         </wsdl:operation>
     </wsdl:portType>
-    <wsdl:binding name="BaseDataTypesSOAP11Binding" type="ns0:BaseDataTypesPortType">
+    <wsdl:binding name="BaseDataTypesSOAP11Binding" type="ns:BaseDataTypesPortType">
         <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
         <wsdl:operation name="retUInt">
             <soap:operation soapAction="urn:retUInt" style="document"/>
@@ -753,7 +753,7 @@
             </wsdl:output>
         </wsdl:operation>
     </wsdl:binding>
-    <wsdl:binding name="BaseDataTypesSOAP12Binding" type="ns0:BaseDataTypesPortType">
+    <wsdl:binding name="BaseDataTypesSOAP12Binding" type="ns:BaseDataTypesPortType">
         <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
         <wsdl:operation name="retUInt">
             <soap12:operation soapAction="urn:retUInt" style="document"/>
@@ -954,7 +954,7 @@
             </wsdl:output>
         </wsdl:operation>
     </wsdl:binding>
-    <wsdl:binding name="BaseDataTypesHttpBinding" type="ns0:BaseDataTypesPortType">
+    <wsdl:binding name="BaseDataTypesHttpBinding" type="ns:BaseDataTypesPortType">
         <http:binding verb="POST"/>
         <wsdl:operation name="retUInt">
             <http:operation location="BaseDataTypes/retUInt"/>
@@ -1156,15 +1156,14 @@
         </wsdl:operation>
     </wsdl:binding>
     <wsdl:service name="BaseDataTypes">
-        <wsdl:port name="BaseDataTypesSOAP11port_http" binding="ns0:BaseDataTypesSOAP11Binding">
+        <wsdl:port name="BaseDataTypesSOAP11port_http" binding="ns:BaseDataTypesSOAP11Binding">
             <soap:address location="http://localhost:8080/axis2/services/BaseDataTypes"/>
         </wsdl:port>
-        <wsdl:port name="BaseDataTypesSOAP12port_http" binding="ns0:BaseDataTypesSOAP12Binding">
+        <wsdl:port name="BaseDataTypesSOAP12port_http" binding="ns:BaseDataTypesSOAP12Binding">
             <soap12:address location="http://localhost:8080/axis2/services/BaseDataTypes"/>
         </wsdl:port>
-        <wsdl:port name="BaseDataTypesHttpport" binding="ns0:BaseDataTypesHttpBinding">
+        <wsdl:port name="BaseDataTypesHttpport" binding="ns:BaseDataTypesHttpBinding">
             <http:address location="http://localhost:8080/axis2/services/BaseDataTypes"/>
         </wsdl:port>
     </wsdl:service>
 </wsdl:definitions>
-

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/pom.xml?rev=613867&r1=613866&r2=613867&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/pom.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/pom.xml Mon Jan 21 04:20:38 2008
@@ -149,6 +149,8 @@
 				<artifactId>maven-compiler-plugin</artifactId>
 				<inherited>true</inherited>
 				<configuration>
+                    <compilerArgument>-Xbootclasspath/p:${basedir}/../jaxws-api/target/classes${path.separator}${basedir}/../jws-api/target/classes</compilerArgument>
+                    <compilerVersion>1.5</compilerVersion>
 					<source>1.5</source>
 					<target>1.5</target>
 				</configuration>
@@ -852,7 +854,7 @@
 				<configuration>
 					<skip>false</skip>
 					<forkMode>once</forkMode>
-					<argLine>-Xms256m -Xmx512m -Djava.endorsed.dirs=${project.build.directory}/../../saaj-api/target/ </argLine>
+					<argLine>-Xms256m -Xmx512m -Djava.endorsed.dirs=${project.build.directory}/../../saaj-api/target/${path.separator}${basedir}/../jaxws-api/target/classes${basedir}/../jws-api/target/classes </argLine>
 					<!-- Enable the next 2 lines if you want to attach a debugger
                     <argLine>-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5006</argLine>-->
 					<includes>

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/ServiceDelegate.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/ServiceDelegate.java?rev=613867&r1=613866&r2=613867&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/ServiceDelegate.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/ServiceDelegate.java Mon Jan 21 04:20:38 2008
@@ -240,7 +240,7 @@
     	}
         EndpointDescription endpointDesc =
                 DescriptionFactory.updateEndpoint(serviceDescription, null, portName,
-                                                  DescriptionFactory.UpdateType.ADD_PORT);
+                                                  DescriptionFactory.UpdateType.ADD_PORT, this);
         // TODO: Need to set endpointAddress and set or check bindingId on the EndpointDesc
         endpointDesc.setEndpointAddress(endpointAddress);
         endpointDesc.setClientBindingID(bindingId);
@@ -290,7 +290,8 @@
         EndpointDescription endpointDesc =
                 DescriptionFactory.updateEndpoint(serviceDescription, null, axis2EPR,
                                                   addressingNamespace,
-                                                  DescriptionFactory.UpdateType.CREATE_DISPATCH);
+                                                  DescriptionFactory.UpdateType.CREATE_DISPATCH,
+                                                  this);
         if (endpointDesc == null) {
             //TODO NLS enable.
             throw ExceptionFactory.makeWebServiceException("Unable to generate an endpoint description for endpoint reference " + jaxwsEPR);
@@ -335,7 +336,8 @@
         EndpointDescription endpointDesc =
                 DescriptionFactory.updateEndpoint(serviceDescription, null, axis2EPR,
                                                   addressingNamespace,
-                                                  DescriptionFactory.UpdateType.CREATE_DISPATCH);
+                                                  DescriptionFactory.UpdateType.CREATE_DISPATCH,
+                                                  this);
         if (endpointDesc == null) {
             //TODO NLS enable.
             throw ExceptionFactory.makeWebServiceException("Unable to generate an endpoint description for endpoint reference " + jaxwsEPR);
@@ -370,8 +372,12 @@
         }
 
         EndpointDescription endpointDesc =
-                DescriptionFactory.updateEndpoint(serviceDescription, null, portName,
-                                                  DescriptionFactory.UpdateType.CREATE_DISPATCH);
+                DescriptionFactory.updateEndpoint(serviceDescription, 
+                								  null, 
+                                                  portName,
+                                                  DescriptionFactory.UpdateType.CREATE_DISPATCH,
+                                                  this);
+
         if (endpointDesc == null) {
             throw ExceptionFactory.makeWebServiceException(
                     Messages.getMessage("createDispatchFail2", portName.toString()));
@@ -401,8 +407,12 @@
         }
 
         EndpointDescription endpointDesc =
-                DescriptionFactory.updateEndpoint(serviceDescription, null, portName,
-                                                  DescriptionFactory.UpdateType.CREATE_DISPATCH);
+                DescriptionFactory.updateEndpoint(serviceDescription, 
+                								  null, 
+                                                  portName,
+                                                  DescriptionFactory.UpdateType.CREATE_DISPATCH,
+                                                  this);
+
         if (endpointDesc == null) {
             throw ExceptionFactory.makeWebServiceException(
                     Messages.getMessage("createDispatchFail2", portName.toString()));
@@ -577,7 +587,7 @@
     * @see javax.xml.ws.spi.ServiceDelegate#getPorts()
     */
     public Iterator<QName> getPorts() {
-        return getServiceDescription().getPorts().iterator();
+        return getServiceDescription().getPorts(this).iterator();
     }
 
     /*
@@ -632,7 +642,7 @@
      * 
      */
     public ServiceClient getServiceClient(QName portQName) throws WebServiceException {
-        return serviceDescription.getServiceClient(portQName);
+        return serviceDescription.getServiceClient(portQName, this);
     }
     
     public <T> T getPort(org.apache.axis2.addressing.EndpointReference axis2EPR, String addressingNamespace, Class<T> sei, WebServiceFeature... features) {



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