From jbosscache-commits at lists.jboss.org Mon Nov 26 13:15:31 2007 Content-Type: multipart/mixed; boundary="===============8503199366516704963==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r4775 - in pojo/trunk/src: test/java/org/jboss/cache/pojo/rollback and 1 other directory. Date: Mon, 26 Nov 2007 13:15:30 -0500 Message-ID: --===============8503199366516704963== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: jason.greene(a)jboss.com Date: 2007-11-26 13:15:30 -0500 (Mon, 26 Nov 2007) New Revision: 4775 Modified: pojo/trunk/src/main/docbook/userguide/en/modules/instrumentation.xml pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/ListUndoTest.java pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/LocalUndoTest.java pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/MapUndoTest.java pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/SetUndoTest.java Log: Merge 4774 from 2.1 branch Modified: pojo/trunk/src/main/docbook/userguide/en/modules/instrumentation.= xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- pojo/trunk/src/main/docbook/userguide/en/modules/instrumentation.xml 20= 07-11-26 18:14:21 UTC (rev 4774) +++ pojo/trunk/src/main/docbook/userguide/en/modules/instrumentation.xml 20= 07-11-26 18:15:30 UTC (rev 4775) @@ -1,320 +1,302 @@ + + Instrumentation = - Instrumentation + In order to store an object in POJO Cache, it must be either + instrumented or made serializable. Instrumentation is the most optimal + approach since it preserves object identity and provides field granular + replication. POJO Cache currently uses the JBoss AOP project to provide + instrumentation, so the same processes described in the AOP documentation + can be used with POJO Cache. = - In this chapter, we explain how to instrument (or "aspectize")= the - POJOs via JBoss Aop. There are two steps needed by JBoss Aop: 1) = POJO - declaration, 2) instrumentation. But depends on the instrumentati= on - mode that you are using, you may not need to pre-process your POJO a= t all. That is, - if you use JDK5.0 (required) and load-time mode, then all you need t= o do is - annotating your POJO (or declare it in a xml file). This makes your = PojoCache - programming nearly transparent. + The primary input to JBoss AOP is the AOP binding file, which is + responsible for specifying which classes should be instrumented. POJO Ca= che + provides a binding file, pojocache-aop.xml , which + matches all classes that have been annotated with the + @Replicable annotation. Advanced users may choose to + alter this definition to instrument classes in other various interesting + ways. However, it is recommended to just stick with the default annotati= on + binding. = - For the first step, since we are using the dynamic Aop feature= , a - POJO is only required to be declared "prepare". Basically, there = are two - ways to do this: either via explicit xml or annotation. + The instrumentation process can be executed at either load-time, or + compile-time. Load-time instrumentation uses a Java agent to intercept a= nd + modify classes as they are loaded; whereas compile-time instrumentation + requires running aopc as part of the compilation + process. = - As for the second step, either we can ask JBoss Aop to do load= -time - (through a special class loader, so-called load-time mode) or com= pile-time - instrumentation (use of an aopc pre-compiler, so-called precompil= ed - mode). Reader can read the JBoss Aop introduction chapter for mor= e details. + + Load-time is the recommended approach, since compile-time + instrumentation adds hard dependencies to the weaved bytecode which ti= es + the output to a particular version of JBoss AOP. + = - - XML descriptor + + Load-time instrumentation = - To declare a POJO via XML configuration file, you will n= eed a - META-INF/jboss-aop.xml (or in the PojoCa= che case, it is - the equivalent pojocache-service.xml - file located under the class - path or listed in the jboss.aop.path sys= tem - property. JBoss AOP framework will read this file during st= artup to make - necessary byte code manipulation for advice and introductio= n. Or you - can pre-compile it using a pre-compiler called - aopc - such that you won't need the XML file during load time. JBo= ss Aop - provides a so-called - pointcut - language where it - consists of a regular expression set to specify the interce= ption - points (or - jointpoint - in aop parlance). The - jointpoint can be constructor, method call, or field. You w= ill need to - declare any of your POJO to be "prepared" so that AOP frame= work knows - to start intercepting either method, field, or constructor = invocations - using the dynamic Aop. - + Load-time instrumentation uses a Java agent to intercept all cla= sses + loaded by the JVM. As they are loaded JBoss AOP instruments them, allo= wing + POJO Cache to monitor field changes. To enable load time instrumentati= on + the JVM must be started with the following specified: = - For PojoCache, we only allow all the - fields (both read and write) to be intercepted. That is, we= don't care - for the method level interception since it is the state tha= t we are - interested in. So you should - only need to change your POJO class name. For details of th= e pointcut - language, please refer to JBoss Aop. + + + The jboss.aop.path system property set to= the + location of pojocache-aop.xml + = - The standalone - JBoss Cache - distribution - package provides an example declaration for the tutorial cl= asses, - namely, - Person - and - Address - . - Detailed class declaration for - Person - and - Address - are provided in the Appendix section. But here - is the snippet for - pojocache-aop.xml - : - + + A javaagent argument which includes + jboss-aop-jdk50.jar + + = - -<aop> - <prepare expr=3D"field(* $instanceof{@org.jboss.cache.pojo.annotation= .Replicable}->*)" /> -</aop> - - and then notice the annotation @Replicable used in the Person and - Address POJOs. Also note that @Replicable i= s now inheritant. For example, - sub-class of Person such as Studen= t will also - be aspectized by JBoss Aop as well. If you want to stop this i= nheritance behavior, - you can simply remove the - $instanceof declaration in the prepare stat= ement, e.g., - - <aop> - <prepare expr=3D"field(* @org.jboss.cache.pojo.annotation= .Replicable->*)" /> - </aop> - + These requirements lead to the following example ant task: = + <java classname=3D"Foo" fork=3D"yes"> = + <jvmarg value=3D"-javaagent:lib/jboss-aop.jar"/> = + <jvmarg value=3D"-Djboss.aop.path=3Detc/META-INF/pojocache-aop.xml"/= > + <classpath refid=3D"test.classpath"/> +</java> + = - Detailed semantics of - pojocache-aop.xml (or equivalently pojocache-aop.xml) - can again - be found in JBoss Aop. But above statements basically decla= re all field - read and write operations in classes - Address - and - Person - will be "prepared" (or "aspectized"). Note - that: - + For the first step, since we are using the dynamic Aop feature, a = POJO + is only required to be declared "prepare". Basically, there are two ways= to + do this: either via explicit xml or annotation. = - - - The wildcard at the end of the expression signifies all = fields in the POJO - + As for the second step, either we can ask JBoss Aop to do load-time + (through a special class loader, so-called load-time mode) or compile-ti= me + instrumentation (use of an aopc pre-compiler, so-called precompiled mode= ). + Reader can read the JBoss Aop introduction chapter for more details. = - - You can potentially replace specific class name with wil= dcard that includes all the POJOs inside the - same package space - + XML descriptor To declare a POJO via XML + configuration file, you will need a + META-INF/jboss-aop.xml (or in the PojoCache case, it = is + the equivalent pojocache-service.xml file located und= er + the class path or listed in the jboss.aop.path system + property. JBoss AOP framework will read this file during startup to make + necessary byte code manipulation for advice and introduction. Or you can + pre-compile it using a pre-compiler called aopc such = that + you won't need the XML file during load time. JBoss Aop provides a so-ca= lled + pointcut language where it consists of a regular + expression set to specify the interception points (or + jointpoint in aop parlance). The jointpoint can be + constructor, method call, or field. You will need to declare any of your + POJO to be "prepared" so that AOP framework knows to start intercepting + either method, field, or constructor invocations using the dynamic Aop. + For PojoCache, we only allow all the fields (both read and + write) to be intercepted. That is, we don't care for the method level + interception since it is the state that we are interested in. So you sho= uld + only need to change your POJO class name. For details of the pointcut + language, please refer to JBoss Aop. The standalone + JBoss Cache distribution package provides an example + declaration for the tutorial classes, namely, Person = and + Address . Detailed class declaration for + Person and Address are provided in= the + Appendix section. But here is the snippet for + pojocache-aop.xml : + <aop> <prepare expr=3D"field(* + $instanceof{@org.jboss.cache.pojo.annotation.Replicable}->*)" + /> </aop> + and then notice the annotation @Replicable used in= the + Person and Address POJOs. Also note + that @Replicable is now inheritant. For example, sub-class of + Person such as Student will also be + aspectized by JBoss Aop as well. If you want to stop this inheritance + behavior, you can simply remove the $instanceof + declaration in the prepare statement, e.g., + <aop> <prepare expr=3D"field(* + @org.jboss.cache.pojo.annotation.Replicable->*)" /> + </aop> + Detailed semantics of + pojocache-aop.xml (or equivalently + pojocache-aop.xml ) can again be found in JBoss Aop. = But + above statements basically declare all field read and write operations in + classes Address and Person will be "prepared" = (or + "aspectized"). Note that: + The wildcard at the end of the expression signifies all fi= elds + in the POJO = - - The + You can potentially replace specific class name with wildc= ard + that includes all the POJOs inside the same package space = - instanceof + The instanceof operator declares any sub-type= or + sub-class of the specific POJO will also be "aspectized". For exampl= e, + if a Student class is a subclass of Person= , + JBossAop will automatically instrument it as well! = - operator declares any sub-type or sub-class of the speci= fic POJO will also be "aspectized". For - example, if a - Student - class is a subclass of - Person - , JBossAop will automatically instrument it as well! - + We intercept the field of all access levels (i.e., + private , protected , + public , etc.) The main reason being that we cons= ider + all fields as stateful data. However, we can relax this requirement = in + the future if there is a use case for it. = - - We intercept the field of all access levels (i.e., - private - , - protected - , - public - , etc.) The main reason being that we consider all field= s as stateful data. However, we can relax this - requirement in the future if there is a use case for it. - + We don't intercept field modifiers of final + and transient though. That is, field with these + modifiers are not stored in cache and is not replicated either. If y= ou + don't want your field to be managed by the cache, you can declare th= em + with these modifiers, e.g., transient. + = - - We don't intercept field modifiers of - final - and - transient - though. That is, field with these modifiers are not stor= ed in cache and is not replicated either. If - you don't want your field to be managed by the cache, yo= u can declare them with these modifiers, e.g., - transient. - - - + + Annotation = - - Annotation - Annotation is a new feature in Java 5.0 that when declar= ed can - contain metadata at compile and run time. It is well suited= for aop - declaration since there will be no need for external metada= ta xml - descriptor. + Annotation is a new feature in Java 5.0 that when declared can + contain metadata at compile and run time. It is well suited for aop + declaration since there will be no need for external metadata xml + descriptor. = - - POJO annotation for instrumentation - To support annotation (in order to - simplify user's development effort), the JBoss Cache distri= bution ships with a - pojocache-aop.xml - under the - resources - directory. For - reference, here is annotation definition from - pojocache-aop.xml again - : - -<aop> - <prepare expr=3D"field(* @org.jboss.cache.pojo.annotation.Replicable-= >*)" /> -</aop> - - Basically, it simply states that any annotation - with both marker interfaces will be "aspectized" accordingl= y. - + POJO annotation for instrumentation To + support annotation (in order to simplify user's development effort), t= he + JBoss Cache distribution ships with a pojocache-aop.xml + under the resources directory. For reference, here = is + annotation definition from pojocache-aop.xml again : + + <aop> <prepare expr=3D"field(* + @org.jboss.cache.pojo.annotation.Replicable->*)" + /> </aop> + Basically, it simply states that any annotat= ion + with both marker interfaces will be "aspectized" accordingly. + Here is a code snippet that illustrate the declaration: + + @org.jboss.cache.pojo.annotation.Replicable public class + Person {...} + The above declaration will instrument the class + Person and all of its sub-classes. That is, if + Student sub-class from Personal , + then it will get instrumented automatically without further annotation + declaration. = + + JDK5.0 field level annotations = - Here is a code snippet that illustrate the declaration:<= /para> - -(a)org.jboss.cache.pojo.annotation.Replicable -public class Person {...} - -The above declaration will instrument the class Person = and all of its sub-classes. That is, if -Student sub-class from Personal, the= n it will get instrumented automatically without - further annotation declaration. - + In Release 2.0, we have added two additional field level + annotations for customized behavior. The first one is + @org.jboss.cache.pojo.annotation.Transient . When appli= ed + to a field variable, it has the same effect as the Java language + transient keyword. That is, PojoCache won't put this fi= eld + into cache management (and therefore no replication). = - - JDK5.0 field level annotations - In Release 2.0, we have added two additional field le= vel annotations for customized behavior. - The first one is @org.jboss.cache.pojo.annotation.= Transient. When applied to a field - variable, it has the same effect as the Java language transient keyword. That is, PojoCache - won't put this field into cache management (and therefor= e no replication). - - - The second one is @org.jboss.cache.pojo.annotation= .Serializable, when applied to a field - variable, PojoCache will treat this variable as Se= rializable, even when it is - Replicable. However, the field will need to= implement the Serializable - interface such that it can be replicated. - - Here is a code snippet that illustrates usage of thes= e two annotations. - Assuming that you have a Gadget class: - -public class Gadget -{ - // resource won't be replicated - @Transient Resource resource; - // specialAddress is treated as a Serializable object but still has obj= ect relationship - @Serializable SpecialAddress specialAddress; - // other state variables -} - - Then when we do: - - Gadget gadget =3D new Gadget(); - Resource resource =3D new Resource(); - SepcialAddress specialAddress =3D new SpecialAddress(); + The second one is + @org.jboss.cache.pojo.annotation.Serializable , when applied= to + a field variable, PojoCache will treat this variable as + Serializable , even when it is Replicable . + However, the field will need to implement the Serializable + interface such that it can be replicated. = - // setters - gadget.setResource(resource); - gadget.setSpecialAddress(specialAddress); + Here is a code snippet that illustrates usage of these two + annotations. Assuming that you have a Gadget class: + public class Gadget { // resource won't be + replicated @Transient Resource resource; // + specialAddress is treated as a Serializable object + but still has object relationship @Serializable + SpecialAddress specialAddress; // other state + variables } + Then when we do: + Gadget gadget =3D new Gadget(); Resource resource =3D + new Resource(); SepcialAddress specialAddress =3D new + SpecialAddress(); = - cache1.putObject("/gadget", gadget); // put into PojoCache management + // setters gadget.setResource(resource); + gadget.setSpecialAddress(specialAddress); = - Gadget g2 =3D (Gadget)cache2.getObject("/gadget"); // retrieve it from = another cache instance - g2.getResource(); // This is should be null because of @Transient tag s= o it is not replicated. + cache1.putObject("/gadget", gadget); // put into + PojoCache management = - SepcialAddress d2 =3D g2.getSpecialAddress(); - d2.setName("inet"); // This won't get replicated automatically because = of @Serializable tag - ge.setSpecialAddress(d2); // Now this will. - - - + Gadget g2 =3D (Gadget)cache2.getObject("/gadget"); // + retrieve it from another cache instance + g2.getResource(); // This is should be null because + of @Transient tag so it is not replicated. = - + SepcialAddress d2 =3D g2.getSpecialAddress(); + d2.setName("inet"); // This won't get replicated + automatically because of @Serializable tag + ge.setSpecialAddress(d2); // Now this will. + + + = - - Weaving + + Weaving = - As already mentioned, a user can use the aop precompiler - (aopc) to precompile the POJO classes su= ch that, - during runtime, there is no additional system class loader = needed. The - precompiler will read in - pojocache-aop.xml - and weave - the POJO byte code at compile time. This is a convenient fe= ature to - make the aop less intrusive. - - - Below is an Ant snippet that defines the library needed for= the various Ant targets that we are - listing here. User can refer to the build.xml in the distribution for full details. - - <path id=3D"aop.classpath"/> - <fileset dir=3D"${lib}"/> - <include name=3D"**/*.jar" //> - <exclude name=3D"**/jboss-cache.jar" //> - <exclude name=3D"**/j*unit.jar" //> - <exclude name=3D"**/bsh*.jar" //> - </fileset/> - </path/> - - + As already mentioned, a user can use the aop precompiler ( + aopc ) to precompile the POJO classes such that, du= ring + runtime, there is no additional system class loader needed. The + precompiler will read in pojocache-aop.xml and weave + the POJO byte code at compile time. This is a convenient feature to ma= ke + the aop less intrusive. = - - Ant target for running load-time instrumentation using = specialized class loader - - In JDK5.0, you can use the javaagent option th= at does not require a - separate Classloader. Here are the ant snippet from o= ne-test-pojo, for example. - - <target name=3D"one.test.pojo" depends=3D"compile" description=3D"ru= n one junit test case."> - <junit printsummary=3D"yes" timeout=3D"${junit.timeout}" fork=3D"y= es"> - <jvmarg value=3D"-Djboss.aop.path=3D${output}/resources/pojocac= he-aop.xml"/> - <jvmarg value=3D"-javaagent:${lib}/jboss-aop-jdk50.jar"/> - <classpath path=3D"${output}/etc" /> - <sysproperty key=3D"log4j.configuration" value=3D"file:${output= }/etc/log4j.xml" /> - <classpath refid=3D"lib.classpath"/> - <classpath refid=3D"build.classpath"/> - <formatter type=3D"xml" usefile=3D"true"/> - <test name=3D"${test}" todir=3D"${reports}"/> - </junit> - </target> - - - + Below is an Ant snippet that defines the library needed for the + various Ant targets that we are listing here. User can refer to the + build.xml in the distribution for full details. + + <path id=3D"aop.classpath"/> <fileset + dir=3D"${lib}"/> <include name=3D"**/*.jar" //> + <exclude name=3D"**/jboss-cache.jar" //> <exclude + name=3D"**/j*unit.jar" //> <exclude + name=3D"**/bsh*.jar" //> </fileset/> + </path/> + = - - Ant target for aopc - Below is the code snippet for the aopc Ant target. Running this target will do - compile-time weaving of the POJO classes specified. - - <taskdef name=3D"aopc" classname=3D"org.jboss.aop.ant.AopC" classpat= href=3D"aop.classpath"/> - <target name=3D"aopc" depends=3D"compile" description=3D"Precompile = aop class"> - <aopc compilerclasspathref=3D"aop.classpath" verbose=3D"true"> - <src path=3D"${build}"/> - <include name=3D"org/jboss/cache/aop/test/**/*.class"/> - <aoppath path=3D"${output}/resources/pojocache-aop.xml"/> - <classpath path=3D"${build}"/> - <classpath refid=3D"lib.classpath"/> - </aopc> - </target> - - - Below is a snapshot of files that are generated when aopc i= s applied. Notice that couple extra classes have - been generated because of aopc. - -
- Classes generated after aopc + + Ant target for running load-time instrumentation using + specialized class loader = - - - - - -
+ In JDK5.0, you can use the javaagent option that = does + not require a separate Classloader. Here are the ant snippet from + one-test-pojo , for example. + <target name=3D"one.test.pojo" depends=3D"compile" + description=3D"run one junit test case."> <junit + printsummary=3D"yes" timeout=3D"${junit.timeout}" + fork=3D"yes"> <jvmarg + value=3D"-Djboss.aop.path=3D${output}/resources/pojocache-a= op.xml"/> + <jvmarg + value=3D"-javaagent:${lib}/jboss-aop-jdk50.jar"/> + <classpath path=3D"${output}/etc" /> + <sysproperty key=3D"log4j.configuration" + value=3D"file:${output}/etc/log4j.xml" /> + <classpath refid=3D"lib.classpath"/> + <classpath refid=3D"build.classpath"/> + <formatter type=3D"xml" usefile=3D"true"/> + <test name=3D"${test}" todir=3D"${reports}"/> + </junit> </target> + +
= - -
+ + Ant target for aopc = + Below is the code snippet for the aopc Ant + target. Running this target will do compile-time weaving of the POJO + classes specified. = -
+ + <taskdef name=3D"aopc" + classname=3D"org.jboss.aop.ant.AopC" + classpathref=3D"aop.classpath"/> <target name=3D"aopc" + depends=3D"compile" description=3D"Precompile aop class"> + <aopc compilerclasspathref=3D"aop.classpath" + verbose=3D"true"> <src path=3D"${build}"/> + <include + name=3D"org/jboss/cache/aop/test/**/*.class"/> + <aoppath + path=3D"${output}/resources/pojocache-aop.xml"/> + <classpath path=3D"${build}"/> <classpath + refid=3D"lib.classpath"/> </aopc> </target> + + + Below is a snapshot of files that are generated when aopc is + applied. Notice that couple extra classes have been generated becaus= e of + aopc . + +
+ Classes generated after aopc + + + + + + +
+ + + \ No newline at end of file Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/ListUndoTe= st.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/ListUndoTest.jav= a 2007-11-26 18:14:21 UTC (rev 4774) +++ pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/ListUndoTest.jav= a 2007-11-26 18:15:30 UTC (rev 4775) @@ -33,7 +33,7 @@ */ = @Test(groups =3D {"functional"}) -public class ListUndoTest = +public class ListUndoTest { Log log_ =3D LogFactory.getLog(ListUndoTest.class); PojoCache cache_; @@ -71,7 +71,13 @@ list.add("test1"); = setTxRollback(true); - cache_.attach("/a", list); + try + { + cache_.attach("/a", list); + } + catch (Exception e) + { + } assertFalse("Should not have cache interceptor ", isProxy(list)); = cache_.attach("/a", list); @@ -88,7 +94,13 @@ test.setLanguages(list); = setTxRollback(true); - cache_.attach("/a", test); + try + { + cache_.attach("/a", test); + } + catch (Exception e) + { + } assertFalse("Should not have cache interceptor ", isProxy(test.getLa= nguages())); = cache_.attach("/a", test); @@ -113,13 +125,15 @@ cache_.attach("/a", test); = setTxRollback(true); - cache_.detach("/a"); + try + { + cache_.detach("/a"); + } + catch (Exception e) + { + } = assertTrue("Should still have cache interceptor ", isProxy(test.getL= anguages())); cache_.detach("/a"); } - - - - } Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/LocalUndoT= est.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/LocalUndoTest.ja= va 2007-11-26 18:14:21 UTC (rev 4774) +++ pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/LocalUndoTest.ja= va 2007-11-26 18:15:30 UTC (rev 4775) @@ -33,7 +33,7 @@ */ = @Test(groups =3D {"functional"}) -public class LocalUndoTest = +public class LocalUndoTest { Log log_ =3D LogFactory.getLog(LocalUndoTest.class); PojoCache cache_; @@ -73,7 +73,13 @@ test.setAge(10); = setTxRollback(true); - cache_.attach("/a", test); + try + { + cache_.attach("/a", test); + } + catch (Exception e) + { + } assertFalse("Should not have cache interceptor ", hasCacheIntercepto= r(test)); } = @@ -97,7 +103,13 @@ cache_.attach("/a", test); = setTxRollback(true); - cache_.detach("/a"); + try + { + cache_.detach("/a"); + } + catch (Exception e) + { + } = assertTrue("Should still have cache interceptor ", hasCacheIntercept= or(test)); } Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/MapUndoTes= t.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/MapUndoTest.java= 2007-11-26 18:14:21 UTC (rev 4774) +++ pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/MapUndoTest.java= 2007-11-26 18:15:30 UTC (rev 4775) @@ -33,7 +33,7 @@ */ = @Test(groups =3D {"functional"}) -public class MapUndoTest = +public class MapUndoTest { Log log_ =3D LogFactory.getLog(MapUndoTest.class); PojoCache cache_; @@ -71,7 +71,13 @@ map.put("1", "test1"); = setTxRollback(true); - cache_.attach("/a", map); + try + { + cache_.attach("/a", map); + } + catch (Exception e) + { + } assertFalse("Should not have cache interceptor ", isProxy(map)); = cache_.attach("/a", map); @@ -88,7 +94,13 @@ test.setHobbies(map); = setTxRollback(true); - cache_.attach("/a", test); + try + { + cache_.attach("/a", test); + } + catch (Exception e) + { + } assertFalse("Should not have cache interceptor ", isProxy(test.getHo= bbies())); = cache_.attach("/a", test); @@ -113,7 +125,13 @@ cache_.attach("/a", test); = setTxRollback(true); - cache_.detach("/a"); + try + { + cache_.detach("/a"); + } + catch (Exception e) + { + } = assertTrue("Should still have cache interceptor ", isProxy(test.getH= obbies())); cache_.detach("/a"); Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/SetUndoTes= t.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/SetUndoTest.java= 2007-11-26 18:14:21 UTC (rev 4774) +++ pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/SetUndoTest.java= 2007-11-26 18:15:30 UTC (rev 4775) @@ -33,7 +33,7 @@ */ = @Test(groups =3D {"functional"}) -public class SetUndoTest = +public class SetUndoTest { Log log_ =3D LogFactory.getLog(SetUndoTest.class); PojoCache cache_; @@ -71,7 +71,13 @@ set.add("test1"); = setTxRollback(true); - cache_.attach("/a", set); + try + { + cache_.attach("/a", set); + } + catch (Exception e) + { + } assertFalse("Should not have cache interceptor ", isProxy(set)); = cache_.attach("/a", set); @@ -88,7 +94,12 @@ test.setSkills(set); = setTxRollback(true); - cache_.attach("/a", test); + try + { + cache_.attach("/a", test); + } catch (Exception e) + { + } assertFalse("Should not have cache interceptor ", isProxy(test.getSk= ills())); = cache_.attach("/a", test); @@ -113,13 +124,14 @@ cache_.attach("/a", test); = setTxRollback(true); - cache_.detach("/a"); + try + { + cache_.detach("/a"); + } catch (Exception e) + { + } = assertTrue("Should still have cache interceptor ", isProxy(test.getS= kills())); cache_.detach("/a"); } - - - - } --===============8503199366516704963==--