[jboss-cvs] JBossAS SVN: r74016 - in trunk/testsuite/src: resources/cluster/drm and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jun 3 16:15:26 EDT 2008
Author: bstansberry at jboss.com
Date: 2008-06-03 16:15:26 -0400 (Tue, 03 Jun 2008)
New Revision: 74016
Added:
trunk/testsuite/src/resources/cluster/drm/drm-test-stacks.xml
Modified:
trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/DRMTestCase.java
Log:
Fix DRMTestCase
Modified: trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/DRMTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/DRMTestCase.java 2008-06-03 20:15:02 UTC (rev 74015)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/DRMTestCase.java 2008-06-03 20:15:26 UTC (rev 74016)
@@ -501,13 +501,18 @@
public void testIsMasterReplica() throws Exception
{
GossipRouter router = null;
+ ClusterPartition partition1 = null;
+ ClusterPartition partition2 = null;
+ boolean partition1Started = false;
+ boolean partition2Started = false;
+
log.debug("+++ testIsMasterReplica()");
try
{
String partitionName = "DRMTestCasePartition";
- String muxFile = "jgroups-channelfactory.sar/META-INF/jgroups-channelfactory-stacks.xml";
- String stackName = "tunnel";
+ String muxFile = "cluster/drm/drm-test-stacks.xml";
+ String stackName = "tunnel1";
log.info("DRMTestCase.testIsMasterReplica() - starting GossipRouter");
// router characteristics here must match the definition in the stack configuration
@@ -519,9 +524,14 @@
factory1.setMultiplexerConfig(muxFile);
factory1.setNamingServicePort(1099);
factory1.setNodeName("node1");
+ factory1.setExposeChannels(false);
+ factory1.setExposeProtocols(false);
+ factory1.create();
+ factory1.start();
Configuration cacheConfig1 = new Configuration();
cacheConfig1.setMultiplexerStack(stackName);
+ cacheConfig1.setCacheMode("REPL_SYNC");
DependencyInjectedConfigurationRegistry registry1 = new DependencyInjectedConfigurationRegistry();
registry1.registerConfiguration("config1", cacheConfig1);
@@ -532,7 +542,7 @@
DistributedReplicantManagerImpl drm1 = new DistributedReplicantManagerImpl();
- ClusterPartition partition1 = new ClusterPartition();
+ partition1 = new ClusterPartition();
partition1.setPartitionName(partitionName);
partition1.setCacheManager(cacheManager1);
partition1.setCacheConfigName("config1");
@@ -547,16 +557,24 @@
Thread.sleep(10000);
+ // Use a different stack name with the same config to avoid singleton conflicts
+ stackName = "tunnel2";
+
JChannelFactory factory2 = new JChannelFactory();
factory2.setMultiplexerConfig(muxFile);
factory2.setNamingServicePort(1099);
- factory1.setNodeName("node2");
+ factory2.setNodeName("node2");
+ factory2.setExposeChannels(false);
+ factory2.setExposeProtocols(false);
+ factory2.create();
+ factory2.start();
Configuration cacheConfig2 = new Configuration();
cacheConfig2.setMultiplexerStack(stackName);
+ cacheConfig2.setCacheMode("REPL_SYNC");
DependencyInjectedConfigurationRegistry registry2 = new DependencyInjectedConfigurationRegistry();
- registry1.registerConfiguration("config2", cacheConfig2);
+ registry2.registerConfiguration("config2", cacheConfig2);
CacheManager cacheManager2 = new CacheManager(registry2, factory2);
@@ -564,7 +582,7 @@
DistributedReplicantManagerImpl drm2 = new DistributedReplicantManagerImpl();
- ClusterPartition partition2 = new ClusterPartition();
+ partition2 = new ClusterPartition();
partition2.setPartitionName(partitionName);
partition2.setCacheManager(cacheManager2);
partition2.setCacheConfigName("config2");
@@ -684,6 +702,10 @@
finally
{
log.info("DRMTestCase.testIsMasterReplica() - cleaning up resources");
+ if (partition1Started)
+ partition1.stop();
+ if (partition2Started)
+ partition2.stop();
if (router != null)
router.stop();
}
Added: trunk/testsuite/src/resources/cluster/drm/drm-test-stacks.xml
===================================================================
--- trunk/testsuite/src/resources/cluster/drm/drm-test-stacks.xml (rev 0)
+++ trunk/testsuite/src/resources/cluster/drm/drm-test-stacks.xml 2008-06-03 20:15:26 UTC (rev 74016)
@@ -0,0 +1,69 @@
+<!--
+ JGroups protocol stacks definitions used by DRMTestCase.
+ Author: Brian Stansberry
+-->
+<protocol_stacks>
+
+ <stack name="tunnel1"
+ description="Used with a GossipRouter">
+ <config>
+ <TUNNEL singleton_name="tunnel1" router_port="12001" router_host="127.0.0.1"/>
+ <PING timeout="2000"
+ num_initial_members="3"
+ gossip_refresh="10000"
+ gossip_host="127.0.0.1"
+ gossip_port="12001"/>
+ <MERGE2 max_interval="20000" min_interval="5000"/>
+ <FD_SOCK/>
+ <FD timeout="2000" max_tries="3" shun="true"/>
+ <VERIFY_SUSPECT timeout="1500"/>
+ <pbcast.NAKACK use_mcast_xmit="false" gc_lag="0"
+ retransmit_timeout="300,600,1200,2400,4800"
+ discard_delivered_msgs="true"/>
+ <UNICAST timeout="300,600,1200,2400,3600"/>
+ <pbcast.STABLE stability_delay="1000" desired_avg_gossip="5000"
+ max_bytes="400000"/>
+ <pbcast.GMS print_local_addr="true" join_timeout="3000"
+ shun="false"
+ view_bundling="true"
+ view_ack_collection_timeout="5000"/>
+ <FC max_credits="2000000" min_threshold="0.10"/>
+ <FRAG2 frag_size="60000"/>
+ <pbcast.STATE_TRANSFER/>
+ <pbcast.FLUSH timeout="0"/>
+ </config>
+ </stack>
+
+ <stack name="tunnel2"
+ description="Used with a GossipRouter">
+ <config>
+ <TUNNEL singleton_name="tunnel2" router_port="12001" router_host="127.0.0.1"/>
+ <PING timeout="2000"
+ num_initial_members="3"
+ gossip_refresh="10000"
+ gossip_host="127.0.0.1"
+ gossip_port="12001"/>
+ <MERGE2 max_interval="20000" min_interval="5000"/>
+ <FD_SOCK/>
+ <FD timeout="2000" max_tries="3" shun="true"/>
+ <VERIFY_SUSPECT timeout="1500"/>
+ <pbcast.NAKACK use_mcast_xmit="false" gc_lag="0"
+ retransmit_timeout="300,600,1200,2400,4800"
+ discard_delivered_msgs="true"/>
+ <UNICAST timeout="300,600,1200,2400,3600"/>
+ <pbcast.STABLE stability_delay="1000" desired_avg_gossip="5000"
+ max_bytes="400000"/>
+ <pbcast.GMS print_local_addr="true" join_timeout="3000"
+ shun="false"
+ view_bundling="true"
+ view_ack_collection_timeout="5000"/>
+ <FC max_credits="2000000" min_threshold="0.10"/>
+ <FRAG2 frag_size="60000"/>
+ <pbcast.STATE_TRANSFER/>
+ <pbcast.FLUSH timeout="0"/>
+ </config>
+ </stack>
+
+</protocol_stacks>
+
+
More information about the jboss-cvs-commits
mailing list