[jbosscache-commits] JBoss Cache SVN: r4449 - in pojo/trunk: src/main/resources and 14 other directories.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Fri Sep 7 23:26:16 EDT 2007


Author: jason.greene at jboss.com
Date: 2007-09-07 23:26:15 -0400 (Fri, 07 Sep 2007)
New Revision: 4449

Added:
   pojo/trunk/src/main/resources/META-INF/
   pojo/trunk/src/main/resources/META-INF/pojocache-aop.xml
Removed:
   pojo/trunk/src/main/resources/pojocache-aop.xml
Modified:
   pojo/trunk/pom.xml
   pojo/trunk/src/test/java/org/jboss/cache/pojo/ArrayTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/BuddyReplicationTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/CachedTypeTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/CircularGraphTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/EnumTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalConcurrentTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalTxTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/NewLocalTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/NewReplicatedTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/NewReplicatedTxTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/NonAspectizedTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/ObjectGraphTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/RecursiveRefTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedByteTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedCircularGraphTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedNonSerializableTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedObjectGraphTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedPutWithBulkRemoveTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedSerializableTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedTxTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/TxUndoTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/annotation/ReplicatedAnnotationTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CachedListImplTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CachedListTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CachedListTxTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CachedMapImplTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CachedMapNullTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CachedMapTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CachedSetTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CollectionTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/ObjectGraphTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/ReplicatedSyncListTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/ReplicatedSyncMapTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/ReplicatedSyncSetTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/integrated/NetworkManagementTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/integrated/PropagationManagerlTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/integrated/ReplicatedNetworkManagementTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/integrated/ReplicatedPropagationManagerlTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/InterceptorRegistrationTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/LegacyConfigurationTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/LifecycleNotificationTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/NotificationTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/OptimisticNotificationTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/PojoCacheJmxWrapperTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/PojoCacheJmxWrapperTestBase.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/memory/ReplicatedTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/ListTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/MapTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/ObjectTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/ReplicatedListTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/ReplicatedMapTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/ReplicatedObjectTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/ReplicatedSetTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/SetTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/TxObjectTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/optimistic/AbstractOptimisticTestCase.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/optimistic/CachedListTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/optimistic/LocalTxTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/passivation/LocalTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/passivation/ReplicatedTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/region/LocalConcurrentTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/region/LocalTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/region/NewLocalTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/region/ReplicatedTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/InMemoryTxUndoTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/ListTxUndoTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/ListUndoTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/LocalExceptionUndoTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/LocalTxUndoTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/LocalUndoTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/MapTxUndoTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/MapUndoTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/PojoCollectionRollbackTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/ReplicatedTxTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/SetTxUndoTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/SetUndoTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/statetransfer/ReplicatedTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/statetransfer/StateTransfer200AopTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/statetransfer/StateTransferAopTestBase.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/util/MethodCallTest.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/util/ObjectUtilTest.java
Log:
Convert pojo cache tests to testng
Add custom surefire config for loadtime weaving


Modified: pojo/trunk/pom.xml
===================================================================
--- pojo/trunk/pom.xml	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/pom.xml	2007-09-08 03:26:15 UTC (rev 4449)
@@ -9,7 +9,7 @@
   <parent>
     <groupId>org.jboss.cache</groupId>
     <artifactId>jbosscache-common-parent</artifactId>
-    <version>1.0</version>
+    <version>1.1-SNAPSHOT</version>
   </parent>
   <groupId>org.jboss.cache</groupId>
   <artifactId>jbosscache-pojo</artifactId>
@@ -61,6 +61,30 @@
         </executions>
       </plugin>
       <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>2.3</version>
+        <configuration>
+          <systemProperties>
+            <property>
+              <name>bind.address</name>
+              <value>127.0.0.1</value>
+            </property>
+            <property>
+              <name>jgroups.stack</name>
+              <value>udp</value>
+            </property>
+          </systemProperties>
+          <groups>functional</groups>
+          <forkMode>always</forkMode>
+          <argLine>-Djboss.aop.path=src/main/resources/META-INF/pojocache-aop.xml -javaagent:${settings.localRepository}/org/jboss/aop/jboss-aop/2.0.0-SNAPSHOT/jboss-aop-2.0.0-SNAPSHOT.jar</argLine>
+          <!-- Warning, this does not work right on 2.4-SNAPSHOT, (see SUREFIRE-349) -->
+          <!-- This seems to fail in some cases on 2.3 as well, disable for now -->
+          <useSystemClassLoader>true</useSystemClassLoader>
+          <redirectTestOutputToFile>false</redirectTestOutputToFile>
+        </configuration>
+      </plugin>
+      <plugin>
         <groupId>org.jboss.maven.plugins</groupId>
         <artifactId>maven-jbossaop-plugin</artifactId>
         <version>1.0-SNAPSHOT</version>
@@ -73,7 +97,7 @@
             </goals>
             <configuration>
               <verbose>false</verbose>
-              <aoppath>src/main/resources/pojocache-aop.xml</aoppath>
+              <aoppath>src/main/resources/META-INF/pojocache-aop.xml</aoppath>
             </configuration>
           </execution>
         </executions>
@@ -226,6 +250,6 @@
       <id>repository.jboss.org</id>
       <url>http://repository.jboss.org/maven2</url>
     </repository>
+
   </repositories>
-
 </project>

Copied: pojo/trunk/src/main/resources/META-INF/pojocache-aop.xml (from rev 4444, pojo/trunk/src/main/resources/pojocache-aop.xml)
===================================================================
--- pojo/trunk/src/main/resources/META-INF/pojocache-aop.xml	                        (rev 0)
+++ pojo/trunk/src/main/resources/META-INF/pojocache-aop.xml	2007-09-08 03:26:15 UTC (rev 4449)
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    This is the PojoCache configuration file that specifies:
+      1. Interceptor stack for API
+      2. Annotation binding for POJO (via "prepare" element)
+
+    Basically, this is a variant of jboss-aop.xml. Note that
+    except for the customization of interceptor stack, you should
+    not need to modify this file.
+
+    To run PojoCache, you will need to define a system property:
+    jboss.aop.path that contains the path to this file such that JBoss Aop
+    can locate it.
+-->
+<aop>
+
+   <!--
+   This defines the PojoCache 2.0 interceptor stack. Unless necessary, don't modify the stack here!
+   -->
+
+   <!-- Check id range validity -->
+   <interceptor name="CheckId" class="org.jboss.cache.pojo.interceptors.CheckIdInterceptor"
+                scope="PER_INSTANCE"/>
+
+   <!-- Track Tx undo operation -->
+   <interceptor name="Undo" class="org.jboss.cache.pojo.interceptors.PojoTxUndoInterceptor"
+                scope="PER_INSTANCE"/>
+
+   <!-- Begining of interceptor chain -->
+   <interceptor name="Start" class="org.jboss.cache.pojo.interceptors.PojoBeginInterceptor"
+                scope="PER_INSTANCE">
+   </interceptor>
+
+   <!-- Check if we need a local tx for batch processing -->
+   <interceptor name="Tx" class="org.jboss.cache.pojo.interceptors.PojoTxInterceptor"
+                scope="PER_INSTANCE"/>
+
+   <!--
+      Mockup failed tx for testing. You will need to set PojoFailedTxMockupInterceptor.setRollback(true)
+      to activate it.
+    -->
+   <interceptor name="MockupTx" class="org.jboss.cache.pojo.interceptors.PojoFailedTxMockupInterceptor"
+                scope="PER_INSTANCE"/>
+
+   <!-- Perform parent level node locking -->
+   <interceptor name="TxLock" class="org.jboss.cache.pojo.interceptors.PojoTxLockInterceptor"
+                scope="PER_INSTANCE"/>
+
+   <!-- Interceptor to perform Pojo level rollback -->
+   <interceptor name="TxUndo" class="org.jboss.cache.pojo.interceptors.PojoTxUndoSynchronizationInterceptor"
+                scope="PER_INSTANCE"/>
+
+   <!-- Interceptor to used to check recursive field interception. -->
+   <interceptor name="ReentrantToString" class="org.jboss.cache.pojo.interceptors.MethodReentrancyStopperInterceptor"
+                scope="PER_INSTANCE">
+               <attribute name="MethodName">toString</attribute>
+   </interceptor>
+
+   <interceptor name="ReentrantHashCode" class="org.jboss.cache.pojo.interceptors.MethodReentrancyStopperInterceptor"
+                scope="PER_INSTANCE">
+               <attribute name="MethodName">hashCode</attribute>
+   </interceptor>
+
+   <!-- Whether to allow non-serializable pojo. Default is false. -->
+   <interceptor name="MarshallNonSerializable"
+                class="org.jboss.cache.pojo.interceptors.CheckNonSerializableInterceptor"
+                scope="PER_INSTANCE">
+         <attribute name="marshallNonSerializable">false</attribute>
+                </interceptor>
+
+   <!-- This defines the stack macro -->
+   <stack name="Attach">
+      <interceptor-ref name="Start"/>
+      <interceptor-ref name="CheckId"/>
+      <interceptor-ref name="MarshallNonSerializable"/>
+      <interceptor-ref name="Tx"/>
+      <!-- NOTE: You can comment this out during production although leaving it here is OK. -->
+      <interceptor-ref name="MockupTx"/>
+      <interceptor-ref name="TxLock"/>
+      <interceptor-ref name="TxUndo"/>
+   </stack>
+
+   <stack name="Detach">
+      <interceptor-ref name="Start"/>
+      <interceptor-ref name="CheckId"/>
+      <interceptor-ref name="Tx"/>
+      <!-- NOTE: You can comment this out during production although leaving it here is OK. -->
+      <interceptor-ref name="MockupTx"/>
+      <interceptor-ref name="TxLock"/>
+      <interceptor-ref name="TxUndo"/>
+   </stack>
+
+   <stack name="Find">
+      <interceptor-ref name="Start"/>
+      <interceptor-ref name="CheckId"/>
+   </stack>
+
+   <!--
+      The following section should be READ-ONLY!! It defines the annotation binding to the stack.
+   -->
+
+   <!-- This binds the jointpoint to specific in-memory operations. Currently in PojoUtil. -->
+   <bind pointcut="execution(*
+      @org.jboss.cache.pojo.annotation.Reentrant->toString())">
+      <interceptor-ref name="ReentrantToString"/>
+   </bind>
+
+   <bind pointcut="execution(*
+      @org.jboss.cache.pojo.annotation.Reentrant->hashCode())">
+      <interceptor-ref name="ReentrantHashCode"/>
+   </bind>
+
+   <bind pointcut="execution(*
+      org.jboss.cache.pojo.impl.PojoUtil->@org.jboss.cache.pojo.annotation.TxUndo(..))">
+      <interceptor-ref name="Undo"/>
+   </bind>
+
+   <bind pointcut="execution(* org.jboss.cache.pojo.impl.PojoCacheImpl->@org.jboss.cache.pojo.annotation.Attach(..))">
+      <stack-ref name="Attach"/>
+   </bind>
+
+   <bind pointcut="execution(* org.jboss.cache.pojo.impl.PojoCacheImpl->@org.jboss.cache.pojo.annotation.Detach(..))">
+      <stack-ref name="Detach"/>
+   </bind>
+
+   <bind pointcut="execution(* org.jboss.cache.pojo.impl.PojoCacheImpl->@org.jboss.cache.pojo.annotation.Find(..))">
+      <stack-ref name="Find"/>
+   </bind>
+
+
+   <!--
+      Following is declaration for JDK50 annotation. You use the specific annotation on your
+      POJO such that it can be instrumented. Idea is user will then need only to annotate like:
+        @org.jboss.cache.pojo.annotation.Replicable
+      in his POJO. There will be no need of jboss-aop.xml from user's side.
+      Note that this annotation is inheritant, meaning the subclass will be
+      instrumented as well.
+   -->
+
+   <!-- If a POJO has PojoCachable annotation, it will be asepectized. -->
+   <!--
+   Supports inheritance and polymorphism. It can either be a concrete class
+   or an interface. All sub-classes or interface implementors will be instrumeneted.
+   -->
+   <prepare expr="field(* $instanceof{@org.jboss.cache.pojo.annotation.Replicable}->*)" />
+</aop>

