JBoss Cache SVN: r4550 - core/trunk/src/main/java/org/jboss/cache.
by jbosscache-commits@lists.jboss.org
Author: vblagojevic(a)jboss.com
Date: 2007-10-05 05:49:42 -0400 (Fri, 05 Oct 2007)
New Revision: 4550
Modified:
core/trunk/src/main/java/org/jboss/cache/CacheImpl.java
Log:
fix connect and state transfer startup for multiplexer
Modified: core/trunk/src/main/java/org/jboss/cache/CacheImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/CacheImpl.java 2007-10-05 09:31:47 UTC (rev 4549)
+++ core/trunk/src/main/java/org/jboss/cache/CacheImpl.java 2007-10-05 09:49:42 UTC (rev 4550)
@@ -756,7 +756,8 @@
{
long start = System.currentTimeMillis();
channel.connect(configuration.getClusterName(), null, null, configuration.getStateRetrievalTimeout());
- if (!isCoordinator())
+ //if I am not the only and the first member than wait for a state to arrive
+ if (getMembers().size()>1)
{
ml.waitForState();
}
18 years, 6 months
JBoss Cache SVN: r4549 - core/trunk/src/test/java/org/jboss/cache/loader.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2007-10-05 05:31:47 -0400 (Fri, 05 Oct 2007)
New Revision: 4549
Modified:
core/trunk/src/test/java/org/jboss/cache/loader/JDBCCacheLoaderDerbyDSTest.java
Log:
fixed test
Modified: core/trunk/src/test/java/org/jboss/cache/loader/JDBCCacheLoaderDerbyDSTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/JDBCCacheLoaderDerbyDSTest.java 2007-10-05 09:19:41 UTC (rev 4548)
+++ core/trunk/src/test/java/org/jboss/cache/loader/JDBCCacheLoaderDerbyDSTest.java 2007-10-05 09:31:47 UTC (rev 4549)
@@ -21,6 +21,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.transaction.DummyTransactionManager;
import org.testng.annotations.AfterMethod;
+import org.testng.annotations.Test;
/**
* This test runs cache loader tests using Database as the cache loader store.
@@ -34,6 +35,7 @@
* @author <a href="hmesha(a)novell.com">Hany Mesha</a>
* @version <tt>$Revision$</tt>
*/
+@Test(groups = {"functional"})
public class JDBCCacheLoaderDerbyDSTest
extends CacheLoaderTestsBase
{
@@ -135,6 +137,7 @@
@AfterMethod(alwaysRun = true)
public void tearDown() throws Exception
{
+ super.tearDown();
Context ctx = new InitialContext();
ctx.unbind(JNDI_NAME);
if (old_factory != null)
18 years, 6 months
JBoss Cache SVN: r4548 - core/trunk/src/test/java/org/jboss/cache/loader.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2007-10-05 05:19:41 -0400 (Fri, 05 Oct 2007)
New Revision: 4548
Modified:
core/trunk/src/test/java/org/jboss/cache/loader/CacheLoaderTestsBase.java
core/trunk/src/test/java/org/jboss/cache/loader/LocalDelegatingCacheLoaderTest.java
core/trunk/src/test/java/org/jboss/cache/loader/SingletonStoreCacheLoaderTest.java
Log:
Fixed failing tests
Modified: core/trunk/src/test/java/org/jboss/cache/loader/CacheLoaderTestsBase.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/CacheLoaderTestsBase.java 2007-10-05 08:30:54 UTC (rev 4547)
+++ core/trunk/src/test/java/org/jboss/cache/loader/CacheLoaderTestsBase.java 2007-10-05 09:19:41 UTC (rev 4548)
@@ -74,8 +74,14 @@
configureCache();
cache.start();
loader = cache.getCacheLoaderManager().getCacheLoader();
+ postConfigure();
}
+ protected void postConfigure()
+ {
+ // no op. Subclass if you need any further cfg after the cache starts.
+ }
+
abstract protected void configureCache() throws Exception;
@AfterMethod(alwaysRun = true)
@@ -2103,7 +2109,9 @@
cache.getConfiguration().getCacheLoaderConfig().getIndividualCacheLoaderConfigs().get(0).setIgnoreModifications(true);
cache.start();
loader = cache.getCacheLoader();
+ postConfigure();
+
// test that the cache loader is wrapped by a read-only delegate
assert loader instanceof ReadOnlyDelegatingCacheLoader;
Modified: core/trunk/src/test/java/org/jboss/cache/loader/LocalDelegatingCacheLoaderTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/LocalDelegatingCacheLoaderTest.java 2007-10-05 08:30:54 UTC (rev 4547)
+++ core/trunk/src/test/java/org/jboss/cache/loader/LocalDelegatingCacheLoaderTest.java 2007-10-05 09:19:41 UTC (rev 4548)
@@ -32,6 +32,34 @@
cache.setCacheLoader(cacheLoader);
}
+ protected void postConfigure()
+ {
+ CacheLoader ldr = loader;
+ LocalDelegatingCacheLoader ldcl = null;
+ do
+ {
+ if (ldr instanceof LocalDelegatingCacheLoader)
+ {
+ ldcl = (LocalDelegatingCacheLoader) ldr;
+ }
+ else
+ {
+ if (ldr instanceof AbstractDelegatingCacheLoader)
+ {
+ // look deeper in the delegate chain
+ ldr = ((AbstractDelegatingCacheLoader) ldr).getCacheLoader();
+ }
+ else
+ {
+ // can't dig any deeper!
+ break;
+ }
+ }
+ } while (ldcl == null);
+
+ ldcl.setDelegateCache(delegating_cache);
+ }
+
@AfterMethod(alwaysRun = true)
public void tearDown() throws Exception
{
Modified: core/trunk/src/test/java/org/jboss/cache/loader/SingletonStoreCacheLoaderTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/SingletonStoreCacheLoaderTest.java 2007-10-05 08:30:54 UTC (rev 4547)
+++ core/trunk/src/test/java/org/jboss/cache/loader/SingletonStoreCacheLoaderTest.java 2007-10-05 09:19:41 UTC (rev 4548)
@@ -6,20 +6,6 @@
*/
package org.jboss.cache.loader;
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertFalse;
-import static org.testng.AssertJUnit.assertTrue;
-import static org.testng.AssertJUnit.fail;
-
-import java.util.concurrent.Callable;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.CacheImpl;
@@ -31,14 +17,26 @@
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
import org.jboss.cache.factories.XmlConfigurationParser;
import org.jboss.cache.xml.XmlHelper;
+import static org.testng.AssertJUnit.*;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
import org.w3c.dom.Element;
+
+import java.util.concurrent.Callable;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
/**
* Unit test class for SingletonStoreCacheLoader
*
* @author <a href="mailto:galder.zamarreno@jboss.com">Galder Zamarreno</a>
*/
+@Test(groups = {"functional"})
public class SingletonStoreCacheLoaderTest extends AbstractCacheLoaderTestBase
{
private static final Log log = LogFactory.getLog(SingletonStoreCacheLoaderTest.class);
18 years, 6 months
JBoss Cache SVN: r4547 - core/trunk/src/test/java/org/jboss/cache/loader.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2007-10-05 04:30:54 -0400 (Fri, 05 Oct 2007)
New Revision: 4547
Modified:
core/trunk/src/test/java/org/jboss/cache/loader/C3p0ConnectionFactoryTest.java
core/trunk/src/test/java/org/jboss/cache/loader/ChainingCacheLoaderFullTest.java
Log:
Fixed failing tests
Modified: core/trunk/src/test/java/org/jboss/cache/loader/C3p0ConnectionFactoryTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/C3p0ConnectionFactoryTest.java 2007-10-05 07:46:18 UTC (rev 4546)
+++ core/trunk/src/test/java/org/jboss/cache/loader/C3p0ConnectionFactoryTest.java 2007-10-05 08:30:54 UTC (rev 4547)
@@ -71,7 +71,7 @@
c6 = cf.getConnection();
fail("Should have produced an SQLException indicating that it timed out checking out a Connection");
}
- catch (IllegalStateException ise)
+ catch (Exception good)
{
}
finally
Modified: core/trunk/src/test/java/org/jboss/cache/loader/ChainingCacheLoaderFullTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/ChainingCacheLoaderFullTest.java 2007-10-05 07:46:18 UTC (rev 4546)
+++ core/trunk/src/test/java/org/jboss/cache/loader/ChainingCacheLoaderFullTest.java 2007-10-05 08:30:54 UTC (rev 4547)
@@ -6,23 +6,21 @@
*/
package org.jboss.cache.loader;
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertNull;
-
-import java.io.File;
-
-import javax.transaction.TransactionManager;
-
import org.jboss.cache.CacheImpl;
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.config.CacheLoaderConfig;
+import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.XmlConfigurationParser;
-import org.jboss.cache.misc.TestingUtil;
+import org.jboss.cache.transaction.DummyTransactionManagerLookup;
import org.jboss.cache.xml.XmlHelper;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNull;
import org.testng.annotations.Test;
import org.w3c.dom.Element;
+import javax.transaction.TransactionManager;
+
/**
* Tests ignoreModifications and tests contents of individual loaders
*
@@ -31,9 +29,6 @@
@Test(groups = {"functional"})
public class ChainingCacheLoaderFullTest
{
- private String loc1 = System.getProperty("java.io.tmpdir", ".") + File.separator + "JBossCache-ChainingCacheLoaderBasicTest-1";
- private String loc2 = System.getProperty("java.io.tmpdir", ".") + File.separator + "JBossCache-ChainingCacheLoaderBasicTest-2";
-
private CacheImpl<Object, Object> cache;
private ChainingCacheLoader chainingCacheLoader;
private CacheLoader loader1, loader2;
@@ -42,30 +37,22 @@
private String value = "value";
- public ChainingCacheLoaderFullTest()
- {
- File dir1 = new File(loc1);
- File dir2 = new File(loc2);
-
- if (!dir1.exists()) dir1.mkdirs();
- if (!dir2.exists()) dir2.mkdirs();
- }
-
protected void startCache(boolean ignoreMods1, boolean ignoreMods2) throws Exception
{
cache = (CacheImpl<Object, Object>) DefaultCacheFactory.getInstance().createCache(false);
- cache.getConfiguration().setCacheLoaderConfig(getCacheLoaderConfig(loc1, loc2, ignoreMods1, ignoreMods2));
+ cache.getConfiguration().setCacheLoaderConfig(getCacheLoaderConfig(ignoreMods1, ignoreMods2));
- TestingUtil.recursiveFileRemove(loc1);
- TestingUtil.recursiveFileRemove(loc2);
-
- cache.getConfiguration().setCacheMode("local");
- cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
+ cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
+ cache.getConfiguration().setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
cache.start();
chainingCacheLoader = (ChainingCacheLoader) cache.getCacheLoaderManager().getCacheLoader();
loader1 = chainingCacheLoader.getCacheLoaders().get(0);
loader2 = chainingCacheLoader.getCacheLoaders().get(1);
+
+ // we need to make sure we have the raw loaders - not the "ReadOnly.." wrapped versions.
+ while (loader1 instanceof AbstractDelegatingCacheLoader) loader1 = ((AbstractDelegatingCacheLoader) loader1).getCacheLoader();
+ while (loader2 instanceof AbstractDelegatingCacheLoader) loader2 = ((AbstractDelegatingCacheLoader) loader2).getCacheLoader();
}
protected void cleanup() throws Exception
@@ -75,24 +62,22 @@
cache = null;
}
- protected CacheLoaderConfig getCacheLoaderConfig(String loc1, String loc2, boolean ignoreMods1, boolean ignoreMods2) throws Exception
+ protected CacheLoaderConfig getCacheLoaderConfig(boolean ignoreMods1, boolean ignoreMods2) throws Exception
{
String xml = "<config>\n" +
"<passivation>false</passivation>\n" +
"<preload></preload>\n" +
"<cacheloader>\n" +
- "<class>org.jboss.cache.loader.FileCacheLoader</class>\n" +
+ "<class>"+ DummyInMemoryCacheLoader.class.getName() +"</class>\n" +
"<properties>" +
- " location=" + loc1 + "\n" +
"</properties>\n" +
"<async>false</async>\n" +
"<fetchPersistentState>true</fetchPersistentState>\n" +
"<ignoreModifications>" + ignoreMods1 + "</ignoreModifications>\n" +
"</cacheloader>\n" +
"<cacheloader>\n" +
- "<class>org.jboss.cache.loader.FileCacheLoader</class>\n" +
+ "<class>"+ DummyInMemoryCacheLoader.class.getName() +"</class>\n" +
"<properties>" +
- " location=" + loc2 + "\n" +
"</properties>\n" +
"<async>false</async>\n" +
"<fetchPersistentState>false</fetchPersistentState>\n" +
18 years, 6 months
JBoss Cache SVN: r4546 - core/trunk/src/test/java/org/jboss/cache/multiplexer.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2007-10-05 03:46:18 -0400 (Fri, 05 Oct 2007)
New Revision: 4546
Modified:
core/trunk/src/test/java/org/jboss/cache/multiplexer/BuddyReplicationFailoverTest.java
Log:
Disabled test
Modified: core/trunk/src/test/java/org/jboss/cache/multiplexer/BuddyReplicationFailoverTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/multiplexer/BuddyReplicationFailoverTest.java 2007-10-05 07:39:01 UTC (rev 4545)
+++ core/trunk/src/test/java/org/jboss/cache/multiplexer/BuddyReplicationFailoverTest.java 2007-10-05 07:46:18 UTC (rev 4546)
@@ -21,11 +21,11 @@
*/
package org.jboss.cache.multiplexer;
+import org.jboss.cache.Cache;
import static org.testng.AssertJUnit.assertTrue;
-
-import org.jboss.cache.Cache;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
/**
@@ -34,6 +34,7 @@
* @author <a href="brian.stansberry(a)jboss.com">Brian Stansberry</a>
* @version $Revision$
*/
+@Test(groups={"functional", "jgroups"}, enabled = false)
public class BuddyReplicationFailoverTest
extends org.jboss.cache.buddyreplication.BuddyReplicationFailoverTest
{
18 years, 6 months
JBoss Cache SVN: r4545 - core/trunk/src/main/java/org/jboss/cache/loader.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2007-10-05 03:39:01 -0400 (Fri, 05 Oct 2007)
New Revision: 4545
Modified:
core/trunk/src/main/java/org/jboss/cache/loader/AdjListJDBCCacheLoaderConfig.java
Log:
if the drop table prop is missing, then the cache will not drop the tables on exit
Modified: core/trunk/src/main/java/org/jboss/cache/loader/AdjListJDBCCacheLoaderConfig.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/AdjListJDBCCacheLoaderConfig.java 2007-10-05 01:58:07 UTC (rev 4544)
+++ core/trunk/src/main/java/org/jboss/cache/loader/AdjListJDBCCacheLoaderConfig.java 2007-10-05 07:39:01 UTC (rev 4545)
@@ -291,7 +291,7 @@
String prop = props.getProperty("cache.jdbc.table.create");
this.createTable = (prop == null || Boolean.valueOf(prop));
prop = props.getProperty("cache.jdbc.table.drop");
- this.dropTable = (prop == null || Boolean.valueOf(prop));
+ this.dropTable = prop == null ? false : Boolean.valueOf(prop);
this.table = props.getProperty("cache.jdbc.table.name", "jbosscache");
String primaryKey = props.getProperty("cache.jdbc.table.primarykey", "jbosscache_pk");
18 years, 6 months
JBoss Cache SVN: r4544 - core/trunk/src/test/java/org/jboss/cache/loader.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2007-10-04 21:58:07 -0400 (Thu, 04 Oct 2007)
New Revision: 4544
Modified:
core/trunk/src/test/java/org/jboss/cache/loader/CacheLoaderTestsBase.java
core/trunk/src/test/java/org/jboss/cache/loader/DummyInMemoryCacheLoader.java
core/trunk/src/test/java/org/jboss/cache/loader/DummyInMemoryCacheLoaderTest.java
core/trunk/src/test/java/org/jboss/cache/loader/JDBCCacheLoaderTest.java
Log:
Fixed a few tests
Modified: core/trunk/src/test/java/org/jboss/cache/loader/CacheLoaderTestsBase.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/CacheLoaderTestsBase.java 2007-10-04 16:52:57 UTC (rev 4543)
+++ core/trunk/src/test/java/org/jboss/cache/loader/CacheLoaderTestsBase.java 2007-10-05 01:58:07 UTC (rev 4544)
@@ -2095,6 +2095,11 @@
// now stop the cache
cache.stop();
cache.destroy();
+
+ assert "v".equals(loader.get(fqn).get("k"));
+ assert cache.getCacheLoader() == null : "Should nullify cache loader in the cache";
+ assert cache.getCacheLoaderManager() == null : "Should nullify cache loader manager in the cache";
+
cache.getConfiguration().getCacheLoaderConfig().getIndividualCacheLoaderConfigs().get(0).setIgnoreModifications(true);
cache.start();
loader = cache.getCacheLoader();
@@ -2103,8 +2108,8 @@
assert loader instanceof ReadOnlyDelegatingCacheLoader;
// old state should be persisted.
- assert "v".equals(cache.get(fqn, "k"));
assert "v".equals(loader.get(fqn).get("k"));
+ assert "v".equals(cache.get(fqn, "k"));
// the loader should now be read-only
cache.put(fqn, "k", "v2");
Modified: core/trunk/src/test/java/org/jboss/cache/loader/DummyInMemoryCacheLoader.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/DummyInMemoryCacheLoader.java 2007-10-04 16:52:57 UTC (rev 4543)
+++ core/trunk/src/test/java/org/jboss/cache/loader/DummyInMemoryCacheLoader.java 2007-10-05 01:58:07 UTC (rev 4544)
@@ -40,9 +40,10 @@
return "NULL placeholder";
}
};
-
+ protected IndividualCacheLoaderConfig config;
public void setConfig(IndividualCacheLoaderConfig config)
{
+ this.config = config;
if (config != null && config.getProperties() != null)
{
debug = Boolean.parseBoolean(config.getProperties().getProperty("debug", "false"));
@@ -51,7 +52,7 @@
public IndividualCacheLoaderConfig getConfig()
{
- return null;
+ return config;
}
public Set<?> getChildrenNames(Fqn fqn) throws Exception
Modified: core/trunk/src/test/java/org/jboss/cache/loader/DummyInMemoryCacheLoaderTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/DummyInMemoryCacheLoaderTest.java 2007-10-04 16:52:57 UTC (rev 4543)
+++ core/trunk/src/test/java/org/jboss/cache/loader/DummyInMemoryCacheLoaderTest.java 2007-10-05 01:58:07 UTC (rev 4544)
@@ -1,13 +1,20 @@
package org.jboss.cache.loader;
+import org.jboss.cache.config.CacheLoaderConfig;
+import org.testng.annotations.Test;
+
/**
* Odd that we need a test for a test class, but if we intend to use the {@link org.jboss.cache.loader.DummyInMemoryCacheLoader} as a cache
* loader stub then we need to make sure it behaves as a valid cache loader.
*/
+@Test(groups = {"functional"})
public class DummyInMemoryCacheLoaderTest extends CacheLoaderTestsBase
{
protected void configureCache() throws Exception
{
- cache.getConfiguration().setCacheLoaderConfig(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.DummyInMemoryCacheLoader", "", false, true, false));
+ // use the shared variation of the DIMCL so that state is persisted in a static variable in memory rather than an
+ // instance one.
+ CacheLoaderConfig clc = getSingleCacheLoaderConfig("", DummySharedInMemoryCacheLoader.class.getName(), "", false, true, false);
+ cache.getConfiguration().setCacheLoaderConfig(clc);
}
}
Modified: core/trunk/src/test/java/org/jboss/cache/loader/JDBCCacheLoaderTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/JDBCCacheLoaderTest.java 2007-10-04 16:52:57 UTC (rev 4543)
+++ core/trunk/src/test/java/org/jboss/cache/loader/JDBCCacheLoaderTest.java 2007-10-05 01:58:07 UTC (rev 4544)
@@ -11,10 +11,12 @@
import static org.testng.AssertJUnit.assertTrue;
import static org.testng.AssertJUnit.fail;
import org.testng.annotations.Test;
+import org.testng.annotations.AfterMethod;
import java.util.Properties;
import org.jboss.cache.Fqn;
+import org.jboss.cache.config.CacheLoaderConfig;
/**
* This test runs cache loader tests using Database as the cache loader store.
@@ -41,10 +43,13 @@
"cache.jdbc.url=" + prop.getProperty("cache.jdbc.url") + "\n" +
"cache.jdbc.user=" + prop.getProperty("cache.jdbc.user") + "\n" +
"cache.jdbc.password=" + prop.getProperty("cache.jdbc.password") + "\n" +
- "cache.jdbc.node.type=" + prop.getProperty("cache.jdbc.node.type") + "\n" +
- "cache.jdbc.sql-concat=" + prop.getProperty("cache.jdbc.sql-concat") + "\n" +
- "cache.jdbc.table.name=" + prop.getProperty("cache.jdbc.table.name");
+ "cache.jdbc.node.type=" + prop.getProperty("cache.jdbc.node.type") + "\n" +
+ "cache.jdbc.sql-concat=" + prop.getProperty("cache.jdbc.sql-concat") + "\n" +
+ "cache.jdbc.table.name=" + prop.getProperty("cache.jdbc.table.name") + "\n" +
+ "cache.jdbc.table.drop=false";
+ // make sure dropTable is false!!
+
cache.getConfiguration().setCacheLoaderConfig(getSingleCacheLoaderConfig("",
"org.jboss.cache.loader.JDBCCacheLoader", props, false, true, false));
}
18 years, 6 months
JBoss Cache SVN: r4543 - core/trunk/src/test/java/org/jboss/cache/lock/pessimistic.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2007-10-04 12:52:57 -0400 (Thu, 04 Oct 2007)
New Revision: 4543
Modified:
core/trunk/src/test/java/org/jboss/cache/lock/pessimistic/LockUpgradeTest.java
Log:
Disabled test
Modified: core/trunk/src/test/java/org/jboss/cache/lock/pessimistic/LockUpgradeTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/lock/pessimistic/LockUpgradeTest.java 2007-10-04 16:37:04 UTC (rev 4542)
+++ core/trunk/src/test/java/org/jboss/cache/lock/pessimistic/LockUpgradeTest.java 2007-10-04 16:52:57 UTC (rev 4543)
@@ -23,7 +23,7 @@
*
* @author jhalat
*/
-@Test(groups = {"functional"})
+@Test(groups = {"functional"}, enabled = false)
public class LockUpgradeTest{
private TransactionManager tm;
18 years, 6 months
JBoss Cache SVN: r4542 - core/trunk/src/test/java/org/jboss/cache/marshall.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2007-10-04 12:37:04 -0400 (Thu, 04 Oct 2007)
New Revision: 4542
Modified:
core/trunk/src/test/java/org/jboss/cache/marshall/FooClassLoader.java
Log:
Fixed dependency on a .clazz file that may not be available during test runs
Modified: core/trunk/src/test/java/org/jboss/cache/marshall/FooClassLoader.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/marshall/FooClassLoader.java 2007-10-04 16:21:24 UTC (rev 4541)
+++ core/trunk/src/test/java/org/jboss/cache/marshall/FooClassLoader.java 2007-10-04 16:37:04 UTC (rev 4542)
@@ -7,33 +7,121 @@
public class FooClassLoader extends ClassLoader
{
private Class foo;
+ private boolean useCachedByteStream = true;
+
public FooClassLoader(ClassLoader parent)
{
super(parent);
}
-
+
public Class loadFoo() throws ClassNotFoundException
{
if (foo == null)
{
- try
+ byte[] bytes;
+ if (useCachedByteStream)
{
- InputStream is = getResourceAsStream("org/jboss/cache/marshall/Foo.clazz");
- byte[] bytes = new byte[1024];
- ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
- int read;
- while ((read = is.read(bytes)) > -1) {
- baos.write(bytes, 0, read);
- }
- bytes = baos.toByteArray();
- foo = this.defineClass("org.jboss.cache.marshall.Foo", bytes, 0, bytes.length);
+ bytes = getFooClazzAsBytes();
}
- catch (IOException e)
+ else
{
- throw new ClassNotFoundException("cannot read org/jboss/cache/marshall/Foo.clazz", e);
+ try
+ {
+ InputStream is = getResourceAsStream("org/jboss/cache/marshall/Foo.clazz");
+ bytes = new byte[1024];
+ ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
+ int read;
+ while ((read = is.read(bytes)) > -1)
+ {
+ baos.write(bytes, 0, read);
+ }
+ bytes = getFooClazzAsBytes();
+ }
+ catch (IOException e)
+ {
+ throw new ClassNotFoundException("cannot read org/jboss/cache/marshall/Foo.clazz", e);
+ }
}
+
+ foo = this.defineClass("org.jboss.cache.marshall.Foo", bytes, 0, bytes.length);
}
return foo;
}
+ private byte[] getFooClazzAsBytes()
+ {
+ // GENERATED using main() method to read org/jboss/cache/marshall/Foo.clazz into a byte[]
+ // so that this byte stream is available even if Foo.clazz is not included in the test classpath by Maven
+ // Copy out this generated snippet into FooClassLoader.java and use this byte[] instead of
+ // trying to read Foo.clazz off the classpath.
+
+ return new byte[]{
+ -54, -2, -70, -66, 0, 0, 0, 46, 0, 61, 7, 0, 2, 1, 0, 28, 111, 114, 103, 47, 106, 98, 111, 115, 115, 47, 99, 97, 99, 104,
+ 101, 47, 109, 97, 114, 115, 104, 97, 108, 108, 47, 70, 111, 111, 7, 0, 4, 1, 0, 16, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47,
+ 79, 98, 106, 101, 99, 116, 7, 0, 6, 1, 0, 20, 106, 97, 118, 97, 47, 105, 111, 47, 83, 101, 114, 105, 97, 108, 105, 122, 97, 98,
+ 108, 101, 1, 0, 16, 115, 101, 114, 105, 97, 108, 86, 101, 114, 115, 105, 111, 110, 85, 73, 68, 1, 0, 1, 74, 1, 0, 13, 67, 111,
+ 110, 115, 116, 97, 110, 116, 86, 97, 108, 117, 101, 5, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 6, 60, 105, 110, 105, 116, 62, 1,
+ 0, 3, 40, 41, 86, 1, 0, 4, 67, 111, 100, 101, 10, 0, 3, 0, 16, 12, 0, 12, 0, 13, 1, 0, 15, 76, 105, 110, 101, 78,
+ 117, 109, 98, 101, 114, 84, 97, 98, 108, 101, 1, 0, 18, 76, 111, 99, 97, 108, 86, 97, 114, 105, 97, 98, 108, 101, 84, 97, 98, 108,
+ 101, 1, 0, 4, 116, 104, 105, 115, 1, 0, 30, 76, 111, 114, 103, 47, 106, 98, 111, 115, 115, 47, 99, 97, 99, 104, 101, 47, 109, 97,
+ 114, 115, 104, 97, 108, 108, 47, 70, 111, 111, 59, 1, 0, 6, 101, 113, 117, 97, 108, 115, 1, 0, 21, 40, 76, 106, 97, 118, 97, 47,
+ 108, 97, 110, 103, 47, 79, 98, 106, 101, 99, 116, 59, 41, 90, 1, 0, 3, 111, 98, 106, 1, 0, 18, 76, 106, 97, 118, 97, 47, 108,
+ 97, 110, 103, 47, 79, 98, 106, 101, 99, 116, 59, 1, 0, 8, 104, 97, 115, 104, 67, 111, 100, 101, 1, 0, 3, 40, 41, 73, 1, 0,
+ 8, 116, 111, 83, 116, 114, 105, 110, 103, 1, 0, 20, 40, 41, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110,
+ 103, 59, 7, 0, 30, 1, 0, 26, 106, 97, 118, 97, 47, 115, 101, 99, 117, 114, 105, 116, 121, 47, 83, 101, 99, 117, 114, 101, 82, 97,
+ 110, 100, 111, 109, 10, 0, 29, 0, 16, 7, 0, 33, 1, 0, 22, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110,
+ 103, 66, 117, 102, 102, 101, 114, 8, 0, 35, 1, 0, 36, 111, 114, 103, 46, 106, 98, 111, 115, 115, 46, 99, 97, 99, 104, 101, 46, 109,
+ 97, 114, 115, 104, 97, 108, 108, 46, 70, 111, 111, 91, 114, 97, 110, 100, 111, 109, 61, 10, 0, 32, 0, 37, 12, 0, 12, 0, 38, 1,
+ 0, 21, 40, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 59, 41, 86, 10, 0, 40, 0, 42, 7, 0,
+ 41, 1, 0, 16, 106, 97, 118, 97, 47, 117, 116, 105, 108, 47, 82, 97, 110, 100, 111, 109, 12, 0, 43, 0, 26, 1, 0, 7, 110, 101,
+ 120, 116, 73, 110, 116, 10, 0, 32, 0, 45, 12, 0, 46, 0, 47, 1, 0, 6, 97, 112, 112, 101, 110, 100, 1, 0, 27, 40, 73, 41,
+ 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 66, 117, 102, 102, 101, 114, 59, 8, 0, 49, 1, 0, 1,
+ 93, 10, 0, 32, 0, 51, 12, 0, 46, 0, 52, 1, 0, 44, 40, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105,
+ 110, 103, 59, 41, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 66, 117, 102, 102, 101, 114, 59, 10, 0,
+ 32, 0, 54, 12, 0, 27, 0, 28, 1, 0, 6, 114, 97, 110, 100, 111, 109, 1, 0, 18, 76, 106, 97, 118, 97, 47, 117, 116, 105, 108,
+ 47, 82, 97, 110, 100, 111, 109, 59, 1, 0, 2, 115, 98, 1, 0, 24, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114,
+ 105, 110, 103, 66, 117, 102, 102, 101, 114, 59, 1, 0, 10, 83, 111, 117, 114, 99, 101, 70, 105, 108, 101, 1, 0, 8, 70, 111, 111, 46,
+ 106, 97, 118, 97, 0, 33, 0, 1, 0, 3, 0, 1, 0, 5, 0, 1, 0, 26, 0, 7, 0, 8, 0, 1, 0, 9, 0, 0, 0, 2,
+ 0, 10, 0, 4, 0, 1, 0, 12, 0, 13, 0, 1, 0, 14, 0, 0, 0, 47, 0, 1, 0, 1, 0, 0, 0, 5, 42, -73, 0, 15,
+ -79, 0, 0, 0, 2, 0, 17, 0, 0, 0, 6, 0, 1, 0, 0, 0, 15, 0, 18, 0, 0, 0, 12, 0, 1, 0, 0, 0, 5, 0,
+ 19, 0, 20, 0, 0, 0, 1, 0, 21, 0, 22, 0, 1, 0, 14, 0, 0, 0, 57, 0, 1, 0, 2, 0, 0, 0, 5, 43, -63, 0,
+ 1, -84, 0, 0, 0, 2, 0, 17, 0, 0, 0, 6, 0, 1, 0, 0, 0, 22, 0, 18, 0, 0, 0, 22, 0, 2, 0, 0, 0, 5,
+ 0, 19, 0, 20, 0, 0, 0, 0, 0, 5, 0, 23, 0, 24, 0, 1, 0, 1, 0, 25, 0, 26, 0, 1, 0, 14, 0, 0, 0, 44,
+ 0, 1, 0, 1, 0, 0, 0, 2, 4, -84, 0, 0, 0, 2, 0, 17, 0, 0, 0, 6, 0, 1, 0, 0, 0, 27, 0, 18, 0, 0,
+ 0, 12, 0, 1, 0, 0, 0, 2, 0, 19, 0, 20, 0, 0, 0, 1, 0, 27, 0, 28, 0, 1, 0, 14, 0, 0, 0, 111, 0, 3,
+ 0, 3, 0, 0, 0, 37, -69, 0, 29, 89, -73, 0, 31, 76, -69, 0, 32, 89, 18, 34, -73, 0, 36, 77, 44, 43, -74, 0, 39, -74,
+ 0, 44, 18, 48, -74, 0, 50, 87, 44, -74, 0, 53, -80, 0, 0, 0, 2, 0, 17, 0, 0, 0, 18, 0, 4, 0, 0, 0, 32, 0,
+ 8, 0, 33, 0, 18, 0, 34, 0, 32, 0, 35, 0, 18, 0, 0, 0, 32, 0, 3, 0, 0, 0, 37, 0, 19, 0, 20, 0, 0, 0,
+ 8, 0, 29, 0, 55, 0, 56, 0, 1, 0, 18, 0, 19, 0, 57, 0, 58, 0, 2, 0, 1, 0, 59, 0, 0, 0, 2, 0, 60,};
+ }
+
+/* public static void main(String[] args) throws Exception
+ {
+ InputStream is = FooClassLoader.class.getClassLoader().getResourceAsStream("org/jboss/cache/marshall/Foo.clazz");
+ byte[] bytes = new byte[1024];
+ ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
+ int read;
+ while ((read = is.read(bytes)) > -1)
+ {
+ baos.write(bytes, 0, read);
+ }
+ bytes = baos.toByteArray();
+
+ System.out.println("// GENERATED using main() method to read org/jboss/cache/marshall/Foo.clazz into a byte[]");
+ System.out.println("// so that this byte stream is available even if Foo.clazz is not included in the test classpath by Maven");
+ System.out.println("// Copy out this generated snippet into FooClassLoader.java and use this byte[] instead of ");
+ System.out.println("// trying to read Foo.clazz off the classpath. ");
+ System.out.println();
+ System.out.println("return new byte[] {");
+
+ int i=0;
+ for (byte b : bytes)
+ {
+ i++;
+ System.out.print(b);
+ System.out.print(", ");
+ if (i % 30 == 0) System.out.println();
+ }
+ System.out.println("};");
+ }*/
}
18 years, 6 months
JBoss Cache SVN: r4541 - core/trunk/src/test/java/org/jboss/cache/lock.
by jbosscache-commits@lists.jboss.org
Author: jason.greene(a)jboss.com
Date: 2007-10-04 12:21:24 -0400 (Thu, 04 Oct 2007)
New Revision: 4541
Modified:
core/trunk/src/test/java/org/jboss/cache/lock/LockReleaseTest.java
Log:
Fix test
Modified: core/trunk/src/test/java/org/jboss/cache/lock/LockReleaseTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/lock/LockReleaseTest.java 2007-10-04 15:55:42 UTC (rev 4540)
+++ core/trunk/src/test/java/org/jboss/cache/lock/LockReleaseTest.java 2007-10-04 16:21:24 UTC (rev 4541)
@@ -76,7 +76,7 @@
CacheImpl<Object, Object> c = (CacheImpl<Object, Object>) DefaultCacheFactory.getInstance().createCache(false);
c.getConfiguration().setClusterName("test");
c.getConfiguration().setStateRetrievalTimeout(10000);
- c.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.JBossTransactionManagerLookup");
+ c.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.GenericTransactionManagerLookup");
c.getConfiguration().setLockAcquisitionTimeout(500);
c.getConfiguration().setIsolationLevel(level);
c.create();
18 years, 6 months