[jboss-cvs] JBossAS SVN: r77204 - projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Aug 19 22:38:09 EDT 2008


Author: bstansberry at jboss.com
Date: 2008-08-19 22:38:09 -0400 (Tue, 19 Aug 2008)
New Revision: 77204

Added:
   projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/OptimisticEntityReplicationTestCase.java
   projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/OptimisticJBossCacheTestCase.java
   projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/PessimisticEntityReplicationNoLocalPutsOnlyTestCase.java
   projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/PessimisticEntityReplicationTestCase.java
   projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/PessimisticJBossCacheTestCase.java
Removed:
   projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/OptimisticEntityReplicationTest.java
   projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/OptimisticJBossCacheTest.java
   projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/PessimisticEntityReplicationNoLocalPutsOnlyTest.java
   projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/PessimisticEntityReplicationTest.java
   projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/PessimisticJBossCacheTest.java
Log:
[JBCLUSTER-206] Rename test classes so they execute via mvn

Deleted: projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/OptimisticEntityReplicationTest.java
===================================================================
--- projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/OptimisticEntityReplicationTest.java	2008-08-20 02:27:41 UTC (rev 77203)
+++ projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/OptimisticEntityReplicationTest.java	2008-08-20 02:38:09 UTC (rev 77204)
@@ -1,59 +0,0 @@
-/*
- * Hibernate, Relational Persistence for Idiomatic Java
- *
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors.  All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- *
- * This program 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 distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA  02110-1301  USA
- */
-package org.jboss.hibernate.jbc.cacheprovider.functional;
-
-import org.hibernate.cfg.Configuration;
-import org.hibernate.cfg.Environment;
-
-
-
-/**
- * Executes the superclass tests, but with Hibernate and JBoss Cache
- * configured for optimistic locking.
- * 
- * @author Brian Stansberry
- * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
- */
-public class OptimisticEntityReplicationTest extends PessimisticEntityReplicationTest
-{
-   public OptimisticEntityReplicationTest(String name)
-   {
-      super(name);
-   }
-
-   @Override
-   protected void configureCacheFactory(Configuration cfg)
-   {
-      cfg.setProperty(Environment.CACHE_PROVIDER_CONFIG, OptimisticJBossCacheTest.JBC_CONFIG);
-      cfg.setProperty(Environment.CACHE_PROVIDER, OptimisticJBossCacheTest.JBC_CACHE_PROVIDER);      
-   }
-
-//   @Override
-//   protected String getEntityCacheConfigName()
-//   {
-//      return "optimistic-shared";
-//   }   
-
-   
-}

Copied: projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/OptimisticEntityReplicationTestCase.java (from rev 77197, projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/OptimisticEntityReplicationTest.java)
===================================================================
--- projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/OptimisticEntityReplicationTestCase.java	                        (rev 0)
+++ projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/OptimisticEntityReplicationTestCase.java	2008-08-20 02:38:09 UTC (rev 77204)
@@ -0,0 +1,59 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors.  All third-party contributions are
+ * distributed under license by Red Hat Middleware LLC.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program 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 distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA  02110-1301  USA
+ */
+package org.jboss.hibernate.jbc.cacheprovider.functional;
+
+import org.hibernate.cfg.Configuration;
+import org.hibernate.cfg.Environment;
+
+
+
+/**
+ * Executes the superclass tests, but with Hibernate and JBoss Cache
+ * configured for optimistic locking.
+ * 
+ * @author Brian Stansberry
+ * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
+ */
+public class OptimisticEntityReplicationTestCase extends PessimisticEntityReplicationTestCase
+{
+   public OptimisticEntityReplicationTestCase(String name)
+   {
+      super(name);
+   }
+
+   @Override
+   protected void configureCacheFactory(Configuration cfg)
+   {
+      cfg.setProperty(Environment.CACHE_PROVIDER_CONFIG, OptimisticJBossCacheTestCase.JBC_CONFIG);
+      cfg.setProperty(Environment.CACHE_PROVIDER, OptimisticJBossCacheTestCase.JBC_CACHE_PROVIDER);      
+   }
+
+//   @Override
+//   protected String getEntityCacheConfigName()
+//   {
+//      return "optimistic-shared";
+//   }   
+
+   
+}

