[jboss-cvs] JBossAS SVN: r108175 - in branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster: clusteredentity/classloader and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Sep 16 12:30:55 EDT 2010
Author: pferraro
Date: 2010-09-16 12:30:55 -0400 (Thu, 16 Sep 2010)
New Revision: 108175
Modified:
branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/BulkOperationsTestBean.java
branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/Contact.java
branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/Customer.java
branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/EntityTest.java
branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/EntityTestBean.java
branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/classloader/EntityQueryTest.java
branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/classloader/EntityQueryTestBean.java
branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/embeddedid/EmbeddedIdTestBean.java
branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/EntityClassloaderTestBase.java
branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/EntityQueryRedeployUnitTestCase.java
branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/EntityUnitTestCase.java
branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/ProvidedPrefixEntityQueryUnitTestCase.java
Log:
clustered entity tests now pass - with the latest infinispan and hibernate-infinispan fixes
Modified: branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/BulkOperationsTestBean.java
===================================================================
--- branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/BulkOperationsTestBean.java 2010-09-16 14:58:34 UTC (rev 108174)
+++ branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/BulkOperationsTestBean.java 2010-09-16 16:30:55 UTC (rev 108175)
@@ -67,42 +67,29 @@
return rowsAffected;
}
+ @SuppressWarnings("unchecked")
public List<Integer> getContactsByCustomer(String customerName)
{
String selectHQL = "select contact.id from Contact contact";
selectHQL += " where contact.customer.name = :cName";
- List results = manager.createQuery(selectHQL)
- .setFlushMode(FlushModeType.AUTO)
- .setParameter("cName", customerName)
- .getResultList();
-
- return results;
+ return manager.createQuery(selectHQL).setFlushMode(FlushModeType.AUTO).setParameter("cName", customerName).getResultList();
}
+ @SuppressWarnings("unchecked")
public List<Integer> getContactsByTLF(String tlf)
{
String selectHQL = "select contact.id from Contact contact";
selectHQL += " where contact.tlf = :cTLF";
- List results = manager.createQuery(selectHQL)
- .setFlushMode(FlushModeType.AUTO)
- .setParameter("cTLF", tlf)
- .getResultList();
-
- return results;
+ return manager.createQuery(selectHQL).setFlushMode(FlushModeType.AUTO).setParameter("cTLF", tlf).getResultList();
}
public int updateContacts(String name, String newTLF)
{
String updateHQL = "update Contact set tlf = :cNewTLF where name = :cName";
- int rowsAffected = manager.createQuery(updateHQL)
- .setFlushMode(FlushModeType.AUTO)
- .setParameter("cNewTLF", newTLF)
- .setParameter("cName", name)
- .executeUpdate();
- return rowsAffected;
+ return manager.createQuery(updateHQL).setFlushMode(FlushModeType.AUTO).setParameter("cNewTLF", newTLF).setParameter("cName", name).executeUpdate();
}
public Contact getContact(Integer id)
Modified: branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/Contact.java
===================================================================
--- branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/Contact.java 2010-09-16 14:58:34 UTC (rev 108174)
+++ branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/Contact.java 2010-09-16 16:30:55 UTC (rev 108175)
@@ -39,6 +39,7 @@
@Cache (usage=CacheConcurrencyStrategy.TRANSACTIONAL)
public class Contact implements Serializable
{
+ private static final long serialVersionUID = -1054580765414826659L;
Integer id;
String name;
String tlf;
Modified: branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/Customer.java
===================================================================
--- branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/Customer.java 2010-09-16 14:58:34 UTC (rev 108174)
+++ branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/Customer.java 2010-09-16 16:30:55 UTC (rev 108175)
@@ -40,6 +40,7 @@
@Cache (usage=CacheConcurrencyStrategy.TRANSACTIONAL)
public class Customer implements java.io.Serializable
{
+ private static final long serialVersionUID = 3289138503743125307L;
Integer id;
String name;
Modified: branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/EntityTest.java
===================================================================
--- branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/EntityTest.java 2010-09-16 14:58:34 UTC (rev 108174)
+++ branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/EntityTest.java 2010-09-16 16:30:55 UTC (rev 108175)
@@ -31,7 +31,7 @@
*/
public interface EntityTest
{
- void getCache(String cacheConfigName);
+ void getCache(String regionPrefix);
Customer createCustomer();
Modified: branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/EntityTestBean.java
===================================================================
--- branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/EntityTestBean.java 2010-09-16 14:58:34 UTC (rev 108174)
+++ branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/EntityTestBean.java 2010-09-16 16:30:55 UTC (rev 108175)
@@ -22,16 +22,18 @@
package org.jboss.test.cluster.clusteredentity;
import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
import java.util.Set;
import java.util.concurrent.ConcurrentSkipListSet;
-import javax.annotation.PreDestroy;
import javax.ejb.Remote;
import javax.ejb.Remove;
import javax.ejb.Stateful;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
+import org.infinispan.Cache;
import org.infinispan.manager.EmbeddedCacheManager;
import org.infinispan.notifications.Listener;
import org.infinispan.notifications.cachelistener.annotation.CacheEntryVisited;
@@ -49,6 +51,7 @@
@Stateful
@Remote(EntityTest.class)
@RemoteBinding(jndiBinding="EntityTestBean/remote")
+ at Listener
public class EntityTestBean implements EntityTest
{
private static final Logger log = Logger.getLogger(EntityTestBean.class);
@@ -56,24 +59,18 @@
@PersistenceContext
private EntityManager manager;
- private transient MyListener listener;
-
- public EntityTestBean()
- {
- }
+ private List<Cache<?, ?>> caches = new LinkedList<Cache<?, ?>>();
- public void getCache(String cacheConfigName)
+ public void getCache(String regionPrefix)
{
- if (listener == null)
+ EmbeddedCacheManager container = DefaultCacheContainerRegistry.getInstance().getCacheContainer("entity");
+ for (String cacheName: container.getCacheNames())
{
- listener = new MyListener();
- EmbeddedCacheManager container = DefaultCacheContainerRegistry.getInstance().getCacheContainer("entity");
- for (String cacheName: container.getCacheNames())
+ if (cacheName.startsWith(regionPrefix))
{
- if (cacheName.startsWith("persistence.unit"))
- {
- container.getCache(cacheName).addListener(listener);
- }
+ Cache<?, ?> cache = container.getCache(cacheName);
+ cache.addListener(this);
+ caches.add(cache);
}
}
}
@@ -83,7 +80,7 @@
System.out.println("CREATE CUSTOMER");
try
{
- listener.clear();
+ this.clear();
Customer customer = new Customer();
customer.setId(new Integer(1));
@@ -126,11 +123,10 @@
public Customer findByCustomerId(Integer id)
{
System.out.println("FIND CUSTOMER");
- listener.clear();
+ this.clear();
try
{
Customer customer = manager.find(Customer.class, id);
-
return customer;
}
catch (RuntimeException e)
@@ -152,14 +148,14 @@
System.out.println("CHECK CACHE");
try
{
- System.out.println("Visited: " + listener.visited);
- if (!listener.visited.contains("Customer#1"))
+ System.out.println("Visited: " + this.visited);
+ if (!this.visited.contains("Customer#1"))
return "Customer#1 was not in cache";
- if (!listener.visited.contains("Contact#1"))
+ if (!this.visited.contains("Contact#1"))
return "Contact#1 was not in cache";
- if (!listener.visited.contains("Contact#2"))
- return "Contact2#1 was not in cache";
- if (!listener.visited.contains("Customer.contacts#1"))
+ if (!this.visited.contains("Contact#2"))
+ return "Contact#2 was not in cache";
+ if (!this.visited.contains("Customer.contacts#1"))
return "Customer.contacts#1 was not in cache";
return null;
}
@@ -170,13 +166,12 @@
}
- @PreDestroy
@Remove
public void cleanup()
{
- if (listener != null)
+ for (Cache<?, ?> cache: caches)
{
- DefaultCacheContainerRegistry.getInstance().getCacheContainer("entity").removeListener(listener);
+ cache.removeListener(this);
}
try
@@ -188,7 +183,7 @@
{
for (Contact contact: c.getContacts())
{
- manager.refresh(contact);
+ manager.remove(contact);
}
c.setContacts(null);
manager.remove(c);
@@ -201,9 +196,9 @@
}
}
- @Listener
- public class MyListener
- {
+// @Listener
+// public static class MyListener
+// {
Set<String> visited = new ConcurrentSkipListSet<String>();
public void clear()
@@ -216,10 +211,18 @@
{
if (!event.isPre())
{
- String region = event.getCache().getName();
- System.out.println("MyListener - recording visit to " + region);
- visited.add(region);
+ String key = event.getKey().toString();
+ System.out.println("MyListener - Visiting node " + key);
+ String token = ".clusteredentity.";
+ int index = key.indexOf(token);
+ if (index > -1)
+ {
+ index += token.length();
+ String name = key.substring(index);
+ System.out.println("MyListener - recording visit to " + name);
+ visited.add(name);
+ }
}
}
- }
+// }
}
Modified: branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/classloader/EntityQueryTest.java
===================================================================
--- branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/classloader/EntityQueryTest.java 2010-09-16 14:58:34 UTC (rev 108174)
+++ branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/classloader/EntityQueryTest.java 2010-09-16 16:30:55 UTC (rev 108175)
@@ -29,7 +29,7 @@
*/
public interface EntityQueryTest
{
- public abstract void getCache(boolean optimistic);
+ public abstract void getCache(String regionPrefix);
// public abstract void createAccountHolder(AccountHolderPK pk, String postCode);
Modified: branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/classloader/EntityQueryTestBean.java
===================================================================
--- branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/classloader/EntityQueryTestBean.java 2010-09-16 14:58:34 UTC (rev 108174)
+++ branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/classloader/EntityQueryTestBean.java 2010-09-16 16:30:55 UTC (rev 108175)
@@ -24,6 +24,7 @@
import java.util.List;
import java.util.Set;
import java.util.concurrent.ConcurrentSkipListSet;
+import java.util.concurrent.CopyOnWriteArrayList;
import javax.annotation.PreDestroy;
import javax.ejb.Remote;
@@ -33,6 +34,7 @@
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
+import org.infinispan.Cache;
import org.infinispan.manager.EmbeddedCacheManager;
import org.infinispan.notifications.Listener;
import org.infinispan.notifications.cachelistener.annotation.CacheEntryCreated;
@@ -56,6 +58,7 @@
@Stateful
@Remote(EntityQueryTest.class)
@RemoteBinding(jndiBinding="EntityQueryTestBean/remote")
+ at Listener(sync = false)
public class EntityQueryTestBean implements EntityQueryTest
{
private static final Logger log = Logger.getLogger(EntityQueryTestBean.class);
@@ -63,28 +66,27 @@
@PersistenceContext
private EntityManager manager;
- private MyListener listener;
+ private List<Cache<?, ?>> caches = new CopyOnWriteArrayList<Cache<?, ?>>();
public EntityQueryTestBean()
{
}
- public void getCache(boolean optimistic)
+ public void getCache(String regionPrefix)
{
try
{
- listener = new MyListener();
- log.info("Adding cache manager listener to entity cache container");
EmbeddedCacheManager container = DefaultCacheContainerRegistry.getInstance().getCacheContainer("entity");
- container.addListener(listener);
for (String cacheName: container.getCacheNames())
{
- if (cacheName.startsWith("persistence.unit"))
+ if (cacheName.startsWith(regionPrefix))
{
- log.info("Adding cache listener to " + cacheName + " cache");
- container.getCache(cacheName).addListener(listener);
+ Cache<?, ?> cache = container.getCache(cacheName);
+ cache.addListener(this);
+ caches.add(cache);
}
}
+ container.addListener(this);
}
catch (Exception e)
{
@@ -217,12 +219,12 @@
public boolean getSawRegionModification(String regionName)
{
- return listener.modified.remove(regionName);
+ return this.modified.remove(regionName);
}
public boolean getSawRegionAccess(String regionName)
{
- return listener.accessed.remove(regionName);
+ return this.accessed.remove(regionName);
}
public void cleanup()
@@ -266,8 +268,13 @@
try
{
- listener.clear();
- DefaultCacheContainerRegistry.getInstance().getCacheContainer("entity").removeListener(listener);
+ this.clear();
+ for (Cache<?, ?> cache: this.caches)
+ {
+ cache.removeListener(this);
+ }
+ this.caches.clear();
+ DefaultCacheContainerRegistry.getInstance().getCacheContainer("entity").removeListener(this);
}
catch (Exception e)
{
@@ -275,12 +282,18 @@
}
}
- @Listener
- public static class MyListener
- {
+// @Listener
+// public static class MyListener
+// {
Set<String> modified = new ConcurrentSkipListSet<String>();
Set<String> accessed = new ConcurrentSkipListSet<String>();
+// private Collection<Cache<?, ?>> caches;
+// public MyListener(Collection<Cache<?, ?>> caches)
+// {
+// this.caches = caches;
+// }
+
public void clear()
{
modified.clear();
@@ -290,8 +303,10 @@
@CacheStarted
public void cacheStarted(CacheStartedEvent event)
{
- log.info("Adding cache listener to " + event.getCacheName() + " cache (via CacheStarted event)");
- event.getCacheManager().getCache(event.getCacheName()).addListener(this);
+ Cache<?, ?> cache = event.getCacheManager().getCache(event.getCacheName());
+ System.out.println("Adding cache listener for " + event.getCacheName());
+ cache.addListener(this);
+ this.caches.add(cache);
}
@CacheEntryModified
@@ -326,5 +341,5 @@
accessed.add(region);
}
}
- }
+// }
}
Modified: branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/embeddedid/EmbeddedIdTestBean.java
===================================================================
--- branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/embeddedid/EmbeddedIdTestBean.java 2010-09-16 14:58:34 UTC (rev 108174)
+++ branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/clusteredentity/embeddedid/EmbeddedIdTestBean.java 2010-09-16 16:30:55 UTC (rev 108175)
@@ -22,10 +22,8 @@
package org.jboss.test.cluster.clusteredentity.embeddedid;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
-import javax.annotation.PreDestroy;
import javax.ejb.Remote;
import javax.ejb.Remove;
import javax.ejb.Stateful;
@@ -66,14 +64,12 @@
: "musician.byinstrument.default";
Query query = manager.createNamedQuery(queryName);
query.setParameter(1, instrument);
- List<MusicianPK> result = new ArrayList<MusicianPK>();
- List users = query.getResultList();
- if (users != null)
+ @SuppressWarnings("unchecked")
+ List<Musician> musicians = query.getResultList();
+ List<MusicianPK> result = new ArrayList<MusicianPK>(musicians.size());
+ for (Musician musician: musicians)
{
- for (Iterator it = users.iterator(); it.hasNext();)
- {
- result.add(((Musician) it.next()).getId());
- }
+ result.add(musician.getId());
}
return result;
}
@@ -91,24 +87,20 @@
if (manager != null)
{
Query query = manager.createQuery("select musician from Musician as musician");
- List accts = query.getResultList();
- if (accts != null)
+ @SuppressWarnings("unchecked")
+ List<Musician> musicians = query.getResultList();
+ for (Musician musician: musicians)
{
- for (Iterator it = accts.iterator(); it.hasNext();)
+ try
{
- try
- {
- Musician musician = (Musician) it.next();
- log.info("Removing " + musician);
- manager.remove(musician);
- }
- catch (Exception ignored) {}
+ log.info("Removing " + musician);
+ manager.remove(musician);
}
+ catch (Exception ignored) {}
}
}
}
- @PreDestroy
@Remove
public void remove()
{
Modified: branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/EntityClassloaderTestBase.java
===================================================================
--- branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/EntityClassloaderTestBase.java 2010-09-16 14:58:34 UTC (rev 108174)
+++ branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/EntityClassloaderTestBase.java 2010-09-16 16:30:55 UTC (rev 108175)
@@ -92,11 +92,11 @@
log.info("Lookup sfsb from " + nodeJNDIAddress);
EntityQueryTest eqt = (EntityQueryTest) ctx.lookup("EntityQueryTestBean/remote");
- eqt.getCache(isOptimistic());
+ eqt.getCache(this.getRegionPrefix());
return eqt;
}
-
+
protected void tearDown() throws Exception
{
if (sfsb0 != null)
@@ -105,7 +105,10 @@
{
sfsb0.remove(true);
}
- catch (Exception e) {}
+ catch (Exception e)
+ {
+ e.printStackTrace(System.err);
+ }
}
if (sfsb1 != null)
{
@@ -113,7 +116,10 @@
{
sfsb1.remove(true);
}
- catch (Exception e) {}
+ catch (Exception e)
+ {
+ e.printStackTrace(System.err);
+ }
}
sfsb0 = sfsb1 = null;
@@ -200,9 +206,13 @@
protected void queryTest(boolean setupEntities, boolean useNamedQuery, boolean useNamedRegion, boolean expectInactivatedRegion, boolean localOnly)
{
if (setupEntities)
+ {
standardEntitySetup();
+ }
else
+ {
restoreEntities(sfsb0);
+ }
resetRegionUsageState();
@@ -226,9 +236,7 @@
// If region is activated and cache isn't localOnly, replication should have been modified
boolean modifiedRemotely = sfsb1.getSawRegionModification(regionName);
- assertEquals("Query cache remotely modified " + regionName,
- !expectInactivatedRegion && !localOnly,
- modifiedRemotely);
+ assertEquals("Query cache remotely modified " + regionName, !expectInactivatedRegion && !localOnly, modifiedRemotely);
// Clear the access state
sfsb1.getSawRegionAccess(regionName);
@@ -237,8 +245,7 @@
if (!modifiedRemotely)
{
// If not replicated before, local query should have cached it
- assertTrue("Query cache modified " + regionName,
- sfsb1.getSawRegionModification(regionName));
+ assertTrue("Query cache modified " + regionName, sfsb1.getSawRegionModification(regionName));
// Clear the access state
sfsb1.getSawRegionAccess(regionName);
}
@@ -278,8 +285,7 @@
// First check if the previous queries replicated (if the region is replicable)
modifiedRemotely = sfsb1.getSawRegionModification(regionName);
- assertEquals("Query cache remotely modified " + regionName,
- !localOnly, modifiedRemotely);
+ assertEquals("Query cache remotely modified " + regionName, !localOnly, modifiedRemotely);
// Clear the access state
sfsb1.getSawRegionAccess(regionName);
@@ -290,8 +296,7 @@
if (!modifiedRemotely)
{
// If not replicated before, local query should have cached it
- assertTrue("Query cache modified " + regionName,
- sfsb1.getSawRegionModification(regionName));
+ assertTrue("Query cache modified " + regionName, sfsb1.getSawRegionModification(regionName));
// Clear the access state
sfsb1.getSawRegionAccess(regionName);
}
@@ -332,12 +337,16 @@
}
}
+ protected String getRegionPrefix()
+ {
+ return createCacheRegionPrefix(getEarName(), getJarName(), getPersistenceUnitName());
+ }
+
protected String createRegionName(String noPrefix)
{
- String prefix = createCacheRegionPrefix(getEarName(), getJarName(), getPersistenceUnitName());
- return prefix + "." + noPrefix;
+ return this.getRegionPrefix() + "." + noPrefix;
}
-
+
protected String getEarName()
{
return EAR_NAME;
Modified: branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/EntityQueryRedeployUnitTestCase.java
===================================================================
--- branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/EntityQueryRedeployUnitTestCase.java 2010-09-16 14:58:34 UTC (rev 108174)
+++ branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/EntityQueryRedeployUnitTestCase.java 2010-09-16 16:30:55 UTC (rev 108175)
@@ -60,6 +60,7 @@
{
// Get rid of our old sfsb and make sure its listener is removed from cache
sfsb1.remove(false);
+ sfsb1 = null;
MBeanServerConnection[] adaptors = getAdaptors();
undeploy(adaptors[1], getEarName() + ".ear");
Modified: branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/EntityUnitTestCase.java
===================================================================
--- branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/EntityUnitTestCase.java 2010-09-16 14:58:34 UTC (rev 108174)
+++ branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/EntityUnitTestCase.java 2010-09-16 16:30:55 UTC (rev 108175)
@@ -117,12 +117,13 @@
InitialContext ctx1 = new InitialContext(prop1);
tester1 = (EntityTest)ctx1.lookup("EntityTestBean/remote");
- tester0.getCache(getCacheConfigName());
+ tester0.getCache("persistence.unit");
+ tester1.getCache("persistence.unit");
Customer customer = tester0.createCustomer();
//Call finder twice since Hibernate seems to not actually save collections
- //into cache on persist(), so make sure it is put into cache on find.
+ //into cache on persist(), so make sure it is put into cache on find.
System.out.println("Find node 0");
customer = tester0.findByCustomerId(customer.getId());
System.out.println("Find(2) node 0");
@@ -130,15 +131,7 @@
//Check everything was in cache
System.out.println("Check cache 0");
- try
- {
- tester0.loadedFromCache();
- }
- catch (Exception e)
- {
- log.info("Call to tester0 failed", e);
- fail(e.getMessage());
- }
+ assertEquals(null, tester0.loadedFromCache());
// The above placement of the collection in the cache is replicated async
// so pause a bit before checking node 1
@@ -146,8 +139,6 @@
//Now connect to cache on node2 and make sure it is all there
- tester1.getCache(getCacheConfigName());
-
System.out.println("Find node 1");
customer = tester1.findByCustomerId(customer.getId());
Modified: branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/ProvidedPrefixEntityQueryUnitTestCase.java
===================================================================
--- branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/ProvidedPrefixEntityQueryUnitTestCase.java 2010-09-16 14:58:34 UTC (rev 108174)
+++ branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/test/ProvidedPrefixEntityQueryUnitTestCase.java 2010-09-16 16:30:55 UTC (rev 108175)
@@ -51,9 +51,9 @@
}
@Override
- protected String createRegionName(String noPrefix)
+ protected String getRegionPrefix()
{
- return PROVIDED_PREFIX + "." + noPrefix;
+ return PROVIDED_PREFIX;
}
@Override
More information about the jboss-cvs-commits
mailing list