JBoss Cache SVN: r6594 - in core/trunk/src/main/java/org/jboss/cache/config/parsing: element and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-08-21 13:33:17 -0400 (Thu, 21 Aug 2008)
New Revision: 6594
Modified:
core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java
core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlParserBase.java
core/trunk/src/main/java/org/jboss/cache/config/parsing/element/BuddyElementParser.java
core/trunk/src/main/java/org/jboss/cache/config/parsing/element/CustomInterceptorsElementParser.java
core/trunk/src/main/java/org/jboss/cache/config/parsing/element/LoadersElementParser.java
Log:
Null chks
Modified: core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java 2008-08-21 15:02:58 UTC (rev 6593)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java 2008-08-21 17:33:17 UTC (rev 6594)
@@ -259,7 +259,7 @@
{
if (element == null) return; //this element is optional
String asyncPoolSizeStr = getAttributeValue(element, "asyncPoolSize");
- if (asyncPoolSizeStr != null && !asyncPoolSizeStr.trim().equals(""))
+ if (existsAttribute(asyncPoolSizeStr))
{
try
{
@@ -306,21 +306,21 @@
{
if (element == null) return; //might not be specified
String enabled = getAttributeValue(element, "enabled");
- if (enabled != null) config.setExposeManagementStatistics(getBoolean(enabled));
+ config.setExposeManagementStatistics(getBoolean(enabled));
}
private void configureShutdown(Element element)
{
if (element == null) return;
String hookBehavior = getAttributeValue(element, "hookBehavior");
- if (hookBehavior != null) config.setShutdownHookBehavior(hookBehavior);
+ if (existsAttribute(hookBehavior)) config.setShutdownHookBehavior(hookBehavior);
}
private void configureTransport(Element element)
{
if (element == null) return; //transport might be missing
String clusterName = getAttributeValue(element, "clusterName");
- config.setClusterName(clusterName);
+ if (existsAttribute(clusterName)) config.setClusterName(clusterName);
String multiplexerStack = getAttributeValue(element, "multiplexerStack");
if (existsAttribute(multiplexerStack)) config.setMultiplexerStack(multiplexerStack);
Element clusterConfig = getSingleElementInCoreNS("jgroupsConfig", element);
@@ -378,7 +378,7 @@
private void configureSyncMode(Element element)
{
String replTimeout = getAttributeValue(element, "replTimeout");
- if (replTimeout != null) config.setSyncReplTimeout(getLong(replTimeout));
+ if (existsAttribute(replTimeout)) config.setSyncReplTimeout(getLong(replTimeout));
}
private void configureAsyncMode(Element element)
Modified: core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlParserBase.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlParserBase.java 2008-08-21 15:02:58 UTC (rev 6593)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlParserBase.java 2008-08-21 17:33:17 UTC (rev 6594)
@@ -21,9 +21,9 @@
*/
package org.jboss.cache.config.parsing;
+import org.jboss.util.StringPropertyReplacer;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
-import org.jboss.util.StringPropertyReplacer;
/**
* Contains utility methods that might be useful to most of the parsers.
@@ -56,15 +56,15 @@
*/
protected boolean getBoolean(String str)
{
- return Boolean.valueOf(str);
+ return str == null ? false : Boolean.valueOf(str);
}
/**
- * Retunrs true if the given value is not empty.
+ * @return true if the given value is not empty.
*/
protected boolean existsAttribute(String attrValue)
{
- return attrValue.length() > 0;
+ return attrValue != null && attrValue.length() > 0;
}
/**
@@ -91,10 +91,12 @@
/**
* Beside querying the element for it's attribute value, it will look into the value, if any, and replace the
* jboss properties(e.g. ${someValue:defaultValue}.
+ *
* @see StringPropertyReplacer#replaceProperties(value);
*/
protected String getAttributeValue(Element element, String attrName)
{
+ if (element == null || attrName == null) return null;
String value = element.getAttribute(attrName);
return value == null ? null : StringPropertyReplacer.replaceProperties(value);
}
Modified: core/trunk/src/main/java/org/jboss/cache/config/parsing/element/BuddyElementParser.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/parsing/element/BuddyElementParser.java 2008-08-21 15:02:58 UTC (rev 6593)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/element/BuddyElementParser.java 2008-08-21 17:33:17 UTC (rev 6594)
@@ -1,9 +1,9 @@
package org.jboss.cache.config.parsing.element;
+import org.jboss.cache.buddyreplication.NextMemberBuddyLocator;
import org.jboss.cache.config.BuddyReplicationConfig;
+import org.jboss.cache.config.parsing.XmlConfigHelper;
import org.jboss.cache.config.parsing.XmlParserBase;
-import org.jboss.cache.config.parsing.XmlConfigHelper;
-import org.jboss.cache.buddyreplication.NextMemberBuddyLocator;
import org.w3c.dom.Element;
import java.util.Properties;
@@ -24,7 +24,7 @@
{
BuddyReplicationConfig brc = new BuddyReplicationConfig();
String enabled = getAttributeValue(element, "enabled");
- if (existsAttribute(enabled)) brc.setEnabled(getBoolean(enabled));
+ brc.setEnabled(getBoolean(enabled));
String buddyPoolName = getAttributeValue(element, "poolName");
if (existsAttribute(buddyPoolName)) brc.setBuddyPoolName(buddyPoolName);
String buddyCommunicationTimeout = getAttributeValue(element, "communicationTimeout");
Modified: core/trunk/src/main/java/org/jboss/cache/config/parsing/element/CustomInterceptorsElementParser.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/parsing/element/CustomInterceptorsElementParser.java 2008-08-21 15:02:58 UTC (rev 6593)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/element/CustomInterceptorsElementParser.java 2008-08-21 17:33:17 UTC (rev 6594)
@@ -21,11 +21,11 @@
*/
package org.jboss.cache.config.parsing.element;
+import org.jboss.cache.config.ConfigurationException;
import org.jboss.cache.config.CustomInterceptorConfig;
-import org.jboss.cache.config.ConfigurationException;
-import org.jboss.cache.config.parsing.XmlParserBase;
import org.jboss.cache.config.parsing.ParsedAttributes;
import org.jboss.cache.config.parsing.XmlConfigHelper;
+import org.jboss.cache.config.parsing.XmlParserBase;
import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.util.Util;
import org.w3c.dom.Element;
@@ -63,7 +63,7 @@
int index = -1;
String after = null;
String before = null;
-
+
Element interceptorElement = (Element) interceptorNodes.item(i);
String position = getAttributeValue(interceptorElement, "position");
if (existsAttribute(position) && "first".equalsIgnoreCase(position))
@@ -83,7 +83,7 @@
if (!existsAttribute(after)) after = null;
CommandInterceptor interceptor = buildCommandInterceptor(interceptorElement);
-
+
CustomInterceptorConfig customInterceptorConfig = new CustomInterceptorConfig(interceptor, first, last, index, after, before);
interceptorConfigs.add(customInterceptorConfig);
}
@@ -96,6 +96,7 @@
private CommandInterceptor buildCommandInterceptor(Element element)
{
String interceptorClass = getAttributeValue(element, "class");
+ if (!existsAttribute(interceptorClass)) throw new ConfigurationException("Interceptor class cannot be empty!");
CommandInterceptor result;
try
{
Modified: core/trunk/src/main/java/org/jboss/cache/config/parsing/element/LoadersElementParser.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/parsing/element/LoadersElementParser.java 2008-08-21 15:02:58 UTC (rev 6593)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/element/LoadersElementParser.java 2008-08-21 17:33:17 UTC (rev 6594)
@@ -76,7 +76,7 @@
Element node = (Element) nodesToPreload.item(i);
String fqn2preload = getAttributeValue(node, "fqn");
if (!existsAttribute(fqn2preload))
- throw new ConfigurationException("Missing 'fqn' attribute in 'preload\\norde' tag");
+ throw new ConfigurationException("Missing 'fqn' attribute in 'preload' element");
if (i > 0) result.append(",");
result.append(fqn2preload);
}
16 years, 4 months
JBoss Cache SVN: r6593 - core/trunk/src/main/java/org/jboss/cache/config.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-08-21 11:02:58 -0400 (Thu, 21 Aug 2008)
New Revision: 6593
Modified:
core/trunk/src/main/java/org/jboss/cache/config/Configuration.java
Log:
MVCC is default node locking scheme
Modified: core/trunk/src/main/java/org/jboss/cache/config/Configuration.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/Configuration.java 2008-08-21 15:02:17 UTC (rev 6592)
+++ core/trunk/src/main/java/org/jboss/cache/config/Configuration.java 2008-08-21 15:02:58 UTC (rev 6593)
@@ -193,7 +193,7 @@
private boolean syncRollbackPhase = false;
private BuddyReplicationConfig buddyReplicationConfig;
- private NodeLockingScheme nodeLockingScheme = NodeLockingScheme.PESSIMISTIC; // TODO: Make this default MVCC once MVCC is completely implemented.
+ private NodeLockingScheme nodeLockingScheme = NodeLockingScheme.MVCC;
private String muxStackName = null;
private boolean usingMultiplexer = false;
private transient RuntimeConfig runtimeConfig;
16 years, 4 months
JBoss Cache SVN: r6592 - in searchable/trunk: src/main/java/org/jboss/cache/search and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: navssurtani
Date: 2008-08-21 11:02:17 -0400 (Thu, 21 Aug 2008)
New Revision: 6592
Modified:
searchable/trunk/pom.xml
searchable/trunk/src/main/java/org/jboss/cache/search/SearchablePojoListener.java
Log:
Commented out SearchablePojoListener and changed pojo dep to cr5
Modified: searchable/trunk/pom.xml
===================================================================
--- searchable/trunk/pom.xml 2008-08-21 15:02:08 UTC (rev 6591)
+++ searchable/trunk/pom.xml 2008-08-21 15:02:17 UTC (rev 6592)
@@ -31,7 +31,7 @@
<dependency>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-pojo</artifactId>
- <version>2.2.0.CR7</version>
+ <version>2.2.0.CR5</version>
<scope>test</scope>
</dependency>
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/SearchablePojoListener.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/SearchablePojoListener.java 2008-08-21 15:02:08 UTC (rev 6591)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/SearchablePojoListener.java 2008-08-21 15:02:17 UTC (rev 6592)
@@ -1,71 +1,71 @@
-package org.jboss.cache.search;
-
-import org.hibernate.search.impl.SearchFactoryImpl;
-import org.jboss.cache.notifications.event.NodeModifiedEvent;
-import org.jboss.cache.pojo.notification.annotation.*;
-import org.jboss.cache.pojo.notification.event.AttachedEvent;
-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
-public class SearchablePojoListener //extends
-{
-// private SearchFactoryImpl searchFactory;
-// private static final Log log = LogFactory.getLog(SearchablePojoListener.class);
+//package org.jboss.cache.search;
//
-// public SearchablePojoListener(SearchFactoryImpl searchFactory)
-// {
-// this.searchFactory = searchFactory;
-// }
-
- /**
- * 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)
-// {
-// Object added = event.getSource();
-// }
-
-
-// @Detached
-// @FieldModified
-// @ListModified
-// @ArrayModified
-// @SetModified
-// @MapModified
-// public void updateLuceneIndexes(NodeModifiedEvent event) throws InvalidKeyException
-// {
+//import org.hibernate.search.impl.SearchFactoryImpl;
+//import org.jboss.cache.notifications.event.NodeModifiedEvent;
+//import org.jboss.cache.pojo.notification.annotation.*;
+//import org.jboss.cache.pojo.notification.event.AttachedEvent;
+//import org.apache.commons.logging.Log;
+//import org.apache.commons.logging.LogFactory;
//
-// if (log.isTraceEnabled()) log.trace("You have entered the PojoListener for Searchable Cache");
-// if (!event.isPre())
-// {
-// if (log.isTraceEnabled()) log.trace("event.isPre is false. Going to start updating indexes");
+//import javax.transaction.Transaction;
//
+///**
+// * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
+// */
//
-// switch (event.getModificationType())
-// {
-// case PUT_MAP:
-// case PUT_DATA:
-// if (log.isTraceEnabled()) log.trace("put() has been called on cache. Going to handle the data.");
-// handlePutData(event, searchFactory);
-// break;
-// case REMOVE_DATA:
-// handleDeleteData(event, searchFactory);
-// break;
-// }
-// }
-// }
-
-
-}
+////@PojoCacheListener
+//public class SearchablePojoListener //extends
+//{
+//// private SearchFactoryImpl searchFactory;
+//// private static final Log log = LogFactory.getLog(SearchablePojoListener.class);
+////
+//// public SearchablePojoListener(SearchFactoryImpl searchFactory)
+//// {
+//// this.searchFactory = searchFactory;
+//// }
+//
+// /**
+// * 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)
+//// {
+//// Object added = event.getSource();
+//// }
+//
+//
+//// @Detached
+//// @FieldModified
+//// @ListModified
+//// @ArrayModified
+//// @SetModified
+//// @MapModified
+//// public void updateLuceneIndexes(NodeModifiedEvent event) throws InvalidKeyException
+//// {
+////
+//// if (log.isTraceEnabled()) log.trace("You have entered the PojoListener for Searchable Cache");
+//// if (!event.isPre())
+//// {
+//// if (log.isTraceEnabled()) log.trace("event.isPre is false. Going to start updating indexes");
+////
+////
+//// switch (event.getModificationType())
+//// {
+//// case PUT_MAP:
+//// case PUT_DATA:
+//// if (log.isTraceEnabled()) log.trace("put() has been called on cache. Going to handle the data.");
+//// handlePutData(event, searchFactory);
+//// break;
+//// case REMOVE_DATA:
+//// handleDeleteData(event, searchFactory);
+//// break;
+//// }
+//// }
+//// }
+//
+//
+//}
16 years, 4 months
JBoss Cache SVN: r6591 - core/trunk/src/test/java/org/jboss/cache/jmx.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-08-21 11:02:08 -0400 (Thu, 21 Aug 2008)
New Revision: 6591
Modified:
core/trunk/src/test/java/org/jboss/cache/jmx/JmxRegistrationManagerTest.java
Log:
main method is not main
Modified: core/trunk/src/test/java/org/jboss/cache/jmx/JmxRegistrationManagerTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/jmx/JmxRegistrationManagerTest.java 2008-08-21 14:20:17 UTC (rev 6590)
+++ core/trunk/src/test/java/org/jboss/cache/jmx/JmxRegistrationManagerTest.java 2008-08-21 15:02:08 UTC (rev 6591)
@@ -89,6 +89,10 @@
cache.stop();
}
+ /**
+ * This is useful when wanting to startup jconsole...
+ */
+ @Test(enabled = false)
public static void main(String[] args)
{
Configuration localConfig = UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.REPL_SYNC);
16 years, 4 months
JBoss Cache SVN: r6590 - core/trunk/src/main/java/org/jboss/cache/jmx.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-08-21 10:20:17 -0400 (Thu, 21 Aug 2008)
New Revision: 6590
Modified:
core/trunk/src/main/java/org/jboss/cache/jmx/PlatformMBeanServerRegistration.java
Log:
guarded against several @stop methods
Modified: core/trunk/src/main/java/org/jboss/cache/jmx/PlatformMBeanServerRegistration.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/jmx/PlatformMBeanServerRegistration.java 2008-08-21 14:05:11 UTC (rev 6589)
+++ core/trunk/src/main/java/org/jboss/cache/jmx/PlatformMBeanServerRegistration.java 2008-08-21 14:20:17 UTC (rev 6590)
@@ -77,6 +77,9 @@
@Stop
public void unregisterMBeans()
{
+ //this method might get called several times.
+ // After the first call the cache will become null, so we guard this
+ if (cache == null) return;
Configuration config = cache.getConfiguration();
if (config.getExposeManagementStatistics())
{
16 years, 4 months
JBoss Cache SVN: r6589 - core/trunk/src/test/resources.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-08-21 10:05:11 -0400 (Thu, 21 Aug 2008)
New Revision: 6589
Modified:
core/trunk/src/test/resources/jbc2-registry-configs.xml
Log:
updated file according to new eviction config
Modified: core/trunk/src/test/resources/jbc2-registry-configs.xml
===================================================================
(Binary files differ)
16 years, 4 months
JBoss Cache SVN: r6588 - core/trunk/src/test/java/org/jboss/cache/jmx/deprecated.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-08-21 09:53:48 -0400 (Thu, 21 Aug 2008)
New Revision: 6588
Modified:
core/trunk/src/test/java/org/jboss/cache/jmx/deprecated/LegacyConfigurationTest.java
Log:
fixed test
Modified: core/trunk/src/test/java/org/jboss/cache/jmx/deprecated/LegacyConfigurationTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/jmx/deprecated/LegacyConfigurationTest.java 2008-08-21 13:16:49 UTC (rev 6587)
+++ core/trunk/src/test/java/org/jboss/cache/jmx/deprecated/LegacyConfigurationTest.java 2008-08-21 13:53:48 UTC (rev 6588)
@@ -34,12 +34,7 @@
import org.jboss.cache.config.EvictionRegionConfig;
import org.jboss.cache.config.RuntimeConfig;
import org.jboss.cache.config.parsing.XmlConfigHelper;
-import org.jboss.cache.eviction.FIFOConfiguration;
-import org.jboss.cache.eviction.FIFOPolicy;
-import org.jboss.cache.eviction.LRUConfiguration;
-import org.jboss.cache.eviction.LRUPolicy;
-import org.jboss.cache.eviction.MRUConfiguration;
-import org.jboss.cache.eviction.MRUPolicy;
+import org.jboss.cache.eviction.*;
import org.jboss.cache.jmx.CacheJmxWrapper;
import org.jboss.cache.jmx.CacheJmxWrapperMBean;
import org.jboss.cache.loader.FileCacheLoader;
@@ -183,37 +178,29 @@
assertEquals("EvictionPolicyConfig", getEvictionPolicyConfig().toString(), wrapper.getEvictionPolicyConfig().toString());
EvictionConfig ec = c.getEvictionConfig();
- assertEquals("EC queue size", 20000, ec.getDefaultEvictionRegionConfig().getEventQueueSize());
+ assertEquals("EC queue size", 1000, ec.getDefaultEvictionRegionConfig().getEventQueueSize());
assertEquals("EC wakeup", 5000, ec.getWakeupInterval());
- assertEquals("EC default pol", LRUPolicy.class.getName(), ec.getDefaultEvictionPolicyClass());
+ assertEquals("EC default pol", LRUAlgorithm.class.getName(), ec.getDefaultEvictionRegionConfig().getEvictionAlgorithmConfig().getEvictionAlgorithmClassName());
List<EvictionRegionConfig> ercs = ec.getEvictionRegionConfigs();
EvictionRegionConfig erc = ercs.get(0);
- assertEquals("ERC0 name", "/_default_", erc.getRegionName());
- assertEquals("ERC0 queue size", 1000, erc.getEventQueueSize());
- LRUConfiguration lru = (LRUConfiguration) erc.getEvictionPolicyConfig();
- assertEquals("EPC0 pol", LRUPolicy.class.getName(), lru.getEvictionPolicyClass());
- assertEquals("EPC0 maxnodes", 5000, lru.getMaxNodes());
- assertEquals("EPC0 ttl", 1000, lru.getTimeToLiveSeconds());
- erc = ercs.get(1);
assertEquals("ERC1 name", "/org/jboss/data", erc.getRegionName());
- assertEquals("ERC1 queue size", 20000, erc.getEventQueueSize());
- FIFOConfiguration fifo = (FIFOConfiguration) erc.getEvictionPolicyConfig();
- assertEquals("EPC1 pol", FIFOPolicy.class.getName(), fifo.getEvictionPolicyClass());
+ assertEquals("ERC1 queue size", 1000, erc.getEventQueueSize());
+ FIFOAlgorithmConfig fifo = (FIFOAlgorithmConfig) erc.getEvictionAlgorithmConfig();
+ assertEquals("EPC1 pol", FIFOAlgorithm.class.getName(), fifo.getEvictionAlgorithmClassName());
assertEquals("EPC1 maxnodes", 5000, fifo.getMaxNodes());
- erc = ercs.get(2);
+ erc = ercs.get(1);
assertEquals("ERC2 name", "/test", erc.getRegionName());
- assertEquals("ERC2 queue size", 20000, erc.getEventQueueSize());
- MRUConfiguration mru = (MRUConfiguration) erc.getEvictionPolicyConfig();
- assertEquals("EPC2 pol", MRUPolicy.class.getName(), mru.getEvictionPolicyClass());
+ assertEquals("ERC2 queue size", 1000, erc.getEventQueueSize());
+ MRUAlgorithmConfig mru = (MRUAlgorithmConfig) erc.getEvictionAlgorithmConfig();
+ assertEquals("EPC2 pol", MRUAlgorithm.class.getName(), mru.getEvictionAlgorithmClassName());
assertEquals("EPC2 maxnodes", 10000, mru.getMaxNodes());
- erc = ercs.get(3);
+ erc = ercs.get(2);
assertEquals("ERC3 name", "/maxAgeTest", erc.getRegionName());
- assertEquals("ERC3 queue size", 20000, erc.getEventQueueSize());
- lru = (LRUConfiguration) erc.getEvictionPolicyConfig();
- assertEquals("EPC3 pol", LRUPolicy.class.getName(), lru.getEvictionPolicyClass());
+ assertEquals("ERC3 queue size", 1000, erc.getEventQueueSize());
+ LRUAlgorithmConfig lru = (LRUAlgorithmConfig) erc.getEvictionAlgorithmConfig();
assertEquals("EPC3 maxnodes", 10000, lru.getMaxNodes());
- assertEquals("EPC3 maxage", 10, lru.getMaxAgeSeconds());
- assertEquals("EPC3 ttl", 8, lru.getTimeToLiveSeconds());
+ assertEquals("EPC3 maxage", 10, lru.getMaxAge());
+ assertEquals("EPC3 ttl", 8, lru.getTimeToLive());
}
@@ -322,8 +309,8 @@
"</region>\n" +
"<region name=\"/maxAgeTest/\">\n" +
" <attribute name=\"maxNodes\">10000</attribute>\n" +
- " <attribute name=\"timeToLiveSeconds\">8</attribute>\n" +
- " <attribute name=\"maxAgeSeconds\">10</attribute>\n" +
+ " <attribute name=\"timeToLive\">8</attribute>\n" +
+ " <attribute name=\"maxAge\">10</attribute>\n" +
"</region>\n" +
" </eviction>";
return XmlConfigHelper.stringToElementInCoreNS(xmlStr);
16 years, 4 months
JBoss Cache SVN: r6587 - core/trunk/src/test/java/org/jboss/cache/eviction.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-08-21 09:16:49 -0400 (Thu, 21 Aug 2008)
New Revision: 6587
Modified:
core/trunk/src/test/java/org/jboss/cache/eviction/ExpirationPolicyTest.java
Log:
fixed test
Modified: core/trunk/src/test/java/org/jboss/cache/eviction/ExpirationPolicyTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/eviction/ExpirationPolicyTest.java 2008-08-21 13:10:15 UTC (rev 6586)
+++ core/trunk/src/test/java/org/jboss/cache/eviction/ExpirationPolicyTest.java 2008-08-21 13:16:49 UTC (rev 6587)
@@ -66,6 +66,20 @@
cache.stop();
}
+ public void testUpdateToFuture() throws Exception
+ {
+ log.info("update 1 from future to past");
+ cache.put(fqn1, ExpirationAlgorithmConfig.EXPIRATION_KEY, future);
+ TestingUtil.sleepThread(200);
+ assertNotNull(cache.getNode(fqn1));
+ cache.put(fqn1, ExpirationAlgorithmConfig.EXPIRATION_KEY, future + 250);
+ TestingUtil.sleepThread(500);
+ assertNotNull(cache.getNode(fqn1));
+ TestingUtil.sleepThread(100);
+ assertNull(cache.getNode(fqn1));
+ cache.removeNode(Fqn.ROOT);
+ }
+
public void testEviction() throws Exception
{
cache.put(fqn1, ExpirationAlgorithmConfig.EXPIRATION_KEY, future);
@@ -95,21 +109,6 @@
cache.removeNode(Fqn.ROOT);
}
- public void testUpdateToFuture() throws Exception
- {
- log.info("update 1 from future to past");
- Long future2 = future + 200;
- cache.put(fqn1, ExpirationAlgorithmConfig.EXPIRATION_KEY, future);
- TestingUtil.sleepThread(200);
- assertNotNull(cache.getNode(fqn1));
- cache.put(fqn1, ExpirationAlgorithmConfig.EXPIRATION_KEY, future2);
- TestingUtil.sleepThread(500);
- assertNotNull(cache.getNode(fqn1));
- TestingUtil.sleepThread(100);
- assertNull(cache.getNode(fqn1));
- cache.removeNode(Fqn.ROOT);
- }
-
public void testMaxNodes() throws Exception
{
log.info("set max nodes to 2, expire soonest to expire first");
16 years, 4 months
JBoss Cache SVN: r6586 - searchable/trunk.
by jbosscache-commits@lists.jboss.org
Author: navssurtani
Date: 2008-08-21 09:10:15 -0400 (Thu, 21 Aug 2008)
New Revision: 6586
Added:
searchable/trunk/README.txt
Log:
commited README.txt
Added: searchable/trunk/README.txt
===================================================================
--- searchable/trunk/README.txt (rev 0)
+++ searchable/trunk/README.txt 2008-08-21 13:10:15 UTC (rev 6586)
@@ -0,0 +1,8 @@
+--README--
+
+If you need more documentation on this software go to http://wiki.jboss.org/wiki/JBossCacheSearchable
+
+For troubleshooting help go to http://www.jbosscache.org and follow the links to the user forum.
+
+
+-Navin Surtani
\ No newline at end of file
16 years, 4 months
JBoss Cache SVN: r6585 - in searchable/trunk: src/test/java/org/jboss/cache/search/blackbox and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: navssurtani
Date: 2008-08-21 05:16:33 -0400 (Thu, 21 Aug 2008)
New Revision: 6585
Modified:
searchable/trunk/pom.xml
searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalCacheTest.java
Log:
Edited LocalCacheTest and pom.xml -
Version changed to 1.1.0.Beta1 and JBC deps changed to CR7
Modified: searchable/trunk/pom.xml
===================================================================
--- searchable/trunk/pom.xml 2008-08-20 12:06:04 UTC (rev 6584)
+++ searchable/trunk/pom.xml 2008-08-21 09:16:33 UTC (rev 6585)
@@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<properties>
- <jbosscache-searchable-version>0.1-Beta1</jbosscache-searchable-version>
+ <jbosscache-searchable-version>1.0.0.Beta1</jbosscache-searchable-version>
<!-- By default only generate Javadocs when we install the module. -->
<javadocPhase>install</javadocPhase>
</properties>
@@ -25,7 +25,7 @@
<dependency>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-core</artifactId>
- <version>2.2.0.CR5</version>
+ <version>2.2.0.CR7</version>
</dependency>
<dependency>
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalCacheTest.java
===================================================================
--- searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalCacheTest.java 2008-08-20 12:06:04 UTC (rev 6584)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalCacheTest.java 2008-08-21 09:16:33 UTC (rev 6585)
@@ -3,6 +3,7 @@
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryParser.QueryParser;
+import org.apache.lucene.queryParser.MultiFieldQueryParser;
import org.apache.lucene.search.*;
import org.apache.lucene.index.Term;
import org.jboss.cache.Cache;
@@ -35,6 +36,7 @@
Person person3;
Person person4;
Person person5;
+ Person person6;
QueryParser queryParser;
Query luceneQuery;
CacheQuery cacheQuery;
@@ -76,7 +78,7 @@
public void tearDown()
{
if (searchableCache != null) searchableCache.stop();
- IndexCleanUp.cleanUpIndexes();
+ IndexCleanUp.cleanUpIndexes();
}
public void testSimple() throws ParseException
@@ -202,7 +204,7 @@
person2.setAge(35);
person3.setAge(12);
- Sort sort = new Sort ("age");
+ Sort sort = new Sort("age");
queryParser = new QueryParser("name", new StandardAnalyzer());
@@ -237,8 +239,8 @@
found = cacheQuery.list();
- assert found.size() ==1;
-
+ assert found.size() == 1;
+
}
}
16 years, 4 months