Author: areshetnyak
Date: 2009-11-09 09:20:47 -0500 (Mon, 09 Nov 2009)
New Revision: 510
Added:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java
Log:
EXOJCR-201 :Add test JDBCCacheLoaderTest.
Added:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java
===================================================================
---
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java
(rev 0)
+++
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-09
14:20:47 UTC (rev 510)
@@ -0,0 +1,133 @@
+package org.exoplatform.services.jcr.impl.storage.jbosscache;
+
+import java.io.Serializable;
+
+import javax.jcr.RepositoryException;
+
+import org.exoplatform.services.jcr.impl.storage.WorkspaceDataContainerBase;
+import org.exoplatform.services.jcr.storage.WorkspaceDataContainer;
+import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
+import org.jboss.cache.CacheSPI;
+import org.jboss.cache.DefaultCacheFactory;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.Node;
+import org.jboss.cache.factories.annotations.NonVolatile;
+import org.picocontainer.Startable;
+
+
+public class JDBCCacheLoaderTest extends JBossCacheStorageConnectionTest
+{
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void setUp() throws Exception
+ {
+ try {
+
+ // JBossCache
+ initJBCConfig();
+
+ cache = new DefaultCacheFactory<Serializable, Object>().createCache(jbcConfig
,false);
+
+
+
+
+ WorkspaceDataContainer persistentContainer = new
JDBCWorkspaceDataContainerTester();
+
+ ((CacheSPI<Serializable,
Object>)cache).getComponentRegistry().registerComponent(persistentContainer,
WorkspaceDataContainer.class);
+
+ // run cache
+ cache.create();
+ cache.start();
+
+ Node<Serializable, Object> cacheRoot = cache.getRoot();
+
+ // prepare cache structures
+ nodes = cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.NODES));
+ props = cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.PROPS));
+
+ // JCR connection
+ conn = new JBossCacheStorageConnection(cache, nodes, props);
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw e;
+ }
+ }
+
+ protected void initJBCConfig()
+ {
+ jbcConfig = "conf/standalone/test-jbosscache-config-exoloader.xml";
+ }
+
+ public void testAddNode() throws Exception
+ {
+ super.testAddNode();
+ conn.commit();
+ }
+}
+@NonVolatile
+class JDBCWorkspaceDataContainerTester extends WorkspaceDataContainerBase implements
Startable
+{
+
+ public JDBCWorkspaceDataContainerTester()
+ {
+ }
+
+ public void start()
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void stop()
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public boolean isSame(WorkspaceDataContainer another)
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public WorkspaceStorageConnection openConnection() throws RepositoryException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public WorkspaceStorageConnection openConnection(boolean readOnly) throws
RepositoryException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public WorkspaceStorageConnection reuseConnection(WorkspaceStorageConnection original)
throws RepositoryException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getInfo()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getName()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getStorageVersion()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+}
+
Property changes on:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Show replies by date