Author: manik.surtani(a)jboss.com
Date: 2008-06-25 09:32:44 -0400 (Wed, 25 Jun 2008)
New Revision: 6032
Modified:
core/trunk/src/test/java/org/jboss/cache/FqnTest.java
core/trunk/src/test/java/org/jboss/cache/api/NodeMoveAPITest.java
core/trunk/src/test/java/org/jboss/cache/api/SyncReplTest.java
core/trunk/src/test/java/org/jboss/cache/api/SyncReplTxTest.java
core/trunk/src/test/java/org/jboss/cache/lock/ReentrantWriterPreferenceReadWriteLockTest.java
core/trunk/src/test/java/org/jboss/cache/replicated/SyncReplTest.java
Log:
Updated tests
Modified: core/trunk/src/test/java/org/jboss/cache/FqnTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/FqnTest.java 2008-06-25 13:29:24 UTC (rev
6031)
+++ core/trunk/src/test/java/org/jboss/cache/FqnTest.java 2008-06-25 13:32:44 UTC (rev
6032)
@@ -216,14 +216,6 @@
assert !fqn.equals(null);
}
- public void testClone() throws CloneNotSupportedException
- {
- Fqn<String> fqn1 = Fqn.fromString("/a/b/c");
- Fqn<String> fqn2 = fqn1.clone();
- assert fqn1.equals(fqn2);
- assert fqn1.hashCode() == fqn2.hashCode();
- }
-
public void testNullElements() throws CloneNotSupportedException
{
Fqn<Object> fqn0 = Fqn.fromElements((Object) null);
@@ -235,7 +227,6 @@
Fqn fqn2 = Fqn.fromElements("NULL", null, 0);
assert fqn1.hashCode() == fqn2.hashCode();
assert fqn1.equals(fqn2);
- assert fqn1.equals(fqn1.clone());
}
public void testIteration()
@@ -320,18 +311,6 @@
assert object.toString().equals(objectFqn.getLastElementAsString());
}
- public void testCloningString() throws CloneNotSupportedException
- {
- Fqn<String> f = Fqn.fromString("/a/b/c");
- assert f.equals(f.clone());
- }
-
- public void testCloningOtherTypes() throws CloneNotSupportedException
- {
- Fqn f = Fqn.fromElements("blah", 10, Boolean.TRUE);
- assert f.equals(f.clone());
- }
-
public void testRemovalNonString() throws Exception
{
Fqn f = Fqn.fromElements("test", 1);
Modified: core/trunk/src/test/java/org/jboss/cache/api/NodeMoveAPITest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/NodeMoveAPITest.java 2008-06-25 13:29:24
UTC (rev 6031)
+++ core/trunk/src/test/java/org/jboss/cache/api/NodeMoveAPITest.java 2008-06-25 13:32:44
UTC (rev 6032)
@@ -2,7 +2,11 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.*;
+import org.jboss.cache.CacheSPI;
+import org.jboss.cache.DefaultCacheFactory;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.Node;
+import org.jboss.cache.NodeNotExistsException;
import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.parsing.CacheLoadersElementParser;
@@ -324,7 +328,7 @@
log.info("nodeD get child E ");
nodeE = nodeD.getChild(E);
- Fqn old_C = C.clone();
+ Fqn old_C = C;
Fqn old_D = Fqn.fromRelativeFqn(old_C, D);
Fqn old_E = Fqn.fromRelativeFqn(old_D, E);
@@ -529,14 +533,14 @@
protected CacheLoaderConfig getSingleCacheLoaderConfig(boolean passivation, String
preload, String cacheloaderClass, String properties, boolean async, boolean
fetchPersistentState, boolean shared, boolean purgeOnStartup) throws Exception
{
String xml =
- " <cacheLoaders passivation=\"" + passivation +
"\" shared=\"" + shared + "\">\n" +
+ " <cacheLoaders passivation=\"" + passivation +
"\" shared=\"" + shared + "\">\n" +
" <preload>\n" +
" <node fqn=\"" + preload +
"\"/>\n" +
" </preload>\n" +
" <cacheLoader class=\"" + cacheloaderClass +
"\" async=\"" + async + "\"
fetchPersistentState=\"" + fetchPersistentState + "\"\n" +
" purgeOnStartup=\"" +
purgeOnStartup + "\">\n" +
" <properties>\n" +
- properties +
+ properties +
" </properties>\n" +
" </cacheLoader>\n" +
" </cacheLoaders>";
Modified: core/trunk/src/test/java/org/jboss/cache/api/SyncReplTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/SyncReplTest.java 2008-06-25 13:29:24 UTC
(rev 6031)
+++ core/trunk/src/test/java/org/jboss/cache/api/SyncReplTest.java 2008-06-25 13:32:44 UTC
(rev 6032)
@@ -135,15 +135,8 @@
private void assertInvocationContextInitState(Cache c)
{
InvocationContext ctx = c.getInvocationContext();
- InvocationContext control = null;
- try
- {
- control = ctx.clone();
- }
- catch (CloneNotSupportedException e)
- {
- throw new RuntimeException(e);
- }
+ InvocationContext control;
+ control = InvocationContext.copy(ctx);
control.reset();
control.setOptionOverrides(new Option());
Modified: core/trunk/src/test/java/org/jboss/cache/api/SyncReplTxTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/SyncReplTxTest.java 2008-06-25 13:29:24
UTC (rev 6031)
+++ core/trunk/src/test/java/org/jboss/cache/api/SyncReplTxTest.java 2008-06-25 13:32:44
UTC (rev 6032)
@@ -149,15 +149,8 @@
private void assertInvocationContextInitState(Cache<Object, Object> c)
{
InvocationContext ctx = c.getInvocationContext();
- InvocationContext control = null;
- try
- {
- control = ctx.clone();
- }
- catch (CloneNotSupportedException e)
- {
- throw new RuntimeException(e);
- }
+ InvocationContext control;
+ control = InvocationContext.copy(ctx);
control.reset();
control.setOptionOverrides(new Option());
Modified:
core/trunk/src/test/java/org/jboss/cache/lock/ReentrantWriterPreferenceReadWriteLockTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/lock/ReentrantWriterPreferenceReadWriteLockTest.java 2008-06-25
13:29:24 UTC (rev 6031)
+++
core/trunk/src/test/java/org/jboss/cache/lock/ReentrantWriterPreferenceReadWriteLockTest.java 2008-06-25
13:32:44 UTC (rev 6032)
@@ -8,6 +8,7 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
/**
* Tests ReentrantWriterPreferenceReadWriteLock
Modified: core/trunk/src/test/java/org/jboss/cache/replicated/SyncReplTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/replicated/SyncReplTest.java 2008-06-25
13:29:24 UTC (rev 6031)
+++ core/trunk/src/test/java/org/jboss/cache/replicated/SyncReplTest.java 2008-06-25
13:32:44 UTC (rev 6032)
@@ -141,15 +141,8 @@
private void assertInvocationContextInitState(Cache c)
{
InvocationContext ctx = c.getInvocationContext();
- InvocationContext control = null;
- try
- {
- control = ctx.clone();
- }
- catch (CloneNotSupportedException e)
- {
- throw new RuntimeException(e);
- }
+ InvocationContext control;
+ control = InvocationContext.copy(ctx);
control.reset();
control.setOptionOverrides(new Option());
Show replies by date