Deleted: projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/OptimisticJBossCacheTest.java
===================================================================
--- projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/OptimisticJBossCacheTest.java	2008-08-20 02:27:41 UTC (rev 77203)
+++ projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/OptimisticJBossCacheTest.java	2008-08-20 02:38:09 UTC (rev 77204)
@@ -1,73 +0,0 @@
-/*
- * Hibernate, Relational Persistence for Idiomatic Java
- *
- * Copyright (c) 2007, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors.  All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- *
- * This program 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 distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA  02110-1301  USA
- */
-package org.jboss.hibernate.jbc.cacheprovider.functional;
-
-import junit.framework.Test;
-
-import org.hibernate.cfg.Configuration;
-import org.hibernate.cfg.Environment;
-import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
-import org.jboss.cache.TreeCache;
-
-/**
- * Basic functional test of a optimistic locking entity + query cache.
- * 
- * @author Brian Stansberry
- * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
- */
-public class OptimisticJBossCacheTest extends AbstractQueryCacheFunctionalTestCase 
-{
-   public static final String JBC_CONFIG = "org/jboss/hibernate/jbc/cacheprovider/functional/optimistic-treecache.xml";
-   
-   public static final String JBC_CACHE_PROVIDER = "org.jboss.hibernate.jbc.cacheprovider.TreeCacheProvider";
-   
-    public OptimisticJBossCacheTest(String x) 
-    {
-       super(x, TreeCache.LOCAL);
-    }
-
-    public static Test suite() 
-    {
-       return new FunctionalTestClassTestSuite(OptimisticJBossCacheTest.class);
-    }
-
-//    protected Class<? extends RegionFactory> getCacheRegionFactory() {
-//        return JBossCacheRegionFactory.class;
-//    }    
-
-    /**
-     * Apply any region-factory specific configurations.
-     * 
-     * @param the Configuration to update.
-     */
-    @Override
-    protected void configureCacheFactory(Configuration cfg) 
-    {
-       super.configureCacheFactory(cfg);
-       
-       cfg.setProperty(Environment.CACHE_PROVIDER_CONFIG, JBC_CONFIG);
-       cfg.setProperty(Environment.CACHE_PROVIDER, JBC_CACHE_PROVIDER);        
-    }
-
-}

Copied: projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/OptimisticJBossCacheTestCase.java (from rev 77197, projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/OptimisticJBossCacheTest.java)
===================================================================
--- projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/OptimisticJBossCacheTestCase.java	                        (rev 0)
+++ projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/OptimisticJBossCacheTestCase.java	2008-08-20 02:38:09 UTC (rev 77204)
@@ -0,0 +1,73 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2007, Red Hat Middleware LLC or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors.  All third-party contributions are
+ * distributed under license by Red Hat Middleware LLC.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program 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 distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA  02110-1301  USA
+ */
+package org.jboss.hibernate.jbc.cacheprovider.functional;
+
+import junit.framework.Test;
+
+import org.hibernate.cfg.Configuration;
+import org.hibernate.cfg.Environment;
+import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
+import org.jboss.cache.TreeCache;
+
+/**
+ * Basic functional test of a optimistic locking entity + query cache.
+ * 
+ * @author Brian Stansberry
+ * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
+ */
+public class OptimisticJBossCacheTestCase extends AbstractQueryCacheFunctionalTestCase 
+{
+   public static final String JBC_CONFIG = "org/jboss/hibernate/jbc/cacheprovider/functional/optimistic-treecache.xml";
+   
+   public static final String JBC_CACHE_PROVIDER = "org.jboss.hibernate.jbc.cacheprovider.TreeCacheProvider";
+   
+    public OptimisticJBossCacheTestCase(String x) 
+    {
+       super(x, TreeCache.LOCAL);
+    }
+
+    public static Test suite() 
+    {
+       return new FunctionalTestClassTestSuite(OptimisticJBossCacheTestCase.class);
+    }
+
+//    protected Class<? extends RegionFactory> getCacheRegionFactory() {
+//        return JBossCacheRegionFactory.class;
+//    }    
+
+    /**
+     * Apply any region-factory specific configurations.
+     * 
+     * @param the Configuration to update.
+     */
+    @Override
+    protected void configureCacheFactory(Configuration cfg) 
+    {
+       super.configureCacheFactory(cfg);
+       
+       cfg.setProperty(Environment.CACHE_PROVIDER_CONFIG, JBC_CONFIG);
+       cfg.setProperty(Environment.CACHE_PROVIDER, JBC_CACHE_PROVIDER);        
+    }
+
+}