Deleted: pojo/trunk/src/main/resources/pojocache-aop.xml
===================================================================
--- pojo/trunk/src/main/resources/pojocache-aop.xml	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/main/resources/pojocache-aop.xml	2007-09-08 03:26:15 UTC (rev 4449)
@@ -1,146 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    This is the PojoCache configuration file that specifies:
-      1. Interceptor stack for API
-      2. Annotation binding for POJO (via "prepare" element)
-
-    Basically, this is a variant of jboss-aop.xml. Note that
-    except for the customization of interceptor stack, you should
-    not need to modify this file.
-
-    To run PojoCache, you will need to define a system property:
-    jboss.aop.path that contains the path to this file such that JBoss Aop
-    can locate it.
--->
-<aop>
-
-   <!--
-   This defines the PojoCache 2.0 interceptor stack. Unless necessary, don't modify the stack here!
-   -->
-
-   <!-- Check id range validity -->
-   <interceptor name="CheckId" class="org.jboss.cache.pojo.interceptors.CheckIdInterceptor"
-                scope="PER_INSTANCE"/>
-
-   <!-- Track Tx undo operation -->
-   <interceptor name="Undo" class="org.jboss.cache.pojo.interceptors.PojoTxUndoInterceptor"
-                scope="PER_INSTANCE"/>
-
-   <!-- Begining of interceptor chain -->
-   <interceptor name="Start" class="org.jboss.cache.pojo.interceptors.PojoBeginInterceptor"
-                scope="PER_INSTANCE">
-   </interceptor>
-
-   <!-- Check if we need a local tx for batch processing -->
-   <interceptor name="Tx" class="org.jboss.cache.pojo.interceptors.PojoTxInterceptor"
-                scope="PER_INSTANCE"/>
-
-   <!--
-      Mockup failed tx for testing. You will need to set PojoFailedTxMockupInterceptor.setRollback(true)
-      to activate it.
-    -->
-   <interceptor name="MockupTx" class="org.jboss.cache.pojo.interceptors.PojoFailedTxMockupInterceptor"
-                scope="PER_INSTANCE"/>
-
-   <!-- Perform parent level node locking -->
-   <interceptor name="TxLock" class="org.jboss.cache.pojo.interceptors.PojoTxLockInterceptor"
-                scope="PER_INSTANCE"/>
-
-   <!-- Interceptor to perform Pojo level rollback -->
-   <interceptor name="TxUndo" class="org.jboss.cache.pojo.interceptors.PojoTxUndoSynchronizationInterceptor"
-                scope="PER_INSTANCE"/>
-
-   <!-- Interceptor to used to check recursive field interception. -->
-   <interceptor name="ReentrantToString" class="org.jboss.cache.pojo.interceptors.MethodReentrancyStopperInterceptor"
-                scope="PER_INSTANCE">
-               <attribute name="MethodName">toString</attribute>
-   </interceptor>
-
-   <interceptor name="ReentrantHashCode" class="org.jboss.cache.pojo.interceptors.MethodReentrancyStopperInterceptor"
-                scope="PER_INSTANCE">
-               <attribute name="MethodName">hashCode</attribute>
-   </interceptor>
-
-   <!-- Whether to allow non-serializable pojo. Default is false. -->
-   <interceptor name="MarshallNonSerializable"
-                class="org.jboss.cache.pojo.interceptors.CheckNonSerializableInterceptor"
-                scope="PER_INSTANCE">
-         <attribute name="marshallNonSerializable">false</attribute>
-                </interceptor>
-
-   <!-- This defines the stack macro -->
-   <stack name="Attach">
-      <interceptor-ref name="Start"/>
-      <interceptor-ref name="CheckId"/>
-      <interceptor-ref name="MarshallNonSerializable"/>
-      <interceptor-ref name="Tx"/>
-      <!-- NOTE: You can comment this out during production although leaving it here is OK. -->
-      <interceptor-ref name="MockupTx"/>
-      <interceptor-ref name="TxLock"/>
-      <interceptor-ref name="TxUndo"/>
-   </stack>
-
-   <stack name="Detach">
-      <interceptor-ref name="Start"/>
-      <interceptor-ref name="CheckId"/>
-      <interceptor-ref name="Tx"/>
-      <!-- NOTE: You can comment this out during production although leaving it here is OK. -->
-      <interceptor-ref name="MockupTx"/>
-      <interceptor-ref name="TxLock"/>
-      <interceptor-ref name="TxUndo"/>
-   </stack>
-
-   <stack name="Find">
-      <interceptor-ref name="Start"/>
-      <interceptor-ref name="CheckId"/>
-   </stack>
-
-   <!--
-      The following section should be READ-ONLY!! It defines the annotation binding to the stack.
-   -->
-
-   <!-- This binds the jointpoint to specific in-memory operations. Currently in PojoUtil. -->
-   <bind pointcut="execution(*
-      @org.jboss.cache.pojo.annotation.Reentrant->toString())">
-      <interceptor-ref name="ReentrantToString"/>
-   </bind>
-
-   <bind pointcut="execution(*
-      @org.jboss.cache.pojo.annotation.Reentrant->hashCode())">
-      <interceptor-ref name="ReentrantHashCode"/>
-   </bind>
-
-   <bind pointcut="execution(*
-      org.jboss.cache.pojo.impl.PojoUtil->@org.jboss.cache.pojo.annotation.TxUndo(..))">
-      <interceptor-ref name="Undo"/>
-   </bind>
-
-   <bind pointcut="execution(* org.jboss.cache.pojo.impl.PojoCacheImpl->@org.jboss.cache.pojo.annotation.Attach(..))">
-      <stack-ref name="Attach"/>
-   </bind>
-
-   <bind pointcut="execution(* org.jboss.cache.pojo.impl.PojoCacheImpl->@org.jboss.cache.pojo.annotation.Detach(..))">
-      <stack-ref name="Detach"/>
-   </bind>
-
-   <bind pointcut="execution(* org.jboss.cache.pojo.impl.PojoCacheImpl->@org.jboss.cache.pojo.annotation.Find(..))">
-      <stack-ref name="Find"/>
-   </bind>
-
-
-   <!--
-      Following is declaration for JDK50 annotation. You use the specific annotation on your
-      POJO such that it can be instrumented. Idea is user will then need only to annotate like:
-        @org.jboss.cache.pojo.annotation.Replicable
-      in his POJO. There will be no need of jboss-aop.xml from user's side.
-      Note that this annotation is inheritant, meaning the subclass will be
-      instrumented as well.
-   -->
-
-   <!-- If a POJO has PojoCachable annotation, it will be asepectized. -->
-   <!--
-   Supports inheritance and polymorphism. It can either be a concrete class
-   or an interface. All sub-classes or interface implementors will be instrumeneted.
-   -->
-   <prepare expr="field(* $instanceof{@org.jboss.cache.pojo.annotation.Replicable}->*)" />
-</aop>

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/ArrayTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/ArrayTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/ArrayTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,33 +7,29 @@
 
 package org.jboss.cache.pojo;
 
-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.ArrayObject;
 import org.jboss.cache.pojo.test.Person;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
 /**
  * Basic PojoCache test case.
  *
  * @author Ben Wang
  */
-
-public class ArrayTest extends TestCase
+ at Test(groups = {"functional"})
+public class ArrayTest 
 {
    Log log = LogFactory.getLog(ArrayTest.class);
    PojoCache cache_;
 
-   public ArrayTest(String name)
-   {
-      super(name);
-   }
-
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
@@ -41,9 +37,9 @@
       cache_.start();
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
    }
 
@@ -68,15 +64,7 @@
 
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(ArrayTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(ArrayTest.suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/BuddyReplicationTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/BuddyReplicationTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/BuddyReplicationTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -22,23 +22,24 @@
 
 package org.jboss.cache.pojo;
 
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertNull;
+
 import java.util.List;
-import java.util.Set;
 
-import junit.framework.TestCase;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.Fqn;
-import org.jboss.cache.Node;
 import org.jboss.cache.buddyreplication.NextMemberBuddyLocatorConfig;
 import org.jboss.cache.config.BuddyReplicationConfig;
 import org.jboss.cache.config.Configuration;
 import org.jboss.cache.config.Configuration.CacheMode;
 import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
-import org.jboss.cache.pojo.impl.PojoReference;
 import org.jboss.cache.pojo.test.Person;
 import org.jboss.cache.pojo.test.Student;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
 /**
  * A BuddyReplicatedTest.
@@ -46,19 +47,15 @@
  * @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
  * @version $Revision$
  */
-public class BuddyReplicationTest extends TestCase
+ at Test(groups = {"functional"})
+public class BuddyReplicationTest 
 {
    Log log = LogFactory.getLog(ReplicatedTest.class);
    PojoCache cache, cache1;
 
-   public BuddyReplicationTest(String name)
-   {
-      super(name);
-   }
-
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       boolean toStart = false;
       Configuration cfg1 = UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC);
@@ -71,9 +68,9 @@
       cache1.start();
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache.stop();
       cache1.stop();
    }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/CachedTypeTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/CachedTypeTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/CachedTypeTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -22,37 +22,34 @@
 
 package org.jboss.cache.pojo;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertTrue;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.cache.pojo.impl.CachedType;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
 /**
  * Basic CachedType test case.
  *
  * @author Ben Wang
  */
-
-public class CachedTypeTest extends TestCase
+ at Test(groups = {"functional"})
+public class CachedTypeTest 
 {
    Log log = LogFactory.getLog(CachedTypeTest.class);
 
-   public CachedTypeTest(String name)
-   {
-      super(name);
-   }
-
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
    }
 
    public void testInteger() throws Exception
@@ -124,15 +121,7 @@
       assertTrue("Byte ", t.isImmediate());
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(CachedTypeTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/CircularGraphTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/CircularGraphTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/CircularGraphTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,38 +7,38 @@
 
 package org.jboss.cache.pojo;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNull;
+
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.cache.Fqn;
 import org.jboss.cache.pojo.test.Link;
 import org.jboss.cache.pojo.test.NodeManager;
 import org.jboss.cache.pojo.test.Person;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import java.util.ArrayList;
-import java.util.List;
-
 /**
  * Test object graph handling in PojoCache, e.g., circular reference, multiple reference, link, etc.
  *
  * @author Ben Wang
  */
 
-public class CircularGraphTest extends TestCase
+ at Test(groups = {"functional"})
+public class CircularGraphTest 
 {
    Log log = LogFactory.getLog(CircularGraphTest.class);
    PojoCache cache_;
 
-   public CircularGraphTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
@@ -46,9 +46,9 @@
       cache_.start();
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
    }
 
@@ -279,14 +279,6 @@
    {
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(CircularGraphTest.class);
-   }
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(CircularGraphTest.suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/EnumTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/EnumTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/EnumTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -22,9 +22,8 @@
 
 package org.jboss.cache.pojo;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertSame;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -32,6 +31,9 @@
 import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
 import org.jboss.cache.pojo.annotation.Replicable;
 import org.jboss.cache.pojo.test.EnumPlanet;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
 /**
  * Basic PojoCache test case for Enum.
@@ -39,7 +41,8 @@
  * @author Ben Wang
  */
 
-public class EnumTest extends TestCase
+ at Test(groups = {"functional"})
+public class EnumTest 
 {
    Log log = LogFactory.getLog(EnumTest.class);
    PojoCache cache_, cache1_;
@@ -69,23 +72,19 @@
       }
    }
 
-   public EnumTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       boolean toStart = true;
       cache_ = PojoCacheFactory.createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), toStart);
       cache1_ = PojoCacheFactory.createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), toStart);
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
       cache1_.stop();
    }
