JBoss Cache SVN: r7570 - core/trunk/src/main/java/org/jboss/cache/interceptors.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2009-01-22 11:36:26 -0500 (Thu, 22 Jan 2009)
New Revision: 7570
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java
Log:
Better debug messages
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java 2009-01-22 11:31:35 UTC (rev 7569)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java 2009-01-22 16:36:26 UTC (rev 7570)
@@ -711,7 +711,17 @@
}
else
{
- if (trace) log.trace("Transaction " + tx + " is already registered.");
+ if (trace)
+ {
+ if (TransactionTable.isValid(tx))
+ {
+ log.trace("Transaction " + tx + " is already registered.");
+ }
+ else
+ {
+ log.trace("Transaction " + tx + " is not valid! Status: " + tx.getStatus());
+ }
+ }
}
return gtx;
}
@@ -1154,4 +1164,4 @@
{
return transactions.size();
}
-}
\ No newline at end of file
+}
15 years, 11 months
JBoss Cache SVN: r7569 - in searchable/trunk: src/main/java/org/jboss/cache/search and 1 other directories.
by jbosscache-commits@lists.jboss.org
Author: navssurtani
Date: 2009-01-22 06:31:35 -0500 (Thu, 22 Jan 2009)
New Revision: 7569
Modified:
searchable/trunk/pom.xml
searchable/trunk/src/main/java/org/jboss/cache/search/PojoTransactionContext.java
searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheFactory.java
searchable/trunk/src/main/java/org/jboss/cache/search/SearchablePojoListener.java
searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalPOJOCacheTest.java
Log:
Playing with pojo
Modified: searchable/trunk/pom.xml
===================================================================
--- searchable/trunk/pom.xml 2009-01-22 10:31:05 UTC (rev 7568)
+++ searchable/trunk/pom.xml 2009-01-22 11:31:35 UTC (rev 7569)
@@ -25,7 +25,7 @@
<dependency>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-core</artifactId>
- <version>3.0.1.GA</version>
+ <version>3.0.2.GA</version>
</dependency>
<dependency>
@@ -40,14 +40,13 @@
<version>1.1.1</version>
</dependency>
-<!--
- Temporarily commented out until the searchable cache is compatible with pojo cache
-
+
+
<dependency>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-pojo</artifactId>
<version>3.0.0.GA</version>
- </dependency> -->
+ </dependency>
<!-- Test dependencies -->
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/PojoTransactionContext.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/PojoTransactionContext.java 2009-01-22 10:31:05 UTC (rev 7568)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/PojoTransactionContext.java 2009-01-22 11:31:35 UTC (rev 7569)
@@ -1,72 +1,72 @@
-///*
-// * JBoss, Home of Professional Open Source
-// * Copyright ${year}, Red Hat Middleware LLC, and individual contributors
-// * by the @authors tag. See the copyright.txt 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.search;
-//
-//import org.hibernate.search.backend.TransactionContext;
-//import org.jboss.cache.pojo.notification.event.Event;
-//
-//import javax.transaction.Synchronization;
-//import javax.transaction.Transaction;
-//
-///**
-// * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
-// */
-//public class PojoTransactionContext implements TransactionContext
-//{
-// Event event;
-//
-// public PojoTransactionContext(Event event)
-// {
-// if (event == null) throw new NullPointerException("event cannot be null");
-// this.event = event;
-//
-// }
-// public boolean isTransactionInProgress()
-// {
-// return (event.getContext().getTransaction() != null);
-//
-// }
-//
-// public Object getTransactionIdentifier()
-// {
-// return event.getContext().getTransaction();
-// }
-//
-// public void registerSynchronization(Synchronization synchronization)
-// {
-// Transaction transaction = event.getContext().getTransaction();
-//
-// if (transaction != null)
-// {
-//
-// try
-// {
-// transaction.registerSynchronization(synchronization);
-// }
-// catch (Exception e)
-// {
-// throw new RuntimeException(e);
-// }
-// }
-// }
-//}
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt 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.search;
+
+import org.hibernate.search.backend.TransactionContext;
+import org.jboss.cache.pojo.notification.event.Event;
+
+import javax.transaction.Synchronization;
+import javax.transaction.Transaction;
+
+/**
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
+ */
+public class PojoTransactionContext implements TransactionContext
+{
+ Event event;
+
+ public PojoTransactionContext(Event event)
+ {
+ if (event == null) throw new NullPointerException("event cannot be null");
+ this.event = event;
+
+ }
+ public boolean isTransactionInProgress()
+ {
+ return (event.getContext().getTransaction() != null);
+
+ }
+
+ public Object getTransactionIdentifier()
+ {
+ return event.getContext().getTransaction();
+ }
+
+ public void registerSynchronization(Synchronization synchronization)
+ {
+ Transaction transaction = event.getContext().getTransaction();
+
+ if (transaction != null)
+ {
+
+ try
+ {
+ transaction.registerSynchronization(synchronization);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+}
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheFactory.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheFactory.java 2009-01-22 10:31:05 UTC (rev 7568)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheFactory.java 2009-01-22 11:31:35 UTC (rev 7569)
@@ -27,6 +27,7 @@
import org.hibernate.search.engine.SearchFactoryImplementor;
import org.jboss.cache.Cache;
import org.jboss.cache.CacheStatus;
+import org.jboss.cache.pojo.PojoCache;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -105,64 +106,64 @@
}
-// /**
-// * This method creates a searchable cache as well but requires the properties object.
-// *
-// * @param pojo - the pojoCache
-// * @param properties - java.util.properties
-// * @param classes - a class array
-// * @return a SearchableCache
-// */
+ /**
+ * This method creates a searchable cache as well but requires the properties object.
+ *
+ * @param pojo - the pojoCache
+ * @param properties - java.util.properties
+ * @param classes - a class array
+ * @return a SearchableCache
+ */
-// public SearchableCache createSearchableCache(PojoCache pojo, Properties properties, Class... classes)
-// {
-//
-// System.out.println("create searchable cache called with pojo cache");
-// //TODO: Ask Manik and/or Jason if there is a way to directly check if the pojo cache is started or not
-// validateClasses(classes);
-//
-// Cache coreCache = pojo.getCache();
-//
-// if (coreCache.getCacheStatus() != CacheStatus.STARTED)
-// {
-// if (log.isInfoEnabled()) log.info("Cache not started. Starting cache first.");
-// pojo.start();
-// }
-//
-// if (classes.length == 0)
-// {
-// if (log.isWarnEnabled()) log.warn("You haven't passed in any classes to index. Is this an error?");
-// }
-//
-// // step 1: create hibernate search searchFactory
-// SearchConfiguration cfg = new SearchableCacheConfiguration(classes, properties);
-// // set classes in the cfg
-//
-// SearchFactoryImplementor searchFactory = new SearchFactoryImpl(cfg);
-//
-// //Now create the pojoListener
-// SearchablePojoListener pojoListener = new SearchablePojoListener(searchFactory);
-// pojo.addListener(pojoListener);
-// pojo.getCache().addCacheListener(pojoListener);
-//
-// SearchableCache sc = new SearchableCacheImpl(coreCache, searchFactory);
-// return sc;
-// }
+ public SearchableCache createSearchableCache(PojoCache pojo, Properties properties, Class... classes)
+ {
-// /**
-// * Creates a searchable cache from a cache object and a class array, without the properties object.
-// *
-// * @param pojo - the pojoCache
-// * @param classes - Class array to be added
-// * @return a SearchableCache
-// */
-//
-//
-// public SearchableCache createSearchableCache(PojoCache pojo, Class... classes)
-// {
-// return createSearchableCache(pojo, null, classes);
-// }
+ System.out.println("create searchable cache called with pojo cache");
+ //TODO: Ask Manik and/or Jason if there is a way to directly check if the pojo cache is started or not
+ validateClasses(classes);
+ Cache coreCache = pojo.getCache();
+
+ if (coreCache.getCacheStatus() != CacheStatus.STARTED)
+ {
+ if (log.isInfoEnabled()) log.info("Cache not started. Starting cache first.");
+ pojo.start();
+ }
+
+ if (classes.length == 0)
+ {
+ if (log.isWarnEnabled()) log.warn("You haven't passed in any classes to index. Is this an error?");
+ }
+
+ // step 1: create hibernate search searchFactory
+ SearchConfiguration cfg = new SearchableCacheConfiguration(classes, properties);
+ // set classes in the cfg
+
+ SearchFactoryImplementor searchFactory = new SearchFactoryImpl(cfg);
+
+ //Now create the pojoListener
+ SearchablePojoListener pojoListener = new SearchablePojoListener(searchFactory);
+ pojo.addListener(pojoListener);
+ pojo.getCache().addCacheListener(pojoListener);
+
+ SearchableCache sc = new SearchableCacheImpl(coreCache, searchFactory);
+ return sc;
+ }
+
+ /**
+ * Creates a searchable cache from a cache object and a class array, without the properties object.
+ *
+ * @param pojo - the pojoCache
+ * @param classes - Class array to be added
+ * @return a SearchableCache
+ */
+
+
+ public SearchableCache createSearchableCache(PojoCache pojo, Class... classes)
+ {
+ return createSearchableCache(pojo, null, classes);
+ }
+
//This is to check that both the @ProvidedId is present and the the @DocumentId is not present. This is because
// don't want both of these 2 annotations used at the same time.
private void validateClasses(Class... classes)
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/SearchablePojoListener.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/SearchablePojoListener.java 2009-01-22 10:31:05 UTC (rev 7568)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/SearchablePojoListener.java 2009-01-22 11:31:35 UTC (rev 7569)
@@ -1,156 +1,156 @@
-///*
-// * JBoss, Home of Professional Open Source
-// * Copyright ${year}, Red Hat Middleware LLC, and individual contributors
-// * by the @authors tag. See the copyright.txt 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.search;
-//
-//import org.hibernate.search.impl.SearchFactoryImpl;
-//import org.hibernate.search.backend.TransactionContext;
-//import org.hibernate.search.backend.Work;
-//import org.hibernate.search.backend.WorkType;
-//import org.hibernate.search.engine.SearchFactoryImplementor;
-//import org.jboss.cache.notifications.event.NodeModifiedEvent;
-//import org.jboss.cache.notifications.event.NodeCreatedEvent;
-//import org.jboss.cache.notifications.annotation.NodeModified;
-//import org.jboss.cache.notifications.annotation.CacheListener;
-//import org.jboss.cache.notifications.annotation.NodeCreated;
-//import org.jboss.cache.pojo.notification.annotation.*;
-//import org.jboss.cache.pojo.notification.event.AttachedEvent;
-//import org.jboss.cache.pojo.notification.event.DetachedEvent;
-//import org.jboss.cache.pojo.notification.event.Event;
-//import org.jboss.cache.pojo.notification.NotificationContext;
-//import org.jboss.cache.pojo.PojoCache;
-//import org.jboss.cache.pojo.impl.InternalHelper;
-//import org.jboss.cache.Fqn;
-//import org.apache.commons.logging.Log;
-//import org.apache.commons.logging.LogFactory;
-//
-//import javax.transaction.Transaction;
-//
-///**
-// * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
-// */
-//
-//@PojoCacheListener
-//@CacheListener
-//public class SearchablePojoListener
-//{
-// private SearchFactoryImplementor searchFactory;
-// private static final Log log = LogFactory.getLog(SearchablePojoListener.class);
-// private String pojoKey = "pojoKey";
-//
-// private ThreadLocal<Fqn> savedFqn = new ThreadLocal<Fqn>();
-//
-// public SearchablePojoListener(SearchFactoryImplementor searchFactory)
-// {
-// this.searchFactory = searchFactory;
-// }
-//
-// @NodeModified
-// public void handleNodeModified(NodeModifiedEvent nme)
-// {
-// if (!nme.isPre()) return;
-// Fqn f = nme.getFqn();
-// if(log.isDebugEnabled()) log.debug("Node modified called for Fqn " + f);
-// if (InternalHelper.isInternalNode(f))
-// {
-// if(log.isDebugEnabled()) log.debug("Is internal and I dont care");
-// }
-// else
-// {
-// savedFqn.set(f);
-// if(log.isDebugEnabled()) log.debug("Saved Fqn to ThreadLocal.");
-// }
-// }
-//
-// @NodeCreated
-// public void handleNodeKreated(NodeCreatedEvent nce)
-// {
-// if (!nce.isPre()) return;
-// Fqn f = nce.getFqn();
-// if(log.isDebugEnabled()) log.debug("Node kreated called for Fqn " + f);
-// if (InternalHelper.isInternalNode(f))
-// {
-// if(log.isDebugEnabled()) log.debug("Is internal and I dont care");
-// }
-// else
-// {
-// savedFqn.set(f);
-// if(log.isDebugEnabled()) log.debug("savedFqn.set() called");
-// }
-// }
-//
-// /**
-// * Takes in a NodeModifiedEvent and updates the Lucene indexes using methods on the NodeModifiedEvent class.
-// *
-// * @param event that has occured - or a node that has been changed. {@link org.jboss.cache.notifications.event.NodeModifiedEvent}
-// * @throws InvalidKeyException if an invalid key is given.
-// */
-//
-// @Attached
-// public void handleAttach(AttachedEvent event) throws InvalidKeyException
-// {
-// System.out.println("Pojocache.attach() called");
-// Object added = event.getSource();
-//
-// System.out.println("the object is " + event.toString());
-//
-// NotificationContext notificationContext = event.getContext();
-// System.out.println("notificationContext is " + notificationContext);
-//
-// PojoCache pojo = notificationContext.getPojoCache();
-// System.out.println("pojo is " + pojo);
-//
-//// Fqn fqn = pojo.getInternalFqn(added);
-// Fqn fqn = savedFqn.get();
-// savedFqn.remove();
-// System.out.println("Fqn is " + fqn);
-//
-//
-// CacheEntityId cacheEntityId = new CacheEntityId(fqn, pojoKey);
-// System.out.println("new CEI created" + cacheEntityId);
-//
-// TransactionContext ctx = new PojoTransactionContext(event);
-// System.out.println("new ctx created" + ctx);
-//
-// searchFactory.getWorker().performWork(new Work(added, cacheEntityId.getDocumentId(), WorkType.ADD), ctx);
-// }
-//
-// @Detached
-// public void handleDetach(DetachedEvent event) throws InvalidKeyException
-// {
-// Object deleted = event.getSource();
-// Fqn fqn = event.getContext().getPojoCache().getInternalFqn(deleted);
-//
-// CacheEntityId cacheEntityId = new CacheEntityId(fqn, pojoKey);
-//
-// TransactionContext ctx = new PojoTransactionContext(event);
-//
-// searchFactory.getWorker().performWork(new Work(deleted, cacheEntityId.getDocumentId(), WorkType.DELETE), ctx);
-// }
-//
-// //TODO: Sort out updating Lucene for the following annotations: -
-//// @FieldModified
-//// @ListModified
-//// @ArrayModified
-//// @SetModified
-//
-//}
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt 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.search;
+
+import org.hibernate.search.impl.SearchFactoryImpl;
+import org.hibernate.search.backend.TransactionContext;
+import org.hibernate.search.backend.Work;
+import org.hibernate.search.backend.WorkType;
+import org.hibernate.search.engine.SearchFactoryImplementor;
+import org.jboss.cache.notifications.event.NodeModifiedEvent;
+import org.jboss.cache.notifications.event.NodeCreatedEvent;
+import org.jboss.cache.notifications.annotation.NodeModified;
+import org.jboss.cache.notifications.annotation.CacheListener;
+import org.jboss.cache.notifications.annotation.NodeCreated;
+import org.jboss.cache.pojo.notification.annotation.*;
+import org.jboss.cache.pojo.notification.event.AttachedEvent;
+import org.jboss.cache.pojo.notification.event.DetachedEvent;
+import org.jboss.cache.pojo.notification.event.Event;
+import org.jboss.cache.pojo.notification.NotificationContext;
+import org.jboss.cache.pojo.PojoCache;
+import org.jboss.cache.pojo.impl.InternalHelper;
+import org.jboss.cache.Fqn;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.transaction.Transaction;
+
+/**
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
+ */
+
+@PojoCacheListener
+@CacheListener
+public class SearchablePojoListener
+{
+ private SearchFactoryImplementor searchFactory;
+ private static final Log log = LogFactory.getLog(SearchablePojoListener.class);
+ private String pojoKey = "pojoKey";
+
+ private ThreadLocal<Fqn> savedFqn = new ThreadLocal<Fqn>();
+
+ public SearchablePojoListener(SearchFactoryImplementor searchFactory)
+ {
+ this.searchFactory = searchFactory;
+ }
+
+ @NodeModified
+ public void handleNodeModified(NodeModifiedEvent nme)
+ {
+ if (!nme.isPre()) return;
+ Fqn f = nme.getFqn();
+ if(log.isDebugEnabled()) log.debug("Node modified called for Fqn " + f);
+ if (InternalHelper.isInternalNode(f))
+ {
+ if(log.isDebugEnabled()) log.debug("Is internal and I dont care");
+ }
+ else
+ {
+ savedFqn.set(f);
+ if(log.isDebugEnabled()) log.debug("Saved Fqn to ThreadLocal.");
+ }
+ }
+
+ @NodeCreated
+ public void handleNodeKreated(NodeCreatedEvent nce)
+ {
+ if (!nce.isPre()) return;
+ Fqn f = nce.getFqn();
+ if(log.isDebugEnabled()) log.debug("Node kreated called for Fqn " + f);
+ if (InternalHelper.isInternalNode(f))
+ {
+ if(log.isDebugEnabled()) log.debug("Is internal and I dont care");
+ }
+ else
+ {
+ savedFqn.set(f);
+ if(log.isDebugEnabled()) log.debug("savedFqn.set() called");
+ }
+ }
+
+ /**
+ * Takes in a NodeModifiedEvent and updates the Lucene indexes using methods on the NodeModifiedEvent class.
+ *
+ * @param event that has occured - or a node that has been changed. {@link org.jboss.cache.notifications.event.NodeModifiedEvent}
+ * @throws InvalidKeyException if an invalid key is given.
+ */
+
+ @Attached
+ public void handleAttach(AttachedEvent event) throws InvalidKeyException
+ {
+ System.out.println("Pojocache.attach() called");
+ Object added = event.getSource();
+
+ System.out.println("the object is " + event.toString());
+
+ NotificationContext notificationContext = event.getContext();
+ System.out.println("notificationContext is " + notificationContext);
+
+ PojoCache pojo = notificationContext.getPojoCache();
+ System.out.println("pojo is " + pojo);
+
+// Fqn fqn = pojo.getInternalFqn(added);
+ Fqn fqn = savedFqn.get();
+ savedFqn.remove();
+ System.out.println("Fqn is " + fqn);
+
+
+ CacheEntityId cacheEntityId = new CacheEntityId(fqn, pojoKey);
+ System.out.println("new CEI created " + cacheEntityId);
+
+ TransactionContext ctx = new PojoTransactionContext(event);
+ System.out.println("new ctx created " + ctx);
+
+ searchFactory.getWorker().performWork(new Work(added, cacheEntityId.getDocumentId(), WorkType.ADD), ctx);
+ }
+
+ @Detached
+ public void handleDetach(DetachedEvent event) throws InvalidKeyException
+ {
+ Object deleted = event.getSource();
+ Fqn fqn = event.getContext().getPojoCache().getInternalFqn(deleted);
+
+ CacheEntityId cacheEntityId = new CacheEntityId(fqn, pojoKey);
+
+ TransactionContext ctx = new PojoTransactionContext(event);
+
+ searchFactory.getWorker().performWork(new Work(deleted, cacheEntityId.getDocumentId(), WorkType.DELETE), ctx);
+ }
+
+ //TODO: Sort out updating Lucene for the following annotations: -
+// @FieldModified
+// @ListModified
+// @ArrayModified
+// @SetModified
+
+}
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalPOJOCacheTest.java
===================================================================
--- searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalPOJOCacheTest.java 2009-01-22 10:31:05 UTC (rev 7568)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalPOJOCacheTest.java 2009-01-22 11:31:35 UTC (rev 7569)
@@ -1,193 +1,195 @@
-//package org.jboss.cache.search.blackbox;
-//
-//import org.apache.commons.logging.Log;
-//import org.apache.commons.logging.LogFactory;
-//import org.apache.lucene.analysis.standard.StandardAnalyzer;
-//import org.apache.lucene.queryParser.ParseException;
-//import org.apache.lucene.queryParser.QueryParser;
-//import org.apache.lucene.search.Query;
-//import org.jboss.cache.Fqn;
-//import org.jboss.cache.config.Configuration;
-//import org.jboss.cache.pojo.PojoCache;
-//import org.jboss.cache.pojo.PojoCacheFactory;
-//import org.jboss.cache.search.CacheQuery;
-//import org.jboss.cache.search.SearchableCache;
-//import org.jboss.cache.search.SearchableCacheFactory;
-//import org.jboss.cache.search.QueryResultIterator;
-//import org.jboss.cache.search.helper.IndexCleanUp;
-//import org.jboss.cache.search.test.Person;
-//import org.testng.annotations.AfterMethod;
-//import org.testng.annotations.BeforeMethod;
-//import org.testng.annotations.Test;
-//
-//import java.util.List;
-//import java.util.Iterator;
-//
-///**
-// * Same as LocalCacheTest except that you will use a POJO Cache instead and use pojoCache.attach() ad pojoCache.detach()
-// * instead of cache.put() and cache.remove().
-// * <p/>
-// *
-// * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
-// */
-//
-//@Test(groups = "functional", enabled = false)
-//public class LocalPOJOCacheTest
-//{
-// SearchableCache searchableCache;
-// PojoCache pojo;
-// Person person1;
-// Person person2;
-// Person person3;
-// Person person4;
-// QueryParser queryParser;
-// Query luceneQuery;
-// CacheQuery cacheQuery;
-// List found;
-// private static final Log log = LogFactory.getLog(LocalPOJOCacheTest.class);
-//
-//
-// @BeforeMethod
-// public void setUp()
-// {
-// boolean toStart = false;
-// pojo = PojoCacheFactory.createCache(new Configuration(), toStart);
-// pojo.start(); // if toStart above is true, it will starts the cache automatically.
-// searchableCache = new SearchableCacheFactory().createSearchableCache(pojo, Person.class);
-//
-// person1 = new Person();
-// person1.setName("Navin Surtani");
-// person1.setBlurb("Likes playing WoW");
-//
-// person2 = new Person();
-// person2.setName("BigGoat");
-// person2.setBlurb("Eats grass");
-//
-// person3 = new Person();
-// person3.setName("MiniGoat");
-// person3.setBlurb("Eats cheese");
-//
-// pojo.attach("/a/b/c", person1);
-// pojo.attach("/a/b/d", person2);
-// pojo.attach("/c/a/t", person3);
-//
-//
-// }
-//
-// @AfterMethod
-// public void tearDown()
-// {
-// if (pojo != null) pojo.stop();
-// if (searchableCache != null) searchableCache.stop();
-// IndexCleanUp.cleanUpIndexes();
-// }
-//
-// public void testSimple() throws ParseException
-// {
-// queryParser = new QueryParser("blurb", new StandardAnalyzer());
-// luceneQuery = queryParser.parse("playing");
-// cacheQuery = searchableCache.createQuery(luceneQuery);
-//
-// QueryResultIterator found = cacheQuery.iterator();
-// found.first();
-// System.out.println("First object is " + found.next());
-// }
-//
-// public void testMultipleResults() throws ParseException
-// {
-// queryParser = new QueryParser("blurb", new StandardAnalyzer());
-// luceneQuery = queryParser.parse("Eats");
-// cacheQuery = searchableCache.createQuery(luceneQuery);
-// found = cacheQuery.list();
-//
-// System.out.println("size is " + found.size());
-// assert found.size() == 2;
-//
-// System.out.println("object 0 is " + found.get(0));
-// System.out.println("object 1 is " + found.get(1));
-// assert !found.get(1).equals(person2);
-// assert !found.get(0).equals(person3);
-//
-// }
-//
-// public void testModified() throws ParseException
-// {
-// queryParser = new QueryParser("blurb", new StandardAnalyzer());
-// luceneQuery = queryParser.parse("playing");
-// cacheQuery = searchableCache.createQuery(luceneQuery);
-//
-// found = cacheQuery.list();
-//
-// assert found.size() == 1;
-//// assert found.get(0).equals(person1);
-//
-// person1.setBlurb("Likes pizza");
-//
-// pojo.attach(Fqn.fromString("/a/b/c/"), person1);
-//
-// queryParser = new QueryParser("blurb", new StandardAnalyzer());
-// luceneQuery = queryParser.parse("pizza");
-// cacheQuery = searchableCache.createQuery(luceneQuery);
-//
-// found = cacheQuery.list();
-//
-// assert found.size() == 1;
-//// assert found.get(0).equals(person1);
-// }
-//
-// public void testAdded() throws ParseException
-// {
-// queryParser = new QueryParser("blurb", new StandardAnalyzer());
-// luceneQuery = queryParser.parse("eats");
-// cacheQuery = searchableCache.createQuery(luceneQuery);
-// found = cacheQuery.list();
-//
-// assert found.size() == 2 : "Size of list should be 2";
-// assert found.contains(person2);
-// assert found.contains(person3);
-// assert !found.contains(person4) : "This should not contain object person4";
-//
-// person4 = new Person();
-// person4.setName("MightyGoat");
-// person4.setBlurb("Also eats grass");
-//
-// pojo.attach(Fqn.fromString("/r/a/m/"), person4);
-//
-// luceneQuery = queryParser.parse("eats");
-// cacheQuery = searchableCache.createQuery(luceneQuery);
-// found = cacheQuery.list();
-//
-// assert found.size() == 3 : "Size of list should be 3";
-// assert found.contains(person2);
-// assert found.contains(person3);
-// assert found.contains(person4) : "This should now contain object person4";
-// }
-//
-// public void testRemoved() throws ParseException
-// {
-// queryParser = new QueryParser("blurb", new StandardAnalyzer());
-// luceneQuery = queryParser.parse("eats");
-// cacheQuery = searchableCache.createQuery(luceneQuery);
-// found = cacheQuery.list();
-//
-// assert found.size() == 2;
-// assert found.contains(person2);
-// assert found.contains(person3) : "This should still contain object person3";
-//
-// pojo.detach("/a/b/d");
-//
-// luceneQuery = queryParser.parse("eats");
-// cacheQuery = searchableCache.createQuery(luceneQuery);
-// found = cacheQuery.list();
-//
-// assert found.size() == 1;
-// assert found.contains(person2);
-// assert !found.contains(person3) : "The search should not return person3";
-//
-//
-// }
-//
-//}
-//
-//
-//
+package org.jboss.cache.search.blackbox;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.lucene.analysis.standard.StandardAnalyzer;
+import org.apache.lucene.queryParser.ParseException;
+import org.apache.lucene.queryParser.QueryParser;
+import org.apache.lucene.search.Query;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.config.Configuration;
+import org.jboss.cache.pojo.PojoCache;
+import org.jboss.cache.pojo.PojoCacheFactory;
+import org.jboss.cache.search.CacheQuery;
+import org.jboss.cache.search.SearchableCache;
+import org.jboss.cache.search.SearchableCacheFactory;
+import org.jboss.cache.search.QueryResultIterator;
+import org.jboss.cache.search.helper.IndexCleanUp;
+import org.jboss.cache.search.test.Person;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import java.util.List;
+import java.util.Iterator;
+
+/**
+ * Same as LocalCacheTest except that you will use a POJO Cache instead and use pojoCache.attach() ad pojoCache.detach()
+ * instead of cache.put() and cache.remove().
+ * <p/>
+ *
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
+ */
+
+@Test(groups = "functional", enabled = true)
+public class LocalPOJOCacheTest
+{
+ SearchableCache searchableCache;
+ PojoCache pojo;
+ Person person1;
+ Person person2;
+ Person person3;
+ Person person4;
+ QueryParser queryParser;
+ Query luceneQuery;
+ CacheQuery cacheQuery;
+ List found;
+ private static final Log log = LogFactory.getLog(LocalPOJOCacheTest.class);
+
+
+ @BeforeMethod
+ public void setUp()
+ {
+ boolean toStart = false;
+ pojo = PojoCacheFactory.createCache(new Configuration(), toStart);
+ pojo.start(); // if toStart above is true, it will starts the cache automatically.
+ searchableCache = new SearchableCacheFactory().createSearchableCache(pojo, Person.class);
+
+ person1 = new Person();
+ person1.setName("Navin Surtani");
+ person1.setBlurb("Likes playing WoW");
+
+ person2 = new Person();
+ person2.setName("BigGoat");
+ person2.setBlurb("Eats grass");
+
+ person3 = new Person();
+ person3.setName("MiniGoat");
+ person3.setBlurb("Eats cheese");
+
+ pojo.attach("/a/b/c", person1);
+ pojo.attach("/a/b/d", person2);
+ pojo.attach("/c/a/t", person3);
+
+
+ }
+
+ @AfterMethod
+ public void tearDown()
+ {
+ if (pojo != null) pojo.stop();
+ if (searchableCache != null) searchableCache.stop();
+ IndexCleanUp.cleanUpIndexes();
+ }
+
+ public void testSimple() throws ParseException
+ {
+ queryParser = new QueryParser("blurb", new StandardAnalyzer());
+ luceneQuery = queryParser.parse("eats");
+ cacheQuery = searchableCache.createQuery(luceneQuery);
+
+ found = cacheQuery.list();
+
+ System.out.println("Size of list is " + found.size());
+ System.out.println("Object 1 is " + found.get(0));
+ System.out.println("Object 2 is " + found.get(1));
+ }
+
+ public void testMultipleResults() throws ParseException
+ {
+ queryParser = new QueryParser("blurb", new StandardAnalyzer());
+ luceneQuery = queryParser.parse("Eats");
+ cacheQuery = searchableCache.createQuery(luceneQuery);
+ found = cacheQuery.list();
+
+ System.out.println("size is " + found.size());
+ assert found.size() == 2;
+
+ System.out.println("object 0 is " + found.get(0));
+ System.out.println("object 1 is " + found.get(1));
+ assert !found.get(1).equals(person2);
+ assert !found.get(0).equals(person3);
+
+ }
+
+ public void testModified() throws ParseException
+ {
+ queryParser = new QueryParser("blurb", new StandardAnalyzer());
+ luceneQuery = queryParser.parse("playing");
+ cacheQuery = searchableCache.createQuery(luceneQuery);
+
+ found = cacheQuery.list();
+
+ assert found.size() == 1;
+// assert found.get(0).equals(person1);
+
+ person1.setBlurb("Likes pizza");
+
+ pojo.attach(Fqn.fromString("/a/b/c/"), person1);
+
+ queryParser = new QueryParser("blurb", new StandardAnalyzer());
+ luceneQuery = queryParser.parse("pizza");
+ cacheQuery = searchableCache.createQuery(luceneQuery);
+
+ found = cacheQuery.list();
+
+ assert found.size() == 1;
+// assert found.get(0).equals(person1);
+ }
+
+ public void testAdded() throws ParseException
+ {
+ queryParser = new QueryParser("blurb", new StandardAnalyzer());
+ luceneQuery = queryParser.parse("eats");
+ cacheQuery = searchableCache.createQuery(luceneQuery);
+ found = cacheQuery.list();
+
+ assert found.size() == 2 : "Size of list should be 2";
+ assert found.contains(person2);
+ assert found.contains(person3);
+ assert !found.contains(person4) : "This should not contain object person4";
+
+ person4 = new Person();
+ person4.setName("MightyGoat");
+ person4.setBlurb("Also eats grass");
+
+ pojo.attach(Fqn.fromString("/r/a/m/"), person4);
+
+ luceneQuery = queryParser.parse("eats");
+ cacheQuery = searchableCache.createQuery(luceneQuery);
+ found = cacheQuery.list();
+
+ assert found.size() == 3 : "Size of list should be 3";
+ assert found.contains(person2);
+ assert found.contains(person3);
+ assert found.contains(person4) : "This should now contain object person4";
+ }
+
+ public void testRemoved() throws ParseException
+ {
+ queryParser = new QueryParser("blurb", new StandardAnalyzer());
+ luceneQuery = queryParser.parse("eats");
+ cacheQuery = searchableCache.createQuery(luceneQuery);
+ found = cacheQuery.list();
+
+ assert found.size() == 2;
+ assert found.contains(person2);
+ assert found.contains(person3) : "This should still contain object person3";
+
+ pojo.detach("/a/b/d");
+
+ luceneQuery = queryParser.parse("eats");
+ cacheQuery = searchableCache.createQuery(luceneQuery);
+ found = cacheQuery.list();
+
+ assert found.size() == 1;
+ assert found.contains(person2);
+ assert !found.contains(person3) : "The search should not return person3";
+
+
+ }
+
+}
+
+
+
15 years, 11 months
JBoss Cache SVN: r7568 - core/trunk/src/test/java/org/jboss/cache/buddyreplication.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2009-01-22 05:31:05 -0500 (Thu, 22 Jan 2009)
New Revision: 7568
Modified:
core/trunk/src/test/java/org/jboss/cache/buddyreplication/Buddy3NodesWithFailoverTest.java
Log:
more strict replication control
Modified: core/trunk/src/test/java/org/jboss/cache/buddyreplication/Buddy3NodesWithFailoverTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/buddyreplication/Buddy3NodesWithFailoverTest.java 2009-01-22 09:26:00 UTC (rev 7567)
+++ core/trunk/src/test/java/org/jboss/cache/buddyreplication/Buddy3NodesWithFailoverTest.java 2009-01-22 10:31:05 UTC (rev 7568)
@@ -9,6 +9,7 @@
import org.jboss.cache.CacheSPI;
import org.jboss.cache.Fqn;
import org.jboss.cache.commands.remote.DataGravitationCleanupCommand;
+import org.jboss.cache.commands.write.PutKeyValueCommand;
import org.jboss.cache.util.TestingUtil;
import org.jboss.cache.util.internals.replicationlisteners.ReplicationListener;
import org.jgroups.JChannel;
@@ -103,74 +104,74 @@
public void testDataGravitationKillOwner() throws Exception
{
- List<CacheSPI<Object, Object>> cachePool = createCaches(3, false, true);
+ List<CacheSPI<Object, Object>> caches = createCaches(3, false, true);
Fqn fqn = Fqn.fromString("/test");
- Fqn backupFqn = fqnTransformer.getBackupFqn(cachePool.get(0).getLocalAddress(), fqn);
+ Fqn backupFqn = fqnTransformer.getBackupFqn(caches.get(2).getLocalAddress(), fqn);
- TestingUtil.dumpCacheContents(cachePool);
+ TestingUtil.dumpCacheContents(caches);
- cachePool.get(0).put(fqn, key, value);
+ ReplicationListener replListener0 = ReplicationListener.getReplicationListener(caches.get(0));
- TestingUtil.dumpCacheContents(cachePool);
+ replListener0.expect(PutKeyValueCommand.class);
+ caches.get(2).put(fqn, key, value);
+ replListener0.waitForReplicationToOccur();
- assertEquals("Value should exist", value, cachePool.get(0).get(fqn, key));
- TestingUtil.dumpCacheContents(cachePool);
+ TestingUtil.dumpCacheContents(caches);
+ assertEquals("Value should exist", value, caches.get(2).get(fqn, key));
+
+ TestingUtil.dumpCacheContents(caches);
+
// use exists instead of get() to prevent going up the interceptor stack
- assertTrue("Should be false", !cachePool.get(1).exists(fqn));
- assertTrue("Should be false", !cachePool.get(2).exists(fqn));
+ assertTrue("Should be false", !caches.get(0).exists(fqn));
+ assertTrue("Should be false", !caches.get(1).exists(fqn));
- assertFalse("Should be false", cachePool.get(0).exists(backupFqn));
- assertTrue("Value be true", cachePool.get(1).exists(backupFqn));
- assertFalse("Should be false", cachePool.get(2).exists(backupFqn));
+ assertTrue("Value be true", caches.get(0).exists(backupFqn));
+ assertFalse("Should be false", caches.get(1).exists(backupFqn));
+ assertFalse("Should be false", caches.get(2).exists(backupFqn));
- Address cacheOAddr = cachePool.get(0).getLocalAddress();
+ Address cache2Addr = caches.get(2).getLocalAddress();
// forcefully kill data owner.
- cachePool.get(0).stop();
- cachePool.get(0).destroy();
- TestingUtil.blockUntilViewsReceived(10000, cachePool.get(1), cachePool.get(2));
- waitForSingleBuddy(cachePool.get(1), cachePool.get(2));
+ caches.get(2).stop();
+ caches.get(2).destroy();
+ TestingUtil.blockUntilViewsReceived(10000, caches.get(0), caches.get(1));
+ waitForSingleBuddy(caches.get(0), caches.get(1));
// TestingUtil.dumpCacheContents(cachePool);
// assert that the remaining cachePool have picked new buddies. Cache 1 should have cache 2's backup data.
- assert cachePool.get(1).peek(fqnTransformer.getBackupRoot(cachePool.get(2).getLocalAddress()), false) != null : "Should have new buddy's backup root.";
- assert cachePool.get(1).peek(fqnTransformer.getBackupRoot(cachePool.get(1).getLocalAddress()), false) == null : "Should not have self as a backup root.";
- assert cachePool.get(1).peek(fqnTransformer.getBackupRoot(cacheOAddr), false) == null : "Should not have dead node as a backup root.";
- assert cachePool.get(1).peek(Fqn.fromRelativeElements(fqnTransformer.getDeadBackupRoot(cacheOAddr), 1), false) != null : "Should have dead node as a defunct backup root.";
+ assert caches.get(0).peek(fqnTransformer.getBackupRoot(caches.get(1).getLocalAddress()), false) != null : "Should have new buddy's backup root.";
+ assert caches.get(1).peek(fqnTransformer.getBackupRoot(caches.get(1).getLocalAddress()), false) == null : "Should not have self as a backup root.";
+ assert caches.get(0).peek(fqnTransformer.getBackupRoot(cache2Addr), false) == null : "Should not have dead node as a backup root.";
+ assert caches.get(0).peek(Fqn.fromRelativeElements(fqnTransformer.getDeadBackupRoot(cache2Addr), 1), false) != null : "Should have dead node as a defunct backup root.";
- assert cachePool.get(2).peek(fqnTransformer.getBackupRoot(cachePool.get(2).getLocalAddress()), false) == null : "Should not have self as a backup root.";
- assert cachePool.get(2).peek(fqnTransformer.getBackupRoot(cachePool.get(1).getLocalAddress()), false) != null : "Should have new buddy's backup root.";
- assert cachePool.get(2).peek(fqnTransformer.getBackupRoot(cacheOAddr), false) == null : "Should not have dead node as a backup root.";
- assert cachePool.get(2).peek(Fqn.fromRelativeElements(fqnTransformer.getDeadBackupRoot(cacheOAddr), 1), false) == null : "Should not have dead node as a defunct backup root.";
+ assert caches.get(1).peek(fqnTransformer.getBackupRoot(caches.get(1).getLocalAddress()), false) == null : "Should not have self as a backup root.";
+ assert caches.get(1).peek(fqnTransformer.getBackupRoot(caches.get(0).getLocalAddress()), false) != null : "Should have new buddy's backup root.";
+ assert caches.get(1).peek(fqnTransformer.getBackupRoot(cache2Addr), false) == null : "Should not have dead node as a backup root.";
+ assert caches.get(1).peek(Fqn.fromRelativeElements(fqnTransformer.getDeadBackupRoot(cache2Addr), 1), false) == null : "Should not have dead node as a defunct backup root.";
- ReplicationListener replListener = ReplicationListener.getReplicationListener(cachePool.get(1));
- replListener.expect(DataGravitationCleanupCommand.class);
+ replListener0.expect(DataGravitationCleanupCommand.class);
+
// according to data gravitation, a call to *any* cache should retrieve the data, and move the data to the new cache.
- assertEquals("Value should have gravitated", value, cachePool.get(2).get(fqn, key));
- replListener.waitForReplicationToOccur();
+ assertEquals("Value should have gravitated", value, caches.get(1).get(fqn, key));
+ replListener0.waitForReplicationToOccur();
-// TestingUtil.dumpCacheContents(cachePool);
-
- // now lets test the eviction part of gravitation
- Fqn newBackupFqn = fqnTransformer.getBackupFqn(cachePool.get(2).getLocalAddress(), fqn);
-
// use exists instead of get() to prevent going up the interceptor stack
- assert cachePool.get(1).peek(fqnTransformer.getBackupRoot(cachePool.get(2).getLocalAddress()), false) != null : "Should have new buddy's backup root.";
- assert cachePool.get(1).peek(fqnTransformer.getBackupRoot(cachePool.get(1).getLocalAddress()), false) == null : "Should not have self as a backup root.";
- assert cachePool.get(1).peek(fqnTransformer.getBackupRoot(cacheOAddr), false) == null : "Should not have dead node as a backup root.";
- assert cachePool.get(1).peek(Fqn.fromRelativeElements(fqnTransformer.getDeadBackupRoot(cacheOAddr), 1), false) == null : "Should not have dead node as a defunct backup root.";
- assert cachePool.get(1).peek(fqnTransformer.getDeadBackupRoot(cacheOAddr), false) == null : "Should not have dead node as a defunct backup root.";
+ assert caches.get(0).peek(fqnTransformer.getBackupRoot(caches.get(1).getLocalAddress()), false) != null : "Should have new buddy's backup root.";
+ assert caches.get(0).peek(fqnTransformer.getBackupRoot(caches.get(0).getLocalAddress()), false) == null : "Should not have self as a backup root.";
+ assert caches.get(0).peek(fqnTransformer.getBackupRoot(cache2Addr), false) == null : "Should not have dead node as a backup root.";
+ assert caches.get(0).peek(Fqn.fromRelativeElements(fqnTransformer.getDeadBackupRoot(cache2Addr), 1), false) == null : "Should not have dead node as a defunct backup root.";
+ assert caches.get(0).peek(fqnTransformer.getDeadBackupRoot(cache2Addr), false) == null : "Should not have dead node as a defunct backup root.";
- assert cachePool.get(2).peek(fqnTransformer.getBackupRoot(cachePool.get(2).getLocalAddress()), false) == null : "Should not have self as a backup root.";
- assert cachePool.get(2).peek(fqnTransformer.getBackupRoot(cachePool.get(1).getLocalAddress()), false) != null : "Should have new buddy's backup root.";
- assert cachePool.get(2).peek(fqnTransformer.getBackupRoot(cacheOAddr), false) == null : "Should not have dead node as a backup root.";
- assert cachePool.get(2).peek(Fqn.fromRelativeElements(fqnTransformer.getDeadBackupRoot(cacheOAddr), 1), false) == null : "Should not have dead node as a defunct backup root.";
- assertTrue("Should be false", !cachePool.get(1).exists(fqn));
+ assert caches.get(1).peek(fqnTransformer.getBackupRoot(caches.get(1).getLocalAddress()), false) == null : "Should not have self as a backup root.";
+ assert caches.get(1).peek(fqnTransformer.getBackupRoot(caches.get(0).getLocalAddress()), false) != null : "Should have new buddy's backup root.";
+ assert caches.get(1).peek(fqnTransformer.getBackupRoot(cache2Addr), false) == null : "Should not have dead node as a backup root.";
+ assert caches.get(1).peek(Fqn.fromRelativeElements(fqnTransformer.getDeadBackupRoot(cache2Addr), 1), false) == null : "Should not have dead node as a defunct backup root.";
+ assertTrue("Should be false", !caches.get(0).exists(fqn));
// the old backup should no longer exist
- assertFalse("Should be null", cachePool.get(1).exists(backupFqn));
- assertFalse("Should be null", cachePool.get(2).exists(backupFqn));
+ assertFalse("Should be null", caches.get(0).exists(backupFqn));
+ assertFalse("Should be null", caches.get(1).exists(backupFqn));
}
}
15 years, 11 months
JBoss Cache SVN: r7567 - core/trunk/src/test/java/org/jboss/cache/lock.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2009-01-22 04:26:00 -0500 (Thu, 22 Jan 2009)
New Revision: 7567
Modified:
core/trunk/src/test/java/org/jboss/cache/lock/IdentityLockTest.java
Log:
commented tests because they rely too heavily on Thread.sleep that do not work anymore
Modified: core/trunk/src/test/java/org/jboss/cache/lock/IdentityLockTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/lock/IdentityLockTest.java 2009-01-22 08:28:30 UTC (rev 7566)
+++ core/trunk/src/test/java/org/jboss/cache/lock/IdentityLockTest.java 2009-01-22 09:26:00 UTC (rev 7567)
@@ -209,208 +209,194 @@
}
}
- public void testThreadedAccess_RWLock() throws Throwable
- {
- setLevelRW();
- log("testThreadedAccess_RWLock ...");
- final Object o1 = new Object();
- final Object o2 = new Object();
+// public void testThreadedAccess_RWLock() throws Throwable
+// {
+// setLevelRW();
+// log("testThreadedAccess_RWLock ...");
+// final Object o1 = new Object();
+// final Object o2 = new Object();
+//
+// // 1. o1 acquires the lock -- succeeds
+// Thread t1 = new Thread()
+// {
+// public void run()
+// {
+// try
+// {
+// log("o1 acquiring lock");
+// lock_.acquireReadLock(o1, 50);
+// log("o1: OK");
+// }
+// catch (Throwable e)
+// {
+// log("o1: FAIL");
+// thread_ex = e;
+// }
+// }
+// };
+//
+// // 2. o2 wants to acquire the lock -- this will fail and o2 will block for 2 secs
+// Thread t2 = new Thread()
+// {
+// public void run()
+// {
+// try
+// {
+// log("o2 acquiring lock");
+// lock_.acquireWriteLock(o2, 2000);
+// log("o2: OK");
+// }
+// catch (Throwable e)
+// {
+// log("o2: FAIL");
+// thread_ex = e;
+// }
+// }
+// };
+//
+// // 3. o1 acquires the lock a second time -- succeeds
+// Thread t3 = new Thread()
+// {
+// public void run()
+// {
+// try
+// {
+// log("o1 acquiring lock");
+// lock_.acquireWriteLock(o1, 10);
+// log("o1: OK");
+// }
+// catch (Throwable e)
+// {
+// log("o1: FAIL");
+// thread_ex = e;
+// }
+// }
+// };
+//
+// t1.start();
+// TestingUtil.sleepThread(100);
+// t2.start();
+// TestingUtil.sleepThread(1000);
+//
+// // o1 must be the owner of the lock
+// assertTrue(lock_.isOwner(o1));
+// TestingUtil.sleepThread(100);
+// // o1 must still be the owner of the lock
+// assertTrue(lock_.isOwner(o1));
+//
+// t3.start();
+// TestingUtil.sleepThread(100);
+// // o1 must still be the owner of the lock
+// assertTrue(lock_.isOwner(o1));
+//
+// // 4. o1 releases the lock; now o2 will succeed in acquiring the lock
+// log("o1 releasing lock");
+// lock_.release(o1);
+// log("o1: OK");
+//
+// TestingUtil.sleepThread(200);
+// //log("o2: " + o2.hashCode() + ", lock_.getOwner()=" + lock_.getOwner());
+// // assertTrue(lock_.isOwner(o2));
+// // lock_.release(o2);
+//
+// t1.join(20000);
+// t2.join(20000);
+// t3.join(20000);
+// if (thread_ex != null)
+// {
+// throw thread_ex;
+// }
+// }
- // 1. o1 acquires the lock -- succeeds
- Thread t1 = new Thread()
- {
- public void run()
- {
- try
- {
- log("o1 acquiring lock");
- lock_.acquireReadLock(o1, 50);
- log("o1: OK");
- }
- catch (Throwable e)
- {
- log("o1: FAIL");
- thread_ex = e;
- }
- }
- };
- // 2. o2 wants to acquire the lock -- this will fail and o2 will block for 2 secs
- Thread t2 = new Thread()
- {
- public void run()
- {
- try
- {
- log("o2 acquiring lock");
- lock_.acquireWriteLock(o2, 2000);
- log("o2: OK");
- }
- catch (Throwable e)
- {
- log("o2: FAIL");
- thread_ex = e;
- }
- }
- };
+// public void testThreadedAccess_SimpleLock() throws Throwable
+// {
+// setLevelSerial();
+// log("testThreadedAccess_SimpleLock() ...");
+// final Object o1 = new Object();
+// final Object o2 = new Object();
+//
+// // 1. o1 acquires the lock -- succeeds
+// Thread t1 = new Thread()
+// {
+// public void run()
+// {
+// try
+// {
+// log("o1 acquiring lock");
+// lock_.acquireReadLock(o1, 50);
+// log("o1: OK");
+// }
+// catch (Throwable e)
+// {
+// log("o1: FAIL");
+// thread_ex = e;
+// }
+// }
+// };
+//
+// // 2. o2 wants to acquire the lock -- this will fail and o2 will block for 2 secs
+// Thread t2 = new Thread()
+// {
+// public void run()
+// {
+// try
+// {
+// log("o2 acquiring lock");
+// lock_.acquireWriteLock(o2, 2000);
+// log("o2: OK");
+// }
+// catch (Throwable e)
+// {
+// log("o2: FAIL");
+// thread_ex = e;
+// }
+// }
+// };
+//
+// // 3. o1 acquires the lock a second time -- succeeds
+// Thread t3 = new Thread()
+// {
+// public void run()
+// {
+// try
+// {
+// log("o1 acquiring lock");
+// lock_.acquireWriteLock(o1, 10);
+// log("o1: OK");
+// }
+// catch (Throwable e)
+// {
+// log("o1: FAIL");
+// thread_ex = e;
+// }
+// }
+// };
+//
+// t1.start();
+// // make sure t1 has the WL!
+// t1.join();
+//
+// t2.start();
+//
+//
+// // o1 must be the owner of the lock
+// assertTrue(lock_.isOwner(o1));
+//
+// t3.start();
+// assertTrue(lock_.isOwner(o1));
+//
+// log("o1 releasing lock");
+// lock_.release(o1);
+//
+// t2.join(20000);
+// t3.join(20000);
+// if (thread_ex != null)
+// {
+// throw thread_ex;
+// }
+// }
- // 3. o1 acquires the lock a second time -- succeeds
- Thread t3 = new Thread()
- {
- public void run()
- {
- try
- {
- log("o1 acquiring lock");
- lock_.acquireWriteLock(o1, 10);
- log("o1: OK");
- }
- catch (Throwable e)
- {
- log("o1: FAIL");
- thread_ex = e;
- }
- }
- };
-
- t1.start();
- TestingUtil.sleepThread(100);
- t2.start();
- TestingUtil.sleepThread(1000);
-
- // o1 must be the owner of the lock
- assertTrue(lock_.isOwner(o1));
- TestingUtil.sleepThread(100);
- // o1 must still be the owner of the lock
- assertTrue(lock_.isOwner(o1));
-
- t3.start();
- TestingUtil.sleepThread(100);
- // o1 must still be the owner of the lock
- assertTrue(lock_.isOwner(o1));
-
- // 4. o1 releases the lock; now o2 will succeed in acquiring the lock
- log("o1 releasing lock");
- lock_.release(o1);
- log("o1: OK");
-
- TestingUtil.sleepThread(200);
- //log("o2: " + o2.hashCode() + ", lock_.getOwner()=" + lock_.getOwner());
- // assertTrue(lock_.isOwner(o2));
- // lock_.release(o2);
-
- t1.join(20000);
- t2.join(20000);
- t3.join(20000);
- if (thread_ex != null)
- {
- throw thread_ex;
- }
- }
-
-
- @Test (invocationCount = 2, successPercentage = 50) //this relies on threads.sleep fails ocasionally (pass 100 in a row on one thread)
- public void testThreadedAccess_SimpleLock() throws Throwable
- {
- setLevelSerial();
- log("testThreadedAccess_SimpleLock() ...");
- final Object o1 = new Object();
- final Object o2 = new Object();
-
- // 1. o1 acquires the lock -- succeeds
- Thread t1 = new Thread()
- {
- public void run()
- {
- try
- {
- log("o1 acquiring lock");
- lock_.acquireReadLock(o1, 50);
- log("o1: OK");
- }
- catch (Throwable e)
- {
- log("o1: FAIL");
- thread_ex = e;
- }
- }
- };
-
- // 2. o2 wants to acquire the lock -- this will fail and o2 will block for 2 secs
- Thread t2 = new Thread()
- {
- public void run()
- {
- try
- {
- log("o2 acquiring lock");
- lock_.acquireWriteLock(o2, 2000);
- log("o2: OK");
- }
- catch (Throwable e)
- {
- log("o2: FAIL");
- thread_ex = e;
- }
- }
- };
-
- // 3. o1 acquires the lock a second time -- succeeds
- Thread t3 = new Thread()
- {
- public void run()
- {
- try
- {
- log("o1 acquiring lock");
- lock_.acquireWriteLock(o1, 10);
- log("o1: OK");
- }
- catch (Throwable e)
- {
- log("o1: FAIL");
- thread_ex = e;
- }
- }
- };
-
- t1.start();
- // make sure t1 has the WL!
- t1.join();
-
- t2.start();
- TestingUtil.sleepThread(1000);
-
- // o1 must be the owner of the lock
- assertTrue(lock_.isOwner(o1));
- TestingUtil.sleepThread(100);
- // o1 must still be the owner of the lock
- assertTrue(lock_.isOwner(o1));
-
- t3.start();
- TestingUtil.sleepThread(100);
- // o1 must still be the owner of the lock
- assertTrue(lock_.isOwner(o1));
-
- // 4. o1 releases the lock; now o2 will succeed in acquiring the lock
- log("o1 releasing lock");
- lock_.release(o1);
- log("o1: OK");
-
- TestingUtil.sleepThread(200);
- //log("o2: " + o2.hashCode() + ", lock_.getOwner()=" + lock_.getOwner());
- // assertTrue(lock_.isOwner(o2));
- // lock_.release(o2);
-
-// t1.join(20000);
- t2.join(20000);
- t3.join(20000);
- if (thread_ex != null)
- {
- throw thread_ex;
- }
- }
-
public void testReadAndReleaseAll()
{
setLevelRW();
@@ -552,13 +538,8 @@
{
public void run()
{
- long initialTime = System.currentTimeMillis();
for (int i = 0; i < opCount; i++)
{
- if (i % 10 == 0)
- {
- initialTime = System.currentTimeMillis();
- }
try
{
iLock.toString(new StringBuilder(), false);
15 years, 11 months
JBoss Cache SVN: r7566 - core/trunk/src/test/java/org/jboss/cache/eviction.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2009-01-22 03:28:30 -0500 (Thu, 22 Jan 2009)
New Revision: 7566
Modified:
core/trunk/src/test/java/org/jboss/cache/eviction/ReplicatedLRUPolicyTest.java
Log:
more strict eviction controll
Modified: core/trunk/src/test/java/org/jboss/cache/eviction/ReplicatedLRUPolicyTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/eviction/ReplicatedLRUPolicyTest.java 2009-01-21 16:45:43 UTC (rev 7565)
+++ core/trunk/src/test/java/org/jboss/cache/eviction/ReplicatedLRUPolicyTest.java 2009-01-22 08:28:30 UTC (rev 7566)
@@ -22,11 +22,10 @@
/**
* @author Ben Wang, Feb 11, 2004
*/
-@Test(groups = {"functional"}, sequential = true, testName = "eviction.ReplicatedLRUPolicyTest")
+@Test(groups = {"functional"}, testName = "eviction.ReplicatedLRUPolicyTest")
public class ReplicatedLRUPolicyTest extends EvictionTestsBase
{
- CacheSPI<Object, Object> cache1, cache2, cache3;
- long wakeupIntervalMillis = 500;
+ CacheSPI<Object, Object> cache1, cache2;
EvictionListener listener = new EvictionListener();
@BeforeMethod(alwaysRun = true)
@@ -35,26 +34,25 @@
cache1 = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(UnitTestConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC, true), false, getClass());
cache1.getConfiguration().setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
cache1.getConfiguration().setUseRegionBasedMarshalling(true);
- cache1.getConfiguration().getEvictionConfig().setWakeupInterval(wakeupIntervalMillis);
+ cache1.getConfiguration().getEvictionConfig().setWakeupInterval(0);
cache1.start();
cache1.getNotifier().addCacheListener(listener);
listener.resetCounter();
- cache3 = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(cache1.getConfiguration().clone(), false, getClass());
- cache3.getConfiguration().setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
- cache3.getConfiguration().setUseRegionBasedMarshalling(true);
- cache3.getConfiguration().getEvictionConfig().setWakeupInterval(wakeupIntervalMillis);
- cache3.start();
+ cache2 = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(cache1.getConfiguration().clone(), false, getClass());
+ cache2.getConfiguration().setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
+ cache2.getConfiguration().setUseRegionBasedMarshalling(true);
+ cache2.getConfiguration().getEvictionConfig().setWakeupInterval(0);
+ cache2.start();
}
@AfterMethod(alwaysRun = true)
public void tearDown() throws Exception
{
- TestingUtil.killCaches(cache1, cache2, cache3);
+ TestingUtil.killCaches(cache1, cache2);
cache1 = null;
cache2 = null;
- cache3 = null;
}
/**
@@ -67,7 +65,7 @@
cfg.setMaxAge(0);
cfg.setTimeToLive(0);
- cfg = (LRUAlgorithmConfig) cache3.getConfiguration().getEvictionConfig().getEvictionRegionConfig(rootStr).getEvictionAlgorithmConfig();
+ cfg = (LRUAlgorithmConfig) cache2.getConfiguration().getEvictionConfig().getEvictionRegionConfig(rootStr).getEvictionAlgorithmConfig();
cfg.setMaxAge(-1, TimeUnit.SECONDS);
cfg.setTimeToLive(-1, TimeUnit.SECONDS);
cfg.setMaxNodes(200);
@@ -75,12 +73,12 @@
String str = rootStr + "0";
Fqn fqn = Fqn.fromString(str);
cache1.put(str, str, str);
-// assert waitForEviction(cache1, 30, TimeUnit.SECONDS, fqn) : "Eviction event not received!";
+
new EvictionController(cache1).startEviction();
Object node = cache1.peek(fqn, false);
assertNull("Node should be evicted already ", node);
assertEquals("Eviction counter ", 1, listener.getCounter());
- String val = (String) cache3.get(str, str);
+ String val = (String) cache2.get(str, str);
assertNotNull("DataNode should not be evicted here ", val);
assertEquals("Eviction counter ", 1, listener.getCounter());
}
@@ -88,11 +86,10 @@
public void testEviction() throws Exception
{
String rootStr = "/org/jboss/test/data/";
- LRUAlgorithmConfig cfg = (LRUAlgorithmConfig) cache3.getConfiguration().getEvictionConfig().getEvictionRegionConfig(rootStr).getEvictionAlgorithmConfig();
+ LRUAlgorithmConfig cfg = (LRUAlgorithmConfig) cache2.getConfiguration().getEvictionConfig().getEvictionRegionConfig(rootStr).getEvictionAlgorithmConfig();
cfg.setMaxAge(60, TimeUnit.SECONDS);
cfg.setTimeToLive(360, TimeUnit.SECONDS);
cfg.setMaxNodes(200);
- EvictionWatcher ew = new EvictionWatcher(cache1, Fqn.fromString(rootStr + 3));
for (int i = 0; i < 10; i++)
{
String str = rootStr + i;
@@ -100,21 +97,20 @@
cache1.put(fqn, str, str);
}
- assert ew.waitForEviction(30, TimeUnit.SECONDS);
+ new EvictionController(cache1).startEviction();
String val = (String) cache1.get(rootStr + "3", rootStr + "3");
assertNull("DataNode should be evicted already ", val);
- val = (String) cache3.get(rootStr + "3", rootStr + "3");
+ val = (String) cache2.get(rootStr + "3", rootStr + "3");
assertNotNull("DataNode should not be evicted here ", val);
}
public void testEvictionReplication() throws Exception
{
String rootStr = "/org/jboss/test/data/";
- LRUAlgorithmConfig cfg = (LRUAlgorithmConfig) cache3.getConfiguration().getEvictionConfig().getEvictionRegionConfig(rootStr).getEvictionAlgorithmConfig();
+ LRUAlgorithmConfig cfg = (LRUAlgorithmConfig) cache2.getConfiguration().getEvictionConfig().getEvictionRegionConfig(rootStr).getEvictionAlgorithmConfig();
cfg.setMaxAge(60, TimeUnit.SECONDS);
cfg.setTimeToLive(360, TimeUnit.SECONDS);
- EvictionWatcher ew = new EvictionWatcher(cache1, Fqn.fromString(rootStr + 3));
for (int i = 0; i < 10; i++)
{
@@ -127,11 +123,11 @@
Fqn fqn = Fqn.fromString(str);
cache1.get(fqn, str);
- assert ew.waitForEviction(30, TimeUnit.SECONDS);
+ new EvictionController(cache1).startEviction();
String val = (String) cache1.get(rootStr + "3", rootStr + "3");
assertNull("DataNode should be empty ", val);
- val = (String) cache3.get(rootStr + "7", rootStr + "7");
+ val = (String) cache2.get(rootStr + "7", rootStr + "7");
assertNotNull("DataNode should not be null", val);
}
15 years, 11 months
JBoss Cache SVN: r7565 - in core/branches/flat/src: test/java/org/horizon/manager and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2009-01-21 11:45:43 -0500 (Wed, 21 Jan 2009)
New Revision: 7565
Modified:
core/branches/flat/src/main/java/org/horizon/jmx/JmxRegistrationManager.java
core/branches/flat/src/test/java/org/horizon/manager/CacheManagerComponentRegistryTest.java
Log:
Fixed JMX stuff
Modified: core/branches/flat/src/main/java/org/horizon/jmx/JmxRegistrationManager.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/jmx/JmxRegistrationManager.java 2009-01-21 16:17:36 UTC (rev 7564)
+++ core/branches/flat/src/main/java/org/horizon/jmx/JmxRegistrationManager.java 2009-01-21 16:45:43 UTC (rev 7565)
@@ -54,7 +54,7 @@
private static final Log log = LogFactory.getLog(JmxRegistrationManager.class);
- private static final String GENERAL_PREFIX = System.getProperty("jbosscache.jmx.prefix", "jboss.cache:service=JBossCache");
+ private static final String GENERAL_PREFIX = System.getProperty("horizon.jmx.prefix", "horizon:service=Horizon");
/**
* default ObjectName for clusterd caches. Cluster name should pe appended.
@@ -176,12 +176,12 @@
return;
}
if (cacheSpi.getConfiguration().getCacheMode().equals(Configuration.CacheMode.LOCAL)) {
- objectNameBase = LOCAL_CACHE_PREFIX + System.currentTimeMillis();
+ objectNameBase = LOCAL_CACHE_PREFIX + ",instance=" + Integer.toHexString(System.identityHashCode(cacheSpi));
} else //the cache is clustered
{
- // TODO: make sure we append the cache name as well somewhere here, since > 1 cache will be attached to the same channel.
- //objectNameBase = REPLICATED_CACHE_PREFIX + cacheSpi.getConfiguration().getGlobalConfiguration().getClusterName();
+ objectNameBase = REPLICATED_CACHE_PREFIX + cacheSpi.getConfiguration().getGlobalConfiguration().getClusterName();
}
+ objectNameBase = objectNameBase + ",cacheName=" + cacheSpi.getName();
}
public String getObjectName(String resourceName) {
Modified: core/branches/flat/src/test/java/org/horizon/manager/CacheManagerComponentRegistryTest.java
===================================================================
--- core/branches/flat/src/test/java/org/horizon/manager/CacheManagerComponentRegistryTest.java 2009-01-21 16:17:36 UTC (rev 7564)
+++ core/branches/flat/src/test/java/org/horizon/manager/CacheManagerComponentRegistryTest.java 2009-01-21 16:45:43 UTC (rev 7565)
@@ -58,6 +58,7 @@
public void testForceUnsharedComponents() throws CacheNameExistsException, NamedCacheNotFoundException {
CacheLoaderConfig clc = new CacheLoaderConfig();
+ // TODO change this to use a dummy in memory cache loader instead!!
FileCacheLoaderConfig fc = new FileCacheLoaderConfig();
fc.setLocation("/tmp");
clc.addIndividualCacheLoaderConfig(fc);
@@ -66,7 +67,7 @@
defaultCfg.setCacheMode(Configuration.CacheMode.REPL_SYNC);
defaultCfg.setCacheLoaderConfig(clc);
// cache manager with default configuration
- cm = new DefaultCacheManager(defaultCfg);
+ cm = new DefaultCacheManager(GlobalConfiguration.getClusteredDefault(), defaultCfg);
// default cache with no overrides
Cache c = cm.getCache();
15 years, 11 months
JBoss Cache SVN: r7564 - core/trunk/src/main/java/org/jboss/cache/loader.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2009-01-21 11:17:36 -0500 (Wed, 21 Jan 2009)
New Revision: 7564
Modified:
core/trunk/src/main/java/org/jboss/cache/loader/FileCacheLoader.java
Log:
the list of files might be null, as per javadoc of File.listFiles
Modified: core/trunk/src/main/java/org/jboss/cache/loader/FileCacheLoader.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/FileCacheLoader.java 2009-01-21 15:59:52 UTC (rev 7563)
+++ core/trunk/src/main/java/org/jboss/cache/loader/FileCacheLoader.java 2009-01-21 16:17:36 UTC (rev 7564)
@@ -383,6 +383,11 @@
{
boolean success = true;
File[] subdirs = dir.listFiles();
+ if (subdirs == null)
+ {
+ if (log.isWarnEnabled()) log.warn("Null list of files for dir: " + dir.getAbsolutePath());
+ return false;
+ }
for (File file : subdirs)
{
if (file.isFile() && file.getName().equals(DATA))
15 years, 11 months
JBoss Cache SVN: r7563 - core/trunk/src/test/java/org/jboss/cache/buddyreplication.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2009-01-21 10:59:52 -0500 (Wed, 21 Jan 2009)
New Revision: 7563
Modified:
core/trunk/src/test/java/org/jboss/cache/buddyreplication/Buddy2NodesNoBuddyPoolTest.java
Log:
reordoned execution sequence
Modified: core/trunk/src/test/java/org/jboss/cache/buddyreplication/Buddy2NodesNoBuddyPoolTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/buddyreplication/Buddy2NodesNoBuddyPoolTest.java 2009-01-21 15:34:21 UTC (rev 7562)
+++ core/trunk/src/test/java/org/jboss/cache/buddyreplication/Buddy2NodesNoBuddyPoolTest.java 2009-01-21 15:59:52 UTC (rev 7563)
@@ -39,6 +39,7 @@
super.tearDown();
}
+ @Test(dependsOnMethods = "testBuddyJoin")
public void testAddingNewCaches() throws Exception
{
// get some data in there.
15 years, 11 months