Package org.jboss.ha.core.framework.server

Examples of org.jboss.ha.core.framework.server.DistributedReplicantManagerImpl


         }
        
         MockHAPartition partition = new MockHAPartition(nodes[2]);
         partition.setCurrentViewClusterNodes(allNodes);
        
         DistributedReplicantManagerImpl drm = new DistributedReplicantManagerImpl(partition);
         drm.createService();
         drm.startService();
        
         CachingListener listener = new CachingListener();
         drm.registerListener("TEST", listener);
        
         SecureRandom random = new SecureRandom();
         boolean[] added = new boolean[nodes.length];
         List lookup = null;
         List<ClusterNode> lookupReplicantsNodes = null;
         for (int i = 0; i < 10; i++)
         {
            int node = random.nextInt(nodes.length);
            if (added[node])
            {
               if (node == 2)
                  drm.remove("TEST");
               else
                  drm._remove("TEST", nodes[node].getName());
               added[node] = false;
            }
            else
            {    
               if (node == 2)
                  drm.add("TEST", replicants[node]);
               else
                  drm._add("TEST", nodes[node].getName(), replicants[node]);  
               added[node] = true;
            }
           
            // Confirm the proper order of the replicant node names
            lookupReplicantsNodes = maskListClass(drm.lookupReplicantsNodes("TEST"));
            confirmReplicantList(lookupReplicantsNodes, nodes, added);
           
            // Confirm the proper order of the replicants via lookupReplicants
            lookup = maskListClass(drm.lookupReplicants("TEST"));
            confirmReplicantList(lookup, replicants, added);
           
            // Confirm the listener got the same list
//            assertEquals("Listener received a correct list", lookup,
//                         maskListClass(listener.replicants));
View Full Code Here

TOP

Related Classes of org.jboss.ha.core.framework.server.DistributedReplicantManagerImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.