[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/mgmt ...
Brian Stansberry
brian.stansberry at jboss.com
Wed Oct 25 00:50:19 EDT 2006
User: bstansberry
Date: 06/10/25 00:50:19
Modified: tests/functional/org/jboss/cache/mgmt
PassivationTest.java CacheLoaderTest.java
NotificationTest.java
Log:
Handle parsing of config XML in XmlConfigurationParser
Revision Changes Path
1.6 +7 -4 JBossCache/tests/functional/org/jboss/cache/mgmt/PassivationTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: PassivationTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/mgmt/PassivationTest.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- PassivationTest.java 25 Sep 2006 05:50:05 -0000 1.5
+++ PassivationTest.java 25 Oct 2006 04:50:18 -0000 1.6
@@ -5,7 +5,9 @@
import junit.framework.TestSuite;
import org.jboss.cache.Fqn;
import org.jboss.cache.TreeCache;
+import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.config.Configuration;
+import org.jboss.cache.factories.XmlConfigurationParser;
import org.jboss.cache.interceptors.ActivationInterceptor;
import org.jboss.cache.interceptors.PassivationInterceptor;
import org.jboss.cache.loader.CacheLoader;
@@ -19,7 +21,7 @@
* Simple functional tests for ActivationInterceptor and PassivationInterceptor statistics
*
* @author Jerry Gauthier
- * @version $Id: PassivationTest.java,v 1.5 2006/09/25 05:50:05 bwang Exp $
+ * @version $Id: PassivationTest.java,v 1.6 2006/10/25 04:50:18 bstansberry Exp $
*/
public class PassivationTest extends TestCase
{
@@ -227,7 +229,7 @@
TreeCache cache = new TreeCache();
Configuration c = new Configuration();
c.setCacheMode("LOCAL");
- c.setCacheLoaderConfiguration(getCacheLoaderConfig("location=" + getTempDir()));
+ c.setCacheLoaderConfig(getCacheLoaderConfig("location=" + getTempDir()));
c.setUseMbean(true);
cache.setConfiguration(c);
cache.create();
@@ -265,7 +267,7 @@
return null;
}
- private Element getCacheLoaderConfig(String properties) throws Exception
+ private CacheLoaderConfig getCacheLoaderConfig(String properties) throws Exception
{
String xml = "<config>\n" +
"<passivation>true</passivation>\n" +
@@ -279,7 +281,8 @@
"<ignoreModifications>false</ignoreModifications>\n" +
"</cacheloader>\n" +
"</config>";
- return XmlHelper.stringToElement(xml);
+ Element element = XmlHelper.stringToElement(xml);
+ return XmlConfigurationParser.parseCacheLoaderConfig(element);
}
private String getTempDir()
1.8 +7 -4 JBossCache/tests/functional/org/jboss/cache/mgmt/CacheLoaderTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheLoaderTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/mgmt/CacheLoaderTest.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- CacheLoaderTest.java 25 Sep 2006 05:50:05 -0000 1.7
+++ CacheLoaderTest.java 25 Oct 2006 04:50:19 -0000 1.8
@@ -5,7 +5,9 @@
import junit.framework.TestSuite;
import org.jboss.cache.Fqn;
import org.jboss.cache.TreeCache;
+import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.config.Configuration;
+import org.jboss.cache.factories.XmlConfigurationParser;
import org.jboss.cache.interceptors.CacheLoaderInterceptor;
import org.jboss.cache.interceptors.CacheStoreInterceptor;
import org.jboss.cache.loader.CacheLoader;
@@ -19,7 +21,7 @@
* Simple functional tests for CacheLoaderInterceptor and CacheStoreInterceptor statistics
*
* @author Jerry Gauthier
- * @version $Id: CacheLoaderTest.java,v 1.7 2006/09/25 05:50:05 bwang Exp $
+ * @version $Id: CacheLoaderTest.java,v 1.8 2006/10/25 04:50:19 bstansberry Exp $
*/
public class CacheLoaderTest extends TestCase
{
@@ -202,7 +204,7 @@
{
TreeCache cache = new TreeCache();
cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
- cache.getConfiguration().setCacheLoaderConfiguration(getCacheLoaderConfig("location=" + getTempDir()));
+ cache.getConfiguration().setCacheLoaderConfig(getCacheLoaderConfig("location=" + getTempDir()));
cache.getConfiguration().setUseMbean(true);
cache.create();
cache.start();
@@ -239,7 +241,7 @@
return null;
}
- private Element getCacheLoaderConfig(String properties) throws Exception
+ private CacheLoaderConfig getCacheLoaderConfig(String properties) throws Exception
{
String xml = "<config>\n" +
"<passivation>false</passivation>\n" +
@@ -253,7 +255,8 @@
"<ignoreModifications>false</ignoreModifications>\n" +
"</cacheloader>\n" +
"</config>";
- return XmlHelper.stringToElement(xml);
+ Element element = XmlHelper.stringToElement(xml);
+ return XmlConfigurationParser.parseCacheLoaderConfig(element);
}
private String getTempDir()
1.12 +6 -4 JBossCache/tests/functional/org/jboss/cache/mgmt/NotificationTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: NotificationTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/mgmt/NotificationTest.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- NotificationTest.java 25 Sep 2006 05:50:05 -0000 1.11
+++ NotificationTest.java 25 Oct 2006 04:50:19 -0000 1.12
@@ -3,6 +3,7 @@
import junit.framework.TestCase;
import org.jboss.cache.Fqn;
import org.jboss.cache.TreeCache;
+import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.XmlConfigurationParser;
import org.jboss.cache.interceptors.CacheMgmtInterceptor;
@@ -22,7 +23,7 @@
* Functional tests for CacheMgmtInterceptor broadcast of cache event notifications
*
* @author Jerry Gauthier
- * @version $Id: NotificationTest.java,v 1.11 2006/09/25 05:50:05 bwang Exp $
+ * @version $Id: NotificationTest.java,v 1.12 2006/10/25 04:50:19 bstansberry Exp $
*/
public class NotificationTest extends TestCase
{
@@ -154,7 +155,7 @@
TreeCache cache = new TreeCache();
cache.setConfiguration(new XmlConfigurationParser().parseFile("META-INF/replSync-service.xml"));
cache.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
- cache.getConfiguration().setCacheLoaderConfiguration(getCacheLoaderConfig("location=" + getTempDir()));
+ cache.getConfiguration().setCacheLoaderConfig(getCacheLoaderConfig("location=" + getTempDir()));
cache.getConfiguration().setUseMbean(true);
cache.getConfiguration().setClusterName(clusterName);
if (optimistic)
@@ -183,7 +184,7 @@
return (Boolean) parms[1];
}
- private Element getCacheLoaderConfig(String properties) throws Exception
+ private CacheLoaderConfig getCacheLoaderConfig(String properties) throws Exception
{
String xml = "<config>\n" +
"<passivation>true</passivation>\n" +
@@ -197,7 +198,8 @@
"<ignoreModifications>false</ignoreModifications>\n" +
"</cacheloader>\n" +
"</config>";
- return XmlHelper.stringToElement(xml);
+ Element element = XmlHelper.stringToElement(xml);
+ return XmlConfigurationParser.parseCacheLoaderConfig(element);
}
private class MyListener implements NotificationListener
More information about the jboss-cvs-commits
mailing list