JBoss Cache SVN: r5763 - in core/branches/2.1.X/src: main/release and 1 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-04-29 19:46:22 -0400 (Tue, 29 Apr 2008)
New Revision: 5763
Modified:
core/branches/2.1.X/src/main/etc/META-INF/total-replication-cache-service.xml
core/branches/2.1.X/src/main/release/build.xml
core/branches/2.1.X/src/test/java/org/jboss/cache/demo/JBossCacheGUI.java
core/branches/2.1.X/src/test/java/org/jboss/cache/demo/JBossCacheView.java
Log:
Fixed tutorial GUI
Modified: core/branches/2.1.X/src/main/etc/META-INF/total-replication-cache-service.xml
===================================================================
--- core/branches/2.1.X/src/main/etc/META-INF/total-replication-cache-service.xml 2008-04-29 23:27:26 UTC (rev 5762)
+++ core/branches/2.1.X/src/main/etc/META-INF/total-replication-cache-service.xml 2008-04-29 23:46:22 UTC (rev 5763)
@@ -101,15 +101,15 @@
oob_thread_pool.queue_max_size="10"
oob_thread_pool.rejection_policy="Run"/>
- <PING timeout="2000" num_initial_members="3"/>
+ <PING timeout="2000" num_initial_members="2"/>
<MERGE2 max_interval="30000" min_interval="10000"/>
<FD_SOCK/>
<FD timeout="10000" max_tries="5" shun="true"/>
<VERIFY_SUSPECT timeout="1500"/>
<pbcast.NAKACK
- use_mcast_xmit="false" gc_lag="0"
- retransmit_timeout="300,600,1200,2400,4800"
- discard_delivered_msgs="true"/>
+ use_mcast_xmit="false" gc_lag="0"
+ retransmit_timeout="300,600,1200,2400,4800"
+ discard_delivered_msgs="true"/>
<UNICAST timeout="300,600,1200,2400,3600"/>
<pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
max_bytes="400000"/>
@@ -122,6 +122,11 @@
</config>
</attribute>
+ <!--
+ Whether or not to fetch state on joining a cluster
+ NOTE this used to be called FetchStateOnStartup and has been renamed to be more descriptive.
+ -->
+ <attribute name="FetchInMemoryState">true</attribute>
<!--
The max amount of time (in milliseconds) we wait until the
Modified: core/branches/2.1.X/src/main/release/build.xml
===================================================================
--- core/branches/2.1.X/src/main/release/build.xml 2008-04-29 23:27:26 UTC (rev 5762)
+++ core/branches/2.1.X/src/main/release/build.xml 2008-04-29 23:46:22 UTC (rev 5763)
@@ -18,8 +18,9 @@
<!-- JVM args for when running tests -->
<property name="jvm.ipv4" value="-Djava.net.preferIPv4Stack=true"/>
<property name="jvm.localhost" value="-Dbind.address=127.0.0.1"/>
- <property name="jvm.ms" value="-Xms128M" />
- <property name="jvm.mx" value="-Xms1024M" />
+ <property name="jvm.ms" value="-Xms128M"/>
+ <property name="jvm.mx" value="-Xms1024M"/>
+ <property name="demo.cfg.file" value="META-INF/total-replication-cache-service.xml"/>
<!-- Test if JDK5 is available -->
<available classname="java.lang.Enum" property="HAVE_JDK_1.5"/>
@@ -119,8 +120,8 @@
<classfileset dir="${build}" includes="${test}.class"/>
<jvmarg value="${jvm.ipv4}"/>
<jvmarg value="${jvm.localhost}"/>
- <jvmarg value="${jvm.ms}" />
- <jvmarg value="${jvm.mx}" />
+ <jvmarg value="${jvm.ms}"/>
+ <jvmarg value="${jvm.mx}"/>
</testng>
</target>
@@ -146,6 +147,8 @@
<jvmarg value="${jvm.ipv4}"/>
<jvmarg value="${jvm.localhost}"/>
<arg value="-console"/>
+ <arg value="-config"/>
+ <arg value="${demo.cfg.file}"/>
</java>
</target>
Modified: core/branches/2.1.X/src/test/java/org/jboss/cache/demo/JBossCacheGUI.java
===================================================================
--- core/branches/2.1.X/src/test/java/org/jboss/cache/demo/JBossCacheGUI.java 2008-04-29 23:27:26 UTC (rev 5762)
+++ core/branches/2.1.X/src/test/java/org/jboss/cache/demo/JBossCacheGUI.java 2008-04-29 23:46:22 UTC (rev 5763)
@@ -12,7 +12,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.Cache;
-import org.jboss.cache.CacheImpl;
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
import org.jboss.cache.lock.TimeoutException;
@@ -26,6 +25,7 @@
import org.jboss.cache.notifications.event.NodeEvent;
import org.jboss.cache.notifications.event.NodeModifiedEvent;
import org.jboss.cache.notifications.event.ViewChangedEvent;
+import org.jboss.cache.util.CachePrinter;
import org.jgroups.Address;
import javax.swing.*;
@@ -92,6 +92,7 @@
private List<Address> membership = new LinkedList<Address>();
private Address coordinator = null;
private boolean useConsole = false;
+ JConsole bshConsole;
/**
* Run any work that happens in this interface in a separate thread. This is good practise. Unless there's a
@@ -148,7 +149,7 @@
{
String welcomeMessage = getWelcomeMessage();
- JConsole bshConsole = new JConsole();
+ bshConsole = new JConsole();
Interpreter interpreter = new Interpreter(bshConsole);
configureInterpreter(interpreter, cacheDelegate);
@@ -230,6 +231,8 @@
setCacheModelDelegate(cacheDelegate);
init();
setVisible(true);
+ tree_model.setRoot(myNodeRoot);
+ tree_model.reload();
if (useConsole)
{
@@ -685,7 +688,7 @@
JBossCacheGUI.AddModifyDataForNodeAction addModAction = new JBossCacheGUI.AddModifyDataForNodeAction();
addModAction.putValue(AbstractAction.NAME, "Add/Modify data");
JBossCacheGUI.PrintLockInfoAction print_locks = new JBossCacheGUI.PrintLockInfoAction();
- print_locks.putValue(AbstractAction.NAME, "Print lock information (stdout)");
+ print_locks.putValue(AbstractAction.NAME, "Print lock information" + (useConsole ? "" : " (stdout)"));
JBossCacheGUI.ExitAction exitAction = new JBossCacheGUI.ExitAction();
exitAction.putValue(AbstractAction.NAME, "Exit");
JBossCacheGUI.StartTransaction start_tx = new JBossCacheGUI.StartTransaction();
@@ -1064,7 +1067,27 @@
public void actionPerformed(ActionEvent e)
{
- System.out.println("\n*** lock information ****\n" + ((CacheImpl) cache).printLockInfo());
+ if (bshConsole != null)
+ {
+ new Thread()
+ {
+ public void run()
+ {
+ bshConsole.getOut().println("\n*** lock information ****\n" + CachePrinter.printCacheLockingInfo(cache));
+ }
+ }.start();
+
+ }
+ else
+ {
+ new Thread()
+ {
+ public void run()
+ {
+ System.out.println("\n*** lock information ****\n" + CachePrinter.printCacheLockingInfo(cache));
+ }
+ }.start();
+ }
}
}
@@ -1095,6 +1118,7 @@
{
log.trace("node added/modified, updating GUI: " + e);
}
+ if (selected_node == null) return;
clearTable();
Map<String, String> data = selected_node.getData();
Modified: core/branches/2.1.X/src/test/java/org/jboss/cache/demo/JBossCacheView.java
===================================================================
--- core/branches/2.1.X/src/test/java/org/jboss/cache/demo/JBossCacheView.java 2008-04-29 23:27:26 UTC (rev 5762)
+++ core/branches/2.1.X/src/test/java/org/jboss/cache/demo/JBossCacheView.java 2008-04-29 23:46:22 UTC (rev 5763)
@@ -46,7 +46,7 @@
/**
* Cache configuration file.
*/
- private String configurationFile = "META-INF/replSync-service.xml";
+ private String configurationFile = null;
/**
* The cache model.
@@ -84,10 +84,15 @@
{
parseParameters(args);
+ if (configurationFile == null)
+ {
+ help();
+ throw new Exception("Configuration file cannot be null, please specify with the -config parameter when starting!");
+ }
+
CacheModelDelegate cacheModelDelegate = createCacheDelegate();
- startCacheModelDelegate(cacheModelDelegate);
+ cacheModelDelegate.getGenericCache().start();
setCacheModelDelegate(cacheModelDelegate);
-
start();
}
@@ -102,7 +107,7 @@
{
log.info("start(): creating the GUI");
System.out.println("start(): creating the GUI");
- gui = createCacheGUI(cacheModelDelegate, useConsole);
+ gui = new JBossCacheGUI(cacheModelDelegate, useConsole);
}
}
@@ -171,47 +176,23 @@
{
CacheFactory<String, String> factory = new DefaultCacheFactory();
Cache<String, String> cache = factory.createCache(configurationFile, false);
- // hack to prevent a state transfer for now
- cache.getConfiguration().setFetchInMemoryState(false);
-
CacheModelDelegate delegate = new JBossCacheModelDelegate();
delegate.setCacheShellVariable(cache);
return delegate;
}
- /**
- * Factory method that creates a cache GUI instance
- *
- * @param cacheDelegate cache model instance
- * @param useConsole whether to enable the embedded beanshell console
- * @return instance of cache GUI
- * @throws Exception
- */
- protected JBossCacheGUI createCacheGUI(CacheModelDelegate cacheDelegate, boolean useConsole) throws Exception
- {
- return new JBossCacheGUI(cacheDelegate, useConsole);
- }
-
- /**
- * Starts the cache model
- *
- * @param cacheModelDelegate cache model instance to start
- */
- private void startCacheModelDelegate(CacheModelDelegate cacheModelDelegate)
- {
- cacheModelDelegate.getGenericCache().start();
- }
-
private static void help()
{
System.out.println("JBossCacheView [-help] " +
"[-console] " +
- "[-config <path to configuration file to use>] ");
+ "[-config <path to configuration file to use>]");
System.out.println();
System.out.println("-console enables the embedded BeanShell console");
System.out.println("-config allows you to provide a path to the configuration file to use.");
+ System.out.println();
+ System.out.println();
}
}
16 years, 8 months
JBoss Cache SVN: r5762 - core/trunk/src/main/java/org/jboss/cache/loader.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-04-29 19:27:26 -0400 (Tue, 29 Apr 2008)
New Revision: 5762
Modified:
core/trunk/src/main/java/org/jboss/cache/loader/TcpDelegatingCacheLoader.java
Log:
Removed unused states
Modified: core/trunk/src/main/java/org/jboss/cache/loader/TcpDelegatingCacheLoader.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/TcpDelegatingCacheLoader.java 2008-04-29 23:26:38 UTC (rev 5761)
+++ core/trunk/src/main/java/org/jboss/cache/loader/TcpDelegatingCacheLoader.java 2008-04-29 23:27:26 UTC (rev 5762)
@@ -48,13 +48,7 @@
ObjectOutputStream out;
private static final Log log = LogFactory.getLog(TcpDelegatingCacheLoader.class);
private static Method GET_CHILDREN_METHOD, GET_METHOD, PUT_KEY_METHOD, PUT_DATA_METHOD, REMOVE_KEY_METHOD, REMOVE_METHOD, PUT_MODS_METHOD, EXISTS_METHOD, REMOVE_DATA_METHOD;
- private State state = State.STOPPED;
- private enum State
- {
- STOPPED, STARTING, STARTED
- }
-
static
{
try
@@ -375,18 +369,15 @@
@Override
public void start() throws IOException
{
- state = State.STARTING;
sock = new Socket(config.getHost(), config.getPort());
out = new ObjectOutputStream(new BufferedOutputStream(sock.getOutputStream()));
out.flush();
in = new ObjectInputStream(new BufferedInputStream(sock.getInputStream()));
- state = State.STARTED;
}
@Override
public void stop()
{
- state = State.STOPPED;
try
{
if (in != null) in.close();
16 years, 8 months
JBoss Cache SVN: r5761 - core/trunk/src/main/java/org/jboss/cache/loader/bdbje.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-04-29 19:26:38 -0400 (Tue, 29 Apr 2008)
New Revision: 5761
Modified:
core/trunk/src/main/java/org/jboss/cache/loader/bdbje/BdbjeCacheLoader.java
Log:
cache loader timeout
Modified: core/trunk/src/main/java/org/jboss/cache/loader/bdbje/BdbjeCacheLoader.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/bdbje/BdbjeCacheLoader.java 2008-04-29 23:25:47 UTC (rev 5760)
+++ core/trunk/src/main/java/org/jboss/cache/loader/bdbje/BdbjeCacheLoader.java 2008-04-29 23:26:38 UTC (rev 5761)
@@ -159,7 +159,7 @@
EnvironmentConfig envConfig = new EnvironmentConfig();
envConfig.setAllowCreate(true);
envConfig.setTransactional(true);
- envConfig.setLockTimeout(cache.getConfiguration().getLockAcquisitionTimeout());
+ envConfig.setLockTimeout(1000 * cache.getConfiguration().getLockAcquisitionTimeout()); // these are in nanos
if (log.isTraceEnabled()) log.trace("Creating JE environment with home dir " + homeDir);
env = new Environment(homeDir, envConfig);
if (log.isDebugEnabled()) log.debug("Created JE environment " + env + " for cache loader " + this);
16 years, 8 months
JBoss Cache SVN: r5760 - core/branches/2.1.X/src/main/java/org/jboss/cache/loader/bdbje.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-04-29 19:25:47 -0400 (Tue, 29 Apr 2008)
New Revision: 5760
Modified:
core/branches/2.1.X/src/main/java/org/jboss/cache/loader/bdbje/BdbjeCacheLoader.java
Log:
cache loader timeout
Modified: core/branches/2.1.X/src/main/java/org/jboss/cache/loader/bdbje/BdbjeCacheLoader.java
===================================================================
--- core/branches/2.1.X/src/main/java/org/jboss/cache/loader/bdbje/BdbjeCacheLoader.java 2008-04-29 17:04:39 UTC (rev 5759)
+++ core/branches/2.1.X/src/main/java/org/jboss/cache/loader/bdbje/BdbjeCacheLoader.java 2008-04-29 23:25:47 UTC (rev 5760)
@@ -158,7 +158,7 @@
/* Open the environment, creating it if it doesn't exist. */
EnvironmentConfig envConfig = new EnvironmentConfig();
envConfig.setAllowCreate(true);
- envConfig.setLockTimeout(cache.getConfiguration().getLockAcquisitionTimeout());
+ envConfig.setLockTimeout(1000 * cache.getConfiguration().getLockAcquisitionTimeout()); // these are in nanos
envConfig.setTransactional(true);
if (log.isTraceEnabled()) log.trace("Creating JE environment with home dir " + homeDir);
env = new Environment(homeDir, envConfig);
16 years, 8 months
JBoss Cache SVN: r5759 - core/trunk/src.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-04-29 13:04:39 -0400 (Tue, 29 Apr 2008)
New Revision: 5759
Removed:
core/trunk/src/examples/
core/trunk/src/test-compat/
core/trunk/src/test-perf/
core/trunk/src/test-scripts/
core/trunk/src/test-stress/
Log:
Removed unused files
16 years, 8 months
JBoss Cache SVN: r5758 - core/branches/2.1.X/src.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-04-29 12:26:43 -0400 (Tue, 29 Apr 2008)
New Revision: 5758
Removed:
core/branches/2.1.X/src/examples/
Log:
Removed unused directory
16 years, 8 months
JBoss Cache SVN: r5757 - core/branches/2.1.X/src/test/java/org/jboss/cache/marshall.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-04-29 12:20:24 -0400 (Tue, 29 Apr 2008)
New Revision: 5757
Modified:
core/branches/2.1.X/src/test/java/org/jboss/cache/marshall/CacheMarshaller200Test.java
Log:
Suppress varargs warning
Modified: core/branches/2.1.X/src/test/java/org/jboss/cache/marshall/CacheMarshaller200Test.java
===================================================================
--- core/branches/2.1.X/src/test/java/org/jboss/cache/marshall/CacheMarshaller200Test.java 2008-04-29 16:06:40 UTC (rev 5756)
+++ core/branches/2.1.X/src/test/java/org/jboss/cache/marshall/CacheMarshaller200Test.java 2008-04-29 16:20:24 UTC (rev 5757)
@@ -96,7 +96,7 @@
final Fqn region = Fqn.fromString("/hello");
Region r = rm.getRegion(region, true);
r.registerContextClassLoader(this.getClass().getClassLoader());
- cm200.objectToObjectStream(MethodCallFactory.create(MethodDeclarations.clusteredGetMethod_id, null), oos, region);
+ cm200.objectToObjectStream(MethodCallFactory.create(MethodDeclarations.clusteredGetMethod_id, (Object) null), oos, region);
oos.close();
final byte[] stream = baos.toByteArray();
16 years, 8 months
JBoss Cache SVN: r5756 - core/branches/2.1.X/src/test/java/org/jboss/cache/optimistic.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-04-29 12:06:40 -0400 (Tue, 29 Apr 2008)
New Revision: 5756
Modified:
core/branches/2.1.X/src/test/java/org/jboss/cache/optimistic/CacheTest.java
Log:
JBCACHE-1326: Fixed tests that relied on this leak
Modified: core/branches/2.1.X/src/test/java/org/jboss/cache/optimistic/CacheTest.java
===================================================================
--- core/branches/2.1.X/src/test/java/org/jboss/cache/optimistic/CacheTest.java 2008-04-29 16:06:20 UTC (rev 5755)
+++ core/branches/2.1.X/src/test/java/org/jboss/cache/optimistic/CacheTest.java 2008-04-29 16:06:40 UTC (rev 5756)
@@ -208,13 +208,13 @@
TransactionTable table = c.getTransactionTable();
OptimisticTransactionEntry entry = (OptimisticTransactionEntry) table.get(gtx);
assertNotNull(mgr.getTransaction());
+ MethodCall meth = entry.getModifications().get(0);
mgr.commit();
GlobalTransaction remoteGtx = new GlobalTransaction();
remoteGtx.setAddress(new DummyAddress());
//hack the method call to make it have the remote gtx
- MethodCall meth = entry.getModifications().get(0);
meth.getArgs()[0] = remoteGtx;
//call our remote method
@@ -229,11 +229,8 @@
assertNotNull(table.get(remoteGtx));
assertNotNull(table.getLocalTransaction(remoteGtx));
//assert that this is populated
- assertEquals(1, table.get(remoteGtx).getModifications().size());
-
//assert that the remote prepare has populated the local workspace
assertEquals(3, entry.getTransactionWorkSpace().getNodes().size());
- assertEquals(1, entry.getModifications().size());
List<?> calls = dummy.getAllCalled();
assertEquals(MethodDeclarations.optimisticPrepareMethod, calls.get(2));
16 years, 8 months
JBoss Cache SVN: r5755 - core/branches/2.1.X/src/main/java/org/jboss/cache/loader/bdbje.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-04-29 12:06:20 -0400 (Tue, 29 Apr 2008)
New Revision: 5755
Modified:
core/branches/2.1.X/src/main/java/org/jboss/cache/loader/bdbje/BdbjeCacheLoader.java
Log:
BDBJECacheLoader to adhere to lock acquisition timeout specified in the cache
Modified: core/branches/2.1.X/src/main/java/org/jboss/cache/loader/bdbje/BdbjeCacheLoader.java
===================================================================
--- core/branches/2.1.X/src/main/java/org/jboss/cache/loader/bdbje/BdbjeCacheLoader.java 2008-04-29 16:01:42 UTC (rev 5754)
+++ core/branches/2.1.X/src/main/java/org/jboss/cache/loader/bdbje/BdbjeCacheLoader.java 2008-04-29 16:06:20 UTC (rev 5755)
@@ -158,6 +158,7 @@
/* Open the environment, creating it if it doesn't exist. */
EnvironmentConfig envConfig = new EnvironmentConfig();
envConfig.setAllowCreate(true);
+ envConfig.setLockTimeout(cache.getConfiguration().getLockAcquisitionTimeout());
envConfig.setTransactional(true);
if (log.isTraceEnabled()) log.trace("Creating JE environment with home dir " + homeDir);
env = new Environment(homeDir, envConfig);
16 years, 8 months
JBoss Cache SVN: r5754 - core/branches/2.1.X/src/test/java/org/jboss/cache/optimistic.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-04-29 12:01:42 -0400 (Tue, 29 Apr 2008)
New Revision: 5754
Modified:
core/branches/2.1.X/src/test/java/org/jboss/cache/optimistic/NodeInterceptorRemoveNodeTest.java
core/branches/2.1.X/src/test/java/org/jboss/cache/optimistic/OptimisticReplicationInterceptorTest.java
core/branches/2.1.X/src/test/java/org/jboss/cache/optimistic/TxInterceptorTest.java
Log:
JBCACHE-1326: Fixed tests that relied on this leak
Modified: core/branches/2.1.X/src/test/java/org/jboss/cache/optimistic/NodeInterceptorRemoveNodeTest.java
===================================================================
--- core/branches/2.1.X/src/test/java/org/jboss/cache/optimistic/NodeInterceptorRemoveNodeTest.java 2008-04-29 14:28:51 UTC (rev 5753)
+++ core/branches/2.1.X/src/test/java/org/jboss/cache/optimistic/NodeInterceptorRemoveNodeTest.java 2008-04-29 16:01:42 UTC (rev 5754)
@@ -87,7 +87,6 @@
assertEquals(0, workspace.getNodes().size());
assertTrue(entry.getLocks().isEmpty());
- assertEquals(1, entry.getModifications().size());
assertTrue(!cache.exists("/one/two"));
assertEquals(0, listener.getNodesAdded());
}
@@ -130,7 +129,6 @@
List<Set<Fqn>> mergedChildren = workspace.getNode(Fqn.fromString("/one")).getMergedChildren();
assertEquals(1, mergedChildren.get(1).size());
System.out.println(entry.getModifications());
- assertEquals(2, entry.getModifications().size());
assertTrue(!cache.exists("/one/two"));
}
@@ -168,12 +166,10 @@
assertNotNull(workspace.getNode(Fqn.fromString("/one")));
assertEquals(true, workspace.getNode(Fqn.fromString("/one")).isDeleted());
assertEquals(0, workspace.getNode(Fqn.fromString("/one")).getMergedChildren().get(0).size());
- assertEquals(2, entry.getModifications().size());
assertTrue(!cache.exists("/one/two"));
assert 2 == dummy.getAllCalled().size();
assert dummy.getAllCalled().contains(MethodDeclarations.commitMethod);
assert dummy.getAllCalled().contains(MethodDeclarations.optimisticPrepareMethod);
-
}
public void testTransactionRemoveTwiceMethod() throws Exception
@@ -225,8 +221,6 @@
//assert what should be the results of our call
assertEquals(3, workspace.getNodes().size());
-
- assertEquals(3, entry.getModifications().size());
assertTrue(!cache.exists("/one/two"));
assert 2 == dummy.getAllCalled().size();
assert dummy.getAllCalled().contains(MethodDeclarations.commitMethod);
@@ -286,8 +280,6 @@
//assert what should be the results of our call
assertEquals(3, workspace.getNodes().size());
-
- assertEquals(3, entry.getModifications().size());
assert 2 == dummy.getAllCalled().size();
assert dummy.getAllCalled().contains(MethodDeclarations.commitMethod);
assert dummy.getAllCalled().contains(MethodDeclarations.optimisticPrepareMethod);
@@ -347,8 +339,6 @@
//assert what should be the results of our call
assertEquals(3, workspace.getNodes().size());
-
- assertEquals(3, entry.getModifications().size());
assertTrue(!cache.exists("/one/two"));
assert 2 == dummy.getAllCalled().size();
assert dummy.getAllCalled().contains(MethodDeclarations.commitMethod);
@@ -398,8 +388,6 @@
//assert what should be the results of our call
assertEquals(3, workspace.getNodes().size());
-
- assertEquals(2, entry.getModifications().size());
assertTrue(!cache.exists("/one/two"));
assert 2 == dummy.getAllCalled().size();
assert dummy.getAllCalled().contains(MethodDeclarations.commitMethod);
Modified: core/branches/2.1.X/src/test/java/org/jboss/cache/optimistic/OptimisticReplicationInterceptorTest.java
===================================================================
--- core/branches/2.1.X/src/test/java/org/jboss/cache/optimistic/OptimisticReplicationInterceptorTest.java 2008-04-29 14:28:51 UTC (rev 5753)
+++ core/branches/2.1.X/src/test/java/org/jboss/cache/optimistic/OptimisticReplicationInterceptorTest.java 2008-04-29 16:01:42 UTC (rev 5754)
@@ -133,14 +133,13 @@
TransactionTable table = cache.getTransactionTable();
OptimisticTransactionEntry entry = (OptimisticTransactionEntry) table.get(gtx);
assertNotNull(mgr.getTransaction());
+ MethodCall meth = entry.getModifications().get(0);
mgr.commit();
-
GlobalTransaction remoteGtx = new GlobalTransaction();
remoteGtx.setAddress(new TestAddress());
//hack the method call to make it have the remote gtx
- MethodCall meth = entry.getModifications().get(0);
meth.getArgs()[0] = remoteGtx;
//call our remote method
@@ -161,18 +160,14 @@
assertNotNull(table.get(remoteGtx));
assertNotNull(table.getLocalTransaction(remoteGtx));
//assert that this is populated
- assertEquals(1, table.get(remoteGtx).getModifications().size());
-
//assert that the remote prepare has populated the local workspace
assertEquals(3, entry.getTransactionWorkSpace().getNodes().size());
- assertEquals(1, entry.getModifications().size());
List calls = dummy.getAllCalledIds();
assertEquals(MethodDeclarations.optimisticPrepareMethod_id, calls.get(2));
assertEquals(1, cache.getTransactionTable().getNumGlobalTransactions());
assertEquals(1, cache.getTransactionTable().getNumLocalTransactions());
-
}
@@ -198,15 +193,13 @@
TransactionTable table = cache.getTransactionTable();
OptimisticTransactionEntry entry = (OptimisticTransactionEntry) table.get(gtx);
assertNotNull(mgr.getTransaction());
+ MethodCall meth = entry.getModifications().get(0);
mgr.commit();
-
GlobalTransaction remoteGtx = new GlobalTransaction();
remoteGtx.setAddress(new TestAddress());
//hack the method call to make it have the remote gtx
- MethodCall meth = entry.getModifications().get(0);
-
meth.getArgs()[0] = remoteGtx;
//call our remote method
MethodCall prepareMethod = MethodCallFactory.create(MethodDeclarations.optimisticPrepareMethod_id, remoteGtx, injectDataVersion(entry.getModifications()), null, remoteGtx.getAddress(), false);
@@ -226,10 +219,7 @@
assertNotNull(table.get(remoteGtx));
assertNotNull(table.getLocalTransaction(remoteGtx));
//assert that this is populated
- assertEquals(1, table.get(remoteGtx).getModifications().size());
-
assertEquals(3, entry.getTransactionWorkSpace().getNodes().size());
- assertEquals(1, entry.getModifications().size());
List calls = dummy.getAllCalledIds();
assertEquals(MethodDeclarations.optimisticPrepareMethod_id, calls.get(2));
@@ -277,6 +267,7 @@
TransactionTable table = cache.getTransactionTable();
OptimisticTransactionEntry entry = (OptimisticTransactionEntry) table.get(gtx);
assertNotNull(mgr.getTransaction());
+ MethodCall meth = entry.getModifications().get(0);
mgr.commit();
@@ -284,15 +275,12 @@
remoteGtx.setAddress(new TestAddress());
//hack the method call to make it have the remote gtx
- MethodCall meth = entry.getModifications().get(0);
meth.getArgs()[0] = remoteGtx;
-
List calls = dummy.getAllCalledIds();
assertEquals(2, calls.size());
-
assertEquals(0, cache.getTransactionTable().getNumGlobalTransactions());
assertEquals(0, cache.getTransactionTable().getNumLocalTransactions());
@@ -338,22 +326,19 @@
TransactionTable table = cache.getTransactionTable();
OptimisticTransactionEntry entry = (OptimisticTransactionEntry) table.get(gtx);
assertNotNull(mgr.getTransaction());
+ MethodCall meth = entry.getModifications().get(0);
mgr.commit();
-
GlobalTransaction remoteGtx = new GlobalTransaction();
remoteGtx.setAddress(new TestAddress());
//hack the method call to make it have the remote gtx
- MethodCall meth = entry.getModifications().get(0);
meth.getArgs()[0] = remoteGtx;
-
List calls = dummy.getAllCalledIds();
assertEquals(2, calls.size());
-
assertEquals(0, cache.getTransactionTable().getNumGlobalTransactions());
assertEquals(0, cache.getTransactionTable().getNumLocalTransactions());
@@ -393,14 +378,13 @@
TransactionTable table = cache.getTransactionTable();
OptimisticTransactionEntry entry = (OptimisticTransactionEntry) table.get(gtx);
assertNotNull(mgr.getTransaction());
+ MethodCall meth = entry.getModifications().get(0);
mgr.commit();
-
GlobalTransaction remoteGtx = new GlobalTransaction();
remoteGtx.setAddress(new TestAddress());
//hack the method call to make it have the remote gtx
- MethodCall meth = entry.getModifications().get(0);
meth.getArgs()[0] = remoteGtx;
//call our remote method
@@ -421,11 +405,8 @@
assertNotNull(table.get(remoteGtx));
assertNotNull(table.getLocalTransaction(remoteGtx));
//assert that this is populated
- assertEquals(1, table.get(remoteGtx).getModifications().size());
-
//assert that the remote prepare has populated the local workspace
assertEquals(3, entry.getTransactionWorkSpace().getNodes().size());
- assertEquals(1, entry.getModifications().size());
List calls = dummy.getAllCalledIds();
assertEquals(MethodDeclarations.optimisticPrepareMethod_id, calls.get(2));
Modified: core/branches/2.1.X/src/test/java/org/jboss/cache/optimistic/TxInterceptorTest.java
===================================================================
--- core/branches/2.1.X/src/test/java/org/jboss/cache/optimistic/TxInterceptorTest.java 2008-04-29 14:28:51 UTC (rev 5753)
+++ core/branches/2.1.X/src/test/java/org/jboss/cache/optimistic/TxInterceptorTest.java 2008-04-29 16:01:42 UTC (rev 5754)
@@ -287,6 +287,7 @@
TransactionTable table = cache.getTransactionTable();
OptimisticTransactionEntry entry = (OptimisticTransactionEntry) table.get(gtx);
assertNotNull(mgr.getTransaction());
+ MethodCall meth = entry.getModifications().get(0);
mgr.commit();
//test local calls
@@ -303,7 +304,6 @@
remoteGtx.setAddress(new DummyAddress());
//hack the method call to make it have the remote gtx
- MethodCall meth = entry.getModifications().get(0);
meth.getArgs()[0] = remoteGtx;
//call our remote method
@@ -617,6 +617,7 @@
TransactionTable table = cache.getTransactionTable();
OptimisticTransactionEntry entry = (OptimisticTransactionEntry) table.get(gtx);
assertNotNull(mgr.getTransaction());
+ MethodCall meth = entry.getModifications().get(0);
mgr.commit();
//test local calls
@@ -635,7 +636,6 @@
remoteGtx.setAddress(new DummyAddress());
// hack the method call to make it have the remote gtx
- MethodCall meth = entry.getModifications().get(0);
meth.getArgs()[0] = remoteGtx;
//call our remote method
@@ -658,7 +658,6 @@
assertNotNull(table.get(remoteGtx));
assertNotNull(table.getLocalTransaction(remoteGtx));
//this is not populated until replication interceptor is used
- assertEquals(1, table.get(remoteGtx).getModifications().size());
calls = dummy.getAllCalledIds();
assertEquals(MethodDeclarations.optimisticPrepareMethod_id, calls.get(2));
@@ -682,7 +681,6 @@
assertEquals(0, cache.getTransactionTable().getNumLocalTransactions());
assertNull(mgr.getTransaction());
cache.stop();
-
}
public void testRemoteRollbackTransaction() throws Exception
@@ -709,6 +707,7 @@
TransactionTable table = cache.getTransactionTable();
OptimisticTransactionEntry entry = (OptimisticTransactionEntry) table.get(gtx);
assertNotNull(mgr.getTransaction());
+ MethodCall meth = entry.getModifications().get(0);
mgr.commit();
//test local calls
@@ -721,7 +720,6 @@
remoteGtx.setAddress(new DummyAddress());
// hack the method call to make it have the remote gtx
- MethodCall meth = entry.getModifications().get(0);
meth.getArgs()[0] = remoteGtx;
//call our remote method
@@ -742,8 +740,6 @@
assertNotNull(table.get(remoteGtx));
assertNotNull(table.getLocalTransaction(remoteGtx));
//this is not populated until replication interceptor is used
- assertEquals(1, table.get(remoteGtx).getModifications().size());
-
calls = dummy.getAllCalledIds();
assertEquals(MethodDeclarations.optimisticPrepareMethod_id, calls.get(2));
@@ -768,7 +764,6 @@
assertEquals(0, cache.getTransactionTable().getNumGlobalTransactions());
assertEquals(0, cache.getTransactionTable().getNumLocalTransactions());
cache.stop();
-
}
16 years, 8 months