Deleted: projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/PessimisticEntityReplicationNoLocalPutsOnlyTest.java
===================================================================
--- projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/PessimisticEntityReplicationNoLocalPutsOnlyTest.java	2008-08-20 02:27:41 UTC (rev 77203)
+++ projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/PessimisticEntityReplicationNoLocalPutsOnlyTest.java	2008-08-20 02:38:09 UTC (rev 77204)
@@ -1,114 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, 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.hibernate.jbc.cacheprovider.functional;
-
-import javax.transaction.TransactionManager;
-
-import org.hibernate.SessionFactory;
-import org.hibernate.cfg.Configuration;
-import org.hibernate.cfg.Environment;
-import org.jboss.cache.TreeCache;
-import org.jboss.hibernate.jbc.cacheprovider.CacheProperties;
-import org.jboss.hibernate.jbc.cacheprovider.functional.util.DualNodeTestUtil;
-import org.jboss.hibernate.jbc.cacheprovider.functional.util.TestCacheInstanceManager;
-
-/**
- * PessimisticEntityReplicationNoLocalPutsOnlyTest.
- * 
- * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
- */
-public class PessimisticEntityReplicationNoLocalPutsOnlyTest extends PessimisticEntityReplicationTest
-{
-   public PessimisticEntityReplicationNoLocalPutsOnlyTest(String name)
-   {
-      super(name);
-   }
-   
-   @Override
-   protected void configureCacheFactory(Configuration cfg)
-   {
-      cfg.setProperty(Environment.CACHE_PROVIDER_CONFIG, PessimisticJBossCacheTest.JBC_CONFIG);
-      cfg.setProperty(Environment.CACHE_PROVIDER, PessimisticJBossCacheTest.JBC_CACHE_PROVIDER);
-      cfg.setProperty(CacheProperties.HIBERNATE_CACHE_LOCAL_PUTS_ONLY_PROPERTY, "false");
-   }
-
-   public void testAll() throws Exception
-   {
-      System.out.println("*** " + getName());
-      
-      // Bind a listener to the "local" cache
-      // Our region factory makes its CacheManager available to us
-      TreeCache localCache = TestCacheInstanceManager.getTreeCache(DualNodeTestUtil.LOCAL);
-      MyListener localListener = new MyListener();
-      localCache.addTreeCacheListener(localListener);
-      TransactionManager localTM = localCache.getTransactionManager();
-      
-      // Bind a listener to the "remote" cache
-      TreeCache remoteCache = TestCacheInstanceManager.getTreeCache(DualNodeTestUtil.REMOTE);
-      MyListener remoteListener = new MyListener();
-      remoteCache.addTreeCacheListener(remoteListener);      
-      
-      TransactionManager remoteTM = remoteCache.getTransactionManager();
-      
-      SessionFactory localFactory = getEnvironment().getSessionFactory();
-      SessionFactory remoteFactory = getSecondNodeEnvironment().getSessionFactory();
-      
-      try
-      {
-         System.out.println("Create node 0");
-         IdContainer ids = createCustomer(localFactory, localTM);
-         
-         // Sleep a bit to let async commit propagate. Really just to
-         // help keep the logs organized for debugging any issues
-         sleep(SLEEP_TIME);
-         
-         System.out.println("Find node 0");
-         // This actually brings the collection into the cache
-         getCustomer(ids.customerId, localFactory, localTM);
-         
-         sleep(SLEEP_TIME);
-         
-         // Now the collection is in the cache so, the 2nd "get"
-         // should read everything from the cache
-         System.out.println("Find(2) node 0");         
-         localListener.clear();
-         getCustomer(ids.customerId, localFactory, localTM);
-         
-         //Check the read came from the cache
-         System.out.println("Check cache 0");
-         assertLoadedFromCache(localListener, ids.customerId, ids.contactIds);
-         
-         System.out.println("Find node 1");
-         getCustomer(ids.customerId, remoteFactory, remoteTM);
-   
-         //Check everything was in cache
-         System.out.println("Check cache 1");
-         assertLoadedFromCache(remoteListener, ids.customerId, ids.contactIds);
-      }
-      finally
-      {
-         // cleanup the db
-         System.out.println("Cleaning up");
-         cleanup(localFactory, localTM);
-      }
-   }
-}

Copied: projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/PessimisticEntityReplicationNoLocalPutsOnlyTestCase.java (from rev 77197, projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/PessimisticEntityReplicationNoLocalPutsOnlyTest.java)
===================================================================
--- projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/PessimisticEntityReplicationNoLocalPutsOnlyTestCase.java	                        (rev 0)
+++ projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/PessimisticEntityReplicationNoLocalPutsOnlyTestCase.java	2008-08-20 02:38:09 UTC (rev 77204)
@@ -0,0 +1,114 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.hibernate.jbc.cacheprovider.functional;
+
+import javax.transaction.TransactionManager;
+
+import org.hibernate.SessionFactory;
+import org.hibernate.cfg.Configuration;
+import org.hibernate.cfg.Environment;
+import org.jboss.cache.TreeCache;
+import org.jboss.hibernate.jbc.cacheprovider.CacheProperties;
+import org.jboss.hibernate.jbc.cacheprovider.functional.util.DualNodeTestUtil;
+import org.jboss.hibernate.jbc.cacheprovider.functional.util.TestCacheInstanceManager;
+
+/**
+ * PessimisticEntityReplicationNoLocalPutsOnlyTest.
+ * 
+ * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
+ */
+public class PessimisticEntityReplicationNoLocalPutsOnlyTestCase extends PessimisticEntityReplicationTestCase
+{
+   public PessimisticEntityReplicationNoLocalPutsOnlyTestCase(String name)
+   {
+      super(name);
+   }
+   
+   @Override
+   protected void configureCacheFactory(Configuration cfg)
+   {
+      cfg.setProperty(Environment.CACHE_PROVIDER_CONFIG, PessimisticJBossCacheTestCase.JBC_CONFIG);
+      cfg.setProperty(Environment.CACHE_PROVIDER, PessimisticJBossCacheTestCase.JBC_CACHE_PROVIDER);
+      cfg.setProperty(CacheProperties.HIBERNATE_CACHE_LOCAL_PUTS_ONLY_PROPERTY, "false");
+   }
+
+   public void testAll() throws Exception
+   {
+      System.out.println("*** " + getName());
+      
+      // Bind a listener to the "local" cache
+      // Our region factory makes its CacheManager available to us
+      TreeCache localCache = TestCacheInstanceManager.getTreeCache(DualNodeTestUtil.LOCAL);
+      MyListener localListener = new MyListener();
+      localCache.addTreeCacheListener(localListener);
+      TransactionManager localTM = localCache.getTransactionManager();
+      
+      // Bind a listener to the "remote" cache
+      TreeCache remoteCache = TestCacheInstanceManager.getTreeCache(DualNodeTestUtil.REMOTE);
+      MyListener remoteListener = new MyListener();
+      remoteCache.addTreeCacheListener(remoteListener);      
+      
+      TransactionManager remoteTM = remoteCache.getTransactionManager();
+      
+      SessionFactory localFactory = getEnvironment().getSessionFactory();
+      SessionFactory remoteFactory = getSecondNodeEnvironment().getSessionFactory();
+      
+      try
+      {
+         System.out.println("Create node 0");
+         IdContainer ids = createCustomer(localFactory, localTM);
+         
+         // Sleep a bit to let async commit propagate. Really just to
+         // help keep the logs organized for debugging any issues
+         sleep(SLEEP_TIME);
+         
+         System.out.println("Find node 0");
+         // This actually brings the collection into the cache
+         getCustomer(ids.customerId, localFactory, localTM);
+         
+         sleep(SLEEP_TIME);
+         
+         // Now the collection is in the cache so, the 2nd "get"
+         // should read everything from the cache
+         System.out.println("Find(2) node 0");         
+         localListener.clear();
+         getCustomer(ids.customerId, localFactory, localTM);
+         
+         //Check the read came from the cache
+         System.out.println("Check cache 0");
+         assertLoadedFromCache(localListener, ids.customerId, ids.contactIds);
+         
+         System.out.println("Find node 1");
+         getCustomer(ids.customerId, remoteFactory, remoteTM);
+   
+         //Check everything was in cache
+         System.out.println("Check cache 1");
+         assertLoadedFromCache(remoteListener, ids.customerId, ids.contactIds);
+      }
+      finally
+      {
+         // cleanup the db
+         System.out.println("Cleaning up");
+         cleanup(localFactory, localTM);
+      }
+   }
+}