@@ -118,14 +117,6 @@
       assertEquals(container, container2);
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(EnumTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalConcurrentTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalConcurrentTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalConcurrentTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -8,23 +8,24 @@
 
 package org.jboss.cache.pojo;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import java.util.ArrayList;
+import java.util.Properties;
+import java.util.Random;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.transaction.UserTransaction;
+
 import org.jboss.cache.config.Configuration;
 import org.jboss.cache.lock.UpgradeException;
 import org.jboss.cache.pojo.test.Address;
 import org.jboss.cache.pojo.test.Person;
 import org.jboss.cache.transaction.DummyTransactionManager;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.transaction.UserTransaction;
-import java.util.ArrayList;
-import java.util.Properties;
-import java.util.Random;
 
-
 /**
  * Local concurrent test for PojoCache. Test attach and detach under load
  * and concurrency.
@@ -32,7 +33,8 @@
  * @version $Revision$
  * @author<a href="mailto:bwang at jboss.org">Ben Wang</a> December 2004
  */
-public class LocalConcurrentTest extends TestCase
+ at Test(groups = {"functional"})
+public class LocalConcurrentTest 
 {
    static PojoCache cache_;
    Configuration.CacheMode cachingMode_ = Configuration.CacheMode.LOCAL;
@@ -47,14 +49,9 @@
    static Exception thread_ex = null;
    UserTransaction tx_ = null;
 
-   public LocalConcurrentTest(String name)
-   {
-      super(name);
-   }
-
+   @BeforeMethod(alwaysRun = true)
    public void setUp() throws Exception
    {
-      super.setUp();
       oldFactory_ = System.getProperty(Context.INITIAL_CONTEXT_FACTORY);
       System.setProperty(Context.INITIAL_CONTEXT_FACTORY, FACTORY);
       DummyTransactionManager.getInstance();
@@ -72,9 +69,9 @@
       log("LocalConcurrentTestCase: cacheMode=TRANSIENT, one cache");
    }
 
+   @AfterMethod(alwaysRun = true)
    public void tearDown() throws Exception
    {
-      super.tearDown();
       thread_ex = null;
       DummyTransactionManager.destroy();
       destroyCaches();
@@ -262,10 +259,6 @@
       return strList;
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(LocalConcurrentTest.class);
-   }
 
    private static void log(String str)
    {

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -1,14 +1,9 @@
 package org.jboss.cache.pojo;
 
-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.test.Address;
-import org.jboss.cache.pojo.test.Person;
-import org.jboss.cache.pojo.test.Student;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNull;
+import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.fail;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -17,25 +12,32 @@
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.aop.proxy.ClassProxy;
+import org.jboss.cache.pojo.test.Address;
+import org.jboss.cache.pojo.test.Person;
+import org.jboss.cache.pojo.test.Student;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
 /**
  * Basic PojoCache test case.
  *
  * @author Ben Wang
  */
 
-public class LocalTest extends TestCase
+ at Test(groups = {"functional"})
+public class LocalTest 
 {
    Log log = LogFactory.getLog(LocalTest.class);
    PojoCache cache_;
 
-   public LocalTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
@@ -43,9 +45,9 @@
       cache_.start();
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
    }
 
@@ -354,16 +356,8 @@
    }
 
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(LocalTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 
 }
 

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalTxTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalTxTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalTxTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,15 +7,13 @@
 
 package org.jboss.cache.pojo;
 
-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.Address;
-import org.jboss.cache.pojo.test.Person;
-import org.jboss.cache.transaction.DummyTransactionManager;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.fail;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
@@ -24,14 +22,21 @@
 import javax.transaction.SystemException;
 import javax.transaction.Transaction;
 import javax.transaction.UserTransaction;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.cache.pojo.test.Address;
+import org.jboss.cache.pojo.test.Person;
+import org.jboss.cache.transaction.DummyTransactionManager;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
 /**
  */
 
-public class LocalTxTest extends TestCase
+ at Test(groups = {"functional"})
+public class LocalTxTest 
 {
    Log log = LogFactory.getLog(LocalTxTest.class);
    PojoCache cache;
@@ -41,14 +46,10 @@
    long start = 0;
 
 
-   public LocalTxTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
@@ -61,9 +62,9 @@
       t1_ex = t2_ex = null;
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache.stop();
 
       DummyTransactionManager.destroy();
@@ -443,15 +444,7 @@
    }
 
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(LocalTxTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(LocalTxTest.suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/NewLocalTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/NewLocalTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/NewLocalTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -1,39 +1,42 @@
 package org.jboss.cache.pojo;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertNull;
+import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.fail;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.aop.proxy.ClassProxy;
 import org.jboss.cache.Fqn;
 import org.jboss.cache.pojo.impl.InternalConstant;
 import org.jboss.cache.pojo.test.Person;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-
 /**
  * Additional basic tests
  *
  * @author Ben Wang
  */
 
-public class NewLocalTest extends TestCase
+ at Test(groups = {"functional"})
+public class NewLocalTest 
 {
    Log log_ = LogFactory.getLog(NewLocalTest.class);
    PojoCache cache_;
 
-   public NewLocalTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log_.info("setUp() ....");
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
@@ -41,9 +44,9 @@
       cache_.start();
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
    }
 
@@ -211,16 +214,8 @@
       assertEquals("Objects size should be ", 2, map.size());
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(NewLocalTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 
 }
 

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/NewReplicatedTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/NewReplicatedTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/NewReplicatedTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -1,8 +1,14 @@
 package org.jboss.cache.pojo;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNull;
+import static org.testng.AssertJUnit.fail;
+
+import java.io.Serializable;
+import java.util.Properties;
+
+import javax.naming.Context;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.cache.Fqn;
@@ -12,12 +18,11 @@
 import org.jboss.cache.pojo.test.Person;
 import org.jboss.cache.pojo.test.SpecialSerializedAddress;
 import org.jboss.cache.pojo.test.Student;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import javax.naming.Context;
-import java.io.Serializable;
-import java.util.Properties;
 
-
 /**
  * Replication PojoCache test. This is the real beef as local mode for PojoCache really does
  * not do anything.
@@ -25,20 +30,17 @@
  * @author Ben Wang
  */
 
-public class NewReplicatedTest extends TestCase
+ at Test(groups = {"functional"})
+public class NewReplicatedTest 
 {
    Log log_ = LogFactory.getLog(NewReplicatedTest.class);
    PojoCache cache_;
    PojoCache cache1_;
 
-   public NewReplicatedTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       Properties prop = new Properties();
       prop.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.cache.transaction.DummyContextFactory");
       boolean toStart = false;
@@ -48,9 +50,9 @@
       cache1_.start();
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
       cache1_.stop();
    }
@@ -209,7 +211,7 @@
    {
       public String name;
       public int age;
-
+      
       public PersonSerial(String name, int age)
       {
          this.name = name;
@@ -255,16 +257,8 @@
       assertEquals("Age should be ", 10, remote.getAge());
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(NewReplicatedTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 
 }
 

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/NewReplicatedTxTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/NewReplicatedTxTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/NewReplicatedTxTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,17 +7,13 @@
 
 package org.jboss.cache.pojo;
 
-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.test.Address;
-import org.jboss.cache.pojo.test.Person;
-import org.jboss.cache.transaction.DummyTransactionManager;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.fail;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
@@ -26,17 +22,26 @@
 import javax.transaction.SystemException;
 import javax.transaction.Transaction;
 import javax.transaction.UserTransaction;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
 
+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.test.Address;
+import org.jboss.cache.pojo.test.Person;
+import org.jboss.cache.transaction.DummyTransactionManager;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
 /**
  * PojoCache replicated test cases with tx.
  *
  * @author Ben Wang
  */
 
-public class NewReplicatedTxTest extends TestCase
+ at Test(groups = {"functional"})
+public class NewReplicatedTxTest 
 {
    Log log = LogFactory.getLog(NewReplicatedTxTest.class);
    PojoCache cache_;
@@ -47,16 +52,11 @@
    long start = 0;
 
 
-   public NewReplicatedTxTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
-      super.setUp();
       Properties prop = new Properties();
       prop.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.cache.transaction.DummyContextFactory");
       boolean toStart = false;
@@ -69,9 +69,9 @@
       t1_ex = t2_ex = null;
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
       cache1_.stop();
       DummyTransactionManager.destroy();
@@ -446,15 +446,7 @@
       }
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(NewReplicatedTxTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(NewReplicatedTxTest.suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/NonAspectizedTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/NonAspectizedTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/NonAspectizedTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -1,11 +1,14 @@
 package org.jboss.cache.pojo;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNull;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.cache.pojo.test.SerializedAddress;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
 
 /**
@@ -14,19 +17,16 @@
  * @author Ben Wang
  */
 
-public class NonAspectizedTest extends TestCase
+ at Test(groups = {"functional"})
+public class NonAspectizedTest 
 {
    Log log_ = LogFactory.getLog(NonAspectizedTest.class);
    PojoCache cache_;
 
-   public NonAspectizedTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log_.info("setUp() ....");
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
@@ -34,9 +34,9 @@
       cache_.start();
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
    }
 
@@ -66,16 +66,8 @@
       assertNull("Object should be null ", cache_.find("/a"));
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(NonAspectizedTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 
 }
 

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/ObjectGraphTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/ObjectGraphTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/ObjectGraphTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -1,12 +1,14 @@
 package org.jboss.cache.pojo;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertEquals;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.cache.pojo.test.Address;
 import org.jboss.cache.pojo.test.Person;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
 /**
  * Test object graph handling in PojoCache, e.g., circular reference, multiple reference, link, etc.
@@ -14,19 +16,16 @@
  * @author Ben Wang
  */
 
-public class ObjectGraphTest extends TestCase
+ at Test(groups = {"functional"})
+public class ObjectGraphTest 
 {
    Log log = LogFactory.getLog(ObjectGraphTest.class);
    PojoCache cache_;
 
-   public ObjectGraphTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
@@ -34,9 +33,9 @@
       cache_.start();
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
    }
 
@@ -262,15 +261,7 @@
    {
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(ObjectGraphTest.class);
-   }
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 
 }
 

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/RecursiveRefTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/RecursiveRefTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/RecursiveRefTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -1,17 +1,18 @@
 package org.jboss.cache.pojo;
 
-import junit.framework.TestCase;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.pojo.test.IdObject;
-import org.jboss.cache.pojo.test.ValueObject;
-
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
 
-public class RecursiveRefTest extends TestCase
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+ at Test(groups = {"functional"})
+public class RecursiveRefTest 
 {
    private static final String CONFIG_FILENAME = "META-INF/local-service.xml";
    private PojoCache cache;
@@ -19,14 +20,10 @@
 
    private Map cachedMap;
 
-   public RecursiveRefTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       boolean toStart = false;
       cache = PojoCacheFactory.createCache(CONFIG_FILENAME, toStart);
@@ -35,9 +32,9 @@
       cachedMap = (Map) cache.find("/aop/test");
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
    }
 
    public void XtestDummy()

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedByteTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedByteTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedByteTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -22,34 +22,33 @@
 
 package org.jboss.cache.pojo;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertEquals;
+
 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.test.Resource;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
 /**
  * Replicate POJO with byte array field.
  *
  * @author Ben Wang
  */
-public class ReplicatedByteTest extends TestCase
+ at Test(groups = {"functional"})
+public class ReplicatedByteTest 
 {
    Log log = LogFactory.getLog(ReplicatedByteTest.class);
    PojoCache cache, cache1;
 
 
-   public ReplicatedByteTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       boolean toStart = false;
       cache = PojoCacheFactory.createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), toStart);
@@ -58,9 +57,9 @@
       cache1.start();
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache.stop();
       cache1.stop();
    }
@@ -94,15 +93,7 @@
 
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(ReplicatedByteTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedCircularGraphTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedCircularGraphTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedCircularGraphTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,9 +7,13 @@
 
 package org.jboss.cache.pojo;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertNull;
+
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.cache.Fqn;
@@ -18,38 +22,35 @@
 import org.jboss.cache.pojo.test.Link;
 import org.jboss.cache.pojo.test.NodeManager;
 import org.jboss.cache.pojo.test.Person;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import java.util.ArrayList;
-import java.util.List;
-
 /**
  * Test object graph handling in aop, e.g., circular reference, multiple reference, link, etc.
  *
  * @author Ben Wang
  */
 
-public class ReplicatedCircularGraphTest extends TestCase
+ at Test(groups = {"functional"})
+public class ReplicatedCircularGraphTest 
 {
    Log log = LogFactory.getLog(ReplicatedCircularGraphTest.class);
    PojoCache cache1;
    PojoCache cache2;
 
-   public ReplicatedCircularGraphTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       cache1 = createCache("CacheGroup");
       cache2 = createCache("CacheGroup");
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache1.getCache().removeNode(Fqn.fromString("/"));
       cache1.stop();
       cache2.stop();
@@ -208,14 +209,6 @@
 */
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(ReplicatedCircularGraphTest.class);
-   }
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(ReplicatedCircularGraphTest.suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedNonSerializableTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedNonSerializableTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedNonSerializableTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,37 +7,35 @@
 
 package org.jboss.cache.pojo;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import java.util.Properties;
+
+import javax.naming.Context;
+
 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.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import javax.naming.Context;
-import java.util.Properties;
-
 /**
  * New NewReplicatedAopTest that doesn't use TreeCacheAopTester.
  *
  * @author Ben Wang
  */
 
-public class ReplicatedNonSerializableTest extends TestCase
+ at Test(groups = {"functional"})
+public class ReplicatedNonSerializableTest 
 {
    Log log_ = LogFactory.getLog(ReplicatedNonSerializableTest.class);
    PojoCache cache_;
    PojoCache cache1_;
 
-   public ReplicatedNonSerializableTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       Properties prop = new Properties();
       prop.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.cache.transaction.DummyContextFactory");
       boolean toStart = false;
@@ -47,9 +45,9 @@
       cache1_.start();
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
       cache1_.stop();
    }
@@ -108,15 +106,7 @@
 
 */
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(ReplicatedNonSerializableTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(ReplicatedNonSerializableTest.suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedObjectGraphTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedObjectGraphTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedObjectGraphTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -1,8 +1,7 @@
 package org.jboss.cache.pojo;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertEquals;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.cache.Fqn;
@@ -10,6 +9,9 @@
 import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
 import org.jboss.cache.pojo.test.Address;
 import org.jboss.cache.pojo.test.Person;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
 /**
  * Test object graph handling in aop, e.g., circular reference, multiple reference, link, etc.
@@ -17,28 +19,25 @@
  * @author Ben Wang
  */
 
-public class ReplicatedObjectGraphTest extends TestCase
+ at Test(groups = {"functional"})
+public class ReplicatedObjectGraphTest 
 {
    Log log = LogFactory.getLog(ReplicatedObjectGraphTest.class);
    PojoCache cache1;
    PojoCache cache2;
 
-   public ReplicatedObjectGraphTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       cache1 = createCache("CacheGroup");
       cache2 = createCache("CacheGroup");
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache1.getCache().removeNode(Fqn.fromString("/"));
       cache1.stop();
       cache2.stop();
@@ -226,15 +225,7 @@
       assertEquals("City ", "Santa Clara", add2.getCity());
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(ReplicatedObjectGraphTest.class);
-   }
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 
 }
 

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedPutWithBulkRemoveTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedPutWithBulkRemoveTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedPutWithBulkRemoveTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,41 +7,41 @@
 
 package org.jboss.cache.pojo;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertEquals;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import javax.naming.Context;
+
 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.test.Address;
 import org.jboss.cache.pojo.test.Person;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import javax.naming.Context;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
 /**
  * Test for attach with existing pojo for bulkd remove for speed.
  *
  * @author Ben Wang
  */
 
-public class ReplicatedPutWithBulkRemoveTest extends TestCase
+ at Test(groups = {"functional"})
+public class ReplicatedPutWithBulkRemoveTest 
 {
    Log log_ = LogFactory.getLog(ReplicatedPutWithBulkRemoveTest.class);
    PojoCache cache_;
    PojoCache cache1_;
 
-   public ReplicatedPutWithBulkRemoveTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       Properties prop = new Properties();
       prop.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.cache.transaction.DummyContextFactory");
       boolean toStart = false;
@@ -51,9 +51,9 @@
       cache1_.start();
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
       cache1_.stop();
    }
@@ -179,15 +179,7 @@
       assertEquals("Spanish", result.getLanguages().get(1));      
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(ReplicatedPutWithBulkRemoveTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(ReplicatedPutWithBulkRemoveTest.suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedSerializableTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedSerializableTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedSerializableTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,39 +7,41 @@
 
 package org.jboss.cache.pojo;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.Properties;
+
+import javax.naming.Context;
+
 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.test.CacheObject;
 import org.jboss.cache.pojo.test.Student;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import javax.naming.Context;
-import java.util.Properties;
-
 /**
  * New NewReplicatedAopTest that doesn't use TreeCacheAopTester.
  *
  * @author Ben Wang
  */
 
-public class ReplicatedSerializableTest extends TestCase
+ at Test(groups = {"functional"})
+public class ReplicatedSerializableTest 
 {
    Log log_ = LogFactory.getLog(ReplicatedSerializableTest.class);
    PojoCache cache_;
    PojoCache cache1_;
 
-   public ReplicatedSerializableTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       Properties prop = new Properties();
       prop.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.cache.transaction.DummyContextFactory");
       boolean toStart = false;
@@ -49,9 +51,9 @@
       cache1_.start();
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
       cache1_.stop();
    }
@@ -121,15 +123,7 @@
 
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(ReplicatedSerializableTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(ReplicatedSerializableTest.suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -1,36 +1,37 @@
 package org.jboss.cache.pojo;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.List;
+
 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.test.Person;
 import org.jboss.cache.pojo.test.Student;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import java.util.List;
-
 /**
  * Replicated test that use a tester wrapper. Future new test should use NewReplicatedAopTest
  *
  * @author Ben Wang
  */
-public class ReplicatedTest extends TestCase
+ at Test(groups = {"functional"})
+public class ReplicatedTest 
 {
    Log log = LogFactory.getLog(ReplicatedTest.class);
    PojoCache cache, cache1;
 
 
-   public ReplicatedTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       boolean toStart = false;
       cache = PojoCacheFactory.createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), toStart);
@@ -39,9 +40,9 @@
       cache1.start();
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache.stop();
       cache1.stop();
    }
@@ -185,16 +186,8 @@
    }
 
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(ReplicatedTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 
 }
 

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedTxTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedTxTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedTxTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -1,16 +1,12 @@
 package org.jboss.cache.pojo;
 
-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.test.Person;
-import org.jboss.cache.pojo.test.Student;
-import org.jboss.cache.transaction.DummyTransactionManager;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.fail;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
@@ -19,14 +15,23 @@
 import javax.transaction.SystemException;
 import javax.transaction.Transaction;
 import javax.transaction.UserTransaction;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
 
+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.test.Person;
+import org.jboss.cache.pojo.test.Student;
+import org.jboss.cache.transaction.DummyTransactionManager;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
 /**
  */
 
-public class ReplicatedTxTest extends TestCase
+ at Test(groups = {"functional"})
+public class ReplicatedTxTest 
 {
    Log log = LogFactory.getLog(ReplicatedTxTest.class);
    PojoCache cache, cache1;
@@ -36,14 +41,10 @@
    long start = 0;
 
 
-   public ReplicatedTxTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       boolean toStart = false;
       cache = PojoCacheFactory.createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), toStart);
@@ -57,9 +58,9 @@
       t1_ex = t2_ex = null;
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache.stop();
       cache1.stop();
 
@@ -235,16 +236,8 @@
    }
 
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(ReplicatedTxTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 
 }
 

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/TxUndoTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/TxUndoTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/TxUndoTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,9 +7,11 @@
 
 package org.jboss.cache.pojo;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+
+import javax.transaction.TransactionManager;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.aop.Advised;
@@ -17,29 +19,27 @@
 import org.jboss.cache.pojo.interceptors.dynamic.CacheFieldInterceptor;
 import org.jboss.cache.pojo.test.Person;
 import org.jboss.cache.transaction.DummyTransactionManager;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import javax.transaction.TransactionManager;
-
 /**
  * Additional basic tests
  *
  * @author Ben Wang
  */
 
-public class TxUndoTest extends TestCase
+ at Test(groups = {"functional"})
+public class TxUndoTest 
 {
    Log log_ = LogFactory.getLog(TxUndoTest.class);
    PojoCache cache_;
    TransactionManager tx_mgr;
 
-   public TxUndoTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log_.info("setUp() ....");
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
@@ -49,9 +49,9 @@
 
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
    }
 
@@ -119,15 +119,7 @@
       assertFalse("Should not have cache interceptor ", hasCacheInterceptor(test));
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(TxUndoTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(TxUndoTest.suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/annotation/ReplicatedAnnotationTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/annotation/ReplicatedAnnotationTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/annotation/ReplicatedAnnotationTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,9 +7,18 @@
 
 package org.jboss.cache.pojo.annotation;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertNotSame;
+import static org.testng.AssertJUnit.assertNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import javax.naming.Context;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.cache.config.Configuration.CacheMode;
@@ -19,31 +28,26 @@
 import org.jboss.cache.pojo.test.Gadget;
 import org.jboss.cache.pojo.test.Resource;
 import org.jboss.cache.pojo.test.SpecialAddress;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import javax.naming.Context;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
 /**
  * Test for JDK50 specific annotation.
  *
  * @author Ben Wang
  */
-public class ReplicatedAnnotationTest extends TestCase
+ at Test(groups = {"functional"})
+public class ReplicatedAnnotationTest 
 {
    Log log_ = LogFactory.getLog(ReplicatedAnnotationTest.class);
    PojoCache cache_;
    PojoCache cache1_;
 
-   public ReplicatedAnnotationTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       Properties prop = new Properties();
       prop.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.cache.transaction.DummyContextFactory");
       boolean toStart = false;
@@ -54,9 +58,9 @@
       cache1_.start();
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
       cache1_.stop();
    }
@@ -161,15 +165,7 @@
       assertEquals("String ", "3", l3);
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(ReplicatedAnnotationTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(ReplicatedAnnotationTest.suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CachedListImplTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CachedListImplTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CachedListImplTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -1,8 +1,10 @@
 package org.jboss.cache.pojo.collection;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.fail;
+
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.cache.Fqn;
@@ -10,30 +12,27 @@
 import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
 import org.jboss.cache.pojo.PojoCache;
 import org.jboss.cache.pojo.PojoCacheFactory;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import java.util.ArrayList;
-import java.util.List;
-
 /**
  * List implementation testing.
  *
  * @author Ben Wang
  */
 
-public class CachedListImplTest extends TestCase
+ at Test(groups = {"functional"})
+public class CachedListImplTest 
 {
    Log log = LogFactory.getLog(CachedListImplTest.class);
    PojoCache cache_, cache1_;
 
-   public CachedListImplTest(String name)
-   {
-      super(name);
-   }
 
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       boolean toStart = false;
       cache_ = PojoCacheFactory.createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), toStart);
@@ -44,9 +43,9 @@
       cache1_.start();
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
       cache1_.stop();
    }
@@ -81,15 +80,7 @@
       System.out.println(" list : " + l1);
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(CachedListImplTest.class);
-   }
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 
 }
 

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CachedListTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CachedListTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CachedListTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -1,13 +1,9 @@
 package org.jboss.cache.pojo.collection;
 
-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.cache.pojo.test.Address;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.fail;
 
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -15,28 +11,34 @@
 import java.util.ListIterator;
 import java.util.NoSuchElementException;
 
+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.cache.pojo.test.Address;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
 /**
  * List interface testing.
  *
  * @author Ben Wang
  */
 
-public class CachedListTest extends TestCase
+ at Test(groups = {"functional"})
+public class CachedListTest 
 {
    Log log = LogFactory.getLog(CachedListTest.class);
    PojoCache cache_;
    List languages;
    List languages2;
 
-   public CachedListTest(String name)
-   {
-      super(name);
-   }
 
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
@@ -44,9 +46,9 @@
       cache_.start();
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
    }
 
@@ -407,15 +409,7 @@
       assertFalse("List should not be equal: ", list1.equals(list3));
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(CachedListTest.class);
-   }
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 
 }
 

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CachedListTxTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CachedListTxTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CachedListTxTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -1,12 +1,13 @@
 package org.jboss.cache.pojo.collection;
 
-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.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
 /**
  * List interface testing with transaction control.
@@ -14,20 +15,17 @@
  * @author Scott Marlow
  */
 
-public class CachedListTxTest extends TestCase
+ at Test(groups = {"functional"})
+public class CachedListTxTest 
 {
    Log log = LogFactory.getLog(CachedListTxTest.class);
    PojoCache cache_;
 
 
-   public CachedListTxTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       String configFile = "META-INF/cache-config.xml";
       boolean toStart = false;
@@ -36,9 +34,9 @@
 
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
    }
 
@@ -47,15 +45,7 @@
       // No op now.
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(CachedListTxTest.class);
-   }
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 
 }
 

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CachedMapImplTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CachedMapImplTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CachedMapImplTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -22,9 +22,9 @@
 
 package org.jboss.cache.pojo.collection;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import java.util.HashMap;
+import java.util.Map;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.cache.Fqn;
@@ -32,30 +32,27 @@
 import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
 import org.jboss.cache.pojo.PojoCache;
 import org.jboss.cache.pojo.PojoCacheFactory;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import java.util.HashMap;
-import java.util.Map;
-
 /**
  * List implementation testing.
  *
  * @author Ben Wang
  */
 
-public class CachedMapImplTest extends TestCase
+ at Test(groups = {"functional"})
+public class CachedMapImplTest 
 {
    Log log = LogFactory.getLog(CachedMapImplTest.class);
    PojoCache cache_, cache1_;
 
-   public CachedMapImplTest(String name)
-   {
-      super(name);
-   }
 
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       boolean toStart = true;
       cache_ = PojoCacheFactory.createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), toStart);
@@ -63,9 +60,9 @@
       cache1_ = PojoCacheFactory.createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), toStart);
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
       cache1_.stop();
    }
