[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/factories ...
Brian Stansberry
brian.stansberry at jboss.com
Wed Oct 25 00:50:21 EDT 2006
User: bstansberry
Date: 06/10/25 00:50:21
Modified: tests/functional/org/jboss/cache/factories
InterceptorChainFactoryTest.java
Log:
Handle parsing of config XML in XmlConfigurationParser
Revision Changes Path
1.3 +17 -8 JBossCache/tests/functional/org/jboss/cache/factories/InterceptorChainFactoryTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: InterceptorChainFactoryTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/factories/InterceptorChainFactoryTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- InterceptorChainFactoryTest.java 25 Sep 2006 05:50:05 -0000 1.2
+++ InterceptorChainFactoryTest.java 25 Oct 2006 04:50:21 -0000 1.3
@@ -4,6 +4,8 @@
import junit.framework.Test;
import junit.framework.TestSuite;
import org.jboss.cache.TreeCache;
+import org.jboss.cache.config.BuddyReplicationConfig;
+import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.interceptors.*;
import org.jboss.cache.xml.XmlHelper;
import org.w3c.dom.Element;
@@ -76,7 +78,7 @@
assertInterceptorLinkage(list);
}
- protected Element getCacheLoaderConfig(boolean pasv, boolean fetchPersistentState) throws Exception
+ protected CacheLoaderConfig getCacheLoaderConfig(boolean pasv, boolean fetchPersistentState) throws Exception
{
String xml = " <config>\n" +
" \n" +
@@ -94,14 +96,15 @@
" </cacheloader>\n" +
" \n" +
" </config>";
- return XmlHelper.stringToElement(xml);
+ Element element = XmlHelper.stringToElement(xml);
+ return XmlConfigurationParser.parseCacheLoaderConfig(element);
}
public void testSharedCacheLoaderConfig() throws Exception
{
cache.getConfiguration().setUseMbean(false);
cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
- cache.getConfiguration().setCacheLoaderConfiguration(getCacheLoaderConfig(false, false));
+ cache.getConfiguration().setCacheLoaderConfig(getCacheLoaderConfig(false, false));
cache.getConfiguration().setCacheMode("REPL_ASYNC");
cache.getConfiguration().setFetchInMemoryState(false);
cache.create();
@@ -130,7 +133,7 @@
{
cache.getConfiguration().setUseMbean(false);
cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
- cache.getConfiguration().setCacheLoaderConfiguration(getCacheLoaderConfig(false, true));
+ cache.getConfiguration().setCacheLoaderConfig(getCacheLoaderConfig(false, true));
cache.getConfiguration().setCacheMode("REPL_ASYNC");
cache.getConfiguration().setFetchInMemoryState(false);
cache.create();
@@ -237,7 +240,7 @@
TreeCache cache = new TreeCache();
cache.getConfiguration().setUseMbean(false);
cache.getConfiguration().setNodeLockingOptimistic(true);
- cache.getConfiguration().setCacheLoaderConfiguration(getCacheLoaderConfig(false, false));
+ cache.getConfiguration().setCacheLoaderConfig(getCacheLoaderConfig(false, false));
cache.create();
Interceptor next = new InterceptorChainFactory().buildInterceptorChain(cache);
@@ -265,7 +268,7 @@
TreeCache cache = new TreeCache();
cache.getConfiguration().setUseMbean(false);
cache.getConfiguration().setNodeLockingOptimistic(true);
- cache.getConfiguration().setCacheLoaderConfiguration(getCacheLoaderConfig(true, false));
+ cache.getConfiguration().setCacheLoaderConfig(getCacheLoaderConfig(true, false));
cache.create();
Interceptor next = new InterceptorChainFactory().buildInterceptorChain(cache);
@@ -387,8 +390,11 @@
xmlString += "<buddyPoolName>buddyPoolName</buddyPoolName>";
xmlString += "</config>";
+ Element element = XmlHelper.stringToElement(xmlString);
+ BuddyReplicationConfig brc = XmlConfigurationParser.parseBuddyReplicationConfig(element);
+ cache.getConfiguration().setBuddyReplicationConfig(brc);
+
cache.getConfiguration().setCacheMode("REPL_SYNC");
- cache.getConfiguration().setBuddyReplicationConfig(XmlHelper.stringToElement(xmlString));
cache.getConfiguration().setNodeLockingScheme("OPTIMISTIC");
cache.create(); // initialise various subsystems such as BRManager
Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);
@@ -423,8 +429,11 @@
xmlString += "<buddyPoolName>buddyPoolName</buddyPoolName>";
xmlString += "</config>";
+ Element element = XmlHelper.stringToElement(xmlString);
+ BuddyReplicationConfig brc = XmlConfigurationParser.parseBuddyReplicationConfig(element);
+ cache.getConfiguration().setBuddyReplicationConfig(brc);
+
cache.getConfiguration().setCacheMode("REPL_SYNC");
- cache.getConfiguration().setBuddyReplicationConfig(XmlHelper.stringToElement(xmlString));
cache.create(); // initialise various subsystems such as BRManager
Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);
More information about the jboss-cvs-commits
mailing list