Deleted: projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/PessimisticEntityReplicationTest.java
===================================================================
--- projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/PessimisticEntityReplicationTest.java	2008-08-20 02:27:41 UTC (rev 77203)
+++ projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/PessimisticEntityReplicationTest.java	2008-08-20 02:38:09 UTC (rev 77204)
@@ -1,323 +0,0 @@
-/*
- * Hibernate, Relational Persistence for Idiomatic Java
- *
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors.  All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- *
- * This program 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 distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA  02110-1301  USA
- */
-package org.jboss.hibernate.jbc.cacheprovider.functional;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import javax.management.ObjectName;
-import javax.transaction.TransactionManager;
-
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.hibernate.cfg.Configuration;
-import org.hibernate.cfg.Environment;
-import org.hibernate.transaction.CMTTransactionFactory;
-import org.hibernate.transaction.TransactionManagerLookup;
-import org.hibernate.transaction.TransactionManagerLookupFactory;
-import org.jboss.cache.AbstractTreeCacheListener;
-import org.jboss.cache.Fqn;
-import org.jboss.cache.PropertyConfigurator;
-import org.jboss.cache.TreeCache;
-import org.jboss.hibernate.jbc.cacheprovider.TreeCacheProvider;
-import org.jboss.hibernate.jbc.cacheprovider.functional.util.DualNodeTestUtil;
-import org.jboss.hibernate.jbc.cacheprovider.functional.util.TestCacheInstanceManager;
-import org.jboss.logging.Logger;
-
-/**
- * Port of the earlier JBoss EJB3 project's 
- * org.jboss.ejb3.test.clusteredentity.unit.EntityUnitTestCase
- *
- * @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>
- * @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
- * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
- */
-public class PessimisticEntityReplicationTest extends DualNodeTestCaseBase
-{
-   private static final Logger log = Logger.getLogger(PessimisticEntityReplicationTest.class);
-
-   protected static final long SLEEP_TIME = 50l;
-   
-   private static final Integer CUSTOMER_ID = new Integer(1);
-   
-   static int test = 0;
-   
-   public PessimisticEntityReplicationTest(String name)
-   {
-      super(name, TreeCache.REPL_SYNC);
-   }
-
-   @Override
-   protected boolean getUseQueryCache()
-   {
-      return false;
-   }
-
-   @Override
-   protected void configureCacheFactory(Configuration cfg)
-   {
-      cfg.setProperty(Environment.CACHE_PROVIDER_CONFIG, PessimisticJBossCacheTest.JBC_CONFIG);
-      cfg.setProperty(Environment.CACHE_PROVIDER, PessimisticJBossCacheTest.JBC_CACHE_PROVIDER);      
-   }
-   
-   public void testAll() throws Exception
-   {
-      System.out.println("*** " + getName());
-      
-      // Bind a listener to the "local" cache
-      // Our region factory makes its CacheManager available to us
-      TreeCache localCache = TestCacheInstanceManager.getTreeCache(DualNodeTestUtil.LOCAL);
-      MyListener localListener = new MyListener();
-      localCache.addTreeCacheListener(localListener);
-      TransactionManager localTM = localCache.getTransactionManager();
-      
-      // Bind a listener to the "remote" cache
-      TreeCache remoteCache = TestCacheInstanceManager.getTreeCache(DualNodeTestUtil.REMOTE);
-      MyListener remoteListener = new MyListener();
-      remoteCache.addTreeCacheListener(remoteListener);      
-      
-      TransactionManager remoteTM = remoteCache.getTransactionManager();
-      
-      SessionFactory localFactory = getEnvironment().getSessionFactory();
-      SessionFactory remoteFactory = getSecondNodeEnvironment().getSessionFactory();
-      
-      try
-      {
-         System.out.println("Create node 0");
-         IdContainer ids = createCustomer(localFactory, localTM);
-         
-         // Sleep a bit to let async commit propagate. Really just to
-         // help keep the logs organized for debugging any issues
-         sleep(SLEEP_TIME);
-         
-         System.out.println("Find node 0");
-         // This actually brings the collection into the cache
-         getCustomer(ids.customerId, localFactory, localTM);
-         
-         sleep(SLEEP_TIME);
-         
-         // Now the collection is in the cache so, the 2nd "get"
-         // should read everything from the cache
-         System.out.println("Find(2) node 0");         
-         localListener.clear();
-         getCustomer(ids.customerId, localFactory, localTM);
-         
-         //Check the read came from the cache
-         System.out.println("Check cache 0");
-         assertLoadedFromCache(localListener, ids.customerId, ids.contactIds);
-         
-         System.out.println("Find node 1");
-         // With local puts only, this actually brings the collection into the 
-         // cache. IOW, putting the customer into the cache in node 0 does not 
-         // result on the customer being already available in node 1, we need to
-         // get it.
-         getCustomer(ids.customerId, remoteFactory, remoteTM);
-         
-         sleep(SLEEP_TIME);
-         
-         System.out.println("Find(2) node 1");
-         remoteListener.clear();
-         getCustomer(ids.customerId, remoteFactory, remoteTM);
-   
-         //Check everything was in cache
-         System.out.println("Check cache 1");
-         assertLoadedFromCache(remoteListener, ids.customerId, ids.contactIds);
-      }
-      finally
-      {
-         // cleanup the db
-         System.out.println("Cleaning up");
-         cleanup(localFactory, localTM);
-      }
-   }
-   
-   protected IdContainer createCustomer(SessionFactory sessionFactory, TransactionManager tm)
-      throws Exception
-   {
-      System.out.println("CREATE CUSTOMER");
-      
-      tm.begin(); 
-
-      try
-      {
-         Session session = sessionFactory.getCurrentSession();
-         
-         Customer customer = new Customer();
-         customer.setName("JBoss");
-         Set<Contact> contacts = new HashSet<Contact>();
-         
-         Contact kabir = new Contact();
-         kabir.setCustomer(customer);
-         kabir.setName("Kabir");
-         kabir.setTlf("1111");
-         contacts.add(kabir);
-         
-         Contact bill = new Contact();
-         bill.setCustomer(customer);
-         bill.setName("Bill");
-         bill.setTlf("2222");
-         contacts.add(bill);
-
-         customer.setContacts(contacts);
-
-         session.save(customer);
-         tm.commit();
-         
-         IdContainer ids = new IdContainer();
-         ids.customerId = customer.getId();
-         Set contactIds = new HashSet();
-         contactIds.add(kabir.getId());
-         contactIds.add(bill.getId());
-         ids.contactIds = contactIds;
-         
-         return ids;
-      }
-      catch (Exception e)
-      {
-         log.error("Caught exception creating customer", e);
-         try {
-            tm.rollback();
-         }
-         catch (Exception e1) {
-            log.error("Exception rolling back txn", e1);
-         }
-         throw e;
-      }
-      finally
-      {
-         System.out.println("CREATE CUSTOMER -  END");         
-      }
-   }
-
-   protected Customer getCustomer(Integer id, SessionFactory sessionFactory, TransactionManager tm)
-       throws Exception
-   {      
-      System.out.println("FIND CUSTOMER");
-      
-      tm.begin();
-      try
-      {
-         Session session = sessionFactory.getCurrentSession();
-         Customer customer = (Customer) session.get(Customer.class, id);
-         // Access all the contacts
-         for (Iterator it = customer.getContacts().iterator(); it.hasNext();) {
-            ((Contact) it.next()).getName();
-         }
-         tm.commit();
-         return customer;
-      }
-      catch (Exception e)
-      {
-         try {
-            tm.rollback();
-         }
-         catch (Exception e1) {
-            log.error("Exception rolling back txn", e1);
-         }
-         throw e;
-      }
-      finally
-      {
-         System.out.println("FIND CUSTOMER -  END");         
-      }
-   }
-   
-   protected void cleanup(SessionFactory sessionFactory, TransactionManager tm) throws Exception
-   {
-      tm.begin();
-      try
-      {
-         Session session = sessionFactory.getCurrentSession();
-         Customer c = (Customer) session.get(Customer.class, CUSTOMER_ID);
-         if (c != null)
-         {
-            Set contacts = c.getContacts();
-            for (Iterator it = contacts.iterator(); it.hasNext();)
-               session.delete(it.next());
-            c.setContacts(null);
-            session.delete(c);
-         }
-         
-         tm.commit();
-      }
-      catch (Exception e)
-      {
-         try {
-            tm.rollback();
-         }
-         catch (Exception e1) {
-            log.error("Exception rolling back txn", e1);
-         }
-         log.error("Caught exception in cleanup", e);
-      }
-   }
-   
-   protected void assertLoadedFromCache(MyListener listener, Integer custId, Set contactIds)
-   {
-      assertTrue("Customer#" + custId + " was in cache", listener.visited.contains("Customer#" + custId));
-      for (Iterator it = contactIds.iterator(); it.hasNext();) {
-          Integer contactId = (Integer) it.next();
-          assertTrue("Contact#"+ contactId + " was in cache", listener.visited.contains("Contact#"+ contactId));
-          assertTrue("Contact#"+ contactId + " was in cache", listener.visited.contains("Contact#"+ contactId));
-      }
-      assertTrue("Customer.contacts" + custId + " was in cache", 
-                 listener.visited.contains("Customer.contacts#" + custId));      
-   }
-   
-   //@CacheListener
-   public class MyListener extends AbstractTreeCacheListener
-   {
-      HashSet<String> visited = new HashSet<String>(); 
-      
-      public void clear()
-      {
-         visited.clear();
-      }
-
-      @Override
-      public void nodeVisited(Fqn fqn)
-      {
-         super.nodeVisited(fqn);
-         
-         log.info("MyListener - Visiting node " + fqn.toString());
-         String name = fqn.toString();
-         String token = ".functional.";
-         int index = name.indexOf(token);
-         if (index > -1)
-         {
-            index += token.length();
-            name = name.substring(index);
-            log.info("MyListener - recording visit to " + name);
-            visited.add(name);
-         }
-      }
-   }
-   
-   class IdContainer 
-   {
-      Integer customerId;
-      Set contactIds;
-   }
-}

