Author: pnedonosko
Date: 2009-11-04 09:33:10 -0500 (Wed, 04 Nov 2009)
New Revision: 468
Modified:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoaderTest.java
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java
Log:
EXOJCR-201: test for loader
Modified:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoaderTest.java
===================================================================
---
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoaderTest.java 2009-11-04
14:10:22 UTC (rev 467)
+++
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoaderTest.java 2009-11-04
14:33:10 UTC (rev 468)
@@ -18,15 +18,7 @@
*/
package org.exoplatform.services.jcr.impl.storage.jbosscache;
-import org.jboss.cache.Cache;
-import org.jboss.cache.DefaultCacheFactory;
-import org.jboss.cache.Fqn;
-import org.jboss.cache.Node;
-import java.io.Serializable;
-
-import junit.framework.TestCase;
-
/**
* Created by The eXo Platform SAS.
*
@@ -35,49 +27,15 @@
* @author <a href="mailto:peter.nedonosko@exoplatform.com.ua">Peter
Nedonosko</a>
* @version $Id$
*/
-public class ExoJCRCacheLoaderTest extends TestCase
+public class ExoJCRCacheLoaderTest extends JBossCacheStorageConnectionTest
{
- private Cache<Serializable, Object> cache;
-
- private Node<Serializable, Object> tree;
-
- private Node<Serializable, Object> items;
-
- /**
- * {@inheritDoc}
- */
- protected void setUp() throws Exception
+ @Override
+ protected void initJBCConfig()
{
- super.setUp();
-
- // JBossCache
- String jbcConfig =
"conf/standalone/test-jbosscache-config-exoloader.xml";
-
- cache = new DefaultCacheFactory<Serializable,
Object>().createCache(jbcConfig);
-
- Node<Serializable, Object> cacheRoot = cache.getRoot();
- Node<Serializable, Object> wsRoot =
cacheRoot.addChild(Fqn.fromElements("repo", "ws"));
-
- // prepare cache structures
- tree = wsRoot.addChild(Fqn.fromString(JBossCacheWorkspaceDataContainer.ROOT));
- items = wsRoot.addChild(Fqn.fromString(JBossCacheWorkspaceDataContainer.ITEMS));
-
- // run cache
- cache.create();
- cache.start();
-
- // JCR connection
- //conn = new JBossCacheStorageConnection(cache, tree, items);
-
+ jbcConfig = "conf/standalone/test-jbosscache-config-exoloader.xml";
}
- /**
- * {@inheritDoc}
- */
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
+
+
}
Modified:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java
===================================================================
---
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 2009-11-04
14:10:22 UTC (rev 467)
+++
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 2009-11-04
14:33:10 UTC (rev 468)
@@ -68,13 +68,15 @@
public class JBossCacheStorageConnectionTest extends TestCase
{
- private JBossCacheStorageConnection conn;
+ protected JBossCacheStorageConnection conn;
- private Cache<Serializable, Object> cache;
+ protected Cache<Serializable, Object> cache;
- private Node<Serializable, Object> tree;
+ protected Node<Serializable, Object> tree;
- private Node<Serializable, Object> items;
+ protected Node<Serializable, Object> items;
+
+ protected String jbcConfig;
/**
* {@inheritDoc}
@@ -84,16 +86,16 @@
super.setUp();
// JBossCache
- String jbcConfig =
"conf/standalone/test-jbosscache-config-jdbcloader.xml";
-
+ initJBCConfig();
+
cache = new DefaultCacheFactory<Serializable,
Object>().createCache(jbcConfig);
Node<Serializable, Object> cacheRoot = cache.getRoot();
//Node<Serializable, Object> wsRoot =
cacheRoot.addChild(Fqn.fromElements("repo", "ws"));
// prepare cache structures
- tree = cacheRoot.addChild(Fqn.fromString(JBossCacheWorkspaceDataContainer.ROOT));
- items =
cacheRoot.addChild(Fqn.fromString(JBossCacheWorkspaceDataContainer.ITEMS));
+ tree = cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.TREE));
+ items = cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.ITEMS));
// run cache
cache.create();
@@ -102,6 +104,10 @@
// JCR connection
conn = new JBossCacheStorageConnection(cache, tree, items);
}
+
+ protected void initJBCConfig() {
+ jbcConfig = "conf/standalone/test-jbosscache-config-jdbcloader.xml";
+ }
/**
* {@inheritDoc}
Show replies by date