JBoss Cache SVN: r6691 - in core/branches/1.4.X: src/org/jboss/cache and 2 other directories.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-09-04 10:25:23 -0400 (Thu, 04 Sep 2008)
New Revision: 6691
Modified:
core/branches/1.4.X/build.xml
core/branches/1.4.X/src/org/jboss/cache/TreeCache.java
core/branches/1.4.X/tests/functional/org/jboss/cache/RemoveOnTxTest.java
core/branches/1.4.X/tests/functional/org/jboss/cache/transaction/IsolationLevelReadUncommitedTest.java
Log:
fix for http://jira.jboss.com/jira/browse/JBCACHE-1384
Modified: core/branches/1.4.X/build.xml
===================================================================
--- core/branches/1.4.X/build.xml 2008-09-04 14:12:45 UTC (rev 6690)
+++ core/branches/1.4.X/build.xml 2008-09-04 14:25:23 UTC (rev 6691)
@@ -392,7 +392,7 @@
<target name="one-test-aop" depends="generateClassLoader, compile,unittests-init"
description="Runs a single unit test">
- <junit printsummary="yes" timeout="${junit.timeout}" fork="yes">
+ <junit printsummary="yes" timeout="${junit.timeout}" fork="yes" maxmemory="512">
<jvmarg value="-Djboss.aop.path=${output.etc.dir}/jboss-aop.xml"/>
<jvmarg value="-Xbootclasspath/p:${bootclasspath}"/>
<!-- start of Optimizeit support
Modified: core/branches/1.4.X/src/org/jboss/cache/TreeCache.java
===================================================================
--- core/branches/1.4.X/src/org/jboss/cache/TreeCache.java 2008-09-04 14:12:45 UTC (rev 6690)
+++ core/branches/1.4.X/src/org/jboss/cache/TreeCache.java 2008-09-04 14:25:23 UTC (rev 6691)
@@ -4307,6 +4307,12 @@
else
{
if (log.isDebugEnabled()) log.debug("Node " + f + " NOT marked for removal as expected, not removing!");
+ //also check whether children are marked for deletion, JBCACHE-1406
+ for (Object o : n.getChildren(true).values())
+ {
+ DataNode data = (DataNode) o;
+ realRemove(data.getFqn(), skipMarkerCheck);
+ }
}
}
Modified: core/branches/1.4.X/tests/functional/org/jboss/cache/RemoveOnTxTest.java
===================================================================
--- core/branches/1.4.X/tests/functional/org/jboss/cache/RemoveOnTxTest.java 2008-09-04 14:12:45 UTC (rev 6690)
+++ core/branches/1.4.X/tests/functional/org/jboss/cache/RemoveOnTxTest.java 2008-09-04 14:25:23 UTC (rev 6691)
@@ -69,7 +69,7 @@
print("get(): " + cache.get("/a/b/c", "test"));
tm.commit();
assertTrue(cache.peek(Fqn.fromString("/a/b/c")) == null);
- assertTrue(cache.exists("/a/b/c"));
+ assertTrue(!cache.exists("/a/b/c"));
assertTrue(cache.exists("/a/b/d"));
cache.printLockInfo();
} catch (Exception ex)
Modified: core/branches/1.4.X/tests/functional/org/jboss/cache/transaction/IsolationLevelReadUncommitedTest.java
===================================================================
--- core/branches/1.4.X/tests/functional/org/jboss/cache/transaction/IsolationLevelReadUncommitedTest.java 2008-09-04 14:12:45 UTC (rev 6690)
+++ core/branches/1.4.X/tests/functional/org/jboss/cache/transaction/IsolationLevelReadUncommitedTest.java 2008-09-04 14:25:23 UTC (rev 6691)
@@ -13,7 +13,6 @@
/**
* @author Mircea.Markus(a)jboss.com
- * @since 2.2
*/
public class IsolationLevelReadUncommitedTest extends TestCase {
17 years, 3 months
JBoss Cache SVN: r6690 - core/branches/1.4.X/tests/functional/org/jboss/cache.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-09-04 10:12:45 -0400 (Thu, 04 Sep 2008)
New Revision: 6690
Added:
core/branches/1.4.X/tests/functional/org/jboss/cache/RemoveOnTxTest.java
Log:
http://jira.jboss.com/jira/browse/JBCACHE-1384
Added: core/branches/1.4.X/tests/functional/org/jboss/cache/RemoveOnTxTest.java
===================================================================
--- core/branches/1.4.X/tests/functional/org/jboss/cache/RemoveOnTxTest.java (rev 0)
+++ core/branches/1.4.X/tests/functional/org/jboss/cache/RemoveOnTxTest.java 2008-09-04 14:12:45 UTC (rev 6690)
@@ -0,0 +1,154 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.cache;
+
+import junit.framework.TestCase;
+
+import javax.transaction.TransactionManager;
+import javax.transaction.Transaction;
+
+/**
+ * When deleting a node in TX and adding one of it's parrents in same tx, the node node does not get deleted when
+ * tx finishes. This tests is for reproducing the issue above.
+ */
+public class RemoveOnTxTest extends TestCase
+{
+ TreeCache cache;
+ protected void setUp() throws Exception
+ {
+ cache = new TreeCache();
+ PropertyConfigurator config = new PropertyConfigurator();
+ config.configure(cache, "META-INF/local-service.xml");
+ cache.create();
+ cache.start();
+ }
+
+ protected void tearDown() throws Exception
+ {
+ cache.stop();
+ cache.destroy();
+ }
+
+ public void testFailure() throws Exception
+ {
+
+ TransactionManager tm = cache.getTransactionManager();
+ try
+ {
+ tm.begin();
+ print("put()");
+ cache.put("/a/b/c", "test", "test");
+ assertTrue(cache.get("/a/b/c", "test").equals("test"));
+ print("remove()");
+ cache.remove("/a/b");
+ assertTrue(!cache.exists("/a/b"));
+ assertTrue(!cache.exists("/a/b/c"));
+ cache.put("/a/b/d", "test1", "test1");
+ assertTrue(!cache.exists("/a/b/c"));
+ assertTrue(cache.exists("/a/b/d"));
+ print("Exists? " + cache.exists("/a/b/c"));
+ print("get(): " + cache.get("/a/b/c", "test"));
+ tm.commit();
+ assertTrue(cache.peek(Fqn.fromString("/a/b/c")) == null);
+ assertTrue(cache.exists("/a/b/c"));
+ assertTrue(cache.exists("/a/b/d"));
+ cache.printLockInfo();
+ } catch (Exception ex)
+ {
+ ex.printStackTrace();
+ tm.rollback();
+ }
+ cache.printLockInfo();
+ System.out.println(" lock info " + cache.printLockInfo());
+ try
+ {
+ tm.begin();
+ print(cache.exists("/a/b/c"));
+ print("get(): " + cache.get("/a/b/c", "test"));
+ print("get(): " + cache.get("/a/b/c", "test"));
+ Transaction t = tm.suspend();
+ try
+ {
+ cache.putFailFast("/a/b/c", "test", "test", 0);
+ } catch (Exception ignore)
+ {
+ ignore.printStackTrace();
+ }
+ tm.resume(t);
+ print("get(): " + cache.get("/a/b/c", "test"));
+ print(cache.exists("/a/b/c"));
+ cache.put("/a/b/c", "test", "test");
+ print(cache.exists("/a/b/c"));
+ tm.commit();
+ } catch (Exception ex)
+ {
+ ex.printStackTrace();
+ tm.rollback();
+ }
+ }
+
+ private void print(Object s)
+ {
+ System.out.println(s);
+ }
+
+ private void print(boolean s)
+ {
+ System.out.println(s);
+ }
+
+ public void testReal() throws Exception
+ {
+ TransactionManager tm = cache.getTransactionManager();
+ tm.begin();
+ print("put()");
+ cache.put("/a/b/c", "test", "test");
+ assertTrue(cache.get("/a/b/c", "test").equals("test"));
+ print("remove()");
+ cache.remove("/a/b");
+ assertTrue(!cache.exists("/a/b"));
+ assertTrue(!cache.exists("/a/b/c"));
+ cache.put("/a/b/d", "test1", "test1");
+ assertTrue(!cache.exists("/a/b/c"));
+ assertTrue(cache.exists("/a/b/d"));
+ print("Exists? " + cache.exists("/a/b/c"));
+ print("get(): " + cache.get("/a/b/c", "test"));
+ tm.commit();
+ assertNull(cache.peek(Fqn.fromString("/a/b/c")));
+ assertTrue(!cache.exists("/a/b/c"));
+ assertTrue(cache.exists("/a/b/d"));
+ cache.printLockInfo();
+ }
+
+ public void testSimplified() throws Exception
+ {
+ TransactionManager tm = cache.getTransactionManager();
+ tm.begin();
+ print("put()");
+ cache.put("/a/b/c", "test", "test");
+ assertTrue(cache.peek(Fqn.fromString("/a/b/c")) != null);
+ cache.remove("/a/b");
+ assertTrue(cache.peek(Fqn.fromString("/a/b/c")).getDataKeys().contains("__JBOSS_MARKED_FOR_REMOVAL"));
+ tm.commit();
+ assertTrue(cache.peek(Fqn.fromString("/a/b/c")) == null);
+ }
+}
17 years, 3 months
JBoss Cache SVN: r6689 - in core/tags/3.0.0.BETA1: src/main/java/org/jboss/cache and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-09-03 09:12:51 -0400 (Wed, 03 Sep 2008)
New Revision: 6689
Modified:
core/tags/3.0.0.BETA1/pom.xml
core/tags/3.0.0.BETA1/src/main/java/org/jboss/cache/Version.java
Log:
Beta1
Modified: core/tags/3.0.0.BETA1/pom.xml
===================================================================
--- core/tags/3.0.0.BETA1/pom.xml 2008-09-03 09:38:17 UTC (rev 6688)
+++ core/tags/3.0.0.BETA1/pom.xml 2008-09-03 13:12:51 UTC (rev 6689)
@@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<properties>
- <jbosscache-core-version>3.0.0-SNAPSHOT</jbosscache-core-version>
+ <jbosscache-core-version>3.0.0.BETA1</jbosscache-core-version>
<!-- By default only run tests in the "unit" group -->
<defaultTestGroup>unit</defaultTestGroup>
<!-- By default only generate Javadocs when we install the module. -->
Modified: core/tags/3.0.0.BETA1/src/main/java/org/jboss/cache/Version.java
===================================================================
--- core/tags/3.0.0.BETA1/src/main/java/org/jboss/cache/Version.java 2008-09-03 09:38:17 UTC (rev 6688)
+++ core/tags/3.0.0.BETA1/src/main/java/org/jboss/cache/Version.java 2008-09-03 13:12:51 UTC (rev 6689)
@@ -11,10 +11,10 @@
@Immutable
public class Version
{
- public static final String version = "3.0.0-SNAPSHOT";
+ public static final String version = "3.0.0.BETA1";
public static final String codename = "Naga";
//public static final String cvs = "$Id: Version.java 4592 2007-10-10 16:44:36Z manik.surtani(a)jboss.com $";
- static final byte[] version_id = {'0', '3', '0', '0', 'S'};
+ static final byte[] version_id = {'0', '3', '0', '0', 'B', '1'};
private static final int MAJOR_SHIFT = 11;
private static final int MINOR_SHIFT = 6;
17 years, 3 months
JBoss Cache SVN: r6688 - core/tags.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-09-03 05:38:17 -0400 (Wed, 03 Sep 2008)
New Revision: 6688
Added:
core/tags/3.0.0.BETA1/
Log:
Tagging 3.0.0.Beta1
Copied: core/tags/3.0.0.BETA1 (from rev 6687, core/trunk)
17 years, 3 months
JBoss Cache SVN: r6687 - core/trunk/src/main/java/org/jboss/cache/config/parsing.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-09-03 05:35:12 -0400 (Wed, 03 Sep 2008)
New Revision: 6687
Modified:
core/trunk/src/main/java/org/jboss/cache/config/parsing/CacheConfigsXmlParser.java
Log:
Support for both qualified and unqualified elements
Modified: core/trunk/src/main/java/org/jboss/cache/config/parsing/CacheConfigsXmlParser.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/parsing/CacheConfigsXmlParser.java 2008-09-03 05:41:51 UTC (rev 6686)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/CacheConfigsXmlParser.java 2008-09-03 09:35:12 UTC (rev 6687)
@@ -66,6 +66,8 @@
* in a cache configs XML document.
*/
public static final String CONFIG_ROOT = "cache-config";
+ public static final String QUALIFIED_CONFIG_ROOT = "registry:cache-config";
+
/**
* Name of the attribute in a {@link #CONFIG_ROOT cache-config} element that specifies
* the name of the configuration.
@@ -74,6 +76,7 @@
private static final Log log = LogFactory.getLog(CacheConfigsXmlParser.class);
+
public Map<String, Configuration> parseConfigs(String fileName) throws CloneNotSupportedException
{
FileLookup fileLookup = new FileLookup();
@@ -93,7 +96,12 @@
NodeList list = root.getElementsByTagName(CONFIG_ROOT);
if (list == null || list.getLength() == 0)
- throw new ConfigurationException("Can't find " + CONFIG_ROOT + " tag");
+ {
+ // try looking for a QUALIFIED_CONFIG_ROOT
+ list = root.getElementsByTagName(QUALIFIED_CONFIG_ROOT);
+ if (list == null || list.getLength() == 0)
+ throw new ConfigurationException("Can't find " + CONFIG_ROOT + " or " + QUALIFIED_CONFIG_ROOT + " tag");
+ }
Map<String, Configuration> result = new HashMap<String, Configuration>();
17 years, 3 months
JBoss Cache SVN: r6686 - core/trunk/src/test/java/org/jboss/cache/statetransfer.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-09-03 01:41:51 -0400 (Wed, 03 Sep 2008)
New Revision: 6686
Modified:
core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransferConcurrencyTest.java
core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransferTestBase.java
Log:
More tweaking of tests
Modified: core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransferConcurrencyTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransferConcurrencyTest.java 2008-09-03 04:55:50 UTC (rev 6685)
+++ core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransferConcurrencyTest.java 2008-09-03 05:41:51 UTC (rev 6686)
@@ -17,6 +17,7 @@
import org.jboss.cache.RegionImpl;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.Configuration.CacheMode;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
import org.jboss.cache.marshall.InactiveRegionException;
import org.jboss.cache.util.TestingUtil;
@@ -472,15 +473,15 @@
{
Configuration c = UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC, true);
- Cache<Object, Object> cache1 = new DefaultCacheFactory<Object, Object>().createCache(c, false);
- cache1.start();
+ additionalConfiguration(c);
+ Cache<Object, Object> cache1 = new DefaultCacheFactory<Object, Object>().createCache(c);
caches.put("evict1", cache1);
cache1.put(Fqn.fromString("/a/b/c"), "key", "value");
c = UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC, true);
- Cache<Object, Object> cache2 = new DefaultCacheFactory<Object, Object>().createCache(c, false);
- cache2.start();
+ additionalConfiguration(c);
+ Cache<Object, Object> cache2 = new DefaultCacheFactory<Object, Object>().createCache(c);
caches.put("evict2", cache2);
RegionImpl region = (RegionImpl) cache2.getRegion(Fqn.ROOT, false);
@@ -493,8 +494,8 @@
System.out.println(++i + ") Queue contains : " + region.getEvictionEventQueue().poll(0, TimeUnit.MILLISECONDS));
events = region.getEvictionEventQueue().size();
}
-
- assertEquals("Saw the expected number of node events", 5, nodeEventQueueSize);
+ boolean mvcc = cache2.getConfiguration().getNodeLockingScheme() == NodeLockingScheme.MVCC;
+ assertEquals("Saw the expected number of node events", mvcc ? 5 : 3, nodeEventQueueSize);
}
/**
@@ -503,8 +504,8 @@
public void testEvictionAfterStateTransfer() throws Exception
{
Configuration c = UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC, true);
- Cache<Object, Object> cache1 = new DefaultCacheFactory<Object, Object>().createCache(c, false);
- cache1.start();
+ additionalConfiguration(c);
+ Cache<Object, Object> cache1 = new DefaultCacheFactory<Object, Object>().createCache(c);
caches.put("evict1", cache1);
for (int i = 0; i < 25000; i++)
@@ -522,15 +523,15 @@
EvictionController ec1 = new EvictionController(cache1);
ec1.startEviction();
+ int childrenSize = cache1.getRoot().getChild(Fqn.fromString("/org/jboss/data")).getChildren().size();
+ assert childrenSize == 5000 : "Expected 5000, saw " + childrenSize;
- assert cache1.getRoot().getChild(Fqn.fromString("/org/jboss/data")).getChildren().size() == 5000;
-
c = UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC, true);
- final Cache<Object, Object> cache2 = new DefaultCacheFactory<Object, Object>().createCache(c, false);
- cache2.start();
+ additionalConfiguration(c);
+ final Cache<Object, Object> cache2 = new DefaultCacheFactory<Object, Object>().createCache(c);
caches.put("evict2", cache2);
- Node<Object, Object> parent = cache2.getRoot().getChild(Fqn.fromString("/org/jboss/test/data"));
+ Node<Object, Object> parent;// = cache2.getRoot().getChild(Fqn.fromString("/org/jboss/test/data"));
parent = cache2.getRoot().getChild(Fqn.fromString("/org/jboss/data"));
Set children = parent.getChildren();
//4999 because the root of the region will also be counted, as it is not resident
@@ -579,9 +580,10 @@
boolean sawBaseDecrease = false;
boolean sawDataDecrease = false;
long start = System.currentTimeMillis();
+ Node root = cache2.getRoot();
while ((System.currentTimeMillis() - start) < 10000)
{
- parent = cache2.getRoot().getChild(Fqn.fromString("/org/jboss/test/data"));
+ parent = root.getChild(Fqn.fromString("/org/jboss/test/data"));
children = parent.getChildren();
if (children != null)
{
@@ -678,6 +680,7 @@
this.caches = caches;
}
+ @SuppressWarnings("unchecked")
void useCache() throws Exception
{
System.out.println("---- Cache" + name + " = " + cache.getLocalAddress() + " being used");
@@ -751,7 +754,7 @@
int i = 0;
Fqn fqn = null;
- boolean acquired = false;
+ boolean acquired;
while (!stopped)
{
if (i > 0)
Modified: core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransferTestBase.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransferTestBase.java 2008-09-03 04:55:50 UTC (rev 6685)
+++ core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransferTestBase.java 2008-09-03 05:41:51 UTC (rev 6686)
@@ -128,7 +128,6 @@
CacheMode mode = sync ? CacheMode.REPL_SYNC : CacheMode.REPL_ASYNC;
Configuration c = UnitTestCacheConfigurationFactory.createConfiguration(mode);
- c.setNodeLockingScheme(NodeLockingScheme.PESSIMISTIC);
if (sync)
{
@@ -169,6 +168,7 @@
protected void additionalConfiguration(Configuration c)
{
// to be overridden
+ c.setNodeLockingScheme(NodeLockingScheme.PESSIMISTIC);
}
protected void createAndActivateRegion(CacheSPI<Object, Object> c, Fqn f)
17 years, 3 months
JBoss Cache SVN: r6685 - searchable/trunk/src/test/resources.
by jbosscache-commits@lists.jboss.org
Author: navssurtani
Date: 2008-09-03 00:55:50 -0400 (Wed, 03 Sep 2008)
New Revision: 6685
Modified:
searchable/trunk/src/test/resources/log4j.xml
Log:
Started profiling
Modified: searchable/trunk/src/test/resources/log4j.xml
===================================================================
--- searchable/trunk/src/test/resources/log4j.xml 2008-09-03 04:53:02 UTC (rev 6684)
+++ searchable/trunk/src/test/resources/log4j.xml 2008-09-03 04:55:50 UTC (rev 6685)
@@ -83,7 +83,7 @@
</category>
<category name="org.jgroups">
- <priority value="INFO"/>
+ <priority value="WARN"/>
</category>
<!-- ======================= -->
17 years, 3 months
JBoss Cache SVN: r6684 - searchable/trunk/src/test/java/org/jboss/cache/search/blackbox.
by jbosscache-commits@lists.jboss.org
Author: navssurtani
Date: 2008-09-03 00:53:02 -0400 (Wed, 03 Sep 2008)
New Revision: 6684
Modified:
searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalCacheTest.java
Log:
Started profiling
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalCacheTest.java
===================================================================
--- searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalCacheTest.java 2008-09-03 03:58:46 UTC (rev 6683)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalCacheTest.java 2008-09-03 04:53:02 UTC (rev 6684)
@@ -15,9 +15,7 @@
import org.jboss.cache.search.SearchableCacheFactory;
import org.jboss.cache.search.helper.IndexCleanUp;
import org.jboss.cache.search.test.Person;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
+import org.testng.annotations.*;
import java.util.List;
import java.util.Iterator;
@@ -45,7 +43,7 @@
String key2 = "BigGoat";
String key3 = "MiniGoat";
- @BeforeMethod
+ @BeforeTest
public void setUp()
{
Cache coreCache = new DefaultCacheFactory().createCache();
@@ -74,7 +72,7 @@
}
- @AfterMethod
+ @AfterTest
public void tearDown()
{
if (searchableCache != null) searchableCache.stop();
@@ -106,6 +104,7 @@
}
+ @Test (invocationCount = 200000)
public void testMultipleResults() throws ParseException
{
17 years, 3 months
JBoss Cache SVN: r6683 - core/trunk/src/test/java/org/jboss/cache/statetransfer.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-09-02 23:58:46 -0400 (Tue, 02 Sep 2008)
New Revision: 6683
Modified:
core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransferConcurrencyTest.java
core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransferTestBase.java
Log:
removed infinite wait
Modified: core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransferConcurrencyTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransferConcurrencyTest.java 2008-09-03 03:38:06 UTC (rev 6682)
+++ core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransferConcurrencyTest.java 2008-09-03 03:58:46 UTC (rev 6683)
@@ -487,12 +487,14 @@
// We expect a VISIT event for / and ADD events for /a, /a/b and /a/b/c
int nodeEventQueueSize = region.getEvictionEventQueue().size();
int i = 0;
- while (nodeEventQueueSize > 0)
+ int events = nodeEventQueueSize;
+ while (events > 0)
{
System.out.println(++i + ") Queue contains : " + region.getEvictionEventQueue().poll(0, TimeUnit.MILLISECONDS));
+ events = region.getEvictionEventQueue().size();
}
- assertEquals("Saw the expected number of node events", 4, nodeEventQueueSize);
+ assertEquals("Saw the expected number of node events", 5, nodeEventQueueSize);
}
/**
Modified: core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransferTestBase.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransferTestBase.java 2008-09-03 03:38:06 UTC (rev 6682)
+++ core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransferTestBase.java 2008-09-03 03:58:46 UTC (rev 6683)
@@ -29,6 +29,7 @@
import org.jboss.cache.Region;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.Configuration.CacheMode;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
import org.jboss.cache.loader.AbstractCacheLoaderTestBase;
import org.jboss.cache.loader.CacheLoader;
@@ -127,6 +128,7 @@
CacheMode mode = sync ? CacheMode.REPL_SYNC : CacheMode.REPL_ASYNC;
Configuration c = UnitTestCacheConfigurationFactory.createConfiguration(mode);
+ c.setNodeLockingScheme(NodeLockingScheme.PESSIMISTIC);
if (sync)
{
17 years, 3 months
JBoss Cache SVN: r6682 - core/trunk/src/main/java/org/jboss/cache/eviction.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-09-02 23:38:06 -0400 (Tue, 02 Sep 2008)
New Revision: 6682
Modified:
core/trunk/src/main/java/org/jboss/cache/eviction/EvictionTimerTask.java
Log:
Make sure the eviction thread is a daemon
Modified: core/trunk/src/main/java/org/jboss/cache/eviction/EvictionTimerTask.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/eviction/EvictionTimerTask.java 2008-09-02 17:13:03 UTC (rev 6681)
+++ core/trunk/src/main/java/org/jboss/cache/eviction/EvictionTimerTask.java 2008-09-03 03:38:06 UTC (rev 6682)
@@ -105,7 +105,9 @@
{
public Thread newThread(Runnable r)
{
- return new Thread(r, "EvictionTimer-" + tcount.getAndIncrement());
+ Thread t = new Thread(r, "EvictionTimer-" + tcount.getAndIncrement());
+ t.setDaemon(true);
+ return t;
}
});
scheduledExecutor.scheduleWithFixedDelay(task, wakeupInterval, wakeupInterval, TimeUnit.MILLISECONDS);
17 years, 3 months