Copied: projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/PessimisticEntityReplicationTestCase.java (from rev 77197, projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/PessimisticEntityReplicationTest.java)
===================================================================
--- projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/PessimisticEntityReplicationTestCase.java	                        (rev 0)
+++ projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/PessimisticEntityReplicationTestCase.java	2008-08-20 02:38:09 UTC (rev 77204)
@@ -0,0 +1,323 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors.  All third-party contributions are
+ * distributed under license by Red Hat Middleware LLC.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program 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 distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA  02110-1301  USA
+ */
+package org.jboss.hibernate.jbc.cacheprovider.functional;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import javax.management.ObjectName;
+import javax.transaction.TransactionManager;
+
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.cfg.Configuration;
+import org.hibernate.cfg.Environment;
+import org.hibernate.transaction.CMTTransactionFactory;
+import org.hibernate.transaction.TransactionManagerLookup;
+import org.hibernate.transaction.TransactionManagerLookupFactory;
+import org.jboss.cache.AbstractTreeCacheListener;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.PropertyConfigurator;
+import org.jboss.cache.TreeCache;
+import org.jboss.hibernate.jbc.cacheprovider.TreeCacheProvider;
+import org.jboss.hibernate.jbc.cacheprovider.functional.util.DualNodeTestUtil;
+import org.jboss.hibernate.jbc.cacheprovider.functional.util.TestCacheInstanceManager;
+import org.jboss.logging.Logger;
+
+/**
+ * Port of the earlier JBoss EJB3 project's 
+ * org.jboss.ejb3.test.clusteredentity.unit.EntityUnitTestCase
+ *
+ * @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>
+ * @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
+ * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
+ */
+public class PessimisticEntityReplicationTestCase extends DualNodeTestCaseBase
+{
+   private static final Logger log = Logger.getLogger(PessimisticEntityReplicationTestCase.class);
+
+   protected static final long SLEEP_TIME = 50l;
+   
+   private static final Integer CUSTOMER_ID = new Integer(1);
+   
+   static int test = 0;
+   
+   public PessimisticEntityReplicationTestCase(String name)
+   {
+      super(name, TreeCache.REPL_SYNC);
+   }
+
+   @Override
+   protected boolean getUseQueryCache()
+   {
+      return false;
+   }
+
+   @Override
+   protected void configureCacheFactory(Configuration cfg)
+   {
+      cfg.setProperty(Environment.CACHE_PROVIDER_CONFIG, PessimisticJBossCacheTestCase.JBC_CONFIG);
+      cfg.setProperty(Environment.CACHE_PROVIDER, PessimisticJBossCacheTestCase.JBC_CACHE_PROVIDER);      
+   }
+   
+   public void testAll() throws Exception
+   {
+      System.out.println("*** " + getName());
+      
+      // Bind a listener to the "local" cache
+      // Our region factory makes its CacheManager available to us
+      TreeCache localCache = TestCacheInstanceManager.getTreeCache(DualNodeTestUtil.LOCAL);
+      MyListener localListener = new MyListener();
+      localCache.addTreeCacheListener(localListener);
+      TransactionManager localTM = localCache.getTransactionManager();
+      
+      // Bind a listener to the "remote" cache
+      TreeCache remoteCache = TestCacheInstanceManager.getTreeCache(DualNodeTestUtil.REMOTE);
+      MyListener remoteListener = new MyListener();
+      remoteCache.addTreeCacheListener(remoteListener);      
+      
+      TransactionManager remoteTM = remoteCache.getTransactionManager();
+      
+      SessionFactory localFactory = getEnvironment().getSessionFactory();
+      SessionFactory remoteFactory = getSecondNodeEnvironment().getSessionFactory();
+      
+      try
+      {
+         System.out.println("Create node 0");
+         IdContainer ids = createCustomer(localFactory, localTM);
+         
+         // Sleep a bit to let async commit propagate. Really just to
+         // help keep the logs organized for debugging any issues
+         sleep(SLEEP_TIME);
+         
+         System.out.println("Find node 0");
+         // This actually brings the collection into the cache
+         getCustomer(ids.customerId, localFactory, localTM);
+         
+         sleep(SLEEP_TIME);
+         
+         // Now the collection is in the cache so, the 2nd "get"
+         // should read everything from the cache
+         System.out.println("Find(2) node 0");         
+         localListener.clear();
+         getCustomer(ids.customerId, localFactory, localTM);
+         
+         //Check the read came from the cache
+         System.out.println("Check cache 0");
+         assertLoadedFromCache(localListener, ids.customerId, ids.contactIds);
+         
+         System.out.println("Find node 1");
+         // With local puts only, this actually brings the collection into the 
+         // cache. IOW, putting the customer into the cache in node 0 does not 
+         // result on the customer being already available in node 1, we need to
+         // get it.
+         getCustomer(ids.customerId, remoteFactory, remoteTM);
+         
+         sleep(SLEEP_TIME);
+         
+         System.out.println("Find(2) node 1");
+         remoteListener.clear();
+         getCustomer(ids.customerId, remoteFactory, remoteTM);
+   
+         //Check everything was in cache
+         System.out.println("Check cache 1");
+         assertLoadedFromCache(remoteListener, ids.customerId, ids.contactIds);
+      }
+      finally
+      {
+         // cleanup the db
+         System.out.println("Cleaning up");
+         cleanup(localFactory, localTM);
+      }
+   }
+   
+   protected IdContainer createCustomer(SessionFactory sessionFactory, TransactionManager tm)
+      throws Exception
+   {
+      System.out.println("CREATE CUSTOMER");
+      
+      tm.begin(); 
+
+      try
+      {
+         Session session = sessionFactory.getCurrentSession();
+         
+         Customer customer = new Customer();
+         customer.setName("JBoss");
+         Set<Contact> contacts = new HashSet<Contact>();
+         
+         Contact kabir = new Contact();
+         kabir.setCustomer(customer);
+         kabir.setName("Kabir");
+         kabir.setTlf("1111");
+         contacts.add(kabir);
+         
+         Contact bill = new Contact();
+         bill.setCustomer(customer);
+         bill.setName("Bill");
+         bill.setTlf("2222");
+         contacts.add(bill);
+
+         customer.setContacts(contacts);
+
+         session.save(customer);
+         tm.commit();
+         
+         IdContainer ids = new IdContainer();
+         ids.customerId = customer.getId();
+         Set contactIds = new HashSet();
+         contactIds.add(kabir.getId());
+         contactIds.add(bill.getId());
+         ids.contactIds = contactIds;
+         
+         return ids;
+      }
+      catch (Exception e)
+      {
+         log.error("Caught exception creating customer", e);
+         try {
+            tm.rollback();
+         }
+         catch (Exception e1) {
+            log.error("Exception rolling back txn", e1);
+         }
+         throw e;
+      }
+      finally
+      {
+         System.out.println("CREATE CUSTOMER -  END");         
+      }
+   }
+
+   protected Customer getCustomer(Integer id, SessionFactory sessionFactory, TransactionManager tm)
+       throws Exception
+   {      
+      System.out.println("FIND CUSTOMER");
+      
+      tm.begin();
+      try
+      {
+         Session session = sessionFactory.getCurrentSession();
+         Customer customer = (Customer) session.get(Customer.class, id);
+         // Access all the contacts
+         for (Iterator it = customer.getContacts().iterator(); it.hasNext();) {
+            ((Contact) it.next()).getName();
+         }
+         tm.commit();
+         return customer;
+      }
+      catch (Exception e)
+      {
+         try {
+            tm.rollback();
+         }
+         catch (Exception e1) {
+            log.error("Exception rolling back txn", e1);
+         }
+         throw e;
+      }
+      finally
+      {
+         System.out.println("FIND CUSTOMER -  END");         
+      }
+   }
+   
+   protected void cleanup(SessionFactory sessionFactory, TransactionManager tm) throws Exception
+   {
+      tm.begin();
+      try
+      {
+         Session session = sessionFactory.getCurrentSession();
+         Customer c = (Customer) session.get(Customer.class, CUSTOMER_ID);
+         if (c != null)
+         {
+            Set contacts = c.getContacts();
+            for (Iterator it = contacts.iterator(); it.hasNext();)
+               session.delete(it.next());
+            c.setContacts(null);
+            session.delete(c);
+         }
+         
+         tm.commit();
+      }
+      catch (Exception e)
+      {
+         try {
+            tm.rollback();
+         }
+         catch (Exception e1) {
+            log.error("Exception rolling back txn", e1);
+         }
+         log.error("Caught exception in cleanup", e);
+      }
+   }
+   
+   protected void assertLoadedFromCache(MyListener listener, Integer custId, Set contactIds)
+   {
+      assertTrue("Customer#" + custId + " was in cache", listener.visited.contains("Customer#" + custId));
+      for (Iterator it = contactIds.iterator(); it.hasNext();) {
+          Integer contactId = (Integer) it.next();
+          assertTrue("Contact#"+ contactId + " was in cache", listener.visited.contains("Contact#"+ contactId));
+          assertTrue("Contact#"+ contactId + " was in cache", listener.visited.contains("Contact#"+ contactId));
+      }
+      assertTrue("Customer.contacts" + custId + " was in cache", 
+                 listener.visited.contains("Customer.contacts#" + custId));      
+   }
+   
+   //@CacheListener
+   public class MyListener extends AbstractTreeCacheListener
+   {
+      HashSet<String> visited = new HashSet<String>(); 
+      
+      public void clear()
+      {
+         visited.clear();
+      }
+
+      @Override
+      public void nodeVisited(Fqn fqn)
+      {
+         super.nodeVisited(fqn);
+         
+         log.info("MyListener - Visiting node " + fqn.toString());
+         String name = fqn.toString();
+         String token = ".functional.";
+         int index = name.indexOf(token);
+         if (index > -1)
+         {
+            index += token.length();
+            name = name.substring(index);
+            log.info("MyListener - recording visit to " + name);
+            visited.add(name);
+         }
+      }
+   }
+   
+   class IdContainer 
+   {
+      Integer customerId;
+      Set contactIds;
+   }
+}