@@ -88,14 +85,6 @@
       System.out.println(" map : " + m1);
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(CachedMapImplTest.class);
-   }
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CachedMapNullTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CachedMapNullTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CachedMapNullTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -1,14 +1,9 @@
 package org.jboss.cache.pojo.collection;
 
-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.Address;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.fail;
 
 import java.util.Collection;
 import java.util.HashMap;
@@ -17,26 +12,33 @@
 import java.util.Map;
 import java.util.Set;
 
+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.Address;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
 /**
  * Set interface testing.
  *
  * @author Scott Marlow
  */
 
-public class CachedMapNullTest extends TestCase
+ at Test(groups = {"functional"})
+public class CachedMapNullTest 
 {
    Log log = LogFactory.getLog(CachedMapNullTest.class);
    PojoCache cache_;
    Map hobbies;
 
-   public CachedMapNullTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
@@ -46,9 +48,9 @@
       stage();
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
    }
 
@@ -280,14 +282,6 @@
       assertEquals("Size ", 2, map.size());
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(CachedMapNullTest.class);
-   }
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 }
 

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CachedMapTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CachedMapTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CachedMapTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -1,15 +1,9 @@
 package org.jboss.cache.pojo.collection;
 
-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.PojoCacheException;
-import org.jboss.cache.pojo.PojoCacheFactory;
-import org.jboss.cache.pojo.test.Address;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.fail;
 
 import java.io.Serializable;
 import java.util.Collection;
@@ -19,26 +13,34 @@
 import java.util.Map;
 import java.util.Set;
 
+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.PojoCacheException;
+import org.jboss.cache.pojo.PojoCacheFactory;
+import org.jboss.cache.pojo.test.Address;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
 /**
  * Map interface testing.
  *
  * @author Ben Wang
  */
 
-public class CachedMapTest extends TestCase
+ at Test(groups = {"functional"})
+public class CachedMapTest 
 {
    Log log = LogFactory.getLog(CachedMapTest.class);
    PojoCache cache_;
    Map hobbies;
 
-   public CachedMapTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
@@ -48,9 +50,9 @@
       stage();
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
    }
 
@@ -366,15 +368,7 @@
       }
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(CachedMapTest.class);
-   }
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 
    static class SerializableKeyValue implements Serializable
    {

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CachedSetTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CachedSetTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CachedSetTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -1,13 +1,9 @@
 package org.jboss.cache.pojo.collection;
 
-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.cache.pojo.test.Address;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.fail;
 
 import java.io.PrintWriter;
 import java.io.StringWriter;
@@ -22,26 +18,32 @@
 import java.util.NoSuchElementException;
 import java.util.Set;
 
+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.cache.pojo.test.Address;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
 /**
  * Set interface testing.
  *
  * @author Ben Wang
  */
 
-public class CachedSetTest extends TestCase
+ at Test(groups = {"functional"})
+public class CachedSetTest 
 {
    Log log = LogFactory.getLog(CachedSetTest.class);
    PojoCache cache_;
    Set skills;
 
-   public CachedSetTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
@@ -51,9 +53,9 @@
       stage();
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
    }
 
@@ -395,15 +397,7 @@
       assertFalse("testContainsAll", skills.containsAll(list2));
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(CachedSetTest.class);
-   }
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CollectionTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CollectionTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/CollectionTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -1,37 +1,39 @@
 package org.jboss.cache.pojo.collection;
 
-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 static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.fail;
 
 import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
 import java.util.LinkedList;
 import java.util.Map;
 
+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.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
 /**
  * Generic Collection class support testing.
  *
  * @author Ben Wang
  */
 
-public class CollectionTest extends TestCase
+ at Test(groups = {"functional"})
+public class CollectionTest 
 {
    Log log_ = LogFactory.getLog(CollectionTest.class);
    PojoCache cache_;
 
-   public CollectionTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log_.info("setUp() ....");
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
@@ -39,9 +41,9 @@
       cache_.start();
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
    }
 
@@ -121,15 +123,7 @@
       }
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(CollectionTest.class);
-   }
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 
    // tests for each of the methods in Collection interface
    public void testSize() throws Exception

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/ObjectGraphTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/ObjectGraphTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/ObjectGraphTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -1,14 +1,8 @@
 package org.jboss.cache.pojo.collection;
 
-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.cache.pojo.test.Address;
-import org.jboss.cache.pojo.test.Person;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -17,25 +11,32 @@
 import java.util.Map;
 import java.util.Set;
 
+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.cache.pojo.test.Address;
+import org.jboss.cache.pojo.test.Person;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
 /**
  * Test object graph handling in aop, e.g., circular reference, multiple reference, link, etc.
  *
  * @author Ben Wang
  */
 
-public class ObjectGraphTest extends TestCase
+ at Test(groups = {"functional"})
+public class ObjectGraphTest 
 {
    Log log = LogFactory.getLog(ObjectGraphTest.class);
    PojoCache cache_;
 
-   public ObjectGraphTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
@@ -43,9 +44,9 @@
       cache_.start();
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
    }
 
@@ -254,15 +255,7 @@
    {
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(ObjectGraphTest.class);
-   }
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 
 }
 

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/ReplicatedSyncListTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/ReplicatedSyncListTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/ReplicatedSyncListTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -1,8 +1,13 @@
 package org.jboss.cache.pojo.collection;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.ListIterator;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.aop.proxy.ClassProxy;
@@ -14,39 +19,35 @@
 import org.jboss.cache.pojo.PojoCacheFactory;
 import org.jboss.cache.pojo.test.Address;
 import org.jboss.cache.pojo.test.Person;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-
 /**
  * Test object graph handling in aop, e.g., circular reference, multiple reference, link, etc.
  *
  * @author Ben Wang
  */
 
-public class ReplicatedSyncListTest extends TestCase
+ at Test(groups = {"functional"})
+public class ReplicatedSyncListTest 
 {
    Log log = LogFactory.getLog(ReplicatedSyncListTest.class);
    PojoCache cache1;
    PojoCache cache2;
 
-   public ReplicatedSyncListTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       cache1 = createCache("CacheGroup");
       cache2 = createCache("CacheGroup");
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache1.getCache().removeNode(Fqn.fromString("/"));
       cache1.stop();
       cache2.stop();
@@ -303,15 +304,7 @@
       list.toString();
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(ReplicatedSyncListTest.class);
-   }
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 
 }
 

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/ReplicatedSyncMapTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/ReplicatedSyncMapTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/ReplicatedSyncMapTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -1,8 +1,17 @@
 package org.jboss.cache.pojo.collection;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.fail;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.aop.proxy.ClassProxy;
@@ -14,13 +23,10 @@
 import org.jboss.cache.pojo.PojoCacheFactory;
 import org.jboss.cache.pojo.test.Address;
 import org.jboss.cache.pojo.test.Person;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
 /**
  * Test replicated Map
  *
@@ -28,28 +34,25 @@
  * @author Scott Marlow
  */
 
-public class ReplicatedSyncMapTest extends TestCase
+ at Test(groups = {"functional"})
+public class ReplicatedSyncMapTest 
 {
    Log log = LogFactory.getLog(ReplicatedSyncMapTest.class);
    PojoCache cache1;
    PojoCache cache2;
 
-   public ReplicatedSyncMapTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       cache1 = createCache("CacheGroup");
       cache2 = createCache("CacheGroup");
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache1.getCache().removeNode(Fqn.fromString("/"));
       cache1.stop();
       cache2.stop();
@@ -297,15 +300,7 @@
       fail("Test should fail since we can't handle recursive map");
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(ReplicatedSyncMapTest.class);
-   }
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 
 }
 

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/ReplicatedSyncSetTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/ReplicatedSyncSetTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/collection/ReplicatedSyncSetTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -1,8 +1,14 @@
 package org.jboss.cache.pojo.collection;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.cache.Fqn;
@@ -12,39 +18,35 @@
 import org.jboss.cache.pojo.PojoCacheFactory;
 import org.jboss.cache.pojo.test.Address;
 import org.jboss.cache.pojo.test.Person;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
 /**
  * Test object graph handling in aop, e.g., circular reference, multiple reference, link, etc.
  *
  * @author Ben Wang
  */
 
-public class ReplicatedSyncSetTest extends TestCase
+ at Test(groups = {"functional"})
+public class ReplicatedSyncSetTest 
 {
    Log log = LogFactory.getLog(ReplicatedSyncSetTest.class);
    PojoCache cache1;
    PojoCache cache2;
 
-   public ReplicatedSyncSetTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       cache1 = createCache("CacheGroup");
       cache2 = createCache("CacheGroup");
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache1.getCache().removeNode(Fqn.fromString("/"));
       cache1.stop();
       cache2.stop();
@@ -213,15 +215,7 @@
    }
    */
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(ReplicatedSyncSetTest.class);
-   }
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 
 }
 

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/integrated/NetworkManagementTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/integrated/NetworkManagementTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/integrated/NetworkManagementTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -1,8 +1,10 @@
 package org.jboss.cache.pojo.integrated;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.List;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.cache.Fqn;
@@ -14,9 +16,10 @@
 import org.jboss.cache.pojo.test.NetworkDomain;
 import org.jboss.cache.pojo.test.NetworkElement;
 import org.jboss.cache.pojo.test.NetworkNode;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import java.util.List;
