[jboss-cvs] JBossAS SVN: r110502 - in branches/JBPAPP_5_1_datagrid/testsuite: src/main/org/jboss/test/cluster/datagrid/test and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Jan 31 18:31:25 EST 2011
Author: rachmatowicz at jboss.com
Date: 2011-01-31 18:31:25 -0500 (Mon, 31 Jan 2011)
New Revision: 110502
Modified:
branches/JBPAPP_5_1_datagrid/testsuite/imports/config/tests-clustering.xml
branches/JBPAPP_5_1_datagrid/testsuite/src/main/org/jboss/test/cluster/datagrid/test/HotRodClientFailoverTestCase.java
Log:
Update EDG HotRodClientFailoverTestCase
Modified: branches/JBPAPP_5_1_datagrid/testsuite/imports/config/tests-clustering.xml
===================================================================
--- branches/JBPAPP_5_1_datagrid/testsuite/imports/config/tests-clustering.xml 2011-01-30 05:14:42 UTC (rev 110501)
+++ branches/JBPAPP_5_1_datagrid/testsuite/imports/config/tests-clustering.xml 2011-01-31 23:31:25 UTC (rev 110502)
@@ -1069,6 +1069,8 @@
<antcall target="tests-clustering-datagrid-execute">
<param name="cluster.datagrid.includes.refid" value="cluster.datagrid.failover.includes"/>
<param name="jboss-junit-configuration" value="datagrid"/>
+ <!-- extend test case timeout for server start stop from 180000 (3 min) -->
+ <param name="junit.timeout" value="360000"/>
</antcall>
<server:stop name="datagrid-failover-0"/>
Modified: branches/JBPAPP_5_1_datagrid/testsuite/src/main/org/jboss/test/cluster/datagrid/test/HotRodClientFailoverTestCase.java
===================================================================
--- branches/JBPAPP_5_1_datagrid/testsuite/src/main/org/jboss/test/cluster/datagrid/test/HotRodClientFailoverTestCase.java 2011-01-30 05:14:42 UTC (rev 110501)
+++ branches/JBPAPP_5_1_datagrid/testsuite/src/main/org/jboss/test/cluster/datagrid/test/HotRodClientFailoverTestCase.java 2011-01-31 23:31:25 UTC (rev 110502)
@@ -74,10 +74,12 @@
* Tests for the HotRod client failover
*
* We start one server using server-manager, before the test case starts.
- *
* We start the second server using AsyncShellScriptExecutor so that we can interrogate and
* kill the server as we please from within the test case. Even restart it if necessary!
*
+ * Because this test starts and stops servers within the test the junit.timeout property
+ * needs to be extended.
+ *
* This test is based on JBossTestCase, so we only have all info for one server.
* We need to pick up the details for the second server using jbosstest properties
* and this is done in the setUp().
@@ -184,51 +186,58 @@
// now perform some data grid operations
System.out.println("Putting keys and values") ;
- rc.put("key1", "value1") ;
- rc.put("key2", "value2") ;
- rc.put("key3", "value3") ;
+ rc.put("key1-shutdown", "value1") ;
+ rc.put("key2-shutdown", "value2") ;
+ rc.put("key3-shutdown", "value3") ;
System.out.println("Getting keys and values before server shutdown") ;
- assertTrue("key1 not accessible before server shutdown", rc.get("key1").equals("value1")) ;
- assertTrue("key2 not accessible before server shutdown", rc.get("key2").equals("value2")) ;
- assertTrue("key3 not accessible before server shutdown", rc.get("key3").equals("value3")) ;
+ assertTrue("key1 not accessible before server shutdown", rc.get("key1-shutdown").equals("value1")) ;
+ assertTrue("key2 not accessible before server shutdown", rc.get("key2-shutdown").equals("value2")) ;
+ assertTrue("key3 not accessible before server shutdown", rc.get("key3-shutdown").equals("value3")) ;
// now stop the server we started
stopFailingHostByCleanShutdown() ;
System.out.println("Getting keys and values after server shutdown") ;
- assertTrue("key1 not accessible after server shutdown", rc.get("key1").equals("value1")) ;
- assertTrue("key2 not accessible after server shutdown", rc.get("key2").equals("value2")) ;
- assertTrue("key3 not accessible after server shutdown", rc.get("key3").equals("value3")) ;
+ assertTrue("key1 not accessible after server shutdown", rc.get("key1-shutdown").equals("value1")) ;
+ assertTrue("key2 not accessible after server shutdown", rc.get("key2-shutdown").equals("value2")) ;
+ assertTrue("key3 not accessible after server shutdown", rc.get("key3-shutdown").equals("value3")) ;
}
/*
* Tests the startup of the second server
*/
-// public void testFailoverWithCrash() throws Exception {
-//
-// // start the AS instance datagrid-failover-0
-// startFailingHost() ;
-//
-// // get a CacheManager and a cache
-// Properties testProps = new Properties() ;
-// testProps.put("infinispan.client.hotrod.server_list", hotRodServerList) ;
-//
-// RemoteCacheManager rcm = new RemoteCacheManager(testProps) ;
-// RemoteCache rc = rcm.getCache() ;
-//
-// // now perform some data grid operations
-// rc.put("key1", "value1") ;
-// rc.put("key2", "value2") ;
-// rc.put("key3", "value3") ;
-//
-// // now stop the server we started
-// stopFailingHostByCrash() ;
-//
-// assertTrue("key1 not accessible after server shutdown", rc.get("key1").equals("value1")) ;
-// assertTrue("key2 not accessible after server shutdown", rc.get("key2").equals("value2")) ;
-// assertTrue("key3 not accessible after server shutdown", rc.get("key3").equals("value3")) ;
-// }
+ public void testFailoverWithCrash() throws Exception {
+
+ // start the AS instance datagrid-failover-0
+ startFailingHost() ;
+
+ // get a CacheManager and a cache
+ Properties testProps = new Properties() ;
+ testProps.put("infinispan.client.hotrod.server_list", hotRodServerList) ;
+
+ RemoteCacheManager rcm = new RemoteCacheManager(testProps) ;
+ RemoteCache rc = rcm.getCache() ;
+
+ // now perform some data grid operations
+ System.out.println("Putting keys and values") ;
+ rc.put("key1-crash", "value1") ;
+ rc.put("key2-crash", "value2") ;
+ rc.put("key3-crash", "value3") ;
+
+ System.out.println("Getting keys and values before server crash") ;
+ assertTrue("key1 not accessible before server crash", rc.get("key1-crash").equals("value1")) ;
+ assertTrue("key2 not accessible before server crash", rc.get("key2-crash").equals("value2")) ;
+ assertTrue("key3 not accessible before server crash", rc.get("key3-crash").equals("value3")) ;
+
+ // now stop the server we started
+ stopFailingHostByCrash() ;
+
+ System.out.println("Getting keys and values after server crash") ;
+ assertTrue("key1 not accessible after server crash", rc.get("key1-crash").equals("value1")) ;
+ assertTrue("key2 not accessible after server crash", rc.get("key2-crash").equals("value2")) ;
+ assertTrue("key3 not accessible after server crash", rc.get("key3-crash").equals("value3")) ;
+ }
/**
@@ -236,7 +245,7 @@
*/
private void startFailingHost() throws Exception {
- final int STARTUP_TIMEOUT = 90 ;
+ final int STARTUP_TIMEOUT = 120 ;
// build the shell command to execute
String command = "run" ;
@@ -264,7 +273,7 @@
private void stopFailingHostByCleanShutdown() throws Exception {
- final int SHUTDOWN_TIMEOUT = 90 ;
+ final int SHUTDOWN_TIMEOUT = 120 ;
// use the JMX operation shutdown to stop the server
MBeanServerConnection jmxServer = getMBeanServerConnection(servers[1], 1099) ;
More information about the jboss-cvs-commits
mailing list