Deleted: projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/PessimisticJBossCacheTest.java
===================================================================
--- projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/PessimisticJBossCacheTest.java	2008-08-20 02:27:41 UTC (rev 77203)
+++ projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/PessimisticJBossCacheTest.java	2008-08-20 02:38:09 UTC (rev 77204)
@@ -1,70 +0,0 @@
-/*
- * Hibernate, Relational Persistence for Idiomatic Java
- *
- * Copyright (c) 2007, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors.  All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- *
- * This program 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 distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA  02110-1301  USA
- */
-package org.jboss.hibernate.jbc.cacheprovider.functional;
-
-import junit.framework.Test;
-
-import org.hibernate.cfg.Configuration;
-import org.hibernate.cfg.Environment;
-import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
-import org.jboss.cache.TreeCache;
-import org.jboss.hibernate.jbc.cacheprovider.TreeCacheProvider;
-
-/**
- * Basic functional test of a pessimistic locking entity + query cache.
- * 
- * @author Brian Stansberry
- * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
- */
-public class PessimisticJBossCacheTest extends AbstractQueryCacheFunctionalTestCase 
-{
-   public static final String JBC_CONFIG = "org/jboss/hibernate/jbc/cacheprovider/functional/pessimistic-treecache.xml";
-    
-   /** Use an overriden version TreeCacheProviderHook that does not lookup the 
-    * transaction manager on the JNDI but instead use same as passed to Hibernate */
-   public static final String JBC_CACHE_PROVIDER = "org.jboss.hibernate.jbc.cacheprovider.NonJndiTmTreeCacheProvider";
-    
-   public PessimisticJBossCacheTest(String x) 
-   {
-      super(x, TreeCache.LOCAL);
-   }
-   
-   public static Test suite() 
-   {
-      return new FunctionalTestClassTestSuite(PessimisticJBossCacheTest.class);
-   }
-   
-   /**
-    * Apply any region-factory specific configurations.
-    * 
-    * @param the Configuration to update.
-    */
-   protected void configureCacheFactory(Configuration cfg) 
-   {
-      super.configureCacheFactory(cfg);
-      
-      cfg.setProperty(Environment.CACHE_PROVIDER_CONFIG, JBC_CONFIG);
-      cfg.setProperty(Environment.CACHE_PROVIDER, JBC_CACHE_PROVIDER);
-   }
-}
\ No newline at end of file

