JBoss Cache SVN: r4780 - core/tags/2.1.0.CR2/src/test/java/org/jboss/cache/lock/pessimistic.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2007-11-27 06:49:21 -0500 (Tue, 27 Nov 2007)
New Revision: 4780
Modified:
core/tags/2.1.0.CR2/src/test/java/org/jboss/cache/lock/pessimistic/ConcurrentPutRemoveTest.java
Log:
properly disable ConcurrentPutRemoveTest
Modified: core/tags/2.1.0.CR2/src/test/java/org/jboss/cache/lock/pessimistic/ConcurrentPutRemoveTest.java
===================================================================
--- core/tags/2.1.0.CR2/src/test/java/org/jboss/cache/lock/pessimistic/ConcurrentPutRemoveTest.java 2007-11-27 04:16:25 UTC (rev 4779)
+++ core/tags/2.1.0.CR2/src/test/java/org/jboss/cache/lock/pessimistic/ConcurrentPutRemoveTest.java 2007-11-27 11:49:21 UTC (rev 4780)
@@ -58,7 +58,7 @@
}
}
- @Test (invocationCount = 50)
+ @Test (invocationCount = 50, enabled = false)
public void testLock() throws Exception {
for (int x = 0; x < 2; x++) {
SeparateThread t = new SeparateThread(x);
17 years, 3 months
JBoss Cache SVN: r4779 - core/branches/1.4.X/tests/functional/org/jboss/cache/marshall.
by jbosscache-commits@lists.jboss.org
Author: bstansberry(a)jboss.com
Date: 2007-11-26 23:16:25 -0500 (Mon, 26 Nov 2007)
New Revision: 4779
Added:
core/branches/1.4.X/tests/functional/org/jboss/cache/marshall/BuddyBackupEnqueingTestCase.java
Log:
[JBCACHE-1225] TreeCache._enqueueMethodCall must handle buddy backup FQNs
Added: core/branches/1.4.X/tests/functional/org/jboss/cache/marshall/BuddyBackupEnqueingTestCase.java
===================================================================
--- core/branches/1.4.X/tests/functional/org/jboss/cache/marshall/BuddyBackupEnqueingTestCase.java (rev 0)
+++ core/branches/1.4.X/tests/functional/org/jboss/cache/marshall/BuddyBackupEnqueingTestCase.java 2007-11-27 04:16:25 UTC (rev 4779)
@@ -0,0 +1,107 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.cache.marshall;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.PropertyConfigurator;
+import org.jboss.cache.TreeCache;
+import org.jboss.cache.buddyreplication.BuddyManager;
+
+import junit.framework.TestCase;
+
+/**
+ * Test for JBCACHE-1225 -- whether enqueuing of method calls for buddy
+ * backup regions work.
+ *
+ * @author <a href="brian.stansberry(a)jboss.com">Brian Stansberry</a>
+ * @version $Revision: 1.1 $
+ */
+public class BuddyBackupEnqueingTestCase extends TestCase
+{
+ private static final Log log = LogFactory.getLog(BuddyBackupEnqueingTestCase.class);
+
+ private TreeCache tree;
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ tree=new TreeCache();
+ PropertyConfigurator config=new PropertyConfigurator();
+ config.configure(tree, "META-INF/replAsync-service.xml"); // read in generic replAsync xml
+ tree.setClusterName("Test");
+ // Use marshaller
+ tree.setUseRegionBasedMarshalling(true);
+ tree.setInactiveOnStartup(true);
+ tree.createService();
+ tree.startService();
+ }
+
+ protected void tearDown() throws Exception
+ {
+ super.tearDown();
+
+ tree.stopService();
+ }
+
+ /**
+ * Confirms that we get an ISE if we try to enqueue a method call for
+ * a buddy-backup FQN where no equivalent main tree region exists, and
+ * that we don't get the ISE any more once the main tree region is created.
+ *
+ * This test design is based on the fact that _enqueueMethodCall is public,
+ * so this is a bit too much of a white-box test. But, oh well. ;)
+ *
+ * @throws Throwable
+ */
+ public void testBuddyBackupEnqueuing() throws Throwable
+ {
+ Fqn raw = Fqn.fromString("/region/node");
+ Fqn group = Fqn.fromString("group");
+ Fqn fqn = new Fqn(group, raw);
+ fqn = new Fqn(BuddyManager.BUDDY_BACKUP_SUBTREE_FQN, fqn);
+ JBCMethodCall call = MethodCallFactory.create(MethodDeclarations.existsMethod, new Object[]{ fqn } );
+
+ try
+ {
+ tree._enqueueMethodCall(fqn.toString(), call);
+ fail("Able to enqueue method call for non-existent region");
+ }
+ catch (IllegalStateException good) {}
+
+ tree.activateRegion(raw.toString());
+
+ try
+ {
+ tree._enqueueMethodCall(fqn.toString(), call);
+ }
+ catch (IllegalStateException bad)
+ {
+ String msg = "Caught ISE enqueuing method call for " + fqn;
+ log.error(msg, bad);
+ fail(msg);
+ }
+ }
+
+}
17 years, 3 months
JBoss Cache SVN: r4778 - core/branches/1.4.X/src/org/jboss/cache.
by jbosscache-commits@lists.jboss.org
Author: bstansberry(a)jboss.com
Date: 2007-11-26 23:16:04 -0500 (Mon, 26 Nov 2007)
New Revision: 4778
Modified:
core/branches/1.4.X/src/org/jboss/cache/TreeCache.java
Log:
[JBCACHE-1225] TreeCache._enqueueMethodCall must handle buddy backup FQNs
Modified: core/branches/1.4.X/src/org/jboss/cache/TreeCache.java
===================================================================
--- core/branches/1.4.X/src/org/jboss/cache/TreeCache.java 2007-11-26 18:19:25 UTC (rev 4777)
+++ core/branches/1.4.X/src/org/jboss/cache/TreeCache.java 2007-11-27 04:16:04 UTC (rev 4778)
@@ -2508,7 +2508,15 @@
throws Throwable
{
JBCMethodCall jbcCall = (JBCMethodCall) call;
- Region region = regionManager_.getRegion(subtree);
+ Fqn fqn = Fqn.fromString(subtree);
+ Region region = regionManager_.getRegion(fqn);
+ // JBCACHE-1225 -- handle buddy region fqns
+ if (region == null && BuddyManager.isBackupFqn(fqn))
+ {
+ // Strip out the buddy group portion
+ fqn = fqn.getFqnChild(2, fqn.size());
+ region = regionManager_.getRegion(fqn);
+ }
if (region == null)
throw new IllegalStateException("No region found for " + subtree);
17 years, 3 months
JBoss Cache SVN: r4777 - in pojo/tags: 2.1.0.CR2 and 1 other directories.
by jbosscache-commits@lists.jboss.org
Author: jason.greene(a)jboss.com
Date: 2007-11-26 13:19:25 -0500 (Mon, 26 Nov 2007)
New Revision: 4777
Added:
pojo/tags/2.1.0.CR2/
pojo/tags/2.1.0.CR2/pom.xml
pojo/tags/2.1.0.CR2/src/test/java/org/jboss/cache/pojo/rollback/ListUndoTest.java
pojo/tags/2.1.0.CR2/src/test/java/org/jboss/cache/pojo/rollback/LocalUndoTest.java
pojo/tags/2.1.0.CR2/src/test/java/org/jboss/cache/pojo/rollback/MapUndoTest.java
pojo/tags/2.1.0.CR2/src/test/java/org/jboss/cache/pojo/rollback/SetUndoTest.java
Removed:
pojo/tags/2.1.0.CR2/pom.xml
pojo/tags/2.1.0.CR2/src/test/java/org/jboss/cache/pojo/rollback/ListUndoTest.java
pojo/tags/2.1.0.CR2/src/test/java/org/jboss/cache/pojo/rollback/LocalUndoTest.java
pojo/tags/2.1.0.CR2/src/test/java/org/jboss/cache/pojo/rollback/MapUndoTest.java
pojo/tags/2.1.0.CR2/src/test/java/org/jboss/cache/pojo/rollback/SetUndoTest.java
Log:
Tag CR2
Copied: pojo/tags/2.1.0.CR2 (from rev 4765, pojo/branches/2.1)
Deleted: pojo/tags/2.1.0.CR2/pom.xml
===================================================================
--- pojo/branches/2.1/pom.xml 2007-11-15 18:07:41 UTC (rev 4765)
+++ pojo/tags/2.1.0.CR2/pom.xml 2007-11-26 18:19:25 UTC (rev 4777)
@@ -1,288 +0,0 @@
-<?xml version="1.0"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <properties>
- <jbosscache-pojo-version>2.1.0.CR1</jbosscache-pojo-version>
- <jbosscache-core-version>2.1.0.CR1</jbosscache-core-version>
- <jboss.aop.version>2.0.0.beta1</jboss.aop.version>
- </properties>
- <parent>
- <groupId>org.jboss.cache</groupId>
- <artifactId>jbosscache-common-parent</artifactId>
- <version>1.1</version>
- </parent>
- <groupId>org.jboss.cache</groupId>
- <artifactId>jbosscache-pojo</artifactId>
- <version>${jbosscache-pojo-version}</version>
- <name>JBoss Cache - POJO Edition</name>
- <description>JBoss Cache - POJO Edition</description>
- <packaging>jar</packaging>
- <dependencies>
- <dependency>
- <groupId>org.jboss.aop</groupId>
- <artifactId>jboss-aop</artifactId>
- <version>${jboss.aop.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.cache</groupId>
- <artifactId>jbosscache-core</artifactId>
- <version>${jbosscache-core-version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.cache</groupId>
- <artifactId>jbosscache-core</artifactId>
- <version>${jbosscache-core-version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <!-- Hack AOP has broken deps -->
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-container</artifactId>
- <version>2.0.0.Beta4</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.2-beta-1</version>
- <executions>
- <execution>
- <id>assemble</id>
- <phase>install</phase>
- <goals>
- <goal>attached</goal>
- </goals>
- <configuration>
- <descriptors>
- <descriptor>assembly/bin.xml</descriptor>
- <descriptor>assembly/doc.xml</descriptor>
- <descriptor>assembly/all.xml</descriptor>
- </descriptors>
- <finalName>${artifactId}-${jbosscache-pojo-version}</finalName>
- <outputDirectory>target/distribution</outputDirectory>
- <workDirectory>target/assembly/work</workDirectory>
- </configuration>
- </execution>
- </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>java.net.preferIPv4Stack</name>
- <value>true</value>
- </property>
- <property>
- <name>jgroups.stack</name>
- <value>udp</value>
- </property>
- </systemProperties>
- <groups>functional</groups>
- <forkMode>always</forkMode>
- <argLine>-Djboss.aop.path=${basedir}/src/main/resources/META-INF/pojocache-aop.xml -javaagent:${settings.localRepository}/org/jboss/aop/jboss-aop/${jboss.aop.version}/jboss-aop-${jboss.aop.version}.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>2.0.0.beta1</version>
- <!-- HACK: AOP project and plugin has broken deps -->
- <dependencies>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-container</artifactId>
- <version>2.0.0.Beta4</version>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.0.4</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.cache</groupId>
- <artifactId>jbosscache-core</artifactId>
- <version>${jbosscache-core-version}</version>
- </dependency>
- </dependencies>
- <executions>
- <execution>
- <id>aopc</id>
- <phase>compile</phase>
- <goals>
- <goal>compile</goal>
- </goals>
- <configuration>
- <verbose>false</verbose>
- <aoppaths>
- <aoppath>${basedir}/src/main/resources/META-INF/pojocache-aop.xml</aoppath>
- </aoppaths>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <!-- the docbook generation plugin for the user guide -->
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.0.0</version>
- <extensions>true</extensions>
- <dependencies>
- <dependency>
- <groupId>org.jboss.cache</groupId>
- <artifactId>jbosscache-doc-xslt-support</artifactId>
- <version>1.0</version>
- </dependency>
- </dependencies>
- <executions>
-
- <!-- The User Guide-->
- <execution>
- <id>userguide_en</id>
- <phase>package</phase>
- <goals>
- <goal>resources</goal>
- <goal>generate</goal>
- </goals>
- <configuration>
- <sourceDocumentName>master.xml</sourceDocumentName>
- <sourceDirectory>${basedir}/src/main/docbook/userguide/en</sourceDirectory>
- <imageResource>
- <directory>${basedir}/src/main/docbook/images</directory>
- </imageResource>
- <cssResource>
- <directory>${basedir}/src/main/docbook/css</directory>
- </cssResource>
- <targetDirectory>${basedir}/target/docbook/userguide_en</targetDirectory>
- <formats>
- <format>
- <formatName>pdf</formatName>
- <stylesheetResource>classpath:/standard/fopdf.xsl</stylesheetResource>
- <finalName>userguide_en.pdf</finalName>
- </format>
- <format>
- <formatName>html</formatName>
- <stylesheetResource>classpath:/standard/html_chunk.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- <format>
- <formatName>html_single</formatName>
- <stylesheetResource>classpath:/standard/html.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- <options>
- <xincludeSupported>false</xincludeSupported>
- </options>
- </configuration>
- </execution>
-
- <!-- The Tutorial -->
- <execution>
- <id>tutorial_en</id>
- <phase>package</phase>
- <goals>
- <goal>resources</goal>
- <goal>generate</goal>
- </goals>
- <configuration>
- <sourceDocumentName>master.xml</sourceDocumentName>
- <sourceDirectory>${basedir}/src/main/docbook/tutorial/en</sourceDirectory>
- <imageResource>
- <directory>${basedir}/src/main/docbook/images</directory>
- </imageResource>
- <cssResource>
- <directory>${basedir}/src/main/docbook/css</directory>
- </cssResource>
- <targetDirectory>${basedir}/target/docbook/tutorial_en</targetDirectory>
- <formats>
- <format>
- <formatName>pdf</formatName>
- <stylesheetResource>classpath:/standard/fopdf.xsl</stylesheetResource>
- <finalName>tutorial_en.pdf</finalName>
- </format>
- <format>
- <formatName>html</formatName>
- <stylesheetResource>classpath:/standard/html_chunk.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- <format>
- <formatName>html_single</formatName>
- <stylesheetResource>classpath:/standard/html.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- <options>
- <xincludeSupported>false</xincludeSupported>
- </options>
- </configuration>
- </execution>
-
- <!-- the FAQs -->
- <execution>
- <id>faq_en</id>
- <phase>package</phase>
- <goals>
- <goal>resources</goal>
- <goal>generate</goal>
- </goals>
- <configuration>
- <sourceDocumentName>master.xml</sourceDocumentName>
- <sourceDirectory>${basedir}/src/main/docbook/faq/en</sourceDirectory>
- <imageResource>
- <directory>${basedir}/src/main/docbook/images</directory>
- </imageResource>
- <cssResource>
- <directory>${basedir}/src/main/docbook/css</directory>
- </cssResource>
- <targetDirectory>${basedir}/target/docbook/faq_en</targetDirectory>
- <formats>
- <format>
- <formatName>pdf</formatName>
- <stylesheetResource>classpath:/standard/fopdf.xsl</stylesheetResource>
- <finalName>faq_en.pdf</finalName>
- </format>
- <format>
- <formatName>html</formatName>
- <stylesheetResource>classpath:/standard/html_chunk.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- <format>
- <formatName>html_single</formatName>
- <stylesheetResource>classpath:/standard/html.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- <options>
- <xincludeSupported>false</xincludeSupported>
- </options>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <!-- basic JBoss repository so that the common parent POM in jbosscache-support can be found -->
- <repositories>
- <repository>
- <id>repository.jboss.org</id>
- <url>http://repository.jboss.org/maven2</url>
- </repository>
- </repositories>
-</project>
Copied: pojo/tags/2.1.0.CR2/pom.xml (from rev 4776, pojo/branches/2.1/pom.xml)
===================================================================
--- pojo/tags/2.1.0.CR2/pom.xml (rev 0)
+++ pojo/tags/2.1.0.CR2/pom.xml 2007-11-26 18:19:25 UTC (rev 4777)
@@ -0,0 +1,288 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <properties>
+ <jbosscache-pojo-version>2.1.0.CR2</jbosscache-pojo-version>
+ <jbosscache-core-version>2.1.0.CR2</jbosscache-core-version>
+ <jboss.aop.version>2.0.0.beta1</jboss.aop.version>
+ </properties>
+ <parent>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-common-parent</artifactId>
+ <version>1.1</version>
+ </parent>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-pojo</artifactId>
+ <version>${jbosscache-pojo-version}</version>
+ <name>JBoss Cache - POJO Edition</name>
+ <description>JBoss Cache - POJO Edition</description>
+ <packaging>jar</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.aop</groupId>
+ <artifactId>jboss-aop</artifactId>
+ <version>${jboss.aop.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-core</artifactId>
+ <version>${jbosscache-core-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-core</artifactId>
+ <version>${jbosscache-core-version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <!-- Hack AOP has broken deps -->
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-container</artifactId>
+ <version>2.0.0.Beta4</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2-beta-1</version>
+ <executions>
+ <execution>
+ <id>assemble</id>
+ <phase>install</phase>
+ <goals>
+ <goal>attached</goal>
+ </goals>
+ <configuration>
+ <descriptors>
+ <descriptor>assembly/bin.xml</descriptor>
+ <descriptor>assembly/doc.xml</descriptor>
+ <descriptor>assembly/all.xml</descriptor>
+ </descriptors>
+ <finalName>${artifactId}-${jbosscache-pojo-version}</finalName>
+ <outputDirectory>target/distribution</outputDirectory>
+ <workDirectory>target/assembly/work</workDirectory>
+ </configuration>
+ </execution>
+ </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>java.net.preferIPv4Stack</name>
+ <value>true</value>
+ </property>
+ <property>
+ <name>jgroups.stack</name>
+ <value>udp</value>
+ </property>
+ </systemProperties>
+ <groups>functional</groups>
+ <forkMode>always</forkMode>
+ <argLine>-Djboss.aop.path=${basedir}/src/main/resources/META-INF/pojocache-aop.xml -javaagent:${settings.localRepository}/org/jboss/aop/jboss-aop/${jboss.aop.version}/jboss-aop-${jboss.aop.version}.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>2.0.0.beta1</version>
+ <!-- HACK: AOP project and plugin has broken deps -->
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-container</artifactId>
+ <version>2.0.0.Beta4</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.0.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-core</artifactId>
+ <version>${jbosscache-core-version}</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>aopc</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <verbose>false</verbose>
+ <aoppaths>
+ <aoppath>${basedir}/src/main/resources/META-INF/pojocache-aop.xml</aoppath>
+ </aoppaths>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- the docbook generation plugin for the user guide -->
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.0.0</version>
+ <extensions>true</extensions>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-doc-xslt-support</artifactId>
+ <version>1.0</version>
+ </dependency>
+ </dependencies>
+ <executions>
+
+ <!-- The User Guide-->
+ <execution>
+ <id>userguide_en</id>
+ <phase>package</phase>
+ <goals>
+ <goal>resources</goal>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <sourceDocumentName>master.xml</sourceDocumentName>
+ <sourceDirectory>${basedir}/src/main/docbook/userguide/en</sourceDirectory>
+ <imageResource>
+ <directory>${basedir}/src/main/docbook/images</directory>
+ </imageResource>
+ <cssResource>
+ <directory>${basedir}/src/main/docbook/css</directory>
+ </cssResource>
+ <targetDirectory>${basedir}/target/docbook/userguide_en</targetDirectory>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath:/standard/fopdf.xsl</stylesheetResource>
+ <finalName>userguide_en.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath:/standard/html_chunk.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/standard/html.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ <options>
+ <xincludeSupported>false</xincludeSupported>
+ </options>
+ </configuration>
+ </execution>
+
+ <!-- The Tutorial -->
+ <execution>
+ <id>tutorial_en</id>
+ <phase>package</phase>
+ <goals>
+ <goal>resources</goal>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <sourceDocumentName>master.xml</sourceDocumentName>
+ <sourceDirectory>${basedir}/src/main/docbook/tutorial/en</sourceDirectory>
+ <imageResource>
+ <directory>${basedir}/src/main/docbook/images</directory>
+ </imageResource>
+ <cssResource>
+ <directory>${basedir}/src/main/docbook/css</directory>
+ </cssResource>
+ <targetDirectory>${basedir}/target/docbook/tutorial_en</targetDirectory>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath:/standard/fopdf.xsl</stylesheetResource>
+ <finalName>tutorial_en.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath:/standard/html_chunk.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/standard/html.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ <options>
+ <xincludeSupported>false</xincludeSupported>
+ </options>
+ </configuration>
+ </execution>
+
+ <!-- the FAQs -->
+ <execution>
+ <id>faq_en</id>
+ <phase>package</phase>
+ <goals>
+ <goal>resources</goal>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <sourceDocumentName>master.xml</sourceDocumentName>
+ <sourceDirectory>${basedir}/src/main/docbook/faq/en</sourceDirectory>
+ <imageResource>
+ <directory>${basedir}/src/main/docbook/images</directory>
+ </imageResource>
+ <cssResource>
+ <directory>${basedir}/src/main/docbook/css</directory>
+ </cssResource>
+ <targetDirectory>${basedir}/target/docbook/faq_en</targetDirectory>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath:/standard/fopdf.xsl</stylesheetResource>
+ <finalName>faq_en.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath:/standard/html_chunk.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/standard/html.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ <options>
+ <xincludeSupported>false</xincludeSupported>
+ </options>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <!-- basic JBoss repository so that the common parent POM in jbosscache-support can be found -->
+ <repositories>
+ <repository>
+ <id>repository.jboss.org</id>
+ <url>http://repository.jboss.org/maven2</url>
+ </repository>
+ </repositories>
+</project>
Deleted: pojo/tags/2.1.0.CR2/src/test/java/org/jboss/cache/pojo/rollback/ListUndoTest.java
===================================================================
--- pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/ListUndoTest.java 2007-11-15 18:07:41 UTC (rev 4765)
+++ pojo/tags/2.1.0.CR2/src/test/java/org/jboss/cache/pojo/rollback/ListUndoTest.java 2007-11-26 18:19:25 UTC (rev 4777)
@@ -1,125 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-
-package org.jboss.cache.pojo.rollback;
-
-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;
-import org.jboss.cache.pojo.PojoCache;
-import org.jboss.cache.pojo.PojoCacheFactory;
-import org.jboss.cache.pojo.interceptors.PojoFailedTxMockupInterceptor;
-import org.jboss.cache.pojo.test.Person;
-import org.jboss.cache.transaction.DummyTransactionManager;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-/**
- * Additional basic tests
- *
- * @author Ben Wang
- */
-
-@Test(groups = {"functional"})
-public class ListUndoTest
-{
- Log log_ = LogFactory.getLog(ListUndoTest.class);
- PojoCache cache_;
- TransactionManager tx_mgr;
-
-
- @BeforeMethod(alwaysRun = true)
- protected void setUp() throws Exception
- {
- log_.info("setUp() ....");
- String configFile = "META-INF/local-service.xml";
- boolean toStart = false;
- cache_ = PojoCacheFactory.createCache(configFile, toStart);
- cache_.start();
- tx_mgr = DummyTransactionManager.getInstance();
-
- }
-
- @AfterMethod(alwaysRun = true)
- protected void tearDown() throws Exception
- {
- cache_.stop();
- }
-
-// public void testDummy() {}
-
- private void setTxRollback(boolean isTrue)
- {
- PojoFailedTxMockupInterceptor.TX_ROLLBACK = isTrue;
- }
-
- public void testSimple() throws Exception
- {
- ArrayList<String> list = new ArrayList<String>();
- list.add("test1");
-
- setTxRollback(true);
- cache_.attach("/a", list);
- assertFalse("Should not have cache interceptor ", isProxy(list));
-
- cache_.attach("/a", list);
- }
-
- public void testSimpleTxWithRollback1() throws Exception
- {
- log_.info("testSimpleTxWithRollback1() ....");
- Person test = new Person();
- test.setName("Ben");
- test.setAge(10);
- ArrayList<String> list = new ArrayList<String>();
- list.add("English");
- test.setLanguages(list);
-
- setTxRollback(true);
- cache_.attach("/a", test);
- assertFalse("Should not have cache interceptor ", isProxy(test.getLanguages()));
-
- cache_.attach("/a", test);
- }
-
- private boolean isProxy(Object pojo)
- {
- if (pojo instanceof ClassProxy) return true;
- return false;
- }
-
- public void testSimpleTxWithRollback2() throws Exception
- {
- log_.info("testSimpleTxWithRollback1() ....");
- Person test = new Person();
- test.setName("Ben");
- test.setAge(10);
- ArrayList<String> list = new ArrayList<String>();
- list.add("English");
- test.setLanguages(list);
-
- cache_.attach("/a", test);
-
- setTxRollback(true);
- cache_.detach("/a");
-
- assertTrue("Should still have cache interceptor ", isProxy(test.getLanguages()));
- cache_.detach("/a");
- }
-
-
-
-
-}
Copied: pojo/tags/2.1.0.CR2/src/test/java/org/jboss/cache/pojo/rollback/ListUndoTest.java (from rev 4774, pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/ListUndoTest.java)
===================================================================
--- pojo/tags/2.1.0.CR2/src/test/java/org/jboss/cache/pojo/rollback/ListUndoTest.java (rev 0)
+++ pojo/tags/2.1.0.CR2/src/test/java/org/jboss/cache/pojo/rollback/ListUndoTest.java 2007-11-26 18:19:25 UTC (rev 4777)
@@ -0,0 +1,139 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+
+package org.jboss.cache.pojo.rollback;
+
+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;
+import org.jboss.cache.pojo.PojoCache;
+import org.jboss.cache.pojo.PojoCacheFactory;
+import org.jboss.cache.pojo.interceptors.PojoFailedTxMockupInterceptor;
+import org.jboss.cache.pojo.test.Person;
+import org.jboss.cache.transaction.DummyTransactionManager;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * Additional basic tests
+ *
+ * @author Ben Wang
+ */
+
+@Test(groups = {"functional"})
+public class ListUndoTest
+{
+ Log log_ = LogFactory.getLog(ListUndoTest.class);
+ PojoCache cache_;
+ TransactionManager tx_mgr;
+
+
+ @BeforeMethod(alwaysRun = true)
+ protected void setUp() throws Exception
+ {
+ log_.info("setUp() ....");
+ String configFile = "META-INF/local-service.xml";
+ boolean toStart = false;
+ cache_ = PojoCacheFactory.createCache(configFile, toStart);
+ cache_.start();
+ tx_mgr = DummyTransactionManager.getInstance();
+
+ }
+
+ @AfterMethod(alwaysRun = true)
+ protected void tearDown() throws Exception
+ {
+ cache_.stop();
+ }
+
+// public void testDummy() {}
+
+ private void setTxRollback(boolean isTrue)
+ {
+ PojoFailedTxMockupInterceptor.TX_ROLLBACK = isTrue;
+ }
+
+ public void testSimple() throws Exception
+ {
+ ArrayList<String> list = new ArrayList<String>();
+ list.add("test1");
+
+ setTxRollback(true);
+ try
+ {
+ cache_.attach("/a", list);
+ }
+ catch (Exception e)
+ {
+ }
+ assertFalse("Should not have cache interceptor ", isProxy(list));
+
+ cache_.attach("/a", list);
+ }
+
+ public void testSimpleTxWithRollback1() throws Exception
+ {
+ log_.info("testSimpleTxWithRollback1() ....");
+ Person test = new Person();
+ test.setName("Ben");
+ test.setAge(10);
+ ArrayList<String> list = new ArrayList<String>();
+ list.add("English");
+ test.setLanguages(list);
+
+ setTxRollback(true);
+ try
+ {
+ cache_.attach("/a", test);
+ }
+ catch (Exception e)
+ {
+ }
+ assertFalse("Should not have cache interceptor ", isProxy(test.getLanguages()));
+
+ cache_.attach("/a", test);
+ }
+
+ private boolean isProxy(Object pojo)
+ {
+ if (pojo instanceof ClassProxy) return true;
+ return false;
+ }
+
+ public void testSimpleTxWithRollback2() throws Exception
+ {
+ log_.info("testSimpleTxWithRollback1() ....");
+ Person test = new Person();
+ test.setName("Ben");
+ test.setAge(10);
+ ArrayList<String> list = new ArrayList<String>();
+ list.add("English");
+ test.setLanguages(list);
+
+ cache_.attach("/a", test);
+
+ setTxRollback(true);
+ try
+ {
+ cache_.detach("/a");
+ }
+ catch (Exception e)
+ {
+ }
+
+ assertTrue("Should still have cache interceptor ", isProxy(test.getLanguages()));
+ cache_.detach("/a");
+ }
+}
Deleted: pojo/tags/2.1.0.CR2/src/test/java/org/jboss/cache/pojo/rollback/LocalUndoTest.java
===================================================================
--- pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/LocalUndoTest.java 2007-11-15 18:07:41 UTC (rev 4765)
+++ pojo/tags/2.1.0.CR2/src/test/java/org/jboss/cache/pojo/rollback/LocalUndoTest.java 2007-11-26 18:19:25 UTC (rev 4777)
@@ -1,108 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-
-package org.jboss.cache.pojo.rollback;
-
-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;
-import org.jboss.aop.advice.Interceptor;
-import org.jboss.cache.pojo.PojoCache;
-import org.jboss.cache.pojo.PojoCacheFactory;
-import org.jboss.cache.pojo.interceptors.PojoFailedTxMockupInterceptor;
-import org.jboss.cache.pojo.interceptors.dynamic.CacheFieldInterceptor;
-import org.jboss.cache.pojo.test.Person;
-import org.jboss.cache.transaction.DummyTransactionManager;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-/**
- * Additional basic tests
- *
- * @author Ben Wang
- */
-
-@Test(groups = {"functional"})
-public class LocalUndoTest
-{
- Log log_ = LogFactory.getLog(LocalUndoTest.class);
- PojoCache cache_;
- TransactionManager tx_mgr;
-
-
- @BeforeMethod(alwaysRun = true)
- protected void setUp() throws Exception
- {
- log_.info("setUp() ....");
- String configFile = "META-INF/local-service.xml";
- boolean toStart = false;
- cache_ = PojoCacheFactory.createCache(configFile, toStart);
- cache_.start();
- tx_mgr = DummyTransactionManager.getInstance();
-
- }
-
- @AfterMethod(alwaysRun = true)
- protected void tearDown() throws Exception
- {
- cache_.stop();
- }
-
-// public void testDummy() {}
-
- private void setTxRollback(boolean isTrue)
- {
- PojoFailedTxMockupInterceptor.TX_ROLLBACK = isTrue;
- }
-
- public void testSimpleTxWithRollback1() throws Exception
- {
- log_.info("testSimpleTxWithRollback1() ....");
- Person test = new Person();
- test.setName("Ben");
- test.setAge(10);
-
- setTxRollback(true);
- cache_.attach("/a", test);
- assertFalse("Should not have cache interceptor ", hasCacheInterceptor(test));
- }
-
- private boolean hasCacheInterceptor(Object pojo)
- {
- Interceptor[] interceptors = ((Advised) pojo)._getInstanceAdvisor().getInterceptors();
- for (int i = 0; i < interceptors.length; i++)
- {
- if (interceptors[i] instanceof CacheFieldInterceptor)
- return true;
- }
- return false;
- }
-
- public void testSimpleTxWithRollback2() throws Exception
- {
- log_.info("testSimpleTxWithRollback1() ....");
- Person test = new Person();
- test.setName("Ben");
- test.setAge(10);
- cache_.attach("/a", test);
-
- setTxRollback(true);
- cache_.detach("/a");
-
- assertTrue("Should still have cache interceptor ", hasCacheInterceptor(test));
- }
-
-
-
-
-}
Copied: pojo/tags/2.1.0.CR2/src/test/java/org/jboss/cache/pojo/rollback/LocalUndoTest.java (from rev 4774, pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/LocalUndoTest.java)
===================================================================
--- pojo/tags/2.1.0.CR2/src/test/java/org/jboss/cache/pojo/rollback/LocalUndoTest.java (rev 0)
+++ pojo/tags/2.1.0.CR2/src/test/java/org/jboss/cache/pojo/rollback/LocalUndoTest.java 2007-11-26 18:19:25 UTC (rev 4777)
@@ -0,0 +1,120 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+
+package org.jboss.cache.pojo.rollback;
+
+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;
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.cache.pojo.PojoCache;
+import org.jboss.cache.pojo.PojoCacheFactory;
+import org.jboss.cache.pojo.interceptors.PojoFailedTxMockupInterceptor;
+import org.jboss.cache.pojo.interceptors.dynamic.CacheFieldInterceptor;
+import org.jboss.cache.pojo.test.Person;
+import org.jboss.cache.transaction.DummyTransactionManager;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * Additional basic tests
+ *
+ * @author Ben Wang
+ */
+
+@Test(groups = {"functional"})
+public class LocalUndoTest
+{
+ Log log_ = LogFactory.getLog(LocalUndoTest.class);
+ PojoCache cache_;
+ TransactionManager tx_mgr;
+
+
+ @BeforeMethod(alwaysRun = true)
+ protected void setUp() throws Exception
+ {
+ log_.info("setUp() ....");
+ String configFile = "META-INF/local-service.xml";
+ boolean toStart = false;
+ cache_ = PojoCacheFactory.createCache(configFile, toStart);
+ cache_.start();
+ tx_mgr = DummyTransactionManager.getInstance();
+
+ }
+
+ @AfterMethod(alwaysRun = true)
+ protected void tearDown() throws Exception
+ {
+ cache_.stop();
+ }
+
+// public void testDummy() {}
+
+ private void setTxRollback(boolean isTrue)
+ {
+ PojoFailedTxMockupInterceptor.TX_ROLLBACK = isTrue;
+ }
+
+ public void testSimpleTxWithRollback1() throws Exception
+ {
+ log_.info("testSimpleTxWithRollback1() ....");
+ Person test = new Person();
+ test.setName("Ben");
+ test.setAge(10);
+
+ setTxRollback(true);
+ try
+ {
+ cache_.attach("/a", test);
+ }
+ catch (Exception e)
+ {
+ }
+ assertFalse("Should not have cache interceptor ", hasCacheInterceptor(test));
+ }
+
+ private boolean hasCacheInterceptor(Object pojo)
+ {
+ Interceptor[] interceptors = ((Advised) pojo)._getInstanceAdvisor().getInterceptors();
+ for (int i = 0; i < interceptors.length; i++)
+ {
+ if (interceptors[i] instanceof CacheFieldInterceptor)
+ return true;
+ }
+ return false;
+ }
+
+ public void testSimpleTxWithRollback2() throws Exception
+ {
+ log_.info("testSimpleTxWithRollback1() ....");
+ Person test = new Person();
+ test.setName("Ben");
+ test.setAge(10);
+ cache_.attach("/a", test);
+
+ setTxRollback(true);
+ try
+ {
+ cache_.detach("/a");
+ }
+ catch (Exception e)
+ {
+ }
+
+ assertTrue("Should still have cache interceptor ", hasCacheInterceptor(test));
+ }
+
+
+
+
+}
Deleted: pojo/tags/2.1.0.CR2/src/test/java/org/jboss/cache/pojo/rollback/MapUndoTest.java
===================================================================
--- pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/MapUndoTest.java 2007-11-15 18:07:41 UTC (rev 4765)
+++ pojo/tags/2.1.0.CR2/src/test/java/org/jboss/cache/pojo/rollback/MapUndoTest.java 2007-11-26 18:19:25 UTC (rev 4777)
@@ -1,125 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-
-package org.jboss.cache.pojo.rollback;
-
-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;
-import org.jboss.cache.pojo.PojoCache;
-import org.jboss.cache.pojo.PojoCacheFactory;
-import org.jboss.cache.pojo.interceptors.PojoFailedTxMockupInterceptor;
-import org.jboss.cache.pojo.test.Person;
-import org.jboss.cache.transaction.DummyTransactionManager;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-/**
- * Additional basic tests
- *
- * @author Ben Wang
- */
-
-@Test(groups = {"functional"})
-public class MapUndoTest
-{
- Log log_ = LogFactory.getLog(MapUndoTest.class);
- PojoCache cache_;
- TransactionManager tx_mgr;
-
-
- @BeforeMethod(alwaysRun = true)
- protected void setUp() throws Exception
- {
- log_.info("setUp() ....");
- String configFile = "META-INF/local-service.xml";
- boolean toStart = false;
- cache_ = PojoCacheFactory.createCache(configFile, toStart);
- cache_.start();
- tx_mgr = DummyTransactionManager.getInstance();
-
- }
-
- @AfterMethod(alwaysRun = true)
- protected void tearDown() throws Exception
- {
- cache_.stop();
- }
-
-// public void testDummy() {}
-
- private void setTxRollback(boolean isTrue)
- {
- PojoFailedTxMockupInterceptor.TX_ROLLBACK = isTrue;
- }
-
- public void testSimple() throws Exception
- {
- HashMap<String, String> map = new HashMap<String, String>();
- map.put("1", "test1");
-
- setTxRollback(true);
- cache_.attach("/a", map);
- assertFalse("Should not have cache interceptor ", isProxy(map));
-
- cache_.attach("/a", map);
- }
-
- public void testSimpleTxWithRollback1() throws Exception
- {
- log_.info("testSimpleTxWithRollback1() ....");
- Person test = new Person();
- test.setName("Ben");
- test.setAge(10);
- HashMap<String, String> map = new HashMap<String, String>();
- map.put("1", "English");
- test.setHobbies(map);
-
- setTxRollback(true);
- cache_.attach("/a", test);
- assertFalse("Should not have cache interceptor ", isProxy(test.getHobbies()));
-
- cache_.attach("/a", test);
- }
-
- private boolean isProxy(Object pojo)
- {
- if (pojo instanceof ClassProxy) return true;
- return false;
- }
-
- public void testSimpleTxWithRollback2() throws Exception
- {
- log_.info("testSimpleTxWithRollback1() ....");
- Person test = new Person();
- test.setName("Ben");
- test.setAge(10);
- HashMap<String, String> map = new HashMap<String, String>();
- map.put("1", "English");
- test.setHobbies(map);
-
- cache_.attach("/a", test);
-
- setTxRollback(true);
- cache_.detach("/a");
-
- assertTrue("Should still have cache interceptor ", isProxy(test.getHobbies()));
- cache_.detach("/a");
- }
-
-
-
-
-}
Copied: pojo/tags/2.1.0.CR2/src/test/java/org/jboss/cache/pojo/rollback/MapUndoTest.java (from rev 4774, pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/MapUndoTest.java)
===================================================================
--- pojo/tags/2.1.0.CR2/src/test/java/org/jboss/cache/pojo/rollback/MapUndoTest.java (rev 0)
+++ pojo/tags/2.1.0.CR2/src/test/java/org/jboss/cache/pojo/rollback/MapUndoTest.java 2007-11-26 18:19:25 UTC (rev 4777)
@@ -0,0 +1,143 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+
+package org.jboss.cache.pojo.rollback;
+
+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;
+import org.jboss.cache.pojo.PojoCache;
+import org.jboss.cache.pojo.PojoCacheFactory;
+import org.jboss.cache.pojo.interceptors.PojoFailedTxMockupInterceptor;
+import org.jboss.cache.pojo.test.Person;
+import org.jboss.cache.transaction.DummyTransactionManager;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * Additional basic tests
+ *
+ * @author Ben Wang
+ */
+
+@Test(groups = {"functional"})
+public class MapUndoTest
+{
+ Log log_ = LogFactory.getLog(MapUndoTest.class);
+ PojoCache cache_;
+ TransactionManager tx_mgr;
+
+
+ @BeforeMethod(alwaysRun = true)
+ protected void setUp() throws Exception
+ {
+ log_.info("setUp() ....");
+ String configFile = "META-INF/local-service.xml";
+ boolean toStart = false;
+ cache_ = PojoCacheFactory.createCache(configFile, toStart);
+ cache_.start();
+ tx_mgr = DummyTransactionManager.getInstance();
+
+ }
+
+ @AfterMethod(alwaysRun = true)
+ protected void tearDown() throws Exception
+ {
+ cache_.stop();
+ }
+
+// public void testDummy() {}
+
+ private void setTxRollback(boolean isTrue)
+ {
+ PojoFailedTxMockupInterceptor.TX_ROLLBACK = isTrue;
+ }
+
+ public void testSimple() throws Exception
+ {
+ HashMap<String, String> map = new HashMap<String, String>();
+ map.put("1", "test1");
+
+ setTxRollback(true);
+ try
+ {
+ cache_.attach("/a", map);
+ }
+ catch (Exception e)
+ {
+ }
+ assertFalse("Should not have cache interceptor ", isProxy(map));
+
+ cache_.attach("/a", map);
+ }
+
+ public void testSimpleTxWithRollback1() throws Exception
+ {
+ log_.info("testSimpleTxWithRollback1() ....");
+ Person test = new Person();
+ test.setName("Ben");
+ test.setAge(10);
+ HashMap<String, String> map = new HashMap<String, String>();
+ map.put("1", "English");
+ test.setHobbies(map);
+
+ setTxRollback(true);
+ try
+ {
+ cache_.attach("/a", test);
+ }
+ catch (Exception e)
+ {
+ }
+ assertFalse("Should not have cache interceptor ", isProxy(test.getHobbies()));
+
+ cache_.attach("/a", test);
+ }
+
+ private boolean isProxy(Object pojo)
+ {
+ if (pojo instanceof ClassProxy) return true;
+ return false;
+ }
+
+ public void testSimpleTxWithRollback2() throws Exception
+ {
+ log_.info("testSimpleTxWithRollback1() ....");
+ Person test = new Person();
+ test.setName("Ben");
+ test.setAge(10);
+ HashMap<String, String> map = new HashMap<String, String>();
+ map.put("1", "English");
+ test.setHobbies(map);
+
+ cache_.attach("/a", test);
+
+ setTxRollback(true);
+ try
+ {
+ cache_.detach("/a");
+ }
+ catch (Exception e)
+ {
+ }
+
+ assertTrue("Should still have cache interceptor ", isProxy(test.getHobbies()));
+ cache_.detach("/a");
+ }
+
+
+
+
+}
Deleted: pojo/tags/2.1.0.CR2/src/test/java/org/jboss/cache/pojo/rollback/SetUndoTest.java
===================================================================
--- pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/SetUndoTest.java 2007-11-15 18:07:41 UTC (rev 4765)
+++ pojo/tags/2.1.0.CR2/src/test/java/org/jboss/cache/pojo/rollback/SetUndoTest.java 2007-11-26 18:19:25 UTC (rev 4777)
@@ -1,125 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-
-package org.jboss.cache.pojo.rollback;
-
-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;
-import org.jboss.cache.pojo.PojoCache;
-import org.jboss.cache.pojo.PojoCacheFactory;
-import org.jboss.cache.pojo.interceptors.PojoFailedTxMockupInterceptor;
-import org.jboss.cache.pojo.test.Person;
-import org.jboss.cache.transaction.DummyTransactionManager;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-/**
- * Additional basic tests
- *
- * @author Ben Wang
- */
-
-@Test(groups = {"functional"})
-public class SetUndoTest
-{
- Log log_ = LogFactory.getLog(SetUndoTest.class);
- PojoCache cache_;
- TransactionManager tx_mgr;
-
-
- @BeforeMethod(alwaysRun = true)
- protected void setUp() throws Exception
- {
- log_.info("setUp() ....");
- String configFile = "META-INF/local-service.xml";
- boolean toStart = false;
- cache_ = PojoCacheFactory.createCache(configFile, toStart);
- cache_.start();
- tx_mgr = DummyTransactionManager.getInstance();
-
- }
-
- @AfterMethod(alwaysRun = true)
- protected void tearDown() throws Exception
- {
- cache_.stop();
- }
-
-// public void testDummy() {}
-
- private void setTxRollback(boolean isTrue)
- {
- PojoFailedTxMockupInterceptor.TX_ROLLBACK = isTrue;
- }
-
- public void testSimple() throws Exception
- {
- HashSet<String> set = new HashSet<String>();
- set.add("test1");
-
- setTxRollback(true);
- cache_.attach("/a", set);
- assertFalse("Should not have cache interceptor ", isProxy(set));
-
- cache_.attach("/a", set);
- }
-
- public void testSimpleTxWithRollback1() throws Exception
- {
- log_.info("testSimpleTxWithRollback1() ....");
- Person test = new Person();
- test.setName("Ben");
- test.setAge(10);
- HashSet<String> set = new HashSet<String>();
- set.add("English");
- test.setSkills(set);
-
- setTxRollback(true);
- cache_.attach("/a", test);
- assertFalse("Should not have cache interceptor ", isProxy(test.getSkills()));
-
- cache_.attach("/a", test);
- }
-
- private boolean isProxy(Object pojo)
- {
- if (pojo instanceof ClassProxy) return true;
- return false;
- }
-
- public void testSimpleTxWithRollback2() throws Exception
- {
- log_.info("testSimpleTxWithRollback1() ....");
- Person test = new Person();
- test.setName("Ben");
- test.setAge(10);
- HashSet<String> set = new HashSet<String>();
- set.add("English");
- test.setSkills(set);
-
- cache_.attach("/a", test);
-
- setTxRollback(true);
- cache_.detach("/a");
-
- assertTrue("Should still have cache interceptor ", isProxy(test.getSkills()));
- cache_.detach("/a");
- }
-
-
-
-
-}
Copied: pojo/tags/2.1.0.CR2/src/test/java/org/jboss/cache/pojo/rollback/SetUndoTest.java (from rev 4774, pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/SetUndoTest.java)
===================================================================
--- pojo/tags/2.1.0.CR2/src/test/java/org/jboss/cache/pojo/rollback/SetUndoTest.java (rev 0)
+++ pojo/tags/2.1.0.CR2/src/test/java/org/jboss/cache/pojo/rollback/SetUndoTest.java 2007-11-26 18:19:25 UTC (rev 4777)
@@ -0,0 +1,137 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+
+package org.jboss.cache.pojo.rollback;
+
+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;
+import org.jboss.cache.pojo.PojoCache;
+import org.jboss.cache.pojo.PojoCacheFactory;
+import org.jboss.cache.pojo.interceptors.PojoFailedTxMockupInterceptor;
+import org.jboss.cache.pojo.test.Person;
+import org.jboss.cache.transaction.DummyTransactionManager;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * Additional basic tests
+ *
+ * @author Ben Wang
+ */
+
+@Test(groups = {"functional"})
+public class SetUndoTest
+{
+ Log log_ = LogFactory.getLog(SetUndoTest.class);
+ PojoCache cache_;
+ TransactionManager tx_mgr;
+
+
+ @BeforeMethod(alwaysRun = true)
+ protected void setUp() throws Exception
+ {
+ log_.info("setUp() ....");
+ String configFile = "META-INF/local-service.xml";
+ boolean toStart = false;
+ cache_ = PojoCacheFactory.createCache(configFile, toStart);
+ cache_.start();
+ tx_mgr = DummyTransactionManager.getInstance();
+
+ }
+
+ @AfterMethod(alwaysRun = true)
+ protected void tearDown() throws Exception
+ {
+ cache_.stop();
+ }
+
+// public void testDummy() {}
+
+ private void setTxRollback(boolean isTrue)
+ {
+ PojoFailedTxMockupInterceptor.TX_ROLLBACK = isTrue;
+ }
+
+ public void testSimple() throws Exception
+ {
+ HashSet<String> set = new HashSet<String>();
+ set.add("test1");
+
+ setTxRollback(true);
+ try
+ {
+ cache_.attach("/a", set);
+ }
+ catch (Exception e)
+ {
+ }
+ assertFalse("Should not have cache interceptor ", isProxy(set));
+
+ cache_.attach("/a", set);
+ }
+
+ public void testSimpleTxWithRollback1() throws Exception
+ {
+ log_.info("testSimpleTxWithRollback1() ....");
+ Person test = new Person();
+ test.setName("Ben");
+ test.setAge(10);
+ HashSet<String> set = new HashSet<String>();
+ set.add("English");
+ test.setSkills(set);
+
+ setTxRollback(true);
+ try
+ {
+ cache_.attach("/a", test);
+ } catch (Exception e)
+ {
+ }
+ assertFalse("Should not have cache interceptor ", isProxy(test.getSkills()));
+
+ cache_.attach("/a", test);
+ }
+
+ private boolean isProxy(Object pojo)
+ {
+ if (pojo instanceof ClassProxy) return true;
+ return false;
+ }
+
+ public void testSimpleTxWithRollback2() throws Exception
+ {
+ log_.info("testSimpleTxWithRollback1() ....");
+ Person test = new Person();
+ test.setName("Ben");
+ test.setAge(10);
+ HashSet<String> set = new HashSet<String>();
+ set.add("English");
+ test.setSkills(set);
+
+ cache_.attach("/a", test);
+
+ setTxRollback(true);
+ try
+ {
+ cache_.detach("/a");
+ } catch (Exception e)
+ {
+ }
+
+ assertTrue("Should still have cache interceptor ", isProxy(test.getSkills()));
+ cache_.detach("/a");
+ }
+}
17 years, 3 months
JBoss Cache SVN: r4776 - pojo/branches/2.1.
by jbosscache-commits@lists.jboss.org
Author: jason.greene(a)jboss.com
Date: 2007-11-26 13:16:13 -0500 (Mon, 26 Nov 2007)
New Revision: 4776
Modified:
pojo/branches/2.1/pom.xml
Log:
Update deps
Modified: pojo/branches/2.1/pom.xml
===================================================================
--- pojo/branches/2.1/pom.xml 2007-11-26 18:15:30 UTC (rev 4775)
+++ pojo/branches/2.1/pom.xml 2007-11-26 18:16:13 UTC (rev 4776)
@@ -4,8 +4,8 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<properties>
- <jbosscache-pojo-version>2.1.0.CR1</jbosscache-pojo-version>
- <jbosscache-core-version>2.1.0.CR1</jbosscache-core-version>
+ <jbosscache-pojo-version>2.1.0.CR2</jbosscache-pojo-version>
+ <jbosscache-core-version>2.1.0.CR2</jbosscache-core-version>
<jboss.aop.version>2.0.0.beta1</jboss.aop.version>
</properties>
<parent>
17 years, 3 months
JBoss Cache SVN: r4775 - in pojo/trunk/src: test/java/org/jboss/cache/pojo/rollback and 1 other directory.
by jbosscache-commits@lists.jboss.org
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
===================================================================
--- pojo/trunk/src/main/docbook/userguide/en/modules/instrumentation.xml 2007-11-26 18:14:21 UTC (rev 4774)
+++ pojo/trunk/src/main/docbook/userguide/en/modules/instrumentation.xml 2007-11-26 18:15:30 UTC (rev 4775)
@@ -1,320 +1,302 @@
+<?xml version="1.0" encoding="UTF-8"?>
<chapter id="instrumentation">
+ <title>Instrumentation</title>
- <title>Instrumentation</title>
+ <para>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.</para>
- <para>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 instrumentation
- mode that you are using, you may not need to pre-process your POJO at all. That is,
- if you use JDK5.0 (required) and load-time mode, then all you need to do is
- annotating your POJO (or declare it in a xml file). This makes your PojoCache
- programming nearly transparent.</para>
+ <para>The primary input to JBoss AOP is the AOP binding file, which is
+ responsible for specifying which classes should be instrumented. POJO Cache
+ provides a binding file, <literal>pojocache-aop.xml</literal> , which
+ matches all classes that have been annotated with the
+ <literal>@Replicable</literal> 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 annotation
+ binding.</para>
- <para>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.</para>
+ <para>The instrumentation process can be executed at either load-time, or
+ compile-time. Load-time instrumentation uses a Java agent to intercept and
+ modify classes as they are loaded; whereas compile-time instrumentation
+ requires running <literal>aopc</literal> as part of the compilation
+ process.</para>
- <para>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-time
- instrumentation (use of an aopc pre-compiler, so-called precompiled
- mode). Reader can read the JBoss Aop introduction chapter for more details.</para>
+ <note>
+ <para>Load-time is the recommended approach, since compile-time
+ instrumentation adds hard dependencies to the weaved bytecode which ties
+ the output to a particular version of JBoss AOP.</para>
+ </note>
- <sect1>
- <title>XML descriptor</title>
+ <sect1>
+ <title>Load-time instrumentation</title>
- <para>To declare a POJO via XML configuration file, you will need a
- <literal>META-INF/jboss-aop.xml</literal> (or in the PojoCache case, it is
- the equivalent <literal>pojocache-service.xml</literal>
- file located under the class
- path or listed in the <literal>jboss.aop.path</literal> 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
- <literal>aopc</literal>
- such that you won't need the XML file during load time. JBoss Aop
- provides a so-called
- <literal>pointcut</literal>
- language where it
- consists of a regular expression set to specify the interception
- points (or
- <literal>jointpoint</literal>
- 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.
- </para>
+ <para>Load-time instrumentation uses a Java agent to intercept all classes
+ loaded by the JVM. As they are loaded JBoss AOP instruments them, allowing
+ POJO Cache to monitor field changes. To enable load time instrumentation
+ the JVM must be started with the following specified:</para>
- <para>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 should
- only need to change your POJO class name. For details of the pointcut
- language, please refer to JBoss Aop.</para>
+ <orderedlist>
+ <listitem>
+ <para>The <literal>jboss.aop.path</literal> system property set to the
+ location of <literal>pojocache-aop.xml</literal></para>
+ </listitem>
- <para>The standalone
- <literal>JBoss Cache</literal>
- distribution
- package provides an example declaration for the tutorial classes,
- namely,
- <literal>Person</literal>
- and
- <literal>Address</literal>
- .
- Detailed class declaration for
- <literal>Person</literal>
- and
- <literal>Address</literal>
- are provided in the Appendix section. But here
- is the snippet for
- <literal>pojocache-aop.xml</literal>
- :
- </para>
+ <listitem>
+ <para>A javaagent argument which includes
+ <emphasis>jboss-aop-jdk50.jar</emphasis></para>
+ </listitem>
+ </orderedlist>
-<programlisting>
-<aop>
- <prepare expr="field(* $instanceof{(a)org.jboss.cache.pojo.annotation.Replicable}->*)" />
-</aop>
-</programlisting>
- and then notice the annotation @Replicable used in the <literal>Person</literal> and
- <literal>Address</literal> POJOs. Also note that @Replicable is now inheritant. For example,
- sub-class of <literal>Person</literal> such as <literal>Student</literal> will also
- be aspectized by JBoss Aop as well. If you want to stop this inheritance behavior,
- you can simply remove the
- <literal>$instanceof</literal> declaration in the prepare statement, e.g.,
- <programlisting>
- <aop>
- <prepare expr="field(* @org.jboss.cache.pojo.annotation.Replicable->*)" />
- </aop>
- </programlisting>
+ <para>These requirements lead to the following example ant task:</para>
+ <programlisting><java classname="Foo" fork="yes">
+ <jvmarg value="-javaagent:lib/jboss-aop.jar"/>
+ <jvmarg value="-Djboss.aop.path=etc/META-INF/pojocache-aop.xml"/>
+ <classpath refid="test.classpath"/>
+</java> </programlisting>
+ </sect1>
- <para>Detailed semantics of
- <literal>pojocache-aop.xml</literal> (or equivalently <literal>pojocache-aop.xml</literal>)
- can again
- be found in JBoss Aop. But above statements basically declare all field
- read and write operations in classes
- <code>Address</code>
- and
- <code>Person</code>
- will be "prepared" (or "aspectized"). Note
- that:
- </para>
+ <para>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.</para>
- <itemizedlist>
- <listitem>
- The wildcard at the end of the expression signifies all fields in the POJO
- </listitem>
+ <para>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-time
+ instrumentation (use of an aopc pre-compiler, so-called precompiled mode).
+ Reader can read the JBoss Aop introduction chapter for more details.</para>
- <listitem>
- You can potentially replace specific class name with wildcard that includes all the POJOs inside the
- same package space
- </listitem>
+ <sect1><title>XML descriptor</title> <para> To declare a POJO via XML
+ configuration file, you will need a
+ <literal>META-INF/jboss-aop.xml</literal> (or in the PojoCache case, it is
+ the equivalent <literal>pojocache-service.xml</literal> file located under
+ the class path or listed in the <literal>jboss.aop.path</literal> 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 <literal>aopc</literal> such that
+ you won't need the XML file during load time. JBoss Aop provides a so-called
+ <literal>pointcut</literal> language where it consists of a regular
+ expression set to specify the interception points (or
+ <literal>jointpoint</literal> 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.
+ </para> <para> 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 should
+ only need to change your POJO class name. For details of the pointcut
+ language, please refer to JBoss Aop. </para> <para> The standalone
+ <literal>JBoss Cache</literal> distribution package provides an example
+ declaration for the tutorial classes, namely, <literal>Person</literal> and
+ <literal>Address</literal> . Detailed class declaration for
+ <literal>Person</literal> and <literal>Address</literal> are provided in the
+ Appendix section. But here is the snippet for
+ <literal>pojocache-aop.xml</literal> : </para> <programlisting>
+ <aop> <prepare expr="field(*
+ $instanceof{(a)org.jboss.cache.pojo.annotation.Replicable}->*)"
+ /> </aop>
+ </programlisting> and then notice the annotation @Replicable used in the
+ <literal>Person</literal> and <literal>Address</literal> POJOs. Also note
+ that @Replicable is now inheritant. For example, sub-class of
+ <literal>Person</literal> such as <literal>Student</literal> will also be
+ aspectized by JBoss Aop as well. If you want to stop this inheritance
+ behavior, you can simply remove the <literal>$instanceof</literal>
+ declaration in the prepare statement, e.g., <programlisting>
+ <aop> <prepare expr="field(*
+ @org.jboss.cache.pojo.annotation.Replicable->*)" />
+ </aop>
+ </programlisting> <para> Detailed semantics of
+ <literal>pojocache-aop.xml</literal> (or equivalently
+ <literal>pojocache-aop.xml</literal> ) can again be found in JBoss Aop. But
+ above statements basically declare all field read and write operations in
+ classes <code>Address</code> and <code>Person</code> will be "prepared" (or
+ "aspectized"). Note that: </para> <itemizedlist>
+ <listitem>The wildcard at the end of the expression signifies all fields
+ in the POJO</listitem>
- <listitem>
- The
+ <listitem>You can potentially replace specific class name with wildcard
+ that includes all the POJOs inside the same package space</listitem>
- <code>instanceof</code>
+ <listitem>The <code>instanceof</code> operator declares any sub-type or
+ sub-class of the specific POJO will also be "aspectized". For example,
+ if a <code>Student</code> class is a subclass of <code>Person</code> ,
+ JBossAop will automatically instrument it as well!</listitem>
- operator declares any sub-type or sub-class of the specific POJO will also be "aspectized". For
- example, if a
- <code>Student</code>
- class is a subclass of
- <code>Person</code>
- , JBossAop will automatically instrument it as well!
- </listitem>
+ <listitem>We intercept the field of all access levels (i.e.,
+ <literal>private</literal> , <literal>protected</literal> ,
+ <literal>public</literal> , etc.) The main reason being that we consider
+ all fields as stateful data. However, we can relax this requirement in
+ the future if there is a use case for it.</listitem>
- <listitem>
- We intercept the field of all access levels (i.e.,
- <literal>private</literal>
- ,
- <literal>protected</literal>
- ,
- <literal>public</literal>
- , etc.) The main reason being that we consider all fields as stateful data. However, we can relax this
- requirement in the future if there is a use case for it.
- </listitem>
+ <listitem>We don't intercept field modifiers of <literal>final</literal>
+ and <literal>transient</literal> though. That is, field with these
+ modifiers are not stored in cache and is not replicated either. If you
+ don't want your field to be managed by the cache, you can declare them
+ with these modifiers, e.g., transient.</listitem>
+ </itemizedlist></sect1>
- <listitem>
- We don't intercept field modifiers of
- <literal>final</literal>
- and
- <literal>transient</literal>
- though. That is, field with these modifiers are not stored in cache and is not replicated either. If
- you don't want your field to be managed by the cache, you can declare them with these modifiers, e.g.,
- transient.
- </listitem>
- </itemizedlist>
- </sect1>
+ <sect1>
+ <title>Annotation</title>
- <sect1>
- <title>Annotation</title>
- <para>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.</para>
+ <para>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.</para>
- <sect2>
- <title>POJO annotation for instrumentation</title>
- <para>To support annotation (in order to
- simplify user's development effort), the JBoss Cache distribution ships with a
- <literal>pojocache-aop.xml</literal>
- under the
- <literal>resources</literal>
- directory. For
- reference, here is annotation definition from
- <literal>pojocache-aop.xml</literal> again
- :
-<programlisting>
-<aop>
- <prepare expr="field(* @org.jboss.cache.pojo.annotation.Replicable->*)" />
-</aop>
-</programlisting>
- Basically, it simply states that any annotation
- with both marker interfaces will be "aspectized" accordingly.
- </para>
+ <sect2><title>POJO annotation for instrumentation</title> <para> To
+ support annotation (in order to simplify user's development effort), the
+ JBoss Cache distribution ships with a <literal>pojocache-aop.xml</literal>
+ under the <literal>resources</literal> directory. For reference, here is
+ annotation definition from <literal>pojocache-aop.xml</literal> again :
+ <programlisting>
+ <aop> <prepare expr="field(*
+ @org.jboss.cache.pojo.annotation.Replicable->*)"
+ /> </aop>
+ </programlisting> Basically, it simply states that any annotation
+ with both marker interfaces will be "aspectized" accordingly. </para>
+ <para> Here is a code snippet that illustrate the declaration: </para>
+ <programlisting>
+ @org.jboss.cache.pojo.annotation.Replicable public class
+ Person {...}
+ </programlisting> The above declaration will instrument the class
+ <literal>Person</literal> and all of its sub-classes. That is, if
+ <literal>Student</literal> sub-class from <literal>Personal</literal> ,
+ then it will get instrumented automatically without further annotation
+ declaration.</sect2>
+ <sect2>
+ <title>JDK5.0 field level annotations</title>
- <para>Here is a code snippet that illustrate the declaration:</para>
-<programlisting>
-(a)org.jboss.cache.pojo.annotation.Replicable
-public class Person {...}
-</programlisting>
-The above declaration will instrument the class <literal>Person</literal> and all of its sub-classes. That is, if
-<literal>Student</literal> sub-class from <literal>Personal</literal>, then it will get instrumented automatically without
- further annotation declaration.
- </sect2>
+ <para>In Release 2.0, we have added two additional field level
+ annotations for customized behavior. The first one is
+ <code>@org.jboss.cache.pojo.annotation.Transient</code> . When applied
+ to a field variable, it has the same effect as the Java language
+ <code>transient</code> keyword. That is, PojoCache won't put this field
+ into cache management (and therefore no replication).</para>
- <sect2>
- <title>JDK5.0 field level annotations</title>
- <para>In Release 2.0, we have added two additional field level annotations for customized behavior.
- The first one is <code>@org.jboss.cache.pojo.annotation.Transient</code>. When applied to a field
- variable, it has the same effect as the Java language <code>transient</code> keyword. That is, PojoCache
- won't put this field into cache management (and therefore no replication).
- </para>
- <para>
- The second one is <code>@org.jboss.cache.pojo.annotation.Serializable</code>, when applied to a field
- variable, PojoCache will treat this variable as <code>Serializable</code>, even when it is
- <code>Replicable</code>. However, the field will need to implement the <code>Serializable</code>
- interface such that it can be replicated.
- </para>
- <para>Here is a code snippet that illustrates usage of these two annotations.
- Assuming that you have a Gadget class:
-<programlisting>
-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
-}
-</programlisting>
- Then when we do:
-<programlisting>
- Gadget gadget = new Gadget();
- Resource resource = new Resource();
- SepcialAddress specialAddress = new SpecialAddress();
+ <para>The second one is <code>
+ @org.jboss.cache.pojo.annotation.Serializable </code> , when applied to
+ a field variable, PojoCache will treat this variable as
+ <code>Serializable</code> , even when it is <code>Replicable</code> .
+ However, the field will need to implement the <code>Serializable</code>
+ interface such that it can be replicated.</para>
- // setters
- gadget.setResource(resource);
- gadget.setSpecialAddress(specialAddress);
+ <para>Here is a code snippet that illustrates usage of these two
+ annotations. Assuming that you have a Gadget class: <programlisting>
+ 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 }
+ </programlisting> Then when we do: <programlisting>
+ Gadget gadget = new Gadget(); Resource resource =
+ new Resource(); SepcialAddress specialAddress = new
+ SpecialAddress();
- cache1.putObject("/gadget", gadget); // put into PojoCache management
+ // setters gadget.setResource(resource);
+ gadget.setSpecialAddress(specialAddress);
- Gadget g2 = (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.
+ cache1.putObject("/gadget", gadget); // put into
+ PojoCache management
- SepcialAddress d2 = g2.getSpecialAddress();
- d2.setName("inet"); // This won't get replicated automatically because of @Serializable tag
- ge.setSpecialAddress(d2); // Now this will.
-</programlisting>
- </para>
- </sect2>
+ Gadget g2 = (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.
- </sect1>
+ SepcialAddress d2 = g2.getSpecialAddress();
+ d2.setName("inet"); // This won't get replicated
+ automatically because of @Serializable tag
+ ge.setSpecialAddress(d2); // Now this will.
+ </programlisting></para>
+ </sect2>
+ </sect1>
- <sect1>
- <title>Weaving</title>
+ <sect1>
+ <title>Weaving</title>
- <para>As already mentioned, a user can use the aop precompiler
- (<literal>aopc</literal>) to precompile the POJO classes such that,
- during runtime, there is no additional system class loader needed. The
- precompiler will read in
- <literal>pojocache-aop.xml</literal>
- and weave
- the POJO byte code at compile time. This is a convenient feature to
- make the aop less intrusive.
- </para>
- <para>
- 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 <literal>build.xml</literal> in the distribution for full details.
-<programlisting>
- <path id="aop.classpath"/>
- <fileset dir="${lib}"/>
- <include name="**/*.jar" //>
- <exclude name="**/jboss-cache.jar" //>
- <exclude name="**/j*unit.jar" //>
- <exclude name="**/bsh*.jar" //>
- </fileset/>
- </path/>
-</programlisting>
- </para>
+ <para>As already mentioned, a user can use the aop precompiler (
+ <literal>aopc</literal> ) to precompile the POJO classes such that, during
+ runtime, there is no additional system class loader needed. The
+ precompiler will read in <literal>pojocache-aop.xml</literal> and weave
+ the POJO byte code at compile time. This is a convenient feature to make
+ the aop less intrusive.</para>
- <sect2>
- <title>Ant target for running load-time instrumentation using specialized class loader</title>
- <para>
- In JDK5.0, you can use the <code>javaagent</code> option that does not require a
- separate Classloader. Here are the ant snippet from <code>one-test-pojo</code>, for example.
-<programlisting>
- <target name="one.test.pojo" depends="compile" description="run one junit test case.">
- <junit printsummary="yes" timeout="${junit.timeout}" fork="yes">
- <jvmarg value="-Djboss.aop.path=${output}/resources/pojocache-aop.xml"/>
- <jvmarg value="-javaagent:${lib}/jboss-aop-jdk50.jar"/>
- <classpath path="${output}/etc" />
- <sysproperty key="log4j.configuration" value="file:${output}/etc/log4j.xml" />
- <classpath refid="lib.classpath"/>
- <classpath refid="build.classpath"/>
- <formatter type="xml" usefile="true"/>
- <test name="${test}" todir="${reports}"/>
- </junit>
- </target>
-</programlisting>
- </para>
- </sect2>
+ <para>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
+ <literal>build.xml</literal> in the distribution for full details.
+ <programlisting>
+ <path id="aop.classpath"/> <fileset
+ dir="${lib}"/> <include name="**/*.jar" //>
+ <exclude name="**/jboss-cache.jar" //> <exclude
+ name="**/j*unit.jar" //> <exclude
+ name="**/bsh*.jar" //> </fileset/>
+ </path/>
+ </programlisting></para>
- <sect2>
- <title>Ant target for aopc</title>
- <para>Below is the code snippet for the <literal>aopc</literal> Ant target. Running this target will do
- compile-time weaving of the POJO classes specified.</para>
-<programlisting>
- <taskdef name="aopc" classname="org.jboss.aop.ant.AopC" classpathref="aop.classpath"/>
- <target name="aopc" depends="compile" description="Precompile aop class">
- <aopc compilerclasspathref="aop.classpath" verbose="true">
- <src path="${build}"/>
- <include name="org/jboss/cache/aop/test/**/*.class"/>
- <aoppath path="${output}/resources/pojocache-aop.xml"/>
- <classpath path="${build}"/>
- <classpath refid="lib.classpath"/>
- </aopc>
- </target>
-</programlisting>
- <para>
- Below is a snapshot of files that are generated when aopc is applied. Notice that couple extra classes have
- been generated because of <literal>aopc</literal>.
- </para>
- <figure>
- <title>Classes generated after aopc</title>
+ <sect2>
+ <title>Ant target for running load-time instrumentation using
+ specialized class loader</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/classes.png"/>
- </imageobject>
- </mediaobject>
- </figure>
+ <para>In JDK5.0, you can use the <code>javaagent</code> option that does
+ not require a separate Classloader. Here are the ant snippet from
+ <code>one-test-pojo</code> , for example. <programlisting>
+ <target name="one.test.pojo" depends="compile"
+ description="run one junit test case."> <junit
+ printsummary="yes" timeout="${junit.timeout}"
+ fork="yes"> <jvmarg
+ value="-Djboss.aop.path=${output}/resources/pojocache-aop.xml"/>
+ <jvmarg
+ value="-javaagent:${lib}/jboss-aop-jdk50.jar"/>
+ <classpath path="${output}/etc" />
+ <sysproperty key="log4j.configuration"
+ value="file:${output}/etc/log4j.xml" />
+ <classpath refid="lib.classpath"/>
+ <classpath refid="build.classpath"/>
+ <formatter type="xml" usefile="true"/>
+ <test name="${test}" todir="${reports}"/>
+ </junit> </target>
+ </programlisting></para>
+ </sect2>
- </sect2>
- </sect1>
+ <sect2>
+ <title>Ant target for aopc</title>
+ <para>Below is the code snippet for the <literal>aopc</literal> Ant
+ target. Running this target will do compile-time weaving of the POJO
+ classes specified.</para>
-</chapter>
+ <programlisting>
+ <taskdef name="aopc"
+ classname="org.jboss.aop.ant.AopC"
+ classpathref="aop.classpath"/> <target name="aopc"
+ depends="compile" description="Precompile aop class">
+ <aopc compilerclasspathref="aop.classpath"
+ verbose="true"> <src path="${build}"/>
+ <include
+ name="org/jboss/cache/aop/test/**/*.class"/>
+ <aoppath
+ path="${output}/resources/pojocache-aop.xml"/>
+ <classpath path="${build}"/> <classpath
+ refid="lib.classpath"/> </aopc> </target>
+ </programlisting>
+
+ <para>Below is a snapshot of files that are generated when aopc is
+ applied. Notice that couple extra classes have been generated because of
+ <literal>aopc</literal> .</para>
+
+ <figure>
+ <title>Classes generated after aopc</title>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/classes.png" />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </sect2>
+ </sect1>
+</chapter>
\ No newline at end of file
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-11-26 18:14:21 UTC (rev 4774)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/ListUndoTest.java 2007-11-26 18:15:30 UTC (rev 4775)
@@ -33,7 +33,7 @@
*/
@Test(groups = {"functional"})
-public class ListUndoTest
+public class ListUndoTest
{
Log log_ = 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.getLanguages()));
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.getLanguages()));
cache_.detach("/a");
}
-
-
-
-
}
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-11-26 18:14:21 UTC (rev 4774)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/rollback/LocalUndoTest.java 2007-11-26 18:15:30 UTC (rev 4775)
@@ -33,7 +33,7 @@
*/
@Test(groups = {"functional"})
-public class LocalUndoTest
+public class LocalUndoTest
{
Log log_ = 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 ", hasCacheInterceptor(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 ", hasCacheInterceptor(test));
}
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-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 = {"functional"})
-public class MapUndoTest
+public class MapUndoTest
{
Log log_ = 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.getHobbies()));
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.getHobbies()));
cache_.detach("/a");
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-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 = {"functional"})
-public class SetUndoTest
+public class SetUndoTest
{
Log log_ = 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.getSkills()));
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.getSkills()));
cache_.detach("/a");
}
-
-
-
-
}
17 years, 3 months
JBoss Cache SVN: r4774 - pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback.
by jbosscache-commits@lists.jboss.org
Author: jason.greene(a)jboss.com
Date: 2007-11-26 13:14:21 -0500 (Mon, 26 Nov 2007)
New Revision: 4774
Modified:
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/ListUndoTest.java
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/LocalUndoTest.java
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/MapUndoTest.java
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/SetUndoTest.java
Log:
Add tolerance for new tx checking added in JBCACHE-923
Modified: pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/ListUndoTest.java
===================================================================
--- pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/ListUndoTest.java 2007-11-22 10:27:48 UTC (rev 4773)
+++ pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/ListUndoTest.java 2007-11-26 18:14:21 UTC (rev 4774)
@@ -33,7 +33,7 @@
*/
@Test(groups = {"functional"})
-public class ListUndoTest
+public class ListUndoTest
{
Log log_ = 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.getLanguages()));
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.getLanguages()));
cache_.detach("/a");
}
-
-
-
-
}
Modified: pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/LocalUndoTest.java
===================================================================
--- pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/LocalUndoTest.java 2007-11-22 10:27:48 UTC (rev 4773)
+++ pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/LocalUndoTest.java 2007-11-26 18:14:21 UTC (rev 4774)
@@ -33,7 +33,7 @@
*/
@Test(groups = {"functional"})
-public class LocalUndoTest
+public class LocalUndoTest
{
Log log_ = 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 ", hasCacheInterceptor(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 ", hasCacheInterceptor(test));
}
Modified: pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/MapUndoTest.java
===================================================================
--- pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/MapUndoTest.java 2007-11-22 10:27:48 UTC (rev 4773)
+++ pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/MapUndoTest.java 2007-11-26 18:14:21 UTC (rev 4774)
@@ -33,7 +33,7 @@
*/
@Test(groups = {"functional"})
-public class MapUndoTest
+public class MapUndoTest
{
Log log_ = 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.getHobbies()));
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.getHobbies()));
cache_.detach("/a");
Modified: pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/SetUndoTest.java
===================================================================
--- pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/SetUndoTest.java 2007-11-22 10:27:48 UTC (rev 4773)
+++ pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/SetUndoTest.java 2007-11-26 18:14:21 UTC (rev 4774)
@@ -33,7 +33,7 @@
*/
@Test(groups = {"functional"})
-public class SetUndoTest
+public class SetUndoTest
{
Log log_ = 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.getSkills()));
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.getSkills()));
cache_.detach("/a");
}
-
-
-
-
}
17 years, 3 months
Build failed in Hudson: jboss-cache-core-jdk1.6 » JBoss Cache - Core Edition #117
by jboss-qa-internal@redhat.com
See https://hudson.jboss.org/hudson/job/jboss-cache-core-jdk1.6/org.jboss.cac...
Changes:
[manik.surtani(a)jboss.com] Rolled back updating version info to 2.2.0. Back to 2.1.0 now.
------------------------------------------
started
Building remotely on soa8-RHEL5-x86_64
$ /qa/tools/opt/jdk1.6.0_02/bin/java -Xmx256m -cp /home/hudson/hudson_workspace/maven-agent.jar:/qa/tools/opt/maven-2.0.6/boot/classworlds-1.1.jar hudson.maven.agent.Main /qa/tools/opt/maven-2.0.6 /qa/services/hudson/hudson_1.149/slave.jar /home/hudson/hudson_workspace/maven-interceptor.jar
channel started
[INFO] Scanning for projects...
WAGON_VERSION: 1.0-beta-2
[INFO] ----------------------------------------------------------------------------
[INFO] Building JBoss Cache - Core Edition
[INFO] task-segment: [clean, site]
[INFO] ----------------------------------------------------------------------------
[INFO] artifact org.apache.maven.plugins:maven-clean-plugin: checking for updates from Main Maven Repo
[INFO] artifact org.apache.maven.plugins:maven-clean-plugin: checking for updates from repository.jboss.org
[INFO] artifact org.apache.maven.plugins:maven-clean-plugin: checking for updates from snapshots.jboss.org
[INFO] artifact org.apache.maven.plugins:maven-jar-plugin: checking for updates from Main Maven Repo
[INFO] artifact org.apache.maven.plugins:maven-jar-plugin: checking for updates from repository.jboss.org
[INFO] artifact org.apache.maven.plugins:maven-jar-plugin: checking for updates from snapshots.jboss.org
[INFO] artifact org.apache.maven.plugins:maven-javadoc-plugin: checking for updates from Main Maven Repo
[INFO] artifact org.apache.maven.plugins:maven-javadoc-plugin: checking for updates from snapshots.jboss.org
[INFO] artifact org.apache.maven.plugins:maven-eclipse-plugin: checking for updates from Main Maven Repo
[INFO] artifact org.apache.maven.plugins:maven-eclipse-plugin: checking for updates from repository.jboss.org
[INFO] artifact org.apache.maven.plugins:maven-eclipse-plugin: checking for updates from snapshots.jboss.org
[INFO] [clean:clean]
[INFO] Deleting directory /home/hudson/hudson_workspace/workspace/jboss-cache-core-jdk1.6/./target
[INFO] Deleting directory /home/hudson/hudson_workspace/workspace/jboss-cache-core-jdk1.6/./target/classes
[INFO] Deleting directory /home/hudson/hudson_workspace/workspace/jboss-cache-core-jdk1.6/./target/test-classes
[INFO] Deleting directory /home/hudson/hudson_workspace/workspace/jboss-cache-core-jdk1.6/./target/site
[INFO] artifact org.apache.maven.plugins:maven-site-plugin: checking for updates from Main Maven Repo
[INFO] artifact org.apache.maven.plugins:maven-site-plugin: checking for updates from snapshots.jboss.org
[INFO] artifact org.apache.maven.plugins:maven-jxr-plugin: checking for updates from Main Maven Repo
[INFO] artifact org.apache.maven.plugins:maven-jxr-plugin: checking for updates from repository.jboss.org
[INFO] artifact org.apache.maven.plugins:maven-jxr-plugin: checking for updates from snapshots.jboss.org
[INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] **************************************************************
[INFO] Starting Jakarta Velocity v1.4
[INFO] RuntimeInstance initializing.
[INFO] Default Properties File: org/apache/velocity/runtime/defaults/velocity.properties
[INFO] Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl)
[INFO] Resource Loader Instantiated: org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader
[INFO] ClasspathResourceLoader : initialization starting.
[INFO] ClasspathResourceLoader : initialization complete.
[INFO] ResourceCache : initialized. (class org.apache.velocity.runtime.resource.ResourceCacheImpl)
[INFO] Default ResourceManager initialization complete.
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Literal
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Macro
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Parse
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Include
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Foreach
[INFO] Created: 20 parsers.
[INFO] Velocimacro : initialization starting.
[INFO] Velocimacro : adding VMs from VM library template : VM_global_library.vm
[ERROR] ResourceManager : unable to find resource 'VM_global_library.vm' in any resource loader.
[INFO] Velocimacro : error using VM library template VM_global_library.vm : org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'VM_global_library.vm'
[INFO] Velocimacro : VM library template macro registration complete.
[INFO] Velocimacro : allowInline = true : VMs can be defined inline in templates
[INFO] Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions
[INFO] Velocimacro : allowInlineLocal = false : VMs defined inline will be global in scope if allowed.
[INFO] Velocimacro : initialization complete.
[INFO] Velocity successfully started.
[INFO] artifact org.apache.maven.plugins:maven-pmd-plugin: checking for updates from Main Maven Repo
[INFO] artifact org.apache.maven.plugins:maven-pmd-plugin: checking for updates from repository.jboss.org
[INFO] artifact org.apache.maven.plugins:maven-pmd-plugin: checking for updates from snapshots.jboss.org
[INFO] artifact org.codehaus.mojo:findbugs-maven-plugin: checking for updates from Main Maven Repo
[INFO] artifact org.codehaus.mojo:findbugs-maven-plugin: checking for updates from repository.jboss.org
[INFO] artifact org.codehaus.mojo:findbugs-maven-plugin: checking for updates from snapshots.jboss.org
[INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] **************************************************************
[INFO] Starting Jakarta Velocity v1.4
[INFO] RuntimeInstance initializing.
[INFO] Default Properties File: org/apache/velocity/runtime/defaults/velocity.properties
[INFO] Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl)
[INFO] Resource Loader Instantiated: org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader
[INFO] ClasspathResourceLoader : initialization starting.
[INFO] ClasspathResourceLoader : initialization complete.
[INFO] ResourceCache : initialized. (class org.apache.velocity.runtime.resource.ResourceCacheImpl)
[INFO] Default ResourceManager initialization complete.
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Literal
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Macro
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Parse
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Include
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Foreach
[INFO] Created: 20 parsers.
[INFO] Velocimacro : initialization starting.
[INFO] Velocimacro : adding VMs from VM library template : VM_global_library.vm
[ERROR] ResourceManager : unable to find resource 'VM_global_library.vm' in any resource loader.
[INFO] Velocimacro : error using VM library template VM_global_library.vm : org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'VM_global_library.vm'
[INFO] Velocimacro : VM library template macro registration complete.
[INFO] Velocimacro : allowInline = true : VMs can be defined inline in templates
[INFO] Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions
[INFO] Velocimacro : allowInlineLocal = false : VMs defined inline will be global in scope if allowed.
[INFO] Velocimacro : initialization complete.
[INFO] Velocity successfully started.
[INFO] artifact org.codehaus.mojo:javancss-maven-plugin: checking for updates from Main Maven Repo
[INFO] artifact org.codehaus.mojo:javancss-maven-plugin: checking for updates from repository.jboss.org
[INFO] artifact org.codehaus.mojo:javancss-maven-plugin: checking for updates from snapshots.jboss.org
[INFO] artifact org.codehaus.mojo:taglist-maven-plugin: checking for updates from Main Maven Repo
[INFO] artifact org.codehaus.mojo:taglist-maven-plugin: checking for updates from repository.jboss.org
[INFO] artifact org.codehaus.mojo:taglist-maven-plugin: checking for updates from snapshots.jboss.org
[INFO] artifact org.apache.maven.plugins:maven-project-info-reports-plugin: checking for updates from Main Maven Repo
[INFO] artifact org.apache.maven.plugins:maven-project-info-reports-plugin: checking for updates from repository.jboss.org
[INFO] artifact org.apache.maven.plugins:maven-project-info-reports-plugin: checking for updates from snapshots.jboss.org
[INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] Preparing surefire-report:report
[INFO] artifact org.apache.maven.plugins:maven-resources-plugin: checking for updates from Main Maven Repo
[INFO] artifact org.apache.maven.plugins:maven-resources-plugin: checking for updates from snapshots.jboss.org
[INFO] [enforcer:enforce {execution: enforce-java}]
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 295 source files to /home/hudson/hudson_workspace/workspace/jboss-cache-core-jdk1.6/./target/classes
[HUDSON] Archiving /home/hudson/hudson_workspace/workspace/jboss-cache-core-jdk1.6/./pom.xml
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
/home/hudson/hudson_workspace/workspace/jboss-cache-core-jdk1.6/./src/main/java/org/jboss/cache/util/CachePrinter.java:[6,42] package org.jboss.cache.factories.injection does not exist
/home/hudson/hudson_workspace/workspace/jboss-cache-core-jdk1.6/./src/main/java/org/jboss/cache/util/CachePrinter.java:[60,61] package ComponentFactory does not exist
/home/hudson/hudson_workspace/workspace/jboss-cache-core-jdk1.6/./src/main/java/org/jboss/cache/util/CachePrinter.java:[69,75] package ComponentFactory does not exist
/home/hudson/hudson_workspace/workspace/jboss-cache-core-jdk1.6/./src/main/java/org/jboss/cache/util/CachePrinter.java:[75,27] package ComponentFactory does not exist
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 minutes 22 seconds
[INFO] Finished at: Thu Nov 22 12:07:05 EST 2007
[INFO] Final Memory: 42M/70M
[INFO] ------------------------------------------------------------------------
Sending e-mails to: dpospisi(a)redhat.com manik.surtani(a)jboss.com
Build was marked for publishing on https://hudson.jboss.org/hudson/
finished: FAILURE
17 years, 3 months
JBoss Cache SVN: r4773 - in core/trunk: src/main/java/org/jboss/cache and 1 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2007-11-22 05:27:48 -0500 (Thu, 22 Nov 2007)
New Revision: 4773
Modified:
core/trunk/pom.xml
core/trunk/src/main/java/org/jboss/cache/DefaultCacheFactory.java
core/trunk/src/main/java/org/jboss/cache/InvocationContext.java
core/trunk/src/main/java/org/jboss/cache/Version.java
core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java
Log:
Rolled back updating version info to 2.2.0. Back to 2.1.0 now.
Modified: core/trunk/pom.xml
===================================================================
--- core/trunk/pom.xml 2007-11-22 07:51:14 UTC (rev 4772)
+++ core/trunk/pom.xml 2007-11-22 10:27:48 UTC (rev 4773)
@@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<properties>
- <jbosscache-core-version>2.2.0-SNAPSHOT</jbosscache-core-version>
+ <jbosscache-core-version>2.1.0-SNAPSHOT</jbosscache-core-version>
</properties>
<parent>
<groupId>org.jboss.cache</groupId>
Modified: core/trunk/src/main/java/org/jboss/cache/DefaultCacheFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/DefaultCacheFactory.java 2007-11-22 07:51:14 UTC (rev 4772)
+++ core/trunk/src/main/java/org/jboss/cache/DefaultCacheFactory.java 2007-11-22 10:27:48 UTC (rev 4773)
@@ -6,9 +6,11 @@
*/
package org.jboss.cache;
+import org.jboss.beans.metadata.api.annotations.Inject;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.ConfigurationException;
import org.jboss.cache.factories.XmlConfigurationParser;
+import org.jboss.kernel.Kernel;
import java.io.InputStream;
@@ -21,7 +23,18 @@
public class DefaultCacheFactory<K, V> implements CacheFactory<K, V>
{
private static CacheFactory<?, ?> singleton = new DefaultCacheFactory();
+ private Kernel kernel;
+ public DefaultCacheFactory()
+ {
+ this(new Kernel());
+ }
+
+ public DefaultCacheFactory(@Inject Kernel kernel)
+ {
+ this.kernel = kernel;
+ }
+
/**
* @return a singleton instance of this class.
*/
Modified: core/trunk/src/main/java/org/jboss/cache/InvocationContext.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/InvocationContext.java 2007-11-22 07:51:14 UTC (rev 4772)
+++ core/trunk/src/main/java/org/jboss/cache/InvocationContext.java 2007-11-22 10:27:48 UTC (rev 4773)
@@ -28,10 +28,6 @@
private boolean localRollbackOnly;
private MethodCall methodCall;
- InvocationContext()
- {
- }
-
public void setLocalRollbackOnly(boolean localRollbackOnly)
{
this.localRollbackOnly = localRollbackOnly;
Modified: core/trunk/src/main/java/org/jboss/cache/Version.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/Version.java 2007-11-22 07:51:14 UTC (rev 4772)
+++ core/trunk/src/main/java/org/jboss/cache/Version.java 2007-11-22 10:27:48 UTC (rev 4773)
@@ -11,10 +11,10 @@
@Immutable
public class Version
{
- public static final String version = "2.2.0-SNAPSHOT";
- public static final String codename = "Poblano";
+ public static final String version = "2.1.0-SNAPSHOT";
+ public static final String codename = "Alegrias";
public static final String cvs = "$Id: Version.java 4592 2007-10-10 16:44:36Z manik.surtani(a)jboss.com $";
- static final byte[] version_id = {'0', '2', '2', '0', 'S'};
+ static final byte[] version_id = {'0', '2', '1', '0', 'S'};
private static final int MAJOR_SHIFT = 11;
private static final int MINOR_SHIFT = 6;
Modified: core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java 2007-11-22 07:51:14 UTC (rev 4772)
+++ core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java 2007-11-22 10:27:48 UTC (rev 4773)
@@ -3,6 +3,7 @@
import org.jboss.cache.Cache;
import org.jboss.cache.CacheImpl;
import org.jboss.cache.CacheSPI;
+import org.jboss.cache.factories.injection.ComponentFactory;
import org.jboss.cache.interceptors.Interceptor;
/**
@@ -55,4 +56,27 @@
}
return b.toString();
}
+
+ public static String printDependencyGraph(ComponentFactory.Component c)
+ {
+ StringBuilder b = new StringBuilder();
+ b.append("Dependency graph of component " + c.getType());
+ b.append("\n");
+ addNode(b, 0, c);
+ return b.toString();
+ }
+
+ private static void addNode(StringBuilder b, int level, ComponentFactory.Component c)
+ {
+ addIndent(b, level);
+ b.append("--> ");
+ b.append(c.getType().getName());
+ b.append("\n");
+ for (ComponentFactory.Component d : c.getDependencies()) addNode(b, level + 3, d);
+ }
+
+ private static void addIndent(StringBuilder b, int level)
+ {
+ for (int i=0; i<level; i++) b.append(" ");
+ }
}
17 years, 3 months