-
 /**
  * Sample example for network management that consists of fine-grained replication and object graph (including
  * Collection)
@@ -29,26 +32,23 @@
  * @author Ben Wang
  */
 
-public class NetworkManagementTest extends TestCase
+ at Test(groups = {"functional"})
+public class NetworkManagementTest 
 {
    Log log = LogFactory.getLog(NetworkManagementTest.class);
    PojoCache cache1;
 
-   public NetworkManagementTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       cache1 = createCache("CacheGroup");
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache1.getCache().removeNode(Fqn.fromString("/"));
       cache1.stop();
    }
@@ -360,15 +360,7 @@
       assertEquals("Status ", tempSensor1.getStatus(), tempSens1.getStatus());
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(NetworkManagementTest.class);
-   }
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 
 }
 

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/integrated/PropagationManagerlTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/integrated/PropagationManagerlTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/integrated/PropagationManagerlTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -1,6 +1,5 @@
 package org.jboss.cache.pojo.integrated;
 
-import junit.framework.TestCase;
 import org.jboss.cache.Fqn;
 import org.jboss.cache.config.Configuration.CacheMode;
 import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
@@ -8,17 +7,23 @@
 import org.jboss.cache.pojo.PojoCacheFactory;
 import org.jboss.cache.pojo.test.propagation.PropagationManager;
 import org.jboss.cache.pojo.test.propagation.impl.PropagationManagerImpl;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-public class PropagationManagerlTest extends TestCase
+ at Test(groups = {"functional"})
+public class PropagationManagerlTest 
 {
    private PropagationManager pm_;
    private PojoCache cache_;
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
       cache_ = createCache("TestCluster");
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
       cache_.getCache().removeNode(Fqn.fromString("/"));
@@ -158,11 +163,4 @@
       System.out.println("Final cache content");
       System.out.println("---------------------------------------------");
    }
-
-   public static void main(String[] args) throws Exception
-   {
-      PropagationManagerlTest pmTest = new PropagationManagerlTest();
-      pmTest.setUp();
-      pmTest.testPropagation();
-   }
-}
+}
\ No newline at end of file

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/integrated/ReplicatedNetworkManagementTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/integrated/ReplicatedNetworkManagementTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/integrated/ReplicatedNetworkManagementTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -1,8 +1,10 @@
 package org.jboss.cache.pojo.integrated;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.List;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.cache.Fqn;
@@ -14,9 +16,10 @@
 import org.jboss.cache.pojo.test.NetworkDomain;
 import org.jboss.cache.pojo.test.NetworkElement;
 import org.jboss.cache.pojo.test.NetworkNode;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import java.util.List;
-
 /**
  * Sample example for network management that consists of fine-grained replication and object graph (including
  * Collection)
@@ -29,28 +32,25 @@
  * @author Ben Wang
  */
 
-public class ReplicatedNetworkManagementTest extends TestCase
+ at Test(groups = {"functional"})
+public class ReplicatedNetworkManagementTest 
 {
    Log log = LogFactory.getLog(ReplicatedNetworkManagementTest.class);
    PojoCache cache1;
    PojoCache cache2;
 
-   public ReplicatedNetworkManagementTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       cache1 = createCache("CacheGroup");
       cache2 = createCache("CacheGroup");
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache1.getCache().removeNode(Fqn.fromString("/"));
       cache1.stop();
       cache2.stop();
@@ -260,15 +260,7 @@
       assertEquals("Status ", tempSensor1.getStatus(), tempSens1.getStatus());
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(ReplicatedNetworkManagementTest.class);
-   }
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 
 }
 

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/integrated/ReplicatedPropagationManagerlTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/integrated/ReplicatedPropagationManagerlTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/integrated/ReplicatedPropagationManagerlTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -1,6 +1,7 @@
 package org.jboss.cache.pojo.integrated;
 
-import junit.framework.TestCase;
+import static org.testng.AssertJUnit.assertEquals;
+
 import org.jboss.cache.Fqn;
 import org.jboss.cache.config.Configuration.CacheMode;
 import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
@@ -8,19 +9,25 @@
 import org.jboss.cache.pojo.PojoCacheFactory;
 import org.jboss.cache.pojo.test.propagation.PropagationManager;
 import org.jboss.cache.pojo.test.propagation.impl.PropagationManagerImpl;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-public class ReplicatedPropagationManagerlTest extends TestCase
+ at Test(groups = {"functional"})
+public class ReplicatedPropagationManagerlTest 
 {
    private PropagationManager pm_;
    private PojoCache cache1_;
    private PojoCache cache2_;
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
       cache1_ = createCache("TestCluster");
       cache2_ = createCache("TestCluster");
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
       cache1_.getCache().removeNode(Fqn.fromString("/"));
@@ -167,11 +174,4 @@
       System.out.println("Final cache content");
       System.out.println("---------------------------------------------");
    }
-
-   public static void main(String[] args) throws Exception
-   {
-      ReplicatedPropagationManagerlTest pmTest = new ReplicatedPropagationManagerlTest();
-      pmTest.setUp();
-      pmTest.testPropagation();
-   }
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/InterceptorRegistrationTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/InterceptorRegistrationTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/InterceptorRegistrationTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -22,7 +22,10 @@
 
 package org.jboss.cache.pojo.jmx;
 
+import static org.testng.AssertJUnit.assertTrue;
+
 import org.jboss.cache.config.Configuration;
+import org.testng.annotations.Test;
 
 /**
  * Tests the interceptor registration function of CacheJmxWrapper.
@@ -30,6 +33,7 @@
  * @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
  * @version $Revision$
  */
+ at Test(groups = {"functional"})
 public class InterceptorRegistrationTest extends PojoCacheJmxWrapperTestBase
 {
 

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/LegacyConfigurationTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/LegacyConfigurationTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/LegacyConfigurationTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -22,17 +22,29 @@
 
 package org.jboss.cache.pojo.jmx;
 
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertSame;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.util.List;
+import java.util.Properties;
+
+import javax.management.MBeanServerInvocationHandler;
+import javax.transaction.TransactionManager;
+
 import org.jboss.cache.Version;
 import org.jboss.cache.config.BuddyReplicationConfig;
-import org.jboss.cache.config.BuddyReplicationConfig.BuddyLocatorConfig;
 import org.jboss.cache.config.CacheLoaderConfig;
-import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
 import org.jboss.cache.config.Configuration;
-import org.jboss.cache.config.Configuration.CacheMode;
-import org.jboss.cache.config.Configuration.NodeLockingScheme;
 import org.jboss.cache.config.EvictionConfig;
 import org.jboss.cache.config.EvictionRegionConfig;
 import org.jboss.cache.config.RuntimeConfig;
+import org.jboss.cache.config.BuddyReplicationConfig.BuddyLocatorConfig;
+import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
+import org.jboss.cache.config.Configuration.CacheMode;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
 import org.jboss.cache.eviction.FIFOConfiguration;
 import org.jboss.cache.eviction.FIFOPolicy;
 import org.jboss.cache.eviction.LRUConfiguration;
@@ -47,22 +59,16 @@
 import org.jboss.cache.xml.XmlHelper;
 import org.jgroups.ChannelFactory;
 import org.jgroups.JChannelFactory;
+import org.testng.annotations.Test;
 import org.w3c.dom.Element;
 
-import javax.management.MBeanServerInvocationHandler;
-import javax.transaction.TransactionManager;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.util.List;
-import java.util.Properties;
-
 /**
  * Test of the CacheLegacyJmxWrapper.
  *
  * @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
  * @version $Revision$
  */
+ at Test(groups = {"functional"})
 public class LegacyConfigurationTest extends PojoCacheJmxWrapperTestBase
 {
    public void testLocalCache() throws Exception

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/LifecycleNotificationTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/LifecycleNotificationTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/LifecycleNotificationTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -22,6 +22,8 @@
 
 package org.jboss.cache.pojo.jmx;
 
+import static org.testng.AssertJUnit.assertEquals;
+
 import java.util.LinkedList;
 import java.util.List;
 
@@ -29,12 +31,15 @@
 import javax.management.Notification;
 import javax.management.NotificationListener;
 
+import org.testng.annotations.Test;
+
 /**
  * A LifecycleNotificationTest.
  * 
  * @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
  * @version $Revision$
  */
+ at Test(groups = {"functional"})
 public class LifecycleNotificationTest extends PojoCacheJmxWrapperTestBase
 {
    

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/NotificationTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/NotificationTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/NotificationTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,6 +7,7 @@
 import org.jboss.cache.pojo.PojoCache;
 import org.jboss.cache.pojo.PojoCacheFactory;
 import org.jboss.cache.pojo.impl.PojoCacheImpl;
+import org.testng.annotations.Test;
 
 /**
  * Functional tests for CacheJmxWrapper broadcast of cache event notifications
@@ -14,6 +15,7 @@
  * @author Jerry Gauthier
  * @version $Id$
  */
+ at Test(groups = {"functional"})
 public class NotificationTest extends org.jboss.cache.jmx.NotificationTest
 {
    private PojoCache pojoCache;

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/OptimisticNotificationTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/OptimisticNotificationTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/OptimisticNotificationTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -6,10 +6,13 @@
  */
 package org.jboss.cache.pojo.jmx;
 
+import org.testng.annotations.Test;
 
+
 /**
  * @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
  */
+ at Test(groups = {"functional"})
 public class OptimisticNotificationTest extends NotificationTest
 {
    public OptimisticNotificationTest()

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/PojoCacheJmxWrapperTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/PojoCacheJmxWrapperTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/PojoCacheJmxWrapperTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,6 +7,13 @@
 
 package org.jboss.cache.pojo.jmx;
 
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.fail;
+
+import javax.management.ObjectName;
+
 import org.jboss.cache.CacheException;
 import org.jboss.cache.CacheStatus;
 import org.jboss.cache.config.Configuration;
@@ -15,15 +22,15 @@
 import org.jboss.cache.notifications.annotation.CacheStopped;
 import org.jboss.cache.notifications.event.Event;
 import org.jboss.cache.pojo.PojoCacheException;
+import org.testng.annotations.Test;
 
-import javax.management.ObjectName;
-
 /**
  * Tests the PojoCacheJmxWrapper class
  *
  * @author <a href="mailto:ben.wang at jboss.org">Ben Wang</a>
  * @author Brian Stansberry
  */
+ at Test(groups = {"functional"})
 public class PojoCacheJmxWrapperTest extends PojoCacheJmxWrapperTestBase
 {
 

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/PojoCacheJmxWrapperTestBase.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/PojoCacheJmxWrapperTestBase.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/jmx/PojoCacheJmxWrapperTestBase.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -1,9 +1,7 @@
 package org.jboss.cache.pojo.jmx;
 
-import junit.framework.TestCase;
-import org.jboss.cache.config.Configuration;
-import org.jboss.cache.pojo.PojoCache;
-import org.jboss.cache.pojo.PojoCacheFactory;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
 
 import javax.management.MBeanServer;
 import javax.management.MBeanServerFactory;
@@ -11,12 +9,20 @@
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 
+import org.jboss.cache.config.Configuration;
+import org.jboss.cache.pojo.PojoCache;
+import org.jboss.cache.pojo.PojoCacheFactory;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
 /**
  * Tests the JMX wrapper class around a PojoCache.
  *
  * @author Brian Stansberry
  */
-public class PojoCacheJmxWrapperTestBase extends TestCase
+ at Test(groups = {"functional"})
+public class PojoCacheJmxWrapperTestBase 
 {
    public static final String PC_PREFIX = JmxUtil.POJO_CACHE_DOMAIN + ":" +
                                           JmxUtil.SERVICE_KEY_NAME + "=PojoCacheJmxWrapperTest," +
@@ -31,6 +37,7 @@
    protected ObjectName plainCacheMBeanName;
    protected String plainCacheMBeanNameStr;
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
       mBeanServer = MBeanServerFactory.createMBeanServer("PojoCacheMBeanTest");
@@ -41,6 +48,7 @@
       plainCacheMBeanNameStr = plainCacheMBeanName.getCanonicalName();
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
       try

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/memory/ReplicatedTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/memory/ReplicatedTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/memory/ReplicatedTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,9 +7,13 @@
 
 package org.jboss.cache.pojo.memory;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNull;
+import static org.testng.AssertJUnit.fail;
+
+import java.lang.ref.WeakReference;
+import java.util.ArrayList;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.cache.Fqn;
@@ -21,28 +25,25 @@
 import org.jboss.cache.pojo.test.Address;
 import org.jboss.cache.pojo.test.Person;
 import org.jboss.cache.pojo.test.SerializedAddress;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import java.lang.ref.WeakReference;
-import java.util.ArrayList;
-
 /**
  * @author Ben Wang
  */
 
-public class ReplicatedTest extends TestCase
+ at Test(groups = {"functional"})
+public class ReplicatedTest 
 {
    Log log_ = LogFactory.getLog(ReplicatedTest.class);
    PojoCache cache_;
    PojoCache cache1_;
 
-   public ReplicatedTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       boolean toStart = false;
       cache_ = PojoCacheFactory.createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), toStart);
       cache_.start();
@@ -50,9 +51,9 @@
       cache1_.start();
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
       cache1_.stop();
    }
@@ -179,15 +180,7 @@
       return new SelectedClassnameClassLoader(includesClasses, excludesClasses, cl);
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(ReplicatedTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(ReplicatedTest.suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/ListTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/ListTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/ListTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -21,20 +21,22 @@
 */
 package org.jboss.cache.pojo.notification;
 
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertSame;
+
 import java.util.ArrayList;
 import java.util.List;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
 import org.jboss.cache.pojo.PojoCache;
 import org.jboss.cache.pojo.PojoCacheFactory;
 import org.jboss.cache.pojo.notification.event.AttachedEvent;
 import org.jboss.cache.pojo.notification.event.DetachedEvent;
-import org.jboss.cache.pojo.notification.event.ListModifiedEvent;
 import org.jboss.cache.pojo.notification.event.Event;
+import org.jboss.cache.pojo.notification.event.ListModifiedEvent;
 import org.jboss.cache.pojo.test.Person;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
 //$Id$
 
@@ -43,19 +45,16 @@
  *
  * @author Jason T. Greene
  */
-public class ListTest extends TestCase
+ at Test(groups = {"functional"})
+public class ListTest 
 {
    protected PojoCache cache;
    protected Listener listener = new Listener();
 
-   public ListTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
       cache = PojoCacheFactory.createCache(configFile, toStart);
@@ -63,9 +62,9 @@
       cache.addListener(listener);
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache.stop();
    }
 
@@ -253,13 +252,5 @@
       assertEquals(test, attach.getSource());
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(ListTest.class);
-   }
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(ListTest.suite());
-   }
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/MapTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/MapTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/MapTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -21,20 +21,22 @@
 */
 package org.jboss.cache.pojo.notification;
 
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertSame;
+
 import java.util.LinkedHashMap;
 import java.util.Map;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
 import org.jboss.cache.pojo.PojoCache;
 import org.jboss.cache.pojo.PojoCacheFactory;
 import org.jboss.cache.pojo.notification.event.AttachedEvent;
 import org.jboss.cache.pojo.notification.event.DetachedEvent;
-import org.jboss.cache.pojo.notification.event.MapModifiedEvent;
 import org.jboss.cache.pojo.notification.event.Event;
+import org.jboss.cache.pojo.notification.event.MapModifiedEvent;
 import org.jboss.cache.pojo.test.Person;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
 //$Id$
 
@@ -43,19 +45,16 @@
  *
  * @author Jason T. Greene
  */
-public class MapTest extends TestCase
+ at Test(groups = {"functional"})
+public class MapTest 
 {
    private PojoCache cache;
    private Listener listener = new Listener();
 
-   public MapTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
       cache = PojoCacheFactory.createCache(configFile, toStart);
@@ -64,9 +63,9 @@
    }
 
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache.stop();
    }
 
@@ -218,13 +217,5 @@
       assertEquals(test, attach.getSource());
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(MapTest.class);
-   }
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(MapTest.suite());
-   }
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/ObjectTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/ObjectTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/ObjectTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,18 +7,20 @@
 
 package org.jboss.cache.pojo.notification;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertSame;
 
 import org.jboss.cache.pojo.PojoCache;
 import org.jboss.cache.pojo.PojoCacheFactory;
 import org.jboss.cache.pojo.notification.event.AttachedEvent;
 import org.jboss.cache.pojo.notification.event.DetachedEvent;
-import org.jboss.cache.pojo.notification.event.FieldModifiedEvent;
 import org.jboss.cache.pojo.notification.event.Event;
+import org.jboss.cache.pojo.notification.event.FieldModifiedEvent;
 import org.jboss.cache.pojo.test.Address;
 import org.jboss.cache.pojo.test.Person;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
 // $Id$
 
@@ -27,19 +29,16 @@
  *
  * @author Jason T. Greene
  */
-public class ObjectTest extends TestCase
+ at Test(groups = {"functional"})
+public class ObjectTest 
 {
    private PojoCache cache;
    private Listener listener;
 
-   public ObjectTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
       cache = PojoCacheFactory.createCache(configFile, toStart);
@@ -63,19 +62,11 @@
       assertEquals(true, notification.isLocal());
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(ObjectTest.class);
-   }
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(ObjectTest.suite());
-   }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache.stop();
    }
 

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/ReplicatedListTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/ReplicatedListTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/ReplicatedListTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -21,14 +21,18 @@
 */
 package org.jboss.cache.pojo.notification;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
 
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertSame;
+
 import org.jboss.cache.config.Configuration.CacheMode;
 import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
 import org.jboss.cache.pojo.PojoCache;
 import org.jboss.cache.pojo.PojoCacheFactory;
 import org.jboss.cache.pojo.notification.event.Event;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
 //$Id$
 
