[jbosscache-commits] JBoss Cache SVN: r6528 - core/trunk/src/test/java/org/jboss/cache/buddyreplication.
jbosscache-commits at lists.jboss.org
jbosscache-commits at lists.jboss.org
Wed Aug 6 10:37:50 EDT 2008
Author: manik.surtani at jboss.com
Date: 2008-08-06 10:37:50 -0400 (Wed, 06 Aug 2008)
New Revision: 6528
Modified:
core/trunk/src/test/java/org/jboss/cache/buddyreplication/MvccBuddyReplicationTest.java
Log:
Improved test
Modified: core/trunk/src/test/java/org/jboss/cache/buddyreplication/MvccBuddyReplicationTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/buddyreplication/MvccBuddyReplicationTest.java 2008-08-06 09:23:41 UTC (rev 6527)
+++ core/trunk/src/test/java/org/jboss/cache/buddyreplication/MvccBuddyReplicationTest.java 2008-08-06 14:37:50 UTC (rev 6528)
@@ -21,57 +21,50 @@
*/
package org.jboss.cache.buddyreplication;
-import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Cache;
-import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
-import org.jboss.cache.lock.IsolationLevel;
-import org.jboss.cache.config.Option;
+import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.config.Configuration;
-import org.jboss.cache.config.BuddyReplicationConfig;
+import org.jboss.cache.config.Option;
import org.jboss.cache.config.parsing.XmlConfigurationParser;
+import org.jboss.cache.util.TestingUtil;
import org.testng.annotations.Test;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.AfterMethod;
-import java.util.Properties;
-import java.util.List;
-import java.util.ArrayList;
-
/**
* @author Mircea.Markus at jboss.com
* @since 3.0
*/
- at Test(groups = "functionl")
+ at Test(groups = "functional")
public class MvccBuddyReplicationTest
{
private static final String FILE = "configs/mvcc-repl-sync-br.xml";
- Configuration configuration;
-
- public void testSimpleFailure() throws InterruptedException
+ public void testSimpleFailure()
{
- Cache cache1 = createCache();
- Thread.sleep(1000);
- Cache cache2 = createCache();
-
- cache1.put("/test", "key", "value");
- cache1.stop();
-
- Option option = cache2.getInvocationContext().getOptionOverrides();
- option.setForceDataGravitation(true);
+ Cache<String, String> cache1 = null, cache2 = null;
try
{
+ cache1 = createCache();
+ TestingUtil.sleepThread(1000);
+ cache2 = createCache();
+
+ cache1.put("/test", "key", "value");
+ cache1.stop();
+
+ Option option = cache2.getInvocationContext().getOptionOverrides();
+ option.setForceDataGravitation(true);
assert cache2.get("/test", "key").equals("value");
- } finally
+ }
+ finally
{
- cache2.stop();
+ TestingUtil.killCaches(cache1, cache2);
+
}
}
- private Cache createCache()
+ private Cache<String, String> createCache()
{
Configuration fileConfig = new XmlConfigurationParser().parseFile(FILE);
- DefaultCacheFactory dcf = new DefaultCacheFactory();
+ DefaultCacheFactory<String, String> dcf = new DefaultCacheFactory<String, String>();
return dcf.createCache(fileConfig);
}
}
More information about the jbosscache-commits
mailing list