Copied: projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/PessimisticJBossCacheTestCase.java (from rev 77197, projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/PessimisticJBossCacheTest.java)
===================================================================
--- projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/PessimisticJBossCacheTestCase.java	                        (rev 0)
+++ projects/cluster/hibernate-jbc-cacheprovider/trunk/src/test/java/org/jboss/hibernate/jbc/cacheprovider/functional/PessimisticJBossCacheTestCase.java	2008-08-20 02:38:09 UTC (rev 77204)
@@ -0,0 +1,70 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2007, Red Hat Middleware LLC or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors.  All third-party contributions are
+ * distributed under license by Red Hat Middleware LLC.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program 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 distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA  02110-1301  USA
+ */
+package org.jboss.hibernate.jbc.cacheprovider.functional;
+
+import junit.framework.Test;
+
+import org.hibernate.cfg.Configuration;
+import org.hibernate.cfg.Environment;
+import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
+import org.jboss.cache.TreeCache;
+import org.jboss.hibernate.jbc.cacheprovider.TreeCacheProvider;
+
+/**
+ * Basic functional test of a pessimistic locking entity + query cache.
+ * 
+ * @author Brian Stansberry
+ * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
+ */
+public class PessimisticJBossCacheTestCase extends AbstractQueryCacheFunctionalTestCase 
+{
+   public static final String JBC_CONFIG = "org/jboss/hibernate/jbc/cacheprovider/functional/pessimistic-treecache.xml";
+    
+   /** Use an overriden version TreeCacheProviderHook that does not lookup the 
+    * transaction manager on the JNDI but instead use same as passed to Hibernate */
+   public static final String JBC_CACHE_PROVIDER = "org.jboss.hibernate.jbc.cacheprovider.NonJndiTmTreeCacheProvider";
+    
+   public PessimisticJBossCacheTestCase(String x) 
+   {
+      super(x, TreeCache.LOCAL);
+   }
+   
+   public static Test suite() 
+   {
+      return new FunctionalTestClassTestSuite(PessimisticJBossCacheTestCase.class);
+   }
+   
+   /**
+    * Apply any region-factory specific configurations.
+    * 
+    * @param the Configuration to update.
+    */
+   protected void configureCacheFactory(Configuration cfg) 
+   {
+      super.configureCacheFactory(cfg);
+      
+      cfg.setProperty(Environment.CACHE_PROVIDER_CONFIG, JBC_CONFIG);
+      cfg.setProperty(Environment.CACHE_PROVIDER, JBC_CACHE_PROVIDER);
+   }
+}
\ No newline at end of file




More information about the jboss-cvs-commits mailing list