@@ -37,19 +41,14 @@
  *
  * @author Jason T. Greene
  */
+ at Test(groups = {"functional"})
 public class ReplicatedListTest extends ListTest
 {
    private PojoCache listenerCache;
 
-   public ReplicatedListTest(String name)
-   {
-      super(name);
-   }
-
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
-
       cache = PojoCacheFactory.createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), false);
       cache.start();
       listenerCache = PojoCacheFactory.createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), false);
@@ -57,9 +56,9 @@
       listenerCache.addListener(listener);
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache.stop();
       listenerCache.stop();
    }
@@ -69,14 +68,4 @@
       assertSame(listenerCache, notification.getContext().getPojoCache());
       assertEquals(false, notification.isLocal());
    }
-
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(ReplicatedListTest.class);
-   }
-
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(ReplicatedListTest.suite());
-   }
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/ReplicatedMapTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/ReplicatedMapTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/ReplicatedMapTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -21,14 +21,18 @@
 */
 package org.jboss.cache.pojo.notification;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
 
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertSame;
+
 import org.jboss.cache.config.Configuration.CacheMode;
 import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
 import org.jboss.cache.pojo.PojoCache;
 import org.jboss.cache.pojo.PojoCacheFactory;
 import org.jboss.cache.pojo.notification.event.Event;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
 //$Id$
 
@@ -37,15 +41,12 @@
  *
  * @author Jason T. Greene
  */
+ at Test(groups = {"functional"})
 public class ReplicatedMapTest extends ListTest
 {
    private PojoCache listenerCache;
 
-   public ReplicatedMapTest(String name)
-   {
-      super(name);
-   }
-
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
       super.setUp();
@@ -57,6 +58,7 @@
       listenerCache.addListener(listener);
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
       super.tearDown();
@@ -70,13 +72,5 @@
       assertEquals(false, notification.isLocal());
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(ReplicatedMapTest.class);
-   }
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(ReplicatedMapTest.suite());
-   }
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/ReplicatedObjectTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/ReplicatedObjectTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/ReplicatedObjectTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -21,14 +21,18 @@
 */
 package org.jboss.cache.pojo.notification;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
 
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertSame;
+
 import org.jboss.cache.config.Configuration.CacheMode;
 import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
 import org.jboss.cache.pojo.PojoCache;
 import org.jboss.cache.pojo.PojoCacheFactory;
 import org.jboss.cache.pojo.notification.event.Event;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
 //$Id$
 
@@ -37,29 +41,23 @@
  *
  * @author Jason T. Greene
  */
+ at Test(groups = {"functional"})
 public class ReplicatedObjectTest extends ListTest
 {
    private PojoCache listenerCache;
 
-   public ReplicatedObjectTest(String name)
-   {
-      super(name);
-   }
-
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
-
       cache = PojoCacheFactory.createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), false);
       cache.start();
       listenerCache = PojoCacheFactory.createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), false);
       listenerCache.start();
       listenerCache.addListener(listener);
    }
-
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache.stop();
       listenerCache.stop();
    }
@@ -70,13 +68,5 @@
       assertEquals(false, notification.isLocal());
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(ReplicatedObjectTest.class);
-   }
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(ReplicatedObjectTest.suite());
-   }
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/ReplicatedSetTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/ReplicatedSetTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/ReplicatedSetTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -21,14 +21,18 @@
 */
 package org.jboss.cache.pojo.notification;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
 
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertSame;
+
 import org.jboss.cache.config.Configuration.CacheMode;
 import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
 import org.jboss.cache.pojo.PojoCache;
 import org.jboss.cache.pojo.PojoCacheFactory;
 import org.jboss.cache.pojo.notification.event.Event;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
 //$Id$
 
@@ -37,15 +41,12 @@
  *
  * @author Jason T. Greene
  */
+ at Test(groups = {"functional"})
 public class ReplicatedSetTest extends ListTest
 {
    private PojoCache listenerCache;
 
-   public ReplicatedSetTest(String name)
-   {
-      super(name);
-   }
-
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
       super.setUp();
@@ -57,6 +58,7 @@
       listenerCache.addListener(listener);
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
       super.tearDown();
@@ -70,13 +72,5 @@
       assertEquals(false, notification.isLocal());
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(ReplicatedSetTest.class);
-   }
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(ReplicatedSetTest.suite());
-   }
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/SetTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/SetTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/SetTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -21,13 +21,12 @@
 */
 package org.jboss.cache.pojo.notification;
 
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertSame;
+
 import java.util.LinkedHashSet;
 import java.util.Set;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
 import org.jboss.cache.pojo.PojoCache;
 import org.jboss.cache.pojo.PojoCacheFactory;
 import org.jboss.cache.pojo.notification.event.AttachedEvent;
@@ -35,6 +34,9 @@
 import org.jboss.cache.pojo.notification.event.Event;
 import org.jboss.cache.pojo.notification.event.SetModifiedEvent;
 import org.jboss.cache.pojo.test.Person;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
 //$Id$
 
@@ -43,19 +45,16 @@
  *
  * @author Jason T. Greene
  */
-public class SetTest extends TestCase
+ at Test(groups = {"functional"})
+public class SetTest 
 {
    private PojoCache cache;
    private Listener listener = new Listener();
 
-   public SetTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
       cache = PojoCacheFactory.createCache(configFile, toStart);
@@ -63,9 +62,9 @@
       cache.addListener(listener);
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache.stop();
    }
 
@@ -207,13 +206,5 @@
       assertEquals(test, attach.getSource());
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(SetTest.class);
-   }
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(SetTest.suite());
-   }
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/TxObjectTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/TxObjectTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/notification/TxObjectTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,6 +7,9 @@
 
 package org.jboss.cache.pojo.notification;
 
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertSame;
+
 import java.util.Properties;
 
 import javax.naming.Context;
@@ -16,19 +19,18 @@
 import javax.transaction.SystemException;
 import javax.transaction.UserTransaction;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
 import org.jboss.cache.pojo.PojoCache;
 import org.jboss.cache.pojo.PojoCacheFactory;
 import org.jboss.cache.pojo.notification.event.AttachedEvent;
 import org.jboss.cache.pojo.notification.event.DetachedEvent;
-import org.jboss.cache.pojo.notification.event.FieldModifiedEvent;
 import org.jboss.cache.pojo.notification.event.Event;
+import org.jboss.cache.pojo.notification.event.FieldModifiedEvent;
 import org.jboss.cache.pojo.test.Address;
 import org.jboss.cache.pojo.test.Person;
 import org.jboss.cache.transaction.DummyTransactionManager;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
 // $Id$
 
@@ -37,15 +39,12 @@
  *
  * @author Jason T. Greene
  */
-public class TxObjectTest extends TestCase
+ at Test(groups = {"functional"})
+public class TxObjectTest 
 {
    private PojoCache cache;
    private TxGauranteedListener listener;
 
-   public TxObjectTest(String name)
-   {
-      super(name);
-   }
 
    private UserTransaction getTransaction() throws SystemException, NotSupportedException, NamingException
    {
@@ -56,9 +55,9 @@
    }
 
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
       cache = PojoCacheFactory.createCache(configFile, toStart);
@@ -84,19 +83,11 @@
       assertEquals(true, notification.isLocal());
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(TxObjectTest.class);
-   }
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(TxObjectTest.suite());
-   }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache.stop();
    }
 

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/optimistic/AbstractOptimisticTestCase.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/optimistic/AbstractOptimisticTestCase.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/optimistic/AbstractOptimisticTestCase.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -22,7 +22,14 @@
 
 package org.jboss.cache.pojo.optimistic;
 
-import junit.framework.TestCase;
+import java.io.File;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Random;
+
+import javax.transaction.SystemException;
+import javax.transaction.TransactionManager;
+
 import org.jboss.cache.CacheSPI;
 import org.jboss.cache.Fqn;
 import org.jboss.cache.config.CacheLoaderConfig;
@@ -45,19 +52,13 @@
 import org.jboss.cache.pojo.PojoCacheFactory;
 import org.jboss.cache.transaction.DummyTransactionManager;
 import org.jboss.cache.xml.XmlHelper;
+import org.testng.annotations.AfterMethod;
 import org.w3c.dom.Element;
 
-import javax.transaction.SystemException;
-import javax.transaction.TransactionManager;
-import java.io.File;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Random;
-
 /**
  * Base test for optimistic locking. Copied from Cache counterpart.
  */
-public abstract class AbstractOptimisticTestCase extends TestCase
+public abstract class AbstractOptimisticTestCase 
 {
    private int instanceNumber;
 
@@ -84,11 +85,6 @@
       return tempDir;
    }
 
