Author: skabashnyuk
Date: 2009-11-09 10:07:10 -0500 (Mon, 09 Nov 2009)
New Revision: 518
Removed:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java
Log:
EXOJCR-202 : removed test
Deleted:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java
===================================================================
---
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-09
14:55:24 UTC (rev 517)
+++
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-09
15:07:10 UTC (rev 518)
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.impl.storage.jbosscache;
-
-import junit.framework.TestCase;
-
-import org.jboss.cache.Cache;
-import org.jboss.cache.CacheFactory;
-import org.jboss.cache.DefaultCacheFactory;
-import org.jboss.cache.Fqn;
-import org.jboss.cache.Node;
-import org.jboss.cache.config.CacheLoaderConfig;
-import org.jboss.cache.config.Configuration;
-import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
-
-import java.io.Serializable;
-
-/**
- * @author <a href="mailto:Sergey.Kabashnyuk@exoplatform.org">Sergey
Kabashnyuk</a>
- * @version $Id: exo-jboss-codetemplates.xml 34360 2009-07-22 23:58:59Z ksm $
- *
- */
-public abstract class AbstractCacheLoaderTest extends TestCase
-{
- protected Cache<Serializable, Object> cache;
-
- protected JBossCacheStorageConnection jBossCacheStorageConnection;
-
- /**
- * @see junit.framework.TestCase#setUp()
- */
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- CacheFactory<Serializable, Object> factory = new
DefaultCacheFactory<Serializable, Object>();
- cache = factory.createCache(createCacheConfiguration());
-
- Node<Serializable, Object> cacheRoot = cache.getRoot();
-
- // run cache
- cache.create();
- cache.start();
- cache.startBatch();
- // prepare cache structures
- Node<Serializable, Object> nodes =
cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.NODES));
- Node<Serializable, Object> props =
cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.PROPS));
-
- this.cache.endBatch(true);
-
- // JCR connection
- jBossCacheStorageConnection = new JBossCacheStorageConnection(cache, nodes,
props);
- }
-
- /**
- * Create cache configuration.
- * @return
- */
- protected Configuration createCacheConfiguration()
- {
- Configuration config = new Configuration();
- config.setInvocationBatchingEnabled(true);
- config.setCacheLoaderConfig(createCacheLoaderConfig());
- return config;
- }
-
- /**
- * Create cache configuration.
- * @return
- */
- protected CacheLoaderConfig createCacheLoaderConfig()
- {
- CacheLoaderConfig cacheLoaderConfig = new CacheLoaderConfig();
- cacheLoaderConfig.setPassivation(false);
- cacheLoaderConfig.setShared(false);
-
cacheLoaderConfig.addIndividualCacheLoaderConfig(createIndividualCacheLoaderConfig());
- return cacheLoaderConfig;
- };
-
- protected abstract IndividualCacheLoaderConfig createIndividualCacheLoaderConfig();
-
-}
Deleted:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java
===================================================================
---
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-09
14:55:24 UTC (rev 517)
+++
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-09
15:07:10 UTC (rev 518)
@@ -1,158 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.impl.storage.jbosscache;
-
-import org.exoplatform.services.jcr.access.AccessControlList;
-import org.exoplatform.services.jcr.datamodel.InternalQName;
-import org.exoplatform.services.jcr.impl.Constants;
-import org.exoplatform.services.jcr.impl.core.SessionDataManager;
-import org.exoplatform.services.jcr.impl.core.SessionImpl;
-import org.exoplatform.services.jcr.impl.core.query.IndexException;
-import org.exoplatform.services.jcr.impl.core.query.QueryHandler;
-import org.exoplatform.services.jcr.impl.core.query.SearchManager;
-import org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexerCacheLoader;
-import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData;
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-import org.jboss.cache.Modification;
-import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.Set;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-import javax.jcr.query.InvalidQueryException;
-import javax.jcr.query.Query;
-
-/**
- * @author <a href="mailto:Sergey.Kabashnyuk@exoplatform.org">Sergey
Kabashnyuk</a>
- * @version $Id: exo-jboss-codetemplates.xml 34360 2009-07-22 23:58:59Z ksm $
- *
- */
-public class IndexerCacheLoaderTest extends AbstractCacheLoaderTest
-{
- private final Log log = ExoLogger.getLogger(IndexerCacheLoaderTest.class.getName());
-
- private IndexerCacheLoader loader;
-
- private FakeSearchManager manager;
-
- public void testAddNode() throws Exception
- {
-
- }
-
- public void testAddRoot() throws Exception
- {
- // add root (/)
- jBossCacheStorageConnection.add(new TransientNodeData(Constants.ROOT_PATH,
Constants.ROOT_UUID, 1,
- Constants.NT_UNSTRUCTURED, new InternalQName[0], 0, null, new
AccessControlList()));
- jBossCacheStorageConnection.commit();
-
- assertTrue(manager.getRemovedNodes().isEmpty());
- assertFalse(manager.getAddedNodes().isEmpty());
-
- }
-
- /**
- * @see
org.exoplatform.services.jcr.impl.storage.jbosscache.AbstractCacheLoaderTest#createIndividualCacheLoaderConfig()
- */
- @Override
- protected IndividualCacheLoaderConfig createIndividualCacheLoaderConfig()
- {
- IndividualCacheLoaderConfig individualCacheLoaderConfig = new
IndividualCacheLoaderConfig();
- loader = new IndexerCacheLoader();
- manager = new FakeSearchManager();
- loader.registerSearchManager(manager);
- individualCacheLoaderConfig.setCacheLoader(loader);
- return individualCacheLoaderConfig;
- }
-
- class FakeSearchManager implements SearchManager
- {
-
- private Set<String> removedNodes;
-
- private Set<String> addedNodes;
-
- public Query createQuery(SessionImpl session, SessionDataManager
sessionDataManager, Node node)
- throws InvalidQueryException, RepositoryException
- {
- return null;
- }
-
- public Query createQuery(SessionImpl session, SessionDataManager
sessionDataManager, String statement,
- String language) throws InvalidQueryException, RepositoryException
- {
- return null;
- }
-
- public Set<String> getAddedNodes()
- {
- return addedNodes;
- }
-
- public Set<String> getFieldNames() throws IndexException
- {
- return null;
- }
-
- public QueryHandler getHandler()
- {
- return null;
- }
-
- public Set<String> getNodesByNodeType(InternalQName nodeType) throws
RepositoryException
- {
- return null;
- }
-
- public Set<String> getNodesByUri(String uri) throws RepositoryException
- {
- return null;
- }
-
- public Set<String> getRemovedNodes()
- {
- return removedNodes;
- }
-
- public void updateIndex(Set<String> removedNodes, Set<String>
addedNodes) throws RepositoryException, IOException
- {
- this.removedNodes = removedNodes;
- this.addedNodes = addedNodes;
- }
- }
-
- private class DummyCacheLoader extends AbstractWriteOnlyCacheLoader
- {
-
- /**
- * @see
org.exoplatform.services.jcr.impl.storage.jbosscache.AbstractWriteOnlyCacheLoader#put(java.util.List)
- */
- @Override
- public void put(List<Modification> modifications) throws Exception
- {
- log.info("put:" + modifications);
-
- }
- }
-}