JBoss Cache SVN: r6782 - in core/branches/1.4.X: tests/functional/org/jboss/cache/marshall and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-09-23 10:58:35 -0400 (Tue, 23 Sep 2008)
New Revision: 6782
Modified:
core/branches/1.4.X/src/org/jboss/cache/marshall/TreeCacheMarshaller140.java
core/branches/1.4.X/tests/functional/org/jboss/cache/marshall/TreeCacheMarshaller140Test.java
Log:
JBCACHE-1412: Marshaller uses equals() to test object equality instead of identity when performing reference counting
Modified: core/branches/1.4.X/src/org/jboss/cache/marshall/TreeCacheMarshaller140.java
===================================================================
--- core/branches/1.4.X/src/org/jboss/cache/marshall/TreeCacheMarshaller140.java 2008-09-23 14:52:26 UTC (rev 6781)
+++ core/branches/1.4.X/src/org/jboss/cache/marshall/TreeCacheMarshaller140.java 2008-09-23 14:58:35 UTC (rev 6782)
@@ -30,6 +30,7 @@
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
+import java.util.IdentityHashMap;
/**
* An enhanced marshaller for RPC calls between TreeCache instances.
@@ -74,7 +75,7 @@
public void objectToStream(Object o, ObjectOutputStream out) throws Exception
{
if (log.isTraceEnabled()) log.trace("Marshalling object " + o);
- Map refMap = new HashMap();
+ Map refMap = new IdentityHashMap();
if (useRegionBasedMarshalling)
{
@@ -108,7 +109,7 @@
public Object objectFromStream(ObjectInputStream in) throws Exception
{
Object retValue;
- Map refMap = new HashMap();
+ Map refMap = new IdentityHashMap();
if (useRegionBasedMarshalling)
{
Modified: core/branches/1.4.X/tests/functional/org/jboss/cache/marshall/TreeCacheMarshaller140Test.java
===================================================================
--- core/branches/1.4.X/tests/functional/org/jboss/cache/marshall/TreeCacheMarshaller140Test.java 2008-09-23 14:52:26 UTC (rev 6781)
+++ core/branches/1.4.X/tests/functional/org/jboss/cache/marshall/TreeCacheMarshaller140Test.java 2008-09-23 14:58:35 UTC (rev 6782)
@@ -11,6 +11,10 @@
import org.jgroups.stack.IpAddress;
import java.io.ObjectInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectOutputStream;
+import java.io.ByteArrayInputStream;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -18,6 +22,7 @@
import java.util.LinkedList;
import java.util.TreeMap;
import java.util.TreeSet;
+import java.util.List;
/**
* @author <a href="mailto:manik@jboss.org">Manik Surtani (manik(a)jboss.org)</a>
@@ -31,6 +36,39 @@
expectedMarshallerClass = TreeCacheMarshaller140.class;
}
+ public void testBadEquals() throws Exception
+ {
+ // object1 and Object2 should NOT be equal, even though their equals() methods are broken.
+ Broken o1 = new Broken();
+ Broken o2 = new Broken();
+
+ o1.name = "o1";
+ o2.name = "o2";
+
+ assertNotSame(o1, o2);
+ assertEquals(o1, o2);
+
+ List l = new ArrayList(2); // lists will allow "duplicate" entries.
+ l.add(o1);
+ l.add(o2);
+
+ TreeCacheMarshaller140 marsh = new TreeCacheMarshaller140(null, false, false);
+ ByteArrayOutputStream bout = new ByteArrayOutputStream();
+ ObjectOutputStream out = new ObjectOutputStream(bout);
+ marsh.objectToStream(l, out);
+ out.close();
+ ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bout.toByteArray()));
+ List l2 = (List) marsh.objectFromStream(in);
+
+ assertEquals(l2.size(), 2);
+ assertEquals("o1", ((Broken) l2.get(0)).name);
+ assertEquals("o2", ((Broken) l2.get(1)).name);
+
+ assertNotSame(l2.get(0), l2.get(1));
+ assertEquals(l2.get(0), l2.get(1));
+ }
+
+
public void testKnownCollectionMagicNumbers() throws Exception
{
doMagicNumberTest(new ArrayList(), TreeCacheMarshaller140.MAGICNUMBER_ARRAY_LIST);
@@ -73,3 +111,18 @@
assertEquals("Magic number mismatch", magicNumber, magicNumberFound);
}
}
+
+class Broken implements Serializable
+{
+ String name;
+
+ public boolean equals(Object o)
+ {
+ return true;
+ }
+
+ public int hashCode()
+ {
+ return 10;
+ }
+}
15 years, 7 months
JBoss Cache SVN: r6781 - in core/branches/2.2.X/src: test/java/org/jboss/cache/marshall and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-09-23 10:52:26 -0400 (Tue, 23 Sep 2008)
New Revision: 6781
Modified:
core/branches/2.2.X/src/main/java/org/jboss/cache/marshall/CacheMarshaller200.java
core/branches/2.2.X/src/test/java/org/jboss/cache/marshall/CacheMarshaller200Test.java
Log:
JBCACHE-1412: Marshaller uses equals() to test object equality instead of identity when performing reference counting
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/marshall/CacheMarshaller200.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/marshall/CacheMarshaller200.java 2008-09-23 14:52:05 UTC (rev 6780)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/marshall/CacheMarshaller200.java 2008-09-23 14:52:26 UTC (rev 6781)
@@ -28,6 +28,7 @@
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.IdentityHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -146,7 +147,7 @@
public void objectToObjectStream(Object o, ObjectOutputStream out, Fqn region) throws Exception
{
if (trace) log.trace("Marshalling object " + o);
- Map<Object, Integer> refMap = useRefs ? new HashMap<Object, Integer>() : null;
+ Map<Object, Integer> refMap = useRefs ? new IdentityHashMap<Object, Integer>() : null;
ClassLoader toUse = defaultClassLoader;
Thread current = Thread.currentThread();
ClassLoader old = current.getContextClassLoader();
Modified: core/branches/2.2.X/src/test/java/org/jboss/cache/marshall/CacheMarshaller200Test.java
===================================================================
--- core/branches/2.2.X/src/test/java/org/jboss/cache/marshall/CacheMarshaller200Test.java 2008-09-23 14:52:05 UTC (rev 6780)
+++ core/branches/2.2.X/src/test/java/org/jboss/cache/marshall/CacheMarshaller200Test.java 2008-09-23 14:52:26 UTC (rev 6781)
@@ -16,6 +16,8 @@
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ExecutorService;
@@ -32,6 +34,38 @@
expectedMarshallerClass = CacheMarshaller200.class;
}
+ public void testBadEquals() throws Exception
+ {
+ // object1 and Object2 should NOT be equal, even though their equals() methods are broken.
+ Broken o1 = new Broken();
+ Broken o2 = new Broken();
+
+ o1.name = "o1";
+ o2.name = "o2";
+
+ assert o1 != o2;
+ assert o1.equals(o2);
+
+ List<Broken> l = new ArrayList<Broken>(2); // lists will allow "duplicate" entries.
+ l.add(o1);
+ l.add(o2);
+
+ CacheMarshaller200 cm200 = new CacheMarshaller200();
+ ByteArrayOutputStream bout = new ByteArrayOutputStream();
+ ObjectOutputStream out = new ObjectOutputStream(bout);
+ cm200.objectToObjectStream(l, out);
+ out.close();
+ ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bout.toByteArray()));
+ List<Broken> l2 = (List<Broken>) cm200.objectFromObjectStream(in);
+
+ assert l2.size() == 2;
+ assert l2.get(0).name.equals("o1");
+ assert l2.get(1).name.equals("o2");
+
+ assert l2.get(0) != l2.get(1);
+ assert l2.get(0).equals(l2.get(1));
+ }
+
public void testRegionalisedStream() throws Exception
{
// need to test what's going on with
@@ -205,3 +239,21 @@
assert throwables.size() == 0 : "Should not have caught any exceptions!";
}
}
+
+class Broken implements Serializable
+{
+ String name;
+
+ @Override
+ public boolean equals(Object o)
+ {
+ return true;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return 10;
+ }
+}
+
15 years, 7 months
JBoss Cache SVN: r6780 - in core/trunk/src: test/java/org/jboss/cache/marshall and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-09-23 10:52:05 -0400 (Tue, 23 Sep 2008)
New Revision: 6780
Modified:
core/trunk/src/main/java/org/jboss/cache/marshall/CacheMarshaller200.java
core/trunk/src/test/java/org/jboss/cache/marshall/CacheMarshaller200Test.java
Log:
JBCACHE-1412: Marshaller uses equals() to test object equality instead of identity when performing reference counting
Modified: core/trunk/src/main/java/org/jboss/cache/marshall/CacheMarshaller200.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/marshall/CacheMarshaller200.java 2008-09-23 11:39:22 UTC (rev 6779)
+++ core/trunk/src/main/java/org/jboss/cache/marshall/CacheMarshaller200.java 2008-09-23 14:52:05 UTC (rev 6780)
@@ -45,6 +45,7 @@
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.IdentityHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -170,7 +171,7 @@
public void objectToObjectStream(Object o, ObjectOutputStream out, Fqn region) throws Exception
{
if (trace) log.trace("Marshalling object " + o);
- Map<Object, Integer> refMap = useRefs ? new HashMap<Object, Integer>() : null;
+ Map<Object, Integer> refMap = useRefs ? new IdentityHashMap<Object, Integer>() : null;
ClassLoader toUse = defaultClassLoader;
Thread current = Thread.currentThread();
ClassLoader old = current.getContextClassLoader();
Modified: core/trunk/src/test/java/org/jboss/cache/marshall/CacheMarshaller200Test.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/marshall/CacheMarshaller200Test.java 2008-09-23 11:39:22 UTC (rev 6779)
+++ core/trunk/src/test/java/org/jboss/cache/marshall/CacheMarshaller200Test.java 2008-09-23 14:52:05 UTC (rev 6780)
@@ -18,6 +18,8 @@
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ExecutorService;
@@ -34,6 +36,38 @@
expectedMarshallerClass = CacheMarshaller200.class;
}
+ public void testBadEquals() throws Exception
+ {
+ // object1 and Object2 should NOT be equal, even though their equals() methods are broken.
+ Broken o1 = new Broken();
+ Broken o2 = new Broken();
+
+ o1.name = "o1";
+ o2.name = "o2";
+
+ assert o1 != o2;
+ assert o1.equals(o2);
+
+ List<Broken> l = new ArrayList<Broken>(2); // lists will allow "duplicate" entries.
+ l.add(o1);
+ l.add(o2);
+
+ CacheMarshaller200 cm200 = new CacheMarshaller200();
+ ByteArrayOutputStream bout = new ByteArrayOutputStream();
+ ObjectOutputStream out = new ObjectOutputStream(bout);
+ cm200.objectToObjectStream(l, out);
+ out.close();
+ ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bout.toByteArray()));
+ List<Broken> l2 = (List<Broken>) cm200.objectFromObjectStream(in);
+
+ assert l2.size() == 2;
+ assert l2.get(0).name.equals("o1");
+ assert l2.get(1).name.equals("o2");
+
+ assert l2.get(0) != l2.get(1);
+ assert l2.get(0).equals(l2.get(1));
+ }
+
public void testRegionalisedStream() throws Exception
{
CacheMarshaller200 cm200 = new CacheMarshaller200();
@@ -208,3 +242,20 @@
assert throwables.size() == 0 : "Should not have caught any exceptions!";
}
}
+
+class Broken implements Serializable
+{
+ String name;
+
+ @Override
+ public boolean equals(Object o)
+ {
+ return true;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return 10;
+ }
+}
15 years, 7 months
Build failed in Hudson: jboss-cache-core-2.2.X-jdk1.5 » JBoss Cache - Core Edition #33
by jboss-qa-internal@redhat.com
See http://hudson.qa.jboss.com/hudson/job/jboss-cache-core-2.2.X-jdk1.5/org.j...
Changes:
[manik.surtani(a)jboss.com] Updated tests
[manik.surtani(a)jboss.com] UPdated JGroups
[manik.surtani(a)jboss.com] Updated test
[manik.surtani(a)jboss.com] Updated to make it JGroups 2.6.4-friendly
------------------------------------------
[...truncated 70850 lines...]
-- wakeupInterval is 1000
-- Marking as in-use
-- wakeupInterval is 1000
org.jboss.cache.DataContainerImpl [14 nodes, 0 locks]
org.jboss.cache.DataContainerImpl [9 nodes, 0 locks]
-- wakeupInterval is 1000
-- wakeupInterval is 1000
-- period is 1000
-- wakeupInterval is 1000
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 59.252 sec
Running org.jboss.cache.multiplexer.ChannelInjectionPreferenceTest (of functional,unit)
-------------------------------------------------------
GMS: address is 127.0.0.1:33958
-------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.19 sec
Running org.jboss.cache.transaction.IsolationLevelRepeatableReadTest (of functional,unit)
reader thread exits
writer thread exits
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.524 sec
Running org.jboss.cache.factories.InterceptorChainFactoryTest (of functional,unit)
testTxConfig interceptors are:
[org.jboss.cache.interceptors.InvocationContextInterceptor@162e295, org.jboss.cache.interceptors.TxInterceptor@109de5b, org.jboss.cache.interceptors.NotificationInterceptor@e53220, org.jboss.cache.interceptors.PessimisticLockInterceptor@13e0aba, org.jboss.cache.interceptors.CallInterceptor@3257b8]
testBareConfig interceptors are:
[org.jboss.cache.interceptors.InvocationContextInterceptor@183e7de, org.jboss.cache.interceptors.TxInterceptor@ebcdbb, org.jboss.cache.interceptors.NotificationInterceptor@10fe2b9, org.jboss.cache.interceptors.PessimisticLockInterceptor@1ee148b, org.jboss.cache.interceptors.CallInterceptor@186d484]
testEvictionInterceptorConfig interceptors are:
[org.jboss.cache.interceptors.InvocationContextInterceptor@1a1399, org.jboss.cache.interceptors.CacheMgmtInterceptor@1fcc0a2, org.jboss.cache.interceptors.OptimisticTxInterceptor@caf6c1, org.jboss.cache.interceptors.NotificationInterceptor@10e35d5, org.jboss.cache.interceptors.OptimisticReplicationInterceptor@1f03691, org.jboss.cache.interceptors.DataGravitatorInterceptor@18e8541, org.jboss.cache.interceptors.OptimisticLockingInterceptor@1ce85c4, org.jboss.cache.interceptors.OptimisticValidatorInterceptor@1b03c1a, org.jboss.cache.interceptors.OptimisticCreateIfNotExistsInterceptor@139e351, org.jboss.cache.interceptors.OptimisticNodeInterceptor@17aece8, org.jboss.cache.interceptors.CallInterceptor@1578aab]
testEvictionInterceptorConfig interceptors are:
[org.jboss.cache.interceptors.InvocationContextInterceptor@2e323, org.jboss.cache.interceptors.CacheMgmtInterceptor@18e4327, org.jboss.cache.interceptors.TxInterceptor@dada24, org.jboss.cache.interceptors.NotificationInterceptor@2798e7, org.jboss.cache.interceptors.PessimisticLockInterceptor@1a78071, org.jboss.cache.interceptors.EvictionInterceptor@1e184cb, org.jboss.cache.interceptors.CallInterceptor@d55986]
testEvictionInterceptorConfig interceptors are:
[org.jboss.cache.interceptors.InvocationContextInterceptor@12f1bf0, org.jboss.cache.interceptors.CacheMgmtInterceptor@1d32e45, org.jboss.cache.interceptors.TxInterceptor@182ef6b, org.jboss.cache.interceptors.NotificationInterceptor@1347124, org.jboss.cache.interceptors.ReplicationInterceptor@1f02b85, org.jboss.cache.interceptors.PessimisticLockInterceptor@b957ea, org.jboss.cache.interceptors.DataGravitatorInterceptor@3aff84, org.jboss.cache.interceptors.CallInterceptor@15d4de6]
testTxAndRepl interceptors are:
[org.jboss.cache.interceptors.InvocationContextInterceptor@1546dbc, org.jboss.cache.interceptors.TxInterceptor@1f08ed8, org.jboss.cache.interceptors.NotificationInterceptor@322bce, org.jboss.cache.interceptors.ReplicationInterceptor@1d9e282, org.jboss.cache.interceptors.PessimisticLockInterceptor@1a5db4b, org.jboss.cache.interceptors.CallInterceptor@1e0512a]
testUnsharedCacheLoaderConfig interceptors are:
[org.jboss.cache.interceptors.InvocationContextInterceptor@14eaec9, org.jboss.cache.interceptors.TxInterceptor@b533b8, org.jboss.cache.interceptors.NotificationInterceptor@569c60, org.jboss.cache.interceptors.ReplicationInterceptor@3468f4, org.jboss.cache.interceptors.PessimisticLockInterceptor@d67067, org.jboss.cache.interceptors.CacheLoaderInterceptor@6db724, org.jboss.cache.interceptors.CacheStoreInterceptor@112da40, org.jboss.cache.interceptors.CallInterceptor@b6d6ab]
testCacheMgmtConfig interceptors are:
[org.jboss.cache.interceptors.InvocationContextInterceptor@602b6b, org.jboss.cache.interceptors.CacheMgmtInterceptor@1c297a3, org.jboss.cache.interceptors.TxInterceptor@717323, org.jboss.cache.interceptors.NotificationInterceptor@3e1bc8, org.jboss.cache.interceptors.PessimisticLockInterceptor@191f801, org.jboss.cache.interceptors.CallInterceptor@313170]
testSharedCacheLoaderConfig interceptors are:
[org.jboss.cache.interceptors.InvocationContextInterceptor@4310d0, org.jboss.cache.interceptors.TxInterceptor@104fc23, org.jboss.cache.interceptors.NotificationInterceptor@457d21, org.jboss.cache.interceptors.ReplicationInterceptor@1a0ae6, org.jboss.cache.interceptors.PessimisticLockInterceptor@1c18a4c, org.jboss.cache.interceptors.CacheLoaderInterceptor@15e92d7, org.jboss.cache.interceptors.CacheStoreInterceptor@1fa681c, org.jboss.cache.interceptors.CallInterceptor@c92507]
Tests run: 14, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.133 sec
Running org.jboss.cache.transaction.SuspendTxTest (of functional,unit)
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.804 sec
Running org.jboss.cache.mgmt.PassivationTest (of functional,unit)
count of misses 0
DummyInMemoryCacheLoader debug: Getting data for fqn /Europe/Austria = null
DummyInMemoryCacheLoader debug: Performing exists() on /Europe/Austria
DummyInMemoryCacheLoader debug: Getting data for fqn /Europe/Poland = null
DummyInMemoryCacheLoader debug: Did a put on /Europe/Austria, data is {population=8184691, currency=Euro, capital=VIENNA}
DummyInMemoryCacheLoader debug: Getting data for fqn /Europe/Austria = {population=8184691, currency=Euro, capital=VIENNA}
DummyInMemoryCacheLoader debug: Performing exists() on /Europe/Austria
DummyInMemoryCacheLoader debug: Calling getChildrenNames on Fqn /Europe/Austria. Data map = {/Europe=Node{data={}, fqn=/Europe}, /=Node{data={}, fqn=/}, /Europe/Austria=Node{data={population=8184691, currency=Euro, capital=VIENNA}, fqn=/Europe/Austria}}
DummyInMemoryCacheLoader debug: Fqn /Europe/Austria has children []
DummyInMemoryCacheLoader debug: Removing fqn /Europe/Austria
DummyInMemoryCacheLoader debug: Performing exists() on /Europe/Austria
DummyInMemoryCacheLoader debug: Removing fqn /Europe/Austria
DummyInMemoryCacheLoader debug: Performing exists() on /Europe/Austria
DummyInMemoryCacheLoader debug: Getting data for fqn /Europe/Austria = null
DummyInMemoryCacheLoader debug: Getting data for fqn /Europe/Austria = null
DummyInMemoryCacheLoader debug: Getting data for fqn /Europe/Poland = null
DummyInMemoryCacheLoader debug: Performing exists() on /Europe/Poland
DummyInMemoryCacheLoader debug: Performing exists() on /Europe/Poland
DummyInMemoryCacheLoader debug: Did a put on /Europe/Poland, data is {currency=Zloty, capital=Warsaw}
DummyInMemoryCacheLoader debug: Getting data for fqn /Europe/Poland = {currency=Zloty, capital=Warsaw}
DummyInMemoryCacheLoader debug: Performing exists() on /Europe/Poland
DummyInMemoryCacheLoader debug: Calling getChildrenNames on Fqn /Europe/Poland. Data map = {/Europe/Poland=Node{data={currency=Zloty, capital=Warsaw}, fqn=/Europe/Poland}, /Europe=Node{data={}, fqn=/Europe}, /=Node{data={}, fqn=/}}
DummyInMemoryCacheLoader debug: Fqn /Europe/Poland has children []
DummyInMemoryCacheLoader debug: Removing fqn /Europe/Poland
DummyInMemoryCacheLoader debug: Did a put on /Europe/Poland, data is {currency=Zloty, capital=Warsaw}
DummyInMemoryCacheLoader debug: Getting data for fqn /Europe/Poland = {currency=Zloty, capital=Warsaw}
DummyInMemoryCacheLoader debug: Performing exists() on /Europe/Poland
DummyInMemoryCacheLoader debug: Calling getChildrenNames on Fqn /Europe/Poland. Data map = {/Europe/Poland=Node{data={currency=Zloty, capital=Warsaw}, fqn=/Europe/Poland}, /Europe=Node{data={}, fqn=/Europe}, /=Node{data={}, fqn=/}}
DummyInMemoryCacheLoader debug: Fqn /Europe/Poland has children []
DummyInMemoryCacheLoader debug: Removing fqn /Europe/Poland
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.622 sec
Running org.jboss.cache.CacheFactoryTest (of functional,unit)
-------------------------------------------------------
GMS: address is 127.0.0.1:33958
-------------------------------------------------------
-------------------------------------------------------
GMS: address is 127.0.0.1:33959
-------------------------------------------------------
-------------------------------------------------------
GMS: address is 127.0.0.1:33960
-------------------------------------------------------
-------------------------------------------------------
GMS: address is 127.0.0.1:33961
-------------------------------------------------------
-------------------------------------------------------
GMS: address is 127.0.0.1:33962
-------------------------------------------------------
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 11.697 sec
Running org.jboss.cache.eviction.ElementSizeAlgorithmTest (of functional,unit)
Fqn: /a/b/6 CreateTime: 1221586888216 NodeVisits: 7 ModifiedTime: 1221586888216 NumberOfElements: 6 CurrentlyInUse: false
Fqn: /a/b/4 CreateTime: 1221586888216 NodeVisits: 5 ModifiedTime: 1221586888216 NumberOfElements: 4 CurrentlyInUse: false
Fqn: /a/b/2 CreateTime: 1221586888216 NodeVisits: 3 ModifiedTime: 1221586888215 NumberOfElements: 2 CurrentlyInUse: false
Fqn: /a/b/0 CreateTime: 1221586888216 NodeVisits: 1 ModifiedTime: 1221586888215 NumberOfElements: 0 CurrentlyInUse: false
Fqn: /a/b/1 CreateTime: 1221586888216 NodeVisits: 1 ModifiedTime: 1221586888215 NumberOfElements: 0 CurrentlyInUse: false
Fqn: /a/b/3 CreateTime: 1221586888216 NodeVisits: 1 ModifiedTime: 1221586888215 NumberOfElements: 0 CurrentlyInUse: false
Fqn: /a/b/5 CreateTime: 1221586888216 NodeVisits: 1 ModifiedTime: 1221586888216 NumberOfElements: 0 CurrentlyInUse: false
Fqn: /a/b/7 CreateTime: 1221586888216 NodeVisits: 1 ModifiedTime: 1221586888216 NumberOfElements: 0 CurrentlyInUse: false
Fqn: /a/b/9 CreateTime: 1221586888216 NodeVisits: 1 ModifiedTime: 1221586888216 NumberOfElements: 0 CurrentlyInUse: false
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.311 sec
Running org.jboss.cache.eviction.LFUPolicyTest (of functional,unit)
-- wakeupInterval is 3000
-- sleeping for 3500ms
-- wakeupInterval is 3000
-- nodes/locks: 6/4
-- nodes/locks: 3003/3
-- nodes/locks: 7786/0
-- nodes/locks: 11314/3
-- nodes/locks: 16440/2
-- nodes/locks: 21724/0
-- nodes/locks: 26093/0
-- nodes/locks: 31575/0
-- nodes/locks: 34765/0
-- nodes/locks: 39188/0
-- nodes/locks: 44954/0
-- wakeupInterval is 3000
-- wakeupInterval is 3000
-- period is 3500
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 35.943 sec
Running org.jboss.cache.optimistic.NodeInterceptorRemoveKeyValTest (of functional,unit)
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.037 sec
Running org.jboss.cache.loader.SharedCacheLoaderTest (of functional,unit)
-------------------------------------------------------
GMS: address is 127.0.0.1:33958
-------------------------------------------------------
-------------------------------------------------------
GMS: address is 127.0.0.1:33959
-------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.579 sec
Running org.jboss.cache.loader.PreloadTest (of functional,unit)
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.026 sec
Results :
Failed tests:
Tests run: 2750, Failures: 1, Errors: 0, Skipped: 0
[ERROR] There are test failures.
[HUDSON] Recording test results
[INFO] Preparing surefire-report:report-only
[INFO] Reloading plugin container for: org.jboss.maven.plugins:maven-jdocbook-plugin. The plugin artifact has changed.
[INFO] Reloading plugin container for: org.apache.maven.plugins:maven-compiler-plugin. The plugin artifact has changed.
[INFO] Reloading plugin container for: org.apache.maven.plugins:maven-assembly-plugin. The plugin artifact has changed.
[INFO] Reloading plugin container for: org.apache.maven.plugins:maven-jar-plugin. The plugin artifact has changed.
[INFO] Reloading plugin container for: org.apache.maven.plugins:maven-surefire-plugin. The plugin artifact has changed.
[INFO] Reloading plugin container for: org.apache.maven.plugins:maven-javadoc-plugin. The plugin artifact has changed.
[INFO] Reloading plugin container for: org.apache.maven.plugins:maven-eclipse-plugin. The plugin artifact has changed.
[INFO] Reloading plugin container for: org.apache.maven.plugins:maven-jxr-plugin. The plugin artifact has changed.
[INFO] Reloading plugin container for: org.apache.maven.plugins:maven-pmd-plugin. The plugin artifact has changed.
[INFO] Reloading plugin container for: org.apache.maven.plugins:maven-surefire-report-plugin. The plugin artifact has changed.
[INFO] Reloading plugin container for: org.codehaus.mojo:findbugs-maven-plugin. The plugin artifact has changed.
[INFO] Reloading plugin container for: org.codehaus.mojo:javancss-maven-plugin. The plugin artifact has changed.
[INFO] Reloading plugin container for: org.codehaus.mojo:taglist-maven-plugin. The plugin artifact has changed.
[INFO] Reloading plugin container for: org.apache.maven.plugins:maven-project-info-reports-plugin. The plugin artifact has changed.
[INFO] [enforcer:enforce {execution: enforce-java}]
[INFO] Preparing findbugs:findbugs
[INFO] [enforcer:enforce {execution: enforce-java}]
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [site:site]
[FATAL ERROR] org.apache.maven.plugins.site.SiteMojo#execute() caused a linkage error (java.lang.NoClassDefFoundError) and may be out-of-date. Check the realms:
[FATAL ERROR] Plugin realm = app0.child-container[org.apache.maven.plugins:maven-site-plugin]
urls[0] = file:/home/hudson/.m2/repository/org/apache/maven/plugins/maven-site-plugin/2.0-beta-6/maven-site-plugin-2.0-beta-6.jar
urls[1] = file:/home/hudson/.m2/repository/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.jar
urls[2] = file:/home/hudson/.m2/repository/org/apache/maven/doxia/doxia-module-xhtml/1.0-alpha-10/doxia-module-xhtml-1.0-alpha-10.jar
urls[3] = file:/home/hudson/.m2/repository/org/apache/maven/doxia/doxia-core/1.0-alpha-10/doxia-core-1.0-alpha-10.jar
urls[4] = file:/home/hudson/.m2/repository/org/apache/maven/doxia/doxia-decoration-model/1.0-alpha-10/doxia-decoration-model-1.0-alpha-10.jar
urls[5] = file:/home/hudson/.m2/repository/org/apache/maven/doxia/doxia-site-renderer/1.0-alpha-10/doxia-site-renderer-1.0-alpha-10.jar
urls[6] = file:/home/hudson/.m2/repository/org/codehaus/plexus/plexus-i18n/1.0-beta-7/plexus-i18n-1.0-beta-7.jar
urls[7] = file:/home/hudson/.m2/repository/org/codehaus/plexus/plexus-velocity/1.1.7/plexus-velocity-1.1.7.jar
urls[8] = file:/home/hudson/.m2/repository/org/apache/velocity/velocity/1.5/velocity-1.5.jar
urls[9] = file:/home/hudson/.m2/repository/commons-collections/commons-collections/3.2/commons-collections-3.2.jar
urls[10] = file:/home/hudson/.m2/repository/commons-lang/commons-lang/2.1/commons-lang-2.1.jar
urls[11] = file:/home/hudson/.m2/repository/oro/oro/2.0.8/oro-2.0.8.jar
urls[12] = file:/home/hudson/.m2/repository/org/apache/maven/doxia/doxia-module-apt/1.0-alpha-10/doxia-module-apt-1.0-alpha-10.jar
urls[13] = file:/home/hudson/.m2/repository/org/apache/maven/doxia/doxia-module-fml/1.0-alpha-10/doxia-module-fml-1.0-alpha-10.jar
urls[14] = file:/home/hudson/.m2/repository/org/apache/maven/doxia/doxia-module-xdoc/1.0-alpha-10/doxia-module-xdoc-1.0-alpha-10.jar
urls[15] = file:/home/hudson/.m2/repository/org/codehaus/plexus/plexus-archiver/1.0-alpha-7/plexus-archiver-1.0-alpha-7.jar
urls[16] = file:/home/hudson/.m2/repository/org/mortbay/jetty/jetty/6.1.5/jetty-6.1.5.jar
urls[17] = file:/home/hudson/.m2/repository/org/mortbay/jetty/jetty-util/6.1.5/jetty-util-6.1.5.jar
urls[18] = file:/home/hudson/.m2/repository/org/mortbay/jetty/servlet-api-2.5/6.1.5/servlet-api-2.5-6.1.5.jar
[FATAL ERROR] Container realm = plexus.core.maven
urls[0] = file:/home/hudson/.m2/repository/slide/slide-webdavlib/2.1/slide-webdavlib-2.1.jar
urls[1] = file:/home/hudson/.m2/repository/commons-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.jar
urls[2] = file:/home/hudson/.m2/repository/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar
urls[3] = file:/home/hudson/.m2/repository/jdom/jdom/1.0/jdom-1.0.jar
urls[4] = file:/home/hudson/.m2/repository/de/zeigermann/xml/xml-im-exporter/1.1/xml-im-exporter-1.1.jar
urls[5] = file:/home/hudson/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
urls[6] = file:/home/hudson/.m2/repository/org/apache/maven/wagon/wagon-webdav/1.0-beta-2/wagon-webdav-1.0-beta-2.jar
[HUDSON] Archiving /home/hudson/hudson_workspace/workspace/jboss-cache-core-2.2.X-jdk1.5/./pom.xml
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] org/apache/maven/artifact/Artifact
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.NoClassDefFoundError: org/apache/maven/artifact/Artifact
at org.apache.maven.plugin.jxr.AbstractJxrReport.constructSourceDirs(AbstractJxrReport.java:436)
at org.apache.maven.plugin.jxr.AbstractJxrReport.canGenerateReport(AbstractJxrReport.java:454)
at org.apache.maven.plugins.site.AbstractSiteRenderingMojo.filterReports(AbstractSiteRenderingMojo.java:421)
at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:77)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterceptor.java:136)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:42)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at hudson.maven.agent.Main.launch(Main.java:97)
at hudson.maven.MavenBuilder.call(MavenBuilder.java:129)
at hudson.maven.MavenBuilder.call(MavenBuilder.java:52)
at hudson.remoting.UserRequest.perform(UserRequest.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:23)
at hudson.remoting.Request$2.run(Request.java:200)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 109 minutes 19 seconds
[INFO] Finished at: Tue Sep 16 13:44:22 EDT 2008
[INFO] Final Memory: 44M/108M
[INFO] ------------------------------------------------------------------------
Waiting for Hudson to finish collecting data
15 years, 7 months
JBoss Cache SVN: r6779 - in core/branches/2.2.X/src/main/java/org/jboss/cache: lock and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-09-23 07:39:22 -0400 (Tue, 23 Sep 2008)
New Revision: 6779
Modified:
core/branches/2.2.X/src/main/java/org/jboss/cache/loader/JDBCCacheLoader.java
core/branches/2.2.X/src/main/java/org/jboss/cache/lock/StripedLock.java
Log:
JBCACHE-1410: JDBCCacheLoader may attempt to create a node entry in the DB twice
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/loader/JDBCCacheLoader.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/loader/JDBCCacheLoader.java 2008-09-23 11:39:06 UTC (rev 6778)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/loader/JDBCCacheLoader.java 2008-09-23 11:39:22 UTC (rev 6779)
@@ -240,18 +240,23 @@
Fqn currentNode = name;
do
{
- if (currentNode.equals(name))
+ try
{
- insertNode(currentNode, attributes);
+ lock.acquireLock(currentNode, true);
+ if (currentNode.equals(name))
+ {
+ insertNode(currentNode, attributes);
+ }
+ else
+ {
+ insertNode(currentNode, null);
+ }
}
- else
+ finally
{
- insertNode(currentNode, null);
+ lock.releaseLock(currentNode);
}
- if (currentNode.isRoot())
- {
- break;
- }
+ if (currentNode.isRoot()) break;
currentNode = currentNode.getParent();
}
while (!exists(currentNode));
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/lock/StripedLock.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/lock/StripedLock.java 2008-09-23 11:39:06 UTC (rev 6778)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/lock/StripedLock.java 2008-09-23 11:39:22 UTC (rev 6779)
@@ -94,8 +94,8 @@
{
lock.writeLock().unlock();
// check that we still don't have a stale WL
- if (lock.isWriteLockedByCurrentThread() && log.isWarnEnabled())
- log.warn("Write lock still exists on Fqn " + fqn + " for current thread. Perhaps this was write-locked more than once?");
+// if (lock.isWriteLockedByCurrentThread() && log.isWarnEnabled())
+// log.warn("Write lock still exists on Fqn " + fqn + " for current thread. Perhaps this was write-locked more than once?");
}
else
{
@@ -110,12 +110,12 @@
}
}
- ReentrantReadWriteLock getLock(Object o)
+ final ReentrantReadWriteLock getLock(Object o)
{
return sharedLocks[hashToIndex(o)];
}
- int hashToIndex(Object o)
+ final int hashToIndex(Object o)
{
return (hash(o) >>> lockSegmentShift) & lockSegmentMask;
}
@@ -128,7 +128,7 @@
* @param x the object serving as a key
* @return the hash code
*/
- int hash(Object x)
+ final int hash(Object x)
{
int h = x.toString().hashCode();
h += ~(h << 9);
15 years, 7 months
JBoss Cache SVN: r6778 - in core/trunk/src/main/java/org/jboss/cache: lock and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-09-23 07:39:06 -0400 (Tue, 23 Sep 2008)
New Revision: 6778
Modified:
core/trunk/src/main/java/org/jboss/cache/loader/JDBCCacheLoader.java
core/trunk/src/main/java/org/jboss/cache/lock/StripedLock.java
Log:
JBCACHE-1410: JDBCCacheLoader may attempt to create a node entry in the DB twice
Modified: core/trunk/src/main/java/org/jboss/cache/loader/JDBCCacheLoader.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/JDBCCacheLoader.java 2008-09-23 11:00:16 UTC (rev 6777)
+++ core/trunk/src/main/java/org/jboss/cache/loader/JDBCCacheLoader.java 2008-09-23 11:39:06 UTC (rev 6778)
@@ -326,18 +326,23 @@
Fqn currentNode = name;
do
{
- if (currentNode.equals(name))
+ try
{
- insertNode(currentNode, attributes);
+ lock.acquireLock(currentNode, true);
+ if (currentNode.equals(name))
+ {
+ insertNode(currentNode, attributes);
+ }
+ else
+ {
+ insertNode(currentNode, null);
+ }
}
- else
+ finally
{
- insertNode(currentNode, null);
+ lock.releaseLock(currentNode);
}
- if (currentNode.isRoot())
- {
- break;
- }
+ if (currentNode.isRoot()) break;
currentNode = currentNode.getParent();
}
while (!exists(currentNode));
Modified: core/trunk/src/main/java/org/jboss/cache/lock/StripedLock.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/lock/StripedLock.java 2008-09-23 11:00:16 UTC (rev 6777)
+++ core/trunk/src/main/java/org/jboss/cache/lock/StripedLock.java 2008-09-23 11:39:06 UTC (rev 6778)
@@ -114,8 +114,8 @@
{
lock.writeLock().unlock();
// check that we still don't have a stale WL
- if (lock.isWriteLockedByCurrentThread() && log.isWarnEnabled())
- log.warn("Write lock still exists on Fqn " + fqn + " for current thread. Perhaps this was write-locked more than once?");
+// if (lock.isWriteLockedByCurrentThread() && log.isWarnEnabled())
+// log.warn("Write lock still exists on Fqn " + fqn + " for current thread. Perhaps this was write-locked more than once?");
}
else
{
@@ -130,12 +130,12 @@
}
}
- ReentrantReadWriteLock getLock(Object o)
+ final ReentrantReadWriteLock getLock(Object o)
{
return sharedLocks[hashToIndex(o)];
}
- int hashToIndex(Object o)
+ final int hashToIndex(Object o)
{
return (hash(o) >>> lockSegmentShift) & lockSegmentMask;
}
@@ -148,7 +148,7 @@
* @param x the object serving as a key
* @return the hash code
*/
- int hash(Object x)
+ final int hash(Object x)
{
int h = x.toString().hashCode();
h += ~(h << 9);
15 years, 7 months
JBoss Cache SVN: r6777 - core/branches/2.2.X/src/test/java/org/jboss/cache/profiling.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-09-23 07:00:16 -0400 (Tue, 23 Sep 2008)
New Revision: 6777
Modified:
core/branches/2.2.X/src/test/java/org/jboss/cache/profiling/MockAsyncReplTest.java
Log:
Fixed broken test
Modified: core/branches/2.2.X/src/test/java/org/jboss/cache/profiling/MockAsyncReplTest.java
===================================================================
--- core/branches/2.2.X/src/test/java/org/jboss/cache/profiling/MockAsyncReplTest.java 2008-09-22 17:35:46 UTC (rev 6776)
+++ core/branches/2.2.X/src/test/java/org/jboss/cache/profiling/MockAsyncReplTest.java 2008-09-23 11:00:16 UTC (rev 6777)
@@ -56,27 +56,28 @@
{
AtomicInteger ai = new AtomicInteger();
Marshaller m;
- Marshaller2 m2;
+ // Marshaller2 m2;
@Override
public RspList invokeRemoteCommands(Vector<Address> dests, ReplicableCommand command, int mode, long timeout,
boolean anycasting, boolean oob, RspFilter filter) throws NotSerializableException
{
// make sure we do the marshalling though
- if (m == null && m2 == null)
+ if (m == null)// && m2 == null)
{
m = getRequestMarshaller();
- if (m instanceof Marshaller2)
+ /* if (m instanceof Marshaller2)
{
m2 = (Marshaller2) m;
m = null;
- }
+ }*/
}
try
{
- if (m2 == null) m.objectToByteBuffer(command);
- else m2.objectToBuffer(command);
+ //if (m2 == null)
+ m.objectToByteBuffer(command);
+ //else m2.objectToBuffer(command);
}
catch (Exception e)
{
15 years, 7 months