-   public AbstractOptimisticTestCase(String name)
-   {
-      super(name);
-   }
-
    protected PojoCache createCacheUnstarted() throws Exception
    {
       return createCacheUnstarted(true);
@@ -299,6 +295,7 @@
       TestingUtil.sleepThread(l);
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown()
    {
       TransactionManager mgr = DummyTransactionManager.getInstance();

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/optimistic/CachedListTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/optimistic/CachedListTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/optimistic/CachedListTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -22,12 +22,10 @@
 
 package org.jboss.cache.pojo.optimistic;
 
-import junit.framework.Test;
-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.test.Address;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.fail;
 
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -35,12 +33,21 @@
 import java.util.ListIterator;
 import java.util.NoSuchElementException;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.cache.pojo.PojoCache;
+import org.jboss.cache.pojo.test.Address;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
 /**
  * List interface testing.
  *
  * @author Ben Wang
  */
 
+ at Test(groups = {"functional"})
 public class CachedListTest extends AbstractOptimisticTestCase
 {
    Log log = LogFactory.getLog(CachedListTest.class);
@@ -48,20 +55,15 @@
    List languages;
    List languages2;
 
-   public CachedListTest(String name)
-   {
-      super(name);
-   }
-
-
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       cache_ = createCache();
 //      cache_ = createPessimisticCache();
       log.info("setUp() ....");
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown()
    {
       super.tearDown();
@@ -417,14 +419,6 @@
       assertFalse("List should not be equal: ", list1.equals(list3));
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(CachedListTest.class);
-   }
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/optimistic/LocalTxTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/optimistic/LocalTxTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/optimistic/LocalTxTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -22,18 +22,15 @@
 
 package org.jboss.cache.pojo.optimistic;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.CacheSPI;
-import org.jboss.cache.Fqn;
-import org.jboss.cache.pojo.PojoCache;
-import org.jboss.cache.pojo.test.Address;
-import org.jboss.cache.pojo.test.Person;
-import org.jboss.cache.pojo.util.CacheApiUtil;
-import org.jboss.cache.transaction.DummyTransactionManager;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotSame;
+import static org.testng.AssertJUnit.fail;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.CountDownLatch;
+
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
@@ -42,13 +39,23 @@
 import javax.transaction.SystemException;
 import javax.transaction.Transaction;
 import javax.transaction.UserTransaction;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-import java.util.concurrent.CountDownLatch;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.cache.CacheSPI;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.pojo.PojoCache;
+import org.jboss.cache.pojo.test.Address;
+import org.jboss.cache.pojo.test.Person;
+import org.jboss.cache.pojo.util.CacheApiUtil;
+import org.jboss.cache.transaction.DummyTransactionManager;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
 /**
  */
+ at Test(groups = {"functional"})
 public class LocalTxTest extends AbstractOptimisticTestCase
 {
    Log log = LogFactory.getLog(LocalTxTest.class);
@@ -58,15 +65,9 @@
    Throwable t1_ex, t2_ex;
    long start = 0;
 
-
-   public LocalTxTest(String name)
-   {
-      super(name);
-   }
-
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
 
       cache = createCache();
@@ -78,9 +79,9 @@
       t1_ex = t2_ex = null;
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown()
    {
-      super.tearDown();
       cache.stop();
 
       DummyTransactionManager.destroy();
@@ -511,15 +512,7 @@
    }
 
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(LocalTxTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/passivation/LocalTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/passivation/LocalTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/passivation/LocalTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,9 +7,11 @@
 
 package org.jboss.cache.pojo.passivation;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertNull;
+import static org.testng.AssertJUnit.fail;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.cache.CacheSPI;
@@ -23,29 +25,27 @@
 import org.jboss.cache.pojo.test.Address;
 import org.jboss.cache.pojo.test.Link;
 import org.jboss.cache.pojo.test.Person;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import java.util.Map;
-
 /**
  * Basic PojoCache test case.
  *
  * @author Ben Wang
  */
 
-public class LocalTest extends TestCase
+ at Test(groups = {"functional"})
+public class LocalTest 
 {
    Log log = LogFactory.getLog(org.jboss.cache.pojo.passivation.LocalTest.class);
    PojoCache cache_;
    MyCacheListener listener_;
 
-   public LocalTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       String configFile = "META-INF/pojocache-passivation-service.xml";
       boolean toStart = false;
@@ -58,9 +58,9 @@
       cache_.start();
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.getCache().removeNode(Fqn.ROOT);
       ((CacheSPI) cache_.getCache()).getCacheLoaderManager().getCacheLoader().remove(Fqn.ROOT);
       cache_.getCache().removeCacheListener(listener_);
@@ -240,16 +240,8 @@
    }
 
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(org.jboss.cache.pojo.passivation.LocalTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(org.jboss.cache.pojo.passivation.LocalTest.suite());
-   }
 
    @CacheListener
    public class MyCacheListener

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/passivation/ReplicatedTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/passivation/ReplicatedTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/passivation/ReplicatedTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -22,9 +22,10 @@
 
 package org.jboss.cache.pojo.passivation;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.fail;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.cache.Fqn;
@@ -40,6 +41,9 @@
 import org.jboss.cache.pojo.test.Address;
 import org.jboss.cache.pojo.test.Link;
 import org.jboss.cache.pojo.test.Person;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
 /**
  * Replicated passivation test.
@@ -47,20 +51,17 @@
  * @author Ben Wang
  */
 
-public class ReplicatedTest extends TestCase
+ at Test(groups = {"functional"})
+public class ReplicatedTest 
 {
    Log log = LogFactory.getLog(ReplicatedTest.class);
    PojoCache cache_, cache1_;
    MyCacheListener listener_;
 
-   public ReplicatedTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       String configFile = "META-INF/pojocache-passivation-service.xml";
       boolean toStart = false;
@@ -78,9 +79,9 @@
       cache1_.start();
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.getCache().removeNode(Fqn.fromString("/"));
       cache_.stop();
       cache1_.stop();
@@ -249,16 +250,8 @@
    }
 
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(ReplicatedTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 
    @CacheListener
    public class MyCacheListener

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/region/LocalConcurrentTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/region/LocalConcurrentTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/region/LocalConcurrentTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,9 +7,14 @@
 
 package org.jboss.cache.pojo.region;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import java.util.ArrayList;
+import java.util.Properties;
+import java.util.Random;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.transaction.UserTransaction;
+
 import org.jboss.cache.Fqn;
 import org.jboss.cache.lock.UpgradeException;
 import org.jboss.cache.pojo.PojoCache;
@@ -18,14 +23,10 @@
 import org.jboss.cache.pojo.test.Address;
 import org.jboss.cache.pojo.test.Person;
 import org.jboss.cache.transaction.DummyTransactionManager;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.transaction.UserTransaction;
-import java.util.ArrayList;
-import java.util.Properties;
-import java.util.Random;
-
 /**
  * Local concurrent test for PojoCache. Test attach and detach under load
  * and concurrency.
@@ -33,7 +34,8 @@
  * @version $Revision$
  * @author<a href="mailto:bwang at jboss.org">Ben Wang</a> December 2004
  */
-public class LocalConcurrentTest extends TestCase
+ at Test(groups = {"functional"})
+public class LocalConcurrentTest 
 {
    static PojoCache cache_;
    Properties p_;
@@ -47,14 +49,9 @@
    static Exception thread_ex = null;
    UserTransaction tx_ = null;
 
-   public LocalConcurrentTest(String name)
-   {
-      super(name);
-   }
-
+   @BeforeMethod(alwaysRun = true)
    public void setUp() throws Exception
    {
-      super.setUp();
       oldFactory_ = System.getProperty(Context.INITIAL_CONTEXT_FACTORY);
       System.setProperty(Context.INITIAL_CONTEXT_FACTORY, FACTORY);
       DummyTransactionManager.getInstance();
@@ -72,9 +69,9 @@
       log("LocalConcurrentTestCase: cacheMode=TRANSIENT, one cache");
    }
 
+   @AfterMethod(alwaysRun = true)
    public void tearDown() throws Exception
    {
-      super.tearDown();
       thread_ex = null;
       DummyTransactionManager.destroy();
       destroyCaches();
@@ -261,10 +258,6 @@
       return strList;
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(org.jboss.cache.pojo.region.LocalConcurrentTest.class);
-   }
 
    private static void log(String str)
    {

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/region/LocalTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/region/LocalTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/region/LocalTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,9 +7,18 @@
 
 package org.jboss.cache.pojo.region;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNull;
+import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.fail;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.aop.proxy.ClassProxy;
@@ -22,34 +31,27 @@
 import org.jboss.cache.pojo.test.Address;
 import org.jboss.cache.pojo.test.Person;
 import org.jboss.cache.pojo.test.Student;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
 /**
  * Basic PojoCache test case.
  *
  * @author Ben Wang
  */
 
-public class LocalTest extends TestCase
+ at Test(groups = {"functional"})
+public class LocalTest 
 {
    Log log = LogFactory.getLog(org.jboss.cache.pojo.region.LocalTest.class);
    PojoCache cache_;
    static final String REGION = "person";
 
-   public LocalTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
@@ -59,9 +61,9 @@
       cache_.getCache().getRegion(Fqn.fromString("RANDOM"), true);
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
    }
 
@@ -366,15 +368,7 @@
    }
 
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(org.jboss.cache.pojo.region.LocalTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(org.jboss.cache.pojo.region.LocalTest.suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/region/NewLocalTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/region/NewLocalTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/region/NewLocalTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,9 +7,12 @@
 
 package org.jboss.cache.pojo.region;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNull;
+import static org.testng.AssertJUnit.fail;
+
+import java.util.Map;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.cache.Fqn;
@@ -17,28 +20,26 @@
 import org.jboss.cache.pojo.PojoCacheFactory;
 import org.jboss.cache.pojo.impl.InternalConstant;
 import org.jboss.cache.pojo.test.Person;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import java.util.Map;
-
 /**
  * Additional basic tests
  *
  * @author Ben Wang
  */
 
-public class NewLocalTest extends TestCase
+ at Test(groups = {"functional"})
+public class NewLocalTest 
 {
    Log log_ = LogFactory.getLog(org.jboss.cache.pojo.region.NewLocalTest.class);
    PojoCache cache_;
 
-   public NewLocalTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log_.info("setUp() ....");
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
@@ -47,9 +48,9 @@
       cache_.getCache().getRegion(Fqn.fromString("SESSION"), true);
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
    }
 
@@ -148,15 +149,7 @@
       assertEquals("Objects size should be ", 2, map.size());
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(org.jboss.cache.pojo.region.NewLocalTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(org.jboss.cache.pojo.region.NewLocalTest.suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/region/ReplicatedTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/region/ReplicatedTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/region/ReplicatedTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,9 +7,11 @@
 
 package org.jboss.cache.pojo.region;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNull;
+
+import java.util.List;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.cache.Fqn;
@@ -19,28 +21,26 @@
 import org.jboss.cache.pojo.PojoCacheFactory;
 import org.jboss.cache.pojo.test.Person;
 import org.jboss.cache.pojo.test.Student;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import java.util.List;
-
 /**
  * Replicated test that use a tester wrapper. Future new test should use NewReplicatedAopTest
  *
  * @author Ben Wang
  */
-public class ReplicatedTest extends TestCase
+ at Test(groups = {"functional"})
+public class ReplicatedTest 
 {
    Log log = LogFactory.getLog(org.jboss.cache.pojo.region.ReplicatedTest.class);
    PojoCache cache, cache1;
 
 
-   public ReplicatedTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       boolean toStart = false;
       cache = PojoCacheFactory.createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), toStart);
@@ -51,9 +51,9 @@
       cache1.getCache().getRegion(Fqn.fromString("SESSION"), true);
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache.stop();
       cache1.stop();
    }
@@ -151,15 +151,7 @@
    }
 
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(org.jboss.cache.pojo.region.ReplicatedTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(org.jboss.cache.pojo.region.ReplicatedTest.suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/InMemoryTxUndoTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/InMemoryTxUndoTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/InMemoryTxUndoTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,9 +7,14 @@
 
 package org.jboss.cache.pojo.rollback;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertNull;
+
+import java.util.ArrayList;
+
+import javax.transaction.TransactionManager;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.aop.Advised;
@@ -20,30 +25,27 @@
 import org.jboss.cache.pojo.test.Address;
 import org.jboss.cache.pojo.test.Person;
 import org.jboss.cache.transaction.DummyTransactionManager;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import javax.transaction.TransactionManager;
-import java.util.ArrayList;
-
 /**
  * Additional basic tests
  *
  * @author Ben Wang
  */
 
-public class InMemoryTxUndoTest extends TestCase
+ at Test(groups = {"functional"})
+public class InMemoryTxUndoTest 
 {
    Log log_ = LogFactory.getLog(InMemoryTxUndoTest.class);
    PojoCache cache_;
    TransactionManager tx_mgr;
 
-   public InMemoryTxUndoTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log_.info("setUp() ....");
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
@@ -53,9 +55,9 @@
 
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
    }
 
@@ -158,15 +160,7 @@
       assertEquals("Should still be ", 1, test.getLanguages().size());
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(InMemoryTxUndoTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(InMemoryTxUndoTest.suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/ListTxUndoTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/ListTxUndoTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/ListTxUndoTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,9 +7,13 @@
 
 package org.jboss.cache.pojo.rollback;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.ArrayList;
+
+import javax.transaction.TransactionManager;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.aop.proxy.ClassProxy;
@@ -17,30 +21,27 @@
 import org.jboss.cache.pojo.PojoCacheFactory;
 import org.jboss.cache.pojo.test.Person;
 import org.jboss.cache.transaction.DummyTransactionManager;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import javax.transaction.TransactionManager;
-import java.util.ArrayList;
-
 /**
  * Additional basic tests
  *
  * @author Ben Wang
  */
 
-public class ListTxUndoTest extends TestCase
+ at Test(groups = {"functional"})
+public class ListTxUndoTest 
 {
    Log log_ = LogFactory.getLog(ListTxUndoTest.class);
    PojoCache cache_;
    TransactionManager tx_mgr;
 
-   public ListTxUndoTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log_.info("setUp() ....");
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
@@ -50,9 +51,9 @@
 
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
    }
 
@@ -132,15 +133,7 @@
       assertFalse("Should not have cache interceptor ", isProxy(test.getLanguages()));
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(ListTxUndoTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(ListTxUndoTest.suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/ListUndoTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/ListUndoTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/ListUndoTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,9 +7,13 @@
 
 package org.jboss.cache.pojo.rollback;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.ArrayList;
+
+import javax.transaction.TransactionManager;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.aop.proxy.ClassProxy;
@@ -18,30 +22,27 @@
 import org.jboss.cache.pojo.interceptors.PojoFailedTxMockupInterceptor;
 import org.jboss.cache.pojo.test.Person;
 import org.jboss.cache.transaction.DummyTransactionManager;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import javax.transaction.TransactionManager;
-import java.util.ArrayList;
-
 /**
  * Additional basic tests
  *
  * @author Ben Wang
  */
 
-public class ListUndoTest extends TestCase
+ at Test(groups = {"functional"})
+public class ListUndoTest 
 {
    Log log_ = LogFactory.getLog(ListUndoTest.class);
    PojoCache cache_;
    TransactionManager tx_mgr;
 
-   public ListUndoTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log_.info("setUp() ....");
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
@@ -51,9 +52,9 @@
 
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
    }
 
@@ -66,7 +67,7 @@
 
    public void testSimple() throws Exception
    {
-      ArrayList list = new ArrayList();
+      ArrayList<String> list = new ArrayList<String>();
       list.add("test1");
 
       setTxRollback(true);
@@ -82,7 +83,7 @@
       Person test = new Person();
       test.setName("Ben");
       test.setAge(10);
-      ArrayList list = new ArrayList();
+      ArrayList<String> list = new ArrayList<String>();
       list.add("English");
       test.setLanguages(list);
 
@@ -105,7 +106,7 @@
       Person test = new Person();
       test.setName("Ben");
       test.setAge(10);
-      ArrayList list = new ArrayList();
+      ArrayList<String> list = new ArrayList<String>();
       list.add("English");
       test.setLanguages(list);
 
@@ -118,15 +119,7 @@
       cache_.detach("/a");
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(ListUndoTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(ListUndoTest.suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/LocalExceptionUndoTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/LocalExceptionUndoTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/LocalExceptionUndoTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -22,9 +22,14 @@
 
 package org.jboss.cache.pojo.rollback;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.ArrayList;
+
+import javax.transaction.TransactionManager;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.aop.Advised;
@@ -37,31 +42,27 @@
 import org.jboss.cache.pojo.interceptors.dynamic.CacheFieldInterceptor;
 import org.jboss.cache.pojo.test.Person;
 import org.jboss.cache.transaction.DummyTransactionManager;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import javax.transaction.TransactionManager;
-import java.util.ArrayList;
-
 /**
  * Additional basic tests
  *
  * @author Ben Wang
  */
 
-public class LocalExceptionUndoTest extends TestCase
+ at Test(groups = {"functional"})
+public class LocalExceptionUndoTest 
 {
    Log log_ = LogFactory.getLog(LocalExceptionUndoTest.class);
    PojoCache cache_;
    TransactionManager tx_mgr;
    boolean isTrue = false;
 
-   public LocalExceptionUndoTest(String name)
-   {
-      super(name);
-   }
-
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log_.info("setUp() ....");
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
@@ -85,9 +86,9 @@
       Thread.sleep(200);
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
    }
 
@@ -165,17 +166,10 @@
       return false;
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(LocalExceptionUndoTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 
+ at Test(groups = {"functional"})
    public class LockThread extends Thread
    {
       public void run()

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/LocalTxUndoTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/LocalTxUndoTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/LocalTxUndoTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,9 +7,11 @@
 
 package org.jboss.cache.pojo.rollback;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+
+import javax.transaction.TransactionManager;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.aop.Advised;
@@ -19,29 +21,27 @@
 import org.jboss.cache.pojo.interceptors.dynamic.CacheFieldInterceptor;
 import org.jboss.cache.pojo.test.Person;
 import org.jboss.cache.transaction.DummyTransactionManager;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import javax.transaction.TransactionManager;
-
 /**
  * Additional basic tests
  *
  * @author Ben Wang
  */
 
-public class LocalTxUndoTest extends TestCase
+ at Test(groups = {"functional"})
+public class LocalTxUndoTest 
 {
    Log log_ = LogFactory.getLog(LocalTxUndoTest.class);
    PojoCache cache_;
    TransactionManager tx_mgr;
 
-   public LocalTxUndoTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log_.info("setUp() ....");
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
@@ -51,9 +51,9 @@
 
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
    }
 
@@ -115,15 +115,7 @@
       assertFalse("Should not have cache interceptor ", hasCacheInterceptor(test));
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(LocalTxUndoTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(LocalTxUndoTest.suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/LocalUndoTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/LocalUndoTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/LocalUndoTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,9 +7,11 @@
 
 package org.jboss.cache.pojo.rollback;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+
+import javax.transaction.TransactionManager;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.aop.Advised;
@@ -20,29 +22,27 @@
 import org.jboss.cache.pojo.interceptors.dynamic.CacheFieldInterceptor;
 import org.jboss.cache.pojo.test.Person;
 import org.jboss.cache.transaction.DummyTransactionManager;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import javax.transaction.TransactionManager;
-
 /**
  * Additional basic tests
  *
  * @author Ben Wang
  */
 
-public class LocalUndoTest extends TestCase
+ at Test(groups = {"functional"})
+public class LocalUndoTest 
 {
    Log log_ = LogFactory.getLog(LocalUndoTest.class);
    PojoCache cache_;
    TransactionManager tx_mgr;
 
-   public LocalUndoTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log_.info("setUp() ....");
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
@@ -52,9 +52,9 @@
 
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
    }
 
@@ -102,15 +102,7 @@
       assertTrue("Should still have cache interceptor ", hasCacheInterceptor(test));
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(LocalUndoTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(LocalUndoTest.suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/MapTxUndoTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/MapTxUndoTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/MapTxUndoTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,9 +7,15 @@
 
 package org.jboss.cache.pojo.rollback;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.transaction.TransactionManager;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.aop.proxy.ClassProxy;
@@ -17,31 +23,27 @@
 import org.jboss.cache.pojo.PojoCacheFactory;
 import org.jboss.cache.pojo.test.Person;
 import org.jboss.cache.transaction.DummyTransactionManager;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import javax.transaction.TransactionManager;
-import java.util.HashMap;
-import java.util.Map;
-
 /**
  * Additional basic tests
  *
  * @author Ben Wang
  */
 
-public class MapTxUndoTest extends TestCase
+ at Test(groups = {"functional"})
+public class MapTxUndoTest 
 {
    Log log_ = LogFactory.getLog(MapTxUndoTest.class);
    PojoCache cache_;
    TransactionManager tx_mgr;
 
-   public MapTxUndoTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log_.info("setUp() ....");
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
@@ -51,9 +53,9 @@
 
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
    }
 
@@ -191,15 +193,7 @@
       assertEquals("1", obj1.get("id"));
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(MapTxUndoTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(MapTxUndoTest.suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/MapUndoTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/MapUndoTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/MapUndoTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,9 +7,13 @@
 
 package org.jboss.cache.pojo.rollback;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.HashMap;
+
+import javax.transaction.TransactionManager;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.aop.proxy.ClassProxy;
@@ -18,30 +22,27 @@
 import org.jboss.cache.pojo.interceptors.PojoFailedTxMockupInterceptor;
 import org.jboss.cache.pojo.test.Person;
 import org.jboss.cache.transaction.DummyTransactionManager;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import javax.transaction.TransactionManager;
-import java.util.HashMap;
-
 /**
  * Additional basic tests
  *
  * @author Ben Wang
  */
 
-public class MapUndoTest extends TestCase
+ at Test(groups = {"functional"})
+public class MapUndoTest 
 {
    Log log_ = LogFactory.getLog(MapUndoTest.class);
    PojoCache cache_;
    TransactionManager tx_mgr;
 
-   public MapUndoTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log_.info("setUp() ....");
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
@@ -51,9 +52,9 @@
 
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
    }
 
@@ -118,15 +119,7 @@
       cache_.detach("/a");
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(MapUndoTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(MapUndoTest.suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/PojoCollectionRollbackTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/PojoCollectionRollbackTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/PojoCollectionRollbackTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -8,36 +8,39 @@
  *****************************************/
 package org.jboss.cache.pojo.rollback;
 
-import junit.framework.TestCase;
-import org.jboss.cache.pojo.PojoCache;
-import org.jboss.cache.pojo.PojoCacheFactory;
-import org.jboss.cache.transaction.DummyTransactionManager;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
 
-import javax.transaction.TransactionManager;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import javax.transaction.TransactionManager;
+
+import org.jboss.cache.pojo.PojoCache;
+import org.jboss.cache.pojo.PojoCacheFactory;
+import org.jboss.cache.transaction.DummyTransactionManager;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
 /**
  * @author
  */
-public class PojoCollectionRollbackTest extends TestCase
+ at Test(groups = {"functional"})
+public class PojoCollectionRollbackTest 
 {
    private static final String ID = "id";
    private static final String CONTAINER_FQN = "/objsIndex";
    TransactionManager tx_mgr;
 
-   public PojoCollectionRollbackTest(String s)
-   {
-      super(s);
-   }
-
    private PojoCache cache_;
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
    }
 
    private void startTest() throws Exception
@@ -49,9 +52,9 @@
       tx_mgr = DummyTransactionManager.getInstance();
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
    }
 

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/ReplicatedTxTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/ReplicatedTxTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/ReplicatedTxTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,19 +7,13 @@
 
 package org.jboss.cache.pojo.rollback;
 
-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.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 static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.fail;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
@@ -28,14 +22,25 @@
 import javax.transaction.SystemException;
 import javax.transaction.Transaction;
 import javax.transaction.UserTransaction;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
 
+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.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 org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
 /**
  */
 
-public class ReplicatedTxTest extends TestCase
+ at Test(groups = {"functional"})
+public class ReplicatedTxTest 
 {
    Log log = LogFactory.getLog(org.jboss.cache.pojo.rollback.ReplicatedTxTest.class);
    PojoCache cache, cache1;
@@ -45,14 +50,10 @@
    long start = 0;
 
 
-   public ReplicatedTxTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
       boolean toStart = false;
       cache = PojoCacheFactory.createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), toStart);
@@ -66,9 +67,9 @@
       t1_ex = t2_ex = null;
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache.stop();
       cache1.stop();
 
@@ -399,15 +400,7 @@
    }
 
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(org.jboss.cache.pojo.rollback.ReplicatedTxTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(org.jboss.cache.pojo.rollback.ReplicatedTxTest.suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/SetTxUndoTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/SetTxUndoTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/SetTxUndoTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,9 +7,13 @@
 
 package org.jboss.cache.pojo.rollback;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.HashSet;
+
+import javax.transaction.TransactionManager;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.aop.proxy.ClassProxy;
@@ -17,30 +21,27 @@
 import org.jboss.cache.pojo.PojoCacheFactory;
 import org.jboss.cache.pojo.test.Person;
 import org.jboss.cache.transaction.DummyTransactionManager;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import javax.transaction.TransactionManager;
-import java.util.HashSet;
-
 /**
  * Additional basic tests
  *
  * @author Ben Wang
  */
 
-public class SetTxUndoTest extends TestCase
+ at Test(groups = {"functional"})
+public class SetTxUndoTest 
 {
    Log log_ = LogFactory.getLog(SetTxUndoTest.class);
    PojoCache cache_;
    TransactionManager tx_mgr;
 
-   public SetTxUndoTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log_.info("setUp() ....");
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
@@ -50,9 +51,9 @@
 
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
    }
 
@@ -132,15 +133,7 @@
       assertFalse("Should not have cache interceptor ", isProxy(test.getSkills()));
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(SetTxUndoTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(SetTxUndoTest.suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/SetUndoTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/SetUndoTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/SetUndoTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,9 +7,13 @@
 
 package org.jboss.cache.pojo.rollback;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.HashSet;
+
+import javax.transaction.TransactionManager;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.aop.proxy.ClassProxy;
@@ -18,30 +22,27 @@
 import org.jboss.cache.pojo.interceptors.PojoFailedTxMockupInterceptor;
 import org.jboss.cache.pojo.test.Person;
 import org.jboss.cache.transaction.DummyTransactionManager;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import javax.transaction.TransactionManager;
-import java.util.HashSet;
-
 /**
  * Additional basic tests
  *
  * @author Ben Wang
  */
 
-public class SetUndoTest extends TestCase
+ at Test(groups = {"functional"})
+public class SetUndoTest 
 {
    Log log_ = LogFactory.getLog(SetUndoTest.class);
    PojoCache cache_;
    TransactionManager tx_mgr;
 
-   public SetUndoTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log_.info("setUp() ....");
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
@@ -51,9 +52,9 @@
 
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
    }
 
@@ -118,15 +119,7 @@
       cache_.detach("/a");
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(SetUndoTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(SetUndoTest.suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/statetransfer/ReplicatedTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/statetransfer/ReplicatedTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/statetransfer/ReplicatedTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -22,9 +22,8 @@
 
 package org.jboss.cache.pojo.statetransfer;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertEquals;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.cache.CacheImpl;
@@ -34,32 +33,32 @@
 import org.jboss.cache.pojo.PojoCacheFactory;
 import org.jboss.cache.pojo.test.Person;
 import org.jboss.cache.pojo.test.Student;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
 /**
  * Simple replicated test for state transfer
  *
  * @author Ben Wang
  */
-public class ReplicatedTest extends TestCase
+ at Test(groups = {"functional"})
+public class ReplicatedTest 
 {
    Log log = LogFactory.getLog(ReplicatedTest.class);
    PojoCache cache, cache1;
 
 
-   public ReplicatedTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log.info("setUp() ....");
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache.stop();
       cache1.stop();
    }
@@ -107,15 +106,7 @@
       cache.detach("/person/test1");
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(ReplicatedTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 
 }

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/statetransfer/StateTransfer200AopTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/statetransfer/StateTransfer200AopTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/statetransfer/StateTransfer200AopTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,12 +7,15 @@
 
 package org.jboss.cache.pojo.statetransfer;
 
+import org.testng.annotations.Test;
+
 /**
  * Tests that PojoCache state transfer works properly if the version is 2.0.0.
  *
  * @author <a href="mailto://brian.stansberry@jboss.com">Brian Stansberry</a>
  * @version $Revision$
  */
+ at Test(groups = {"functional"})
 public class StateTransfer200AopTest extends StateTransferAopTestBase
 {
 

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/statetransfer/StateTransferAopTestBase.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/statetransfer/StateTransferAopTestBase.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/statetransfer/StateTransferAopTestBase.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,7 +7,23 @@
 
 package org.jboss.cache.pojo.statetransfer;
 
-import junit.framework.TestCase;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertNull;
+import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.fail;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Random;
+import java.util.Set;
+import java.util.concurrent.Semaphore;
+import java.util.concurrent.TimeUnit;
+
+import javax.transaction.TransactionManager;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.cache.Cache;
@@ -27,25 +43,17 @@
 import org.jboss.cache.pojo.test.Address;
 import org.jboss.cache.pojo.test.Person;
 import org.jboss.cache.xml.XmlHelper;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
 import org.w3c.dom.Element;
 
-import javax.transaction.TransactionManager;
-import java.io.File;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Random;
-import java.util.Set;
-import java.util.concurrent.Semaphore;
-import java.util.concurrent.TimeUnit;
-
 /**
  * Tests state transfer in PojoCache.
  *
  * @author <a href="mailto://brian.stansberry@jboss.com">Brian Stansberry</a>
  * @version $Revision$
  */
-public abstract class StateTransferAopTestBase extends TestCase
+public abstract class StateTransferAopTestBase 
 {
    private Map caches;
 
@@ -683,10 +691,9 @@
 
    protected abstract String getReplicationVersion();
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
-
       caches = new HashMap();
 
       addr1 = new Address();
@@ -736,10 +743,9 @@
       jane.setSkills(skills);
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
-
       Set keys = caches.keySet();
       if (!keys.isEmpty())
       {

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/util/MethodCallTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/util/MethodCallTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/util/MethodCallTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -7,36 +7,33 @@
 
 package org.jboss.cache.pojo.util;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import java.lang.reflect.Method;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-import java.lang.reflect.Method;
-
 /**
  * @author Ben Wang
  */
 
-public class MethodCallTest extends TestCase
+ at Test(groups = {"functional"})
+public class MethodCallTest 
 {
    Log log_ = LogFactory.getLog(MethodCallTest.class);
 
-   public MethodCallTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log_.info("setUp() ....");
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
    }
 
 //   public void testDummy() {}
@@ -54,16 +51,8 @@
       mc.invoke();
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(MethodCallTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(MethodCallTest.suite());
-   }
 
    public static class Foo
    {

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/util/ObjectUtilTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/util/ObjectUtilTest.java	2007-09-07 00:27:09 UTC (rev 4448)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/util/ObjectUtilTest.java	2007-09-08 03:26:15 UTC (rev 4449)
@@ -1,8 +1,8 @@
 package org.jboss.cache.pojo.util;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.cache.pojo.PojoCache;
@@ -10,6 +10,9 @@
 import org.jboss.cache.pojo.impl.PojoCacheImpl;
 import org.jboss.cache.pojo.test.NodeManager;
 import org.jboss.cache.pojo.test.TestNode;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
 
 /**
@@ -18,19 +21,16 @@
  * @author Ben Wang
  */
 
-public class ObjectUtilTest extends TestCase
+ at Test(groups = {"functional"})
+public class ObjectUtilTest 
 {
    Log log_ = LogFactory.getLog(ObjectUtilTest.class);
    PojoCache cache_;
 
-   public ObjectUtilTest(String name)
-   {
-      super(name);
-   }
 
+   @BeforeMethod(alwaysRun = true)
    protected void setUp() throws Exception
    {
-      super.setUp();
       log_.info("setUp() ....");
       String configFile = "META-INF/local-service.xml";
       boolean toStart = false;
@@ -38,9 +38,9 @@
       cache_.start();
    }
 
+   @AfterMethod(alwaysRun = true)
    protected void tearDown() throws Exception
    {
-      super.tearDown();
       cache_.stop();
    }
 
@@ -76,16 +76,8 @@
               ObjectUtil.isReachable((PojoCacheImpl) cache_, kanto, test));
    }
 
-   public static Test suite() throws Exception
-   {
-      return new TestSuite(ObjectUtilTest.class);
-   }
 
 
-   public static void main(String[] args) throws Exception
-   {
-      junit.textui.TestRunner.run(suite());
-   }
 
 }
 




More information about the jbosscache-commits mailing list