[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/misc ...
Manik Surtani
manik at jboss.org
Mon Jul 16 22:03:26 EDT 2007
User: msurtani
Date: 07/07/16 22:03:26
Modified: tests/functional/org/jboss/cache/misc TestingUtil.java
Log:
refactored tests
Revision Changes Path
1.15 +10 -0 JBossCache/tests/functional/org/jboss/cache/misc/TestingUtil.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: TestingUtil.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/misc/TestingUtil.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- TestingUtil.java 28 Jun 2007 16:53:37 -0000 1.14
+++ TestingUtil.java 17 Jul 2007 02:03:26 -0000 1.15
@@ -10,6 +10,7 @@
import org.jboss.cache.Cache;
import org.jboss.cache.CacheImpl;
import org.jboss.cache.CacheSPI;
+import org.jboss.cache.interceptors.Interceptor;
import java.io.File;
import java.util.List;
@@ -33,6 +34,15 @@
}
};
+ public static <T extends Interceptor> T findInterceptor(CacheSPI<?, ?> cache, Class<T> interceptorToFind)
+ {
+ for (Interceptor i : cache.getInterceptorChain())
+ {
+ if (interceptorToFind.isInstance(i)) return interceptorToFind.cast(i);
+ }
+ return null;
+ }
+
/**
* Loops, continually calling {@link #areCacheViewsComplete(org.jboss.cache.Cache[])}
* until it either returns true or <code>timeout</code> ms have elapsed.
More information about the jboss-cvs-commits
mailing list