[jboss-cvs] JBossCache/tests/functional/org/jboss/cache ...
Manik Surtani
msurtani at jboss.com
Sat Dec 30 14:48:46 EST 2006
User: msurtani
Date: 06/12/30 14:48:46
Modified: tests/functional/org/jboss/cache GetKeysTest.java
TreeNodeTest.java FqnTest.java
TreeCacheFunctionalTest.java
Log:
Genericised, autoboxed
Revision Changes Path
1.4 +2 -2 JBossCache/tests/functional/org/jboss/cache/GetKeysTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: GetKeysTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/GetKeysTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- GetKeysTest.java 30 Dec 2006 17:49:54 -0000 1.3
+++ GetKeysTest.java 30 Dec 2006 19:48:46 -0000 1.4
@@ -18,7 +18,7 @@
/**
* @author <a href="mailto:bela at jboss.org">Bela Ban</a>
- * @version $Id: GetKeysTest.java,v 1.3 2006/12/30 17:49:54 msurtani Exp $
+ * @version $Id: GetKeysTest.java,v 1.4 2006/12/30 19:48:46 msurtani Exp $
*/
public class GetKeysTest extends TestCase
{
@@ -45,7 +45,7 @@
cache.create();
cache.start();
cache.put("/a/b/c", "name", "Bela Ban");
- cache.put("/a/b/c", "age", new Integer(40));
+ cache.put("/a/b/c", "age", 40);
cache.put("/a/b/c", "city", "Kreuzlingen");
Set keys = cache.getKeys("/a/b/c");
1.5 +2 -2 JBossCache/tests/functional/org/jboss/cache/TreeNodeTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: TreeNodeTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/TreeNodeTest.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- TreeNodeTest.java 30 Dec 2006 17:49:54 -0000 1.4
+++ TreeNodeTest.java 30 Dec 2006 19:48:46 -0000 1.5
@@ -8,7 +8,7 @@
* Tests restart (stop-destroy-create-start) of CacheImpl
*
* @author Bela Ban
- * @version $Id: TreeNodeTest.java,v 1.4 2006/12/30 17:49:54 msurtani Exp $
+ * @version $Id: TreeNodeTest.java,v 1.5 2006/12/30 19:48:46 msurtani Exp $
*/
public class TreeNodeTest extends TestCase
{
@@ -29,7 +29,7 @@
public void testChildExist() throws Exception
{
- Object key = new Integer(1);
+ Object key = 1;
cache.put("/a/b/c", key, "test");
Node node;
node = cache.get("/a/b");
1.18 +19 -19 JBossCache/tests/functional/org/jboss/cache/FqnTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: FqnTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/FqnTest.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- FqnTest.java 30 Dec 2006 17:49:54 -0000 1.17
+++ FqnTest.java 30 Dec 2006 19:48:46 -0000 1.18
@@ -20,7 +20,7 @@
* Tests {@link Fqn}.
*
* @author <a href="mailto:bela at jboss.org">Bela Ban</a> May 9, 2003
- * @version $Revision: 1.17 $
+ * @version $Revision: 1.18 $
*/
public class FqnTest extends TestCase
{
@@ -41,7 +41,7 @@
public void testOne()
{
- Fqn fqn = new Fqn(new Integer(22));
+ Fqn fqn = new Fqn(22);
log("one fqn is " + fqn);
assertEquals(1, fqn.size());
int hcode = fqn.hashCode();
@@ -70,11 +70,11 @@
public void testHereogeneousNames()
{
- Fqn fqn = new Fqn(new Object[]{"string", new Integer(38), new Boolean(true)});
+ Fqn fqn = new Fqn(new Object[]{"string", 38, true});
log("fqn is " + fqn);
assertEquals(3, fqn.size());
- Fqn fqn2 = new Fqn(new Object[]{"string", new Integer(38), new Boolean(true)});
+ Fqn fqn2 = new Fqn(new Object[]{"string", 38, true});
assertEquals(fqn, fqn2);
assertEquals(fqn.hashCode(), fqn2.hashCode());
}
@@ -88,15 +88,15 @@
assertEquals(fqn1, fqn2);
HashMap map = new HashMap();
- map.put(fqn1, new Integer(33));
- map.put(fqn2, new Integer(34));
+ map.put(fqn1, 33);
+ map.put(fqn2, 34);
assertEquals(1, map.size());
- assertEquals(new Integer(34), map.get(fqn1));
+ assertEquals(34, map.get(fqn1));
}
public void testHashcode2()
{
- Fqn fqn = new Fqn(new Integer(-1));
+ Fqn fqn = new Fqn(-1);
log("one fqn is " + fqn);
assertEquals(1, fqn.size());
int hcode = fqn.hashCode();
@@ -151,7 +151,7 @@
public void testEquals3()
{
Fqn f1, f2;
- f1 = new Fqn(new Object[]{"a", new Integer(322649), Boolean.TRUE});
+ f1 = new Fqn(new Object[]{"a", 322649, Boolean.TRUE});
f2 = new Fqn();
assertFalse(f1.equals(f2));
assertFalse(f2.equals(f1));
@@ -159,17 +159,17 @@
f2 = Fqn.fromString("a/322649/TRUE");
assertFalse(f1.equals(f2));
- f2 = new Fqn(new Object[]{"a", new Integer(322649), Boolean.FALSE});
+ f2 = new Fqn(new Object[]{"a", 322649, Boolean.FALSE});
assertFalse(f1.equals(f2));
- f2 = new Fqn(new Object[]{"a", new Integer(322649), Boolean.TRUE});
+ f2 = new Fqn(new Object[]{"a", 322649, Boolean.TRUE});
assertEquals(f1, f2);
}
public void testEquals3WithMarshalling() throws Exception
{
Fqn f1, f2;
- f1 = new Fqn(new Object[]{"a", new Integer(322649), Boolean.TRUE});
+ f1 = new Fqn(new Object[]{"a", 322649, Boolean.TRUE});
f2 = marshalAndUnmarshal(f1);
assertEquals(f1, f2);
assertEquals(f2, f1);
@@ -178,11 +178,11 @@
f2 = marshalAndUnmarshal(f2);
assertFalse(f1.equals(f2));
- f2 = new Fqn(new Object[]{"a", new Integer(322649), Boolean.FALSE});
+ f2 = new Fqn(new Object[]{"a", 322649, Boolean.FALSE});
f2 = marshalAndUnmarshal(f2);
assertFalse(f1.equals(f2));
- f2 = new Fqn(new Object[]{"a", new Integer(322649), Boolean.TRUE});
+ f2 = new Fqn(new Object[]{"a", 322649, Boolean.TRUE});
f2 = marshalAndUnmarshal(f2);
assertEquals(f1, f2);
}
@@ -209,10 +209,10 @@
Fqn fqn0 = new Fqn((Object) null);
assertEquals(1, fqn0.size());
- Fqn fqn1 = new Fqn(new Object[]{"NULL", null, new Integer(0)});
+ Fqn fqn1 = new Fqn(new Object[]{"NULL", null, 0});
assertEquals(3, fqn1.size());
- Fqn fqn2 = new Fqn(new Object[]{"NULL", null, new Integer(0),});
+ Fqn fqn2 = new Fqn(new Object[]{"NULL", null, 0,});
assertEquals(fqn1.hashCode(), fqn2.hashCode());
assertEquals(fqn1, fqn2);
assertEquals(fqn1, fqn1.clone());
@@ -287,7 +287,7 @@
public void testGetName()
{
- Fqn integerFqn = new Fqn(new Integer(1));
+ Fqn integerFqn = new Fqn(1);
assertEquals("1", integerFqn.getName());
Object object = new Object();
@@ -303,13 +303,13 @@
public void testCloningOtherTypes() throws CloneNotSupportedException
{
- Fqn f = new Fqn(new Object[]{"blah", new Integer(10), Boolean.TRUE});
+ Fqn f = new Fqn(new Object[]{"blah", 10, Boolean.TRUE});
assertEquals(f, f.clone());
}
public void testRemovalNonString() throws Exception
{
- Fqn f = new Fqn(new Object[]{"test", new Integer(1)});
+ Fqn f = new Fqn(new Object[]{"test", 1});
// CacheImpl tc = new CacheImpl();
// tc.getConfiguration().setCacheMode("LOCAL");
// tc.start();
1.7 +5 -5 JBossCache/tests/functional/org/jboss/cache/TreeCacheFunctionalTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: TreeCacheFunctionalTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/TreeCacheFunctionalTest.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- TreeCacheFunctionalTest.java 30 Dec 2006 17:49:54 -0000 1.6
+++ TreeCacheFunctionalTest.java 30 Dec 2006 19:48:46 -0000 1.7
@@ -13,7 +13,7 @@
* Simple functional tests for CacheImpl
*
* @author Bela Ban
- * @version $Id: TreeCacheFunctionalTest.java,v 1.6 2006/12/30 17:49:54 msurtani Exp $
+ * @version $Id: TreeCacheFunctionalTest.java,v 1.7 2006/12/30 19:48:46 msurtani Exp $
*/
public class TreeCacheFunctionalTest extends TestCase
{
@@ -53,8 +53,8 @@
public void testPut() throws CacheException
{
- cache.put("/a/b/c", "age", new Integer(38));
- assertEquals(cache.get("/a/b/c", "age"), new Integer(38));
+ cache.put("/a/b/c", "age", 38);
+ assertEquals(cache.get("/a/b/c", "age"), 38);
assertNotNull(cache.get("/a/b/c"));
assertEquals(0, cache.getNumberOfLocksHeld());
assertEquals(0, cache.getLockTable().size());
@@ -95,9 +95,9 @@
public void testPutKeys() throws CacheException
{
- cache.put("/a/b/c", "age", new Integer(38));
+ cache.put("/a/b/c", "age", 38);
cache.put("/a/b/c", "name", "Bela");
- assertEquals(cache.get("/a/b/c", "age"), new Integer(38));
+ assertEquals(cache.get("/a/b/c", "age"), 38);
assertNotNull(cache.get("/a/b/c"));
assertEquals(cache.getKeys("/a/b/c").size(), 2);
assertEquals(cache.exists("/a/b/c"), true);
More information about the jboss-cvs-commits
mailing list