[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/pojo/rollback ...
Manik Surtani
manik at jboss.org
Wed May 23 06:28:50 EDT 2007
User: msurtani
Date: 07/05/23 06:28:50
Modified: tests/functional/org/jboss/cache/pojo/rollback
ListUndoTest.java InMemoryTxUndoTest.java
ListTxUndoTest.java LocalUndoTest.java
SetTxUndoTest.java ReplicatedTxTest.java
SetUndoTest.java MapUndoTest.java
MapTxUndoTest.java LocalExceptionUndoTest.java
LocalTxUndoTest.java
Log:
Initiated a bunch of performance fixes, including replacing CopyOnWriteArraySets with org.jboss.cache.util.concurrent.ConcurrentHashSet.
Also ran an imports optimiser on the code base - there were a lot of unused imports floating about.
Revision Changes Path
1.2 +3 -3 JBossCache/tests/functional/org/jboss/cache/pojo/rollback/ListUndoTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ListUndoTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/pojo/rollback/ListUndoTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- ListUndoTest.java 13 Jan 2007 15:55:07 -0000 1.1
+++ ListUndoTest.java 23 May 2007 10:28:50 -0000 1.2
@@ -7,17 +7,17 @@
package org.jboss.cache.pojo.rollback;
-import junit.framework.TestCase;
import junit.framework.Test;
+import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.aop.proxy.ClassProxy;
import org.jboss.cache.pojo.PojoCache;
import org.jboss.cache.pojo.PojoCacheFactory;
import org.jboss.cache.pojo.interceptors.PojoFailedTxMockupInterceptor;
import org.jboss.cache.pojo.test.Person;
import org.jboss.cache.transaction.DummyTransactionManager;
-import org.jboss.aop.proxy.ClassProxy;
import javax.transaction.TransactionManager;
import java.util.ArrayList;
@@ -95,7 +95,7 @@
private boolean isProxy(Object pojo)
{
- if(pojo instanceof ClassProxy) return true;
+ if (pojo instanceof ClassProxy) return true;
return false;
}
1.2 +8 -8 JBossCache/tests/functional/org/jboss/cache/pojo/rollback/InMemoryTxUndoTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: InMemoryTxUndoTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/pojo/rollback/InMemoryTxUndoTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- InMemoryTxUndoTest.java 13 Jan 2007 15:55:07 -0000 1.1
+++ InMemoryTxUndoTest.java 23 May 2007 10:28:50 -0000 1.2
@@ -7,19 +7,19 @@
package org.jboss.cache.pojo.rollback;
-import junit.framework.TestCase;
import junit.framework.Test;
+import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.aop.Advised;
+import org.jboss.aop.advice.Interceptor;
import org.jboss.cache.pojo.PojoCache;
import org.jboss.cache.pojo.PojoCacheFactory;
import org.jboss.cache.pojo.interceptors.dynamic.CacheFieldInterceptor;
-import org.jboss.cache.pojo.test.Person;
import org.jboss.cache.pojo.test.Address;
+import org.jboss.cache.pojo.test.Person;
import org.jboss.cache.transaction.DummyTransactionManager;
-import org.jboss.aop.advice.Interceptor;
-import org.jboss.aop.Advised;
import javax.transaction.TransactionManager;
import java.util.ArrayList;
@@ -59,13 +59,13 @@
cache_.stop();
}
-// public void testDummy() {}
+ // public void testDummy() {}
private boolean hasCacheInterceptor(Object pojo)
{
- Interceptor[] interceptors = ((Advised)pojo)._getInstanceAdvisor().getInterceptors();
- for(int i=0; i < interceptors.length; i++)
+ Interceptor[] interceptors = ((Advised) pojo)._getInstanceAdvisor().getInterceptors();
+ for (int i = 0; i < interceptors.length; i++)
{
- if(interceptors[i] instanceof CacheFieldInterceptor)
+ if (interceptors[i] instanceof CacheFieldInterceptor)
return true;
}
return false;
1.2 +3 -3 JBossCache/tests/functional/org/jboss/cache/pojo/rollback/ListTxUndoTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ListTxUndoTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/pojo/rollback/ListTxUndoTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- ListTxUndoTest.java 13 Jan 2007 15:55:07 -0000 1.1
+++ ListTxUndoTest.java 23 May 2007 10:28:50 -0000 1.2
@@ -7,16 +7,16 @@
package org.jboss.cache.pojo.rollback;
-import junit.framework.TestCase;
import junit.framework.Test;
+import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.aop.proxy.ClassProxy;
import org.jboss.cache.pojo.PojoCache;
import org.jboss.cache.pojo.PojoCacheFactory;
import org.jboss.cache.pojo.test.Person;
import org.jboss.cache.transaction.DummyTransactionManager;
-import org.jboss.aop.proxy.ClassProxy;
import javax.transaction.TransactionManager;
import java.util.ArrayList;
@@ -91,7 +91,7 @@
private boolean isProxy(Object pojo)
{
- if(pojo instanceof ClassProxy) return true;
+ if (pojo instanceof ClassProxy) return true;
return false;
}
1.2 +7 -7 JBossCache/tests/functional/org/jboss/cache/pojo/rollback/LocalUndoTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: LocalUndoTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/pojo/rollback/LocalUndoTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- LocalUndoTest.java 13 Jan 2007 15:55:07 -0000 1.1
+++ LocalUndoTest.java 23 May 2007 10:28:50 -0000 1.2
@@ -7,19 +7,19 @@
package org.jboss.cache.pojo.rollback;
-import junit.framework.TestCase;
import junit.framework.Test;
+import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.aop.Advised;
+import org.jboss.aop.advice.Interceptor;
import org.jboss.cache.pojo.PojoCache;
import org.jboss.cache.pojo.PojoCacheFactory;
-import org.jboss.cache.pojo.interceptors.dynamic.CacheFieldInterceptor;
import org.jboss.cache.pojo.interceptors.PojoFailedTxMockupInterceptor;
+import org.jboss.cache.pojo.interceptors.dynamic.CacheFieldInterceptor;
import org.jboss.cache.pojo.test.Person;
import org.jboss.cache.transaction.DummyTransactionManager;
-import org.jboss.aop.advice.Interceptor;
-import org.jboss.aop.Advised;
import javax.transaction.TransactionManager;
@@ -79,10 +79,10 @@
private boolean hasCacheInterceptor(Object pojo)
{
- Interceptor[] interceptors = ((Advised)pojo)._getInstanceAdvisor().getInterceptors();
- for(int i=0; i < interceptors.length; i++)
+ Interceptor[] interceptors = ((Advised) pojo)._getInstanceAdvisor().getInterceptors();
+ for (int i = 0; i < interceptors.length; i++)
{
- if(interceptors[i] instanceof CacheFieldInterceptor)
+ if (interceptors[i] instanceof CacheFieldInterceptor)
return true;
}
return false;
1.2 +3 -3 JBossCache/tests/functional/org/jboss/cache/pojo/rollback/SetTxUndoTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: SetTxUndoTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/pojo/rollback/SetTxUndoTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- SetTxUndoTest.java 13 Jan 2007 15:55:07 -0000 1.1
+++ SetTxUndoTest.java 23 May 2007 10:28:50 -0000 1.2
@@ -7,16 +7,16 @@
package org.jboss.cache.pojo.rollback;
-import junit.framework.TestCase;
import junit.framework.Test;
+import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.aop.proxy.ClassProxy;
import org.jboss.cache.pojo.PojoCache;
import org.jboss.cache.pojo.PojoCacheFactory;
import org.jboss.cache.pojo.test.Person;
import org.jboss.cache.transaction.DummyTransactionManager;
-import org.jboss.aop.proxy.ClassProxy;
import javax.transaction.TransactionManager;
import java.util.HashSet;
@@ -91,7 +91,7 @@
private boolean isProxy(Object pojo)
{
- if(pojo instanceof ClassProxy) return true;
+ if (pojo instanceof ClassProxy) return true;
return false;
}
1.3 +17 -12 JBossCache/tests/functional/org/jboss/cache/pojo/rollback/ReplicatedTxTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ReplicatedTxTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/pojo/rollback/ReplicatedTxTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- ReplicatedTxTest.java 16 Apr 2007 17:37:13 -0000 1.2
+++ ReplicatedTxTest.java 23 May 2007 10:28:50 -0000 1.3
@@ -7,28 +7,30 @@
package org.jboss.cache.pojo.rollback;
-import junit.framework.TestCase;
import junit.framework.Test;
+import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.config.Configuration.CacheMode;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
-import org.jboss.cache.pojo.*;
+import org.jboss.cache.pojo.PojoCache;
+import org.jboss.cache.pojo.PojoCacheFactory;
+import org.jboss.cache.pojo.TestingUtil;
import org.jboss.cache.pojo.test.Person;
import org.jboss.cache.transaction.DummyTransactionManager;
import javax.naming.Context;
-import javax.naming.NamingException;
import javax.naming.InitialContext;
-import javax.transaction.UserTransaction;
-import javax.transaction.SystemException;
+import javax.naming.NamingException;
import javax.transaction.NotSupportedException;
-import javax.transaction.Transaction;
import javax.transaction.RollbackException;
-import java.util.Properties;
-import java.util.List;
+import javax.transaction.SystemException;
+import javax.transaction.Transaction;
+import javax.transaction.UserTransaction;
import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
/**
*/
@@ -175,7 +177,8 @@
try
{
tx.rollback();
- } catch (SystemException e)
+ }
+ catch (SystemException e)
{
e.printStackTrace();
t2_ex = e;
@@ -261,7 +264,8 @@
try
{
tx.rollback();
- } catch (SystemException e)
+ }
+ catch (SystemException e)
{
e.printStackTrace();
t2_ex = e;
@@ -350,7 +354,8 @@
try
{
tx.rollback();
- } catch (SystemException e)
+ }
+ catch (SystemException e)
{
e.printStackTrace();
t2_ex = e;
1.2 +3 -3 JBossCache/tests/functional/org/jboss/cache/pojo/rollback/SetUndoTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: SetUndoTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/pojo/rollback/SetUndoTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- SetUndoTest.java 13 Jan 2007 15:55:07 -0000 1.1
+++ SetUndoTest.java 23 May 2007 10:28:50 -0000 1.2
@@ -7,17 +7,17 @@
package org.jboss.cache.pojo.rollback;
-import junit.framework.TestCase;
import junit.framework.Test;
+import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.aop.proxy.ClassProxy;
import org.jboss.cache.pojo.PojoCache;
import org.jboss.cache.pojo.PojoCacheFactory;
import org.jboss.cache.pojo.interceptors.PojoFailedTxMockupInterceptor;
import org.jboss.cache.pojo.test.Person;
import org.jboss.cache.transaction.DummyTransactionManager;
-import org.jboss.aop.proxy.ClassProxy;
import javax.transaction.TransactionManager;
import java.util.HashSet;
@@ -95,7 +95,7 @@
private boolean isProxy(Object pojo)
{
- if(pojo instanceof ClassProxy) return true;
+ if (pojo instanceof ClassProxy) return true;
return false;
}
1.2 +3 -3 JBossCache/tests/functional/org/jboss/cache/pojo/rollback/MapUndoTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: MapUndoTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/pojo/rollback/MapUndoTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- MapUndoTest.java 13 Jan 2007 15:55:07 -0000 1.1
+++ MapUndoTest.java 23 May 2007 10:28:50 -0000 1.2
@@ -7,17 +7,17 @@
package org.jboss.cache.pojo.rollback;
-import junit.framework.TestCase;
import junit.framework.Test;
+import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.aop.proxy.ClassProxy;
import org.jboss.cache.pojo.PojoCache;
import org.jboss.cache.pojo.PojoCacheFactory;
import org.jboss.cache.pojo.interceptors.PojoFailedTxMockupInterceptor;
import org.jboss.cache.pojo.test.Person;
import org.jboss.cache.transaction.DummyTransactionManager;
-import org.jboss.aop.proxy.ClassProxy;
import javax.transaction.TransactionManager;
import java.util.HashMap;
@@ -95,7 +95,7 @@
private boolean isProxy(Object pojo)
{
- if(pojo instanceof ClassProxy) return true;
+ if (pojo instanceof ClassProxy) return true;
return false;
}
1.2 +36 -35 JBossCache/tests/functional/org/jboss/cache/pojo/rollback/MapTxUndoTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: MapTxUndoTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/pojo/rollback/MapTxUndoTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- MapTxUndoTest.java 13 Jan 2007 15:55:07 -0000 1.1
+++ MapTxUndoTest.java 23 May 2007 10:28:50 -0000 1.2
@@ -7,16 +7,16 @@
package org.jboss.cache.pojo.rollback;
-import junit.framework.TestCase;
import junit.framework.Test;
+import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.aop.proxy.ClassProxy;
import org.jboss.cache.pojo.PojoCache;
import org.jboss.cache.pojo.PojoCacheFactory;
import org.jboss.cache.pojo.test.Person;
import org.jboss.cache.transaction.DummyTransactionManager;
-import org.jboss.aop.proxy.ClassProxy;
import javax.transaction.TransactionManager;
import java.util.HashMap;
@@ -92,7 +92,7 @@
private boolean isProxy(Object pojo)
{
- if(pojo instanceof ClassProxy) return true;
+ if (pojo instanceof ClassProxy) return true;
return false;
}
@@ -135,6 +135,7 @@
/**
* Contributed by Niztan Niv
+ *
* @throws Exception
*/
public void testNestedMapWithRollback() throws Exception
@@ -160,7 +161,7 @@
indexMap.put(KEY, obj1);
Object beforeModify = indexMap.get(KEY);
- System.out.println("beforeModify: " + beforeModify + ", data object id: " + ((Map)beforeModify).get("id"));
+ System.out.println("beforeModify: " + beforeModify + ", data object id: " + ((Map) beforeModify).get("id"));
// modify the collection by replacing the first data object with the second
// and then roll-back the transaction
@@ -169,7 +170,7 @@
tx_mgr.rollback();
Object afterRollback = indexMap.get(KEY);
- System.out.println("afterRollback: " + afterRollback + ", data object id: " + ((Map)afterRollback).get("id"));
+ System.out.println("afterRollback: " + afterRollback + ", data object id: " + ((Map) afterRollback).get("id"));
// check if state of collection was restored
assertEquals(beforeModify, afterRollback);
1.3 +24 -18 JBossCache/tests/functional/org/jboss/cache/pojo/rollback/LocalExceptionUndoTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: LocalExceptionUndoTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/pojo/rollback/LocalExceptionUndoTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- LocalExceptionUndoTest.java 31 Jan 2007 17:40:51 -0000 1.2
+++ LocalExceptionUndoTest.java 23 May 2007 10:28:50 -0000 1.3
@@ -22,22 +22,21 @@
package org.jboss.cache.pojo.rollback;
-import junit.framework.TestCase;
import junit.framework.Test;
+import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.pojo.PojoCache;
-import org.jboss.cache.pojo.PojoCacheFactory;
+import org.jboss.aop.Advised;
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.cache.Fqn;
import org.jboss.cache.pojo.InternalConstant;
+import org.jboss.cache.pojo.PojoCache;
import org.jboss.cache.pojo.PojoCacheException;
-import org.jboss.cache.pojo.test.Person;
-import org.jboss.cache.pojo.interceptors.PojoFailedTxMockupInterceptor;
+import org.jboss.cache.pojo.PojoCacheFactory;
import org.jboss.cache.pojo.interceptors.dynamic.CacheFieldInterceptor;
+import org.jboss.cache.pojo.test.Person;
import org.jboss.cache.transaction.DummyTransactionManager;
-import org.jboss.cache.Fqn;
-import org.jboss.aop.advice.Interceptor;
-import org.jboss.aop.Advised;
import javax.transaction.TransactionManager;
import java.util.ArrayList;
@@ -104,9 +103,11 @@
startLockThread();
- try {
+ try
+ {
cache_.attach("/a", test);
- } catch (PojoCacheException ex)
+ }
+ catch (PojoCacheException ex)
{
// ex.printStackTrace();
}
@@ -127,18 +128,22 @@
list.add("English");
test.setLanguages(list);
- try {
+ try
+ {
cache_.attach("/a", test);
- } catch (PojoCacheException ex)
+ }
+ catch (PojoCacheException ex)
{
// ex.printStackTrace();
}
startLockThread();
- try {
+ try
+ {
cache_.detach("/a");
- } catch (PojoCacheException ex)
+ }
+ catch (PojoCacheException ex)
{
// ex.printStackTrace();
}
@@ -151,10 +156,10 @@
private boolean hasCacheInterceptor(Object pojo)
{
- Interceptor[] interceptors = ((Advised)pojo)._getInstanceAdvisor().getInterceptors();
- for(int i=0; i < interceptors.length; i++)
+ Interceptor[] interceptors = ((Advised) pojo)._getInstanceAdvisor().getInterceptors();
+ for (int i = 0; i < interceptors.length; i++)
{
- if(interceptors[i] instanceof CacheFieldInterceptor)
+ if (interceptors[i] instanceof CacheFieldInterceptor)
return true;
}
return false;
@@ -188,7 +193,8 @@
sleep(100);
}
tx_mgr.commit();
- } catch (Exception ex)
+ }
+ catch (Exception ex)
{
ex.printStackTrace();
}
1.2 +8 -8 JBossCache/tests/functional/org/jboss/cache/pojo/rollback/LocalTxUndoTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: LocalTxUndoTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/pojo/rollback/LocalTxUndoTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- LocalTxUndoTest.java 13 Jan 2007 15:55:07 -0000 1.1
+++ LocalTxUndoTest.java 23 May 2007 10:28:50 -0000 1.2
@@ -7,18 +7,18 @@
package org.jboss.cache.pojo.rollback;
-import junit.framework.TestCase;
import junit.framework.Test;
+import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.pojo.test.Person;
-import org.jboss.cache.pojo.interceptors.dynamic.CacheFieldInterceptor;
+import org.jboss.aop.Advised;
+import org.jboss.aop.advice.Interceptor;
import org.jboss.cache.pojo.PojoCache;
import org.jboss.cache.pojo.PojoCacheFactory;
+import org.jboss.cache.pojo.interceptors.dynamic.CacheFieldInterceptor;
+import org.jboss.cache.pojo.test.Person;
import org.jboss.cache.transaction.DummyTransactionManager;
-import org.jboss.aop.Advised;
-import org.jboss.aop.advice.Interceptor;
import javax.transaction.TransactionManager;
@@ -76,10 +76,10 @@
private boolean hasCacheInterceptor(Object pojo)
{
- Interceptor[] interceptors = ((Advised)pojo)._getInstanceAdvisor().getInterceptors();
- for(int i=0; i < interceptors.length; i++)
+ Interceptor[] interceptors = ((Advised) pojo)._getInstanceAdvisor().getInterceptors();
+ for (int i = 0; i < interceptors.length; i++)
{
- if(interceptors[i] instanceof CacheFieldInterceptor)
+ if (interceptors[i] instanceof CacheFieldInterceptor)
return true;
}
return false;
More information about the jboss-cvs-commits
mailing list