[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/loader ...
Manik Surtani
manik at jboss.org
Mon Jun 11 08:58:16 EDT 2007
User: msurtani
Date: 07/06/11 08:58:16
Modified: tests/functional/org/jboss/cache/loader
InterceptorSynchronizationTest.java
FileCacheLoaderTest.java BdbjeTest.java
Log:
Reduce Java5 related ide generated warnings
Revision Changes Path
1.8 +4 -7 JBossCache/tests/functional/org/jboss/cache/loader/InterceptorSynchronizationTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: InterceptorSynchronizationTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/InterceptorSynchronizationTest.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- InterceptorSynchronizationTest.java 11 Jan 2007 13:49:06 -0000 1.7
+++ InterceptorSynchronizationTest.java 11 Jun 2007 12:58:16 -0000 1.8
@@ -13,7 +13,6 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -41,7 +40,7 @@
cache.start();
long begin = System.currentTimeMillis();
- Collection threads = new ArrayList();
+ Collection<Thread> threads = new ArrayList<Thread>();
/*
* Create lots of threads all trying to load DIFFERENT fqn's, as well as a set with different top level nodes.
@@ -54,15 +53,13 @@
Thread thread2 = new Thread(new Retriever(cache, "/Meow/" + i));
threads.add(thread2);
}
- for (Iterator iter = threads.iterator(); iter.hasNext();)
+ for (Thread thread : threads)
{
- Thread thread = (Thread) iter.next();
thread.start();
-
}
- for (Iterator iter = threads.iterator(); iter.hasNext();)
+
+ for (Thread thread : threads)
{
- Thread thread = (Thread) iter.next();
thread.join();
}
1.13 +32 -32 JBossCache/tests/functional/org/jboss/cache/loader/FileCacheLoaderTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: FileCacheLoaderTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/FileCacheLoaderTest.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- FileCacheLoaderTest.java 1 Feb 2007 16:33:10 -0000 1.12
+++ FileCacheLoaderTest.java 11 Jun 2007 12:58:16 -0000 1.13
@@ -25,7 +25,7 @@
{
FileCacheLoader fcl = new FileCacheLoader();
- Object[][] data = new Object[][] {
+ Object[][] data = new Object[][]{
{"C:\\here\\there.txt", true},
{"/home/here/there", true},
{"/home/*/jboss", false},
@@ -34,10 +34,10 @@
{"/pojocache|/galder", false},
{"/pojocache/gal\"der", false}};
- for (int i=0; i < data.length; i++)
+ for (Object[] aData : data)
{
- String path = (String)data[i][0];
- boolean expected = (Boolean)data[i][1];
+ String path = (String) aData[0];
+ boolean expected = (Boolean) aData[1];
assertEquals(path, expected, fcl.isCharacterPortableLocation(path));
}
}
@@ -46,7 +46,7 @@
{
FileCacheLoader fcl = new FileCacheLoader();
- Object[][] data = new Object[][] {
+ Object[][] data = new Object[][]{
{Fqn.fromString("/a/b/c/d/e"), true},
{Fqn.fromString("/a/*/c/d/e"), false},
{Fqn.fromString("/a/b/>/d/e"), false},
@@ -56,12 +56,12 @@
{Fqn.fromString("/a/b/c/d/\""), false},
{Fqn.fromString("/a/b/c/d/\\"), false},
{Fqn.fromString("/a/b/c/d///"), true},
- {Fqn.fromString("/a/b/c/:/e"), false}, };
+ {Fqn.fromString("/a/b/c/:/e"), false},};
- for (int i=0; i < data.length; i++)
+ for (Object[] aData : data)
{
- Fqn fqn = (Fqn)data[i][0];
- boolean expected = (Boolean)data[i][1];
+ Fqn fqn = (Fqn) aData[0];
+ boolean expected = (Boolean) aData[1];
assertEquals(fqn.toString(), expected, fcl.isCharacterPortableTree(fqn));
}
}
@@ -70,15 +70,15 @@
{
FileCacheLoader fcl = new FileCacheLoader();
- Object[][] data = new Object[][] {
+ Object[][] data = new Object[][]{
{"C:\\here\\org\\jboss\\cache\\jgroups\\pojocache\\application\\server\\clustering\\portal\\web_services\\org\\jboss\\cache\\jgroups\\pojocache\\application\\server\\clustering\\portal\\webservices\\org\\jboss\\cache\\jgroups\\pojocache\\application\\server\\clustering\\portal\\data.dat", true},
{"C:\\there\\org\\jboss\\cache\\jgroups\\pojocache\\application\\server\\clustering\\portal\\web_services\\org\\jboss\\cache\\jgroups\\pojocache\\application\\server\\clustering\\portal\\webservices\\org\\jboss\\cache\\jgroups\\pojocache\\application\\server\\clustering\\portal\\data.dat", true},
{"C:\\deerme\\org\\jboss\\cache\\jgroups\\pojocache\\application\\server\\clustering\\portal\\web_services\\org\\jboss\\cache\\jgroups\\pojocache\\application\\server\\clustering\\portal\\webservices\\org\\jboss\\cache\\jgroups\\pojocache\\application\\server\\clustering\\portal\\data.dat", false}};
- for (int i=0; i < data.length; i++)
+ for (Object[] aData : data)
{
- String path = (String)data[i][0];
- boolean expected = (Boolean)data[i][1];
+ String path = (String) aData[0];
+ boolean expected = (Boolean) aData[1];
assertEquals(path, expected, fcl.isLengthPortablePath(path));
}
}
1.21 +2 -4 JBossCache/tests/functional/org/jboss/cache/loader/BdbjeTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: BdbjeTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/BdbjeTest.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- BdbjeTest.java 7 Feb 2007 22:06:49 -0000 1.20
+++ BdbjeTest.java 11 Jun 2007 12:58:16 -0000 1.21
@@ -25,7 +25,6 @@
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -37,7 +36,7 @@
* directory. Any scratch directory will do, but beware that all files in
* the directory will be deleted by setUp().</p>
*
- * @version $Revision: 1.20 $
+ * @version $Revision: 1.21 $
*/
public class BdbjeTest extends TestCase
{
@@ -758,9 +757,8 @@
break;
case PUT_DATA:
Map map = mod.getData();
- for (Iterator iter = map.keySet().iterator(); iter.hasNext();)
+ for (Object key : map.keySet())
{
- Object key = iter.next();
assertEquals(map.get(key), loader.get(fqn).get(key));
}
break;
More information about the jboss-cvs-commits
mailing list