From jbosscache-commits at lists.jboss.org Wed Feb 6 20:24:19 2008 Content-Type: multipart/mixed; boundary="===============1522041934695020253==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r5318 - in core/trunk/src/test/java/org/jboss/cache: marshall and 1 other directories. Date: Wed, 06 Feb 2008 20:24:19 -0500 Message-ID: --===============1522041934695020253== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: manik.surtani(a)jboss.com Date: 2008-02-06 20:24:19 -0500 (Wed, 06 Feb 2008) New Revision: 5318 Modified: core/trunk/src/test/java/org/jboss/cache/lock/PessimisticLockTest.java core/trunk/src/test/java/org/jboss/cache/marshall/CacheMarshallerTestBas= e.java core/trunk/src/test/java/org/jboss/cache/marshall/MarshalledValueTest.ja= va core/trunk/src/test/java/org/jboss/cache/transaction/TransactionTest.java Log: Fixed broken tests Modified: core/trunk/src/test/java/org/jboss/cache/lock/PessimisticLockTest= .java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/src/test/java/org/jboss/cache/lock/PessimisticLockTest.java = 2008-02-06 16:23:32 UTC (rev 5317) +++ core/trunk/src/test/java/org/jboss/cache/lock/PessimisticLockTest.java = 2008-02-07 01:24:19 UTC (rev 5318) @@ -5,9 +5,6 @@ import org.jboss.cache.DefaultCacheFactory; import org.jboss.cache.Fqn; import org.jboss.cache.NodeSPI; -import org.jboss.cache.interceptors.PessimisticLockInterceptor; -import org.jboss.cache.interceptors.UnlockInterceptor; -import org.jboss.cache.misc.TestingUtil; import org.jboss.cache.transaction.DummyTransactionManagerLookup; import static org.testng.AssertJUnit.assertFalse; import static org.testng.AssertJUnit.assertTrue; @@ -16,7 +13,6 @@ import org.testng.annotations.Test; = import javax.transaction.TransactionManager; -import java.util.Map; = /** * basic locking test @@ -24,7 +20,7 @@ * @author Manik Surtani * @since 2.0.0 */ -(a)Test(groups =3D {"functional"}) +(a)Test(groups =3D "functional") public class PessimisticLockTest { private Cache cache; @@ -49,18 +45,6 @@ private void assertNoStaleLocks() { CacheSPI spi =3D (CacheSPI) cache; - PessimisticLockInterceptor pli =3D TestingUtil.findInterceptor(spi, = PessimisticLockInterceptor.class); - UnlockInterceptor ui =3D TestingUtil.findInterceptor(spi, UnlockInte= rceptor.class); - - Map lockTablePLI =3D (Map) TestingUtil.extractField(pli, "lockTable"= ); - Map lockTableUI =3D (Map) TestingUtil.extractField(ui, "lockTable"); - - // they should be the SAME!! - assert lockTablePLI =3D=3D lockTableUI : "PessimisticLockInterceptor= and UnlockInterceptor should be referring to the same LockTable!!"; - - assert lockTablePLI.size() =3D=3D 0 : "Lock table on pessimistic loc= k interceptor should be empty"; - assert lockTableUI.size() =3D=3D 0 : "Lock table on unlock intercept= or should be empty"; - assert spi.getNumberOfLocksHeld() =3D=3D 0 : "Should have no stale l= ocks!"; } = Modified: core/trunk/src/test/java/org/jboss/cache/marshall/CacheMarshaller= TestBase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/src/test/java/org/jboss/cache/marshall/CacheMarshallerTestBa= se.java 2008-02-06 16:23:32 UTC (rev 5317) +++ core/trunk/src/test/java/org/jboss/cache/marshall/CacheMarshallerTestBa= se.java 2008-02-07 01:24:19 UTC (rev 5318) @@ -9,6 +9,8 @@ import org.jboss.cache.Fqn; import org.jboss.cache.RegionManager; import org.jboss.cache.config.Configuration; +import org.jboss.cache.factories.ComponentRegistry; +import org.jboss.cache.marshall.io.ObjectStreamPool; import static org.testng.AssertJUnit.*; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; @@ -37,6 +39,10 @@ c.setReplVersionString(currentVersion); //c.setUseReferenceCounting(true); marshaller =3D createVAM(c, regionManager); + ObjectStreamPool pool =3D new ObjectStreamPool(); + ComponentRegistry reg =3D new ComponentRegistry(c); + marshaller.injectComponents(reg, pool); + pool.start(); } = @AfterMethod(alwaysRun =3D true) Modified: core/trunk/src/test/java/org/jboss/cache/marshall/MarshalledValue= Test.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/src/test/java/org/jboss/cache/marshall/MarshalledValueTest.j= ava 2008-02-06 16:23:32 UTC (rev 5317) +++ core/trunk/src/test/java/org/jboss/cache/marshall/MarshalledValueTest.j= ava 2008-02-07 01:24:19 UTC (rev 5318) @@ -46,10 +46,12 @@ @BeforeMethod public void setUp() { - cache1 =3D (CacheSPI) new DefaultCacheFactory().createCache(UnitTestCacheConfigurationFactory.createConfigurati= on(Configuration.CacheMode.REPL_SYNC, false)); - cache2 =3D (CacheSPI) new DefaultCacheFactory().createCache(UnitTestCacheConfigurationFactory.createConfigurati= on(Configuration.CacheMode.REPL_SYNC, false)); + cache1 =3D (CacheSPI) new DefaultCacheFactory().createCache(UnitTestCacheConfigurationFactory.createConfigurati= on(Configuration.CacheMode.REPL_SYNC, false), false); + cache2 =3D (CacheSPI) new DefaultCacheFactory().createCache(UnitTestCacheConfigurationFactory.createConfigurati= on(Configuration.CacheMode.REPL_SYNC, false), false); cache1.getConfiguration().setUseLazyDeserialization(true); cache2.getConfiguration().setUseLazyDeserialization(true); + cache1.start(); + cache2.start(); = assert TestingUtil.findInterceptor(cache1, MarshalledValueIntercepto= r.class) !=3D null : "Marshalled value interceptor not in chain!"; assert TestingUtil.findInterceptor(cache2, MarshalledValueIntercepto= r.class) !=3D null : "Marshalled value interceptor not in chain!"; Modified: core/trunk/src/test/java/org/jboss/cache/transaction/TransactionT= est.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/src/test/java/org/jboss/cache/transaction/TransactionTest.ja= va 2008-02-06 16:23:32 UTC (rev 5317) +++ core/trunk/src/test/java/org/jboss/cache/transaction/TransactionTest.ja= va 2008-02-07 01:24:19 UTC (rev 5318) @@ -631,7 +631,6 @@ cache.put("/a/b/c/3/a/b/c", null); = assertEquals(0, cache.getNumberOfLocksHeld()); - assertEquals(0, getLockTable(cache).size()); = tx.begin(); cache.removeNode("/a/b/c"); @@ -652,7 +651,6 @@ cache.put("/a/b/c/3/a/b/c", null); = assertEquals(0, cache.getNumberOfLocksHeld()); - assertEquals(0, getLockTable(cache).size()); = tx.begin(); cache.removeNode("/a/b/c"); --===============1522041934695020253==--