[infinispan-commits] Infinispan SVN: r1913 - in trunk/cachestore/remote/src/test/java: org and 4 other directories.

infinispan-commits at lists.jboss.org infinispan-commits at lists.jboss.org
Wed Jun 16 03:11:35 EDT 2010


Author: galder.zamarreno at jboss.com
Date: 2010-06-16 03:11:35 -0400 (Wed, 16 Jun 2010)
New Revision: 1913

Added:
   trunk/cachestore/remote/src/test/java/org/
   trunk/cachestore/remote/src/test/java/org/infinispan/
   trunk/cachestore/remote/src/test/java/org/infinispan/loaders/
   trunk/cachestore/remote/src/test/java/org/infinispan/loaders/remote/
   trunk/cachestore/remote/src/test/java/org/infinispan/loaders/remote/RemoteCacheStoreConfigTest.java
   trunk/cachestore/remote/src/test/java/org/infinispan/loaders/remote/RemoteCacheStoreFunctionalTest.java
   trunk/cachestore/remote/src/test/java/org/infinispan/loaders/remote/RemoteCacheStoreTest.java
Removed:
   trunk/cachestore/remote/src/test/java/org.infinispan.loaders.remote/RemoteCacheStoreConfigTest.java
   trunk/cachestore/remote/src/test/java/org.infinispan.loaders.remote/RemoteCacheStoreFunctionalTest.java
   trunk/cachestore/remote/src/test/java/org.infinispan.loaders.remote/RemoteCacheStoreTest.java
Log:
[ISPN-495] (Incorrect directory structure in cachestore/remote) Fixed..

Copied: trunk/cachestore/remote/src/test/java/org/infinispan/loaders/remote/RemoteCacheStoreConfigTest.java (from rev 1907, trunk/cachestore/remote/src/test/java/org.infinispan.loaders.remote/RemoteCacheStoreConfigTest.java)
===================================================================
--- trunk/cachestore/remote/src/test/java/org/infinispan/loaders/remote/RemoteCacheStoreConfigTest.java	                        (rev 0)
+++ trunk/cachestore/remote/src/test/java/org/infinispan/loaders/remote/RemoteCacheStoreConfigTest.java	2010-06-16 07:11:35 UTC (rev 1913)
@@ -0,0 +1,64 @@
+package org.infinispan.loaders.remote;
+
+import org.infinispan.Cache;
+import org.infinispan.loaders.CacheLoader;
+import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.DefaultCacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
+import org.infinispan.server.hotrod.HotRodServer;
+import org.infinispan.server.hotrod.test.HotRodTestingUtil;
+import org.infinispan.test.TestingUtil;
+import org.infinispan.test.fwk.TestCacheManagerFactory;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+
+import java.io.IOException;
+
+import static junit.framework.Assert.assertEquals;
+
+/**
+ * Simple test to sample how remote cache store is configured.
+ *
+ * @author Mircea.Markus at jboss.com
+ * @since 4.1
+ */
+ at Test(testName = "loaders.remote.RemoteCacheStoreConfigTest", groups = "functional")
+public class RemoteCacheStoreConfigTest {
+
+   public static final String CACHE_LOADER_CONFIG = "remote-cl-config.xml";
+   private EmbeddedCacheManager cacheManager;
+   private HotRodServer hotRodServer;
+
+   @BeforeTest
+   public void startUp() {
+      cacheManager = TestCacheManagerFactory.createLocalCacheManager();
+      assertEquals(cacheManager.getCache().size(), 0);
+      hotRodServer = HotRodTestingUtil.startHotRodServer(cacheManager, 19711);
+   }
+
+   public void simpleTest() throws IOException {
+      CacheManager cm = new DefaultCacheManager(CACHE_LOADER_CONFIG);
+      Cache<Object, Object> cache = cm.getCache();
+      CacheLoader cacheLoader = TestingUtil.getCacheLoader(cache);
+      assert cacheLoader != null;
+      assert cacheLoader instanceof RemoteCacheStore;
+
+
+      cache.put("k", "v");
+
+      assertEquals(1, cacheManager.getCache().size());
+      cache.stop();
+      assertEquals(1, cacheManager.getCache().size());
+      cm.stop();
+      cm = new DefaultCacheManager(CACHE_LOADER_CONFIG);
+      cache = cm.getCache();
+      assertEquals("v", cache.get("k"));
+   }
+
+   @AfterTest
+   public void tearDown() {
+      hotRodServer.stop();
+      cacheManager.stop();
+   }
+}

Copied: trunk/cachestore/remote/src/test/java/org/infinispan/loaders/remote/RemoteCacheStoreFunctionalTest.java (from rev 1907, trunk/cachestore/remote/src/test/java/org.infinispan.loaders.remote/RemoteCacheStoreFunctionalTest.java)
===================================================================
--- trunk/cachestore/remote/src/test/java/org/infinispan/loaders/remote/RemoteCacheStoreFunctionalTest.java	                        (rev 0)
+++ trunk/cachestore/remote/src/test/java/org/infinispan/loaders/remote/RemoteCacheStoreFunctionalTest.java	2010-06-16 07:11:35 UTC (rev 1913)
@@ -0,0 +1,53 @@
+package org.infinispan.loaders.remote;
+
+import org.infinispan.client.hotrod.TestHelper;
+import org.infinispan.loaders.BaseCacheStoreFunctionalTest;
+import org.infinispan.loaders.CacheStoreConfig;
+import org.infinispan.manager.DefaultCacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
+import org.infinispan.server.hotrod.HotRodServer;
+import org.infinispan.test.fwk.TestCacheManagerFactory;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.Test;
+
+import java.util.Properties;
+
+/**
+ * @author Mircea.Markus at jboss.com
+ * @since 4.1
+ */
+ at Test(testName = "loaders.remote.RemoteCacheStoreFunctionalTest", groups = "functional")
+public class RemoteCacheStoreFunctionalTest extends BaseCacheStoreFunctionalTest {
+   private EmbeddedCacheManager localCacheManager;
+   private HotRodServer hrServer;
+
+   @Override
+   protected CacheStoreConfig createCacheStoreConfig() throws Exception {
+      RemoteCacheStoreConfig remoteCacheStoreConfig = new RemoteCacheStoreConfig();
+      localCacheManager = TestCacheManagerFactory.createLocalCacheManager();
+      hrServer = TestHelper.startHotRodServer(localCacheManager);
+
+      remoteCacheStoreConfig.setRemoteCacheName(DefaultCacheManager.DEFAULT_CACHE_NAME);
+      Properties properties = new Properties();
+      properties.put("hotrod-servers", "localhost:"+ hrServer.getPort());
+      remoteCacheStoreConfig.setHotRodClientProperties(properties);
+
+      return remoteCacheStoreConfig;
+   }
+
+   @AfterTest
+   public void tearDown() {
+      hrServer.stop();
+      localCacheManager.stop();
+   }
+
+   @Override
+   public void testPreloadAndExpiry() {
+      assert true : "Remote cache store does not support preload";
+   }
+
+   @Override
+   public void testTwoCachesSameCacheStore() {
+      //not applicable
+   }
+}

Copied: trunk/cachestore/remote/src/test/java/org/infinispan/loaders/remote/RemoteCacheStoreTest.java (from rev 1907, trunk/cachestore/remote/src/test/java/org.infinispan.loaders.remote/RemoteCacheStoreTest.java)
===================================================================
--- trunk/cachestore/remote/src/test/java/org/infinispan/loaders/remote/RemoteCacheStoreTest.java	                        (rev 0)
+++ trunk/cachestore/remote/src/test/java/org/infinispan/loaders/remote/RemoteCacheStoreTest.java	2010-06-16 07:11:35 UTC (rev 1913)
@@ -0,0 +1,99 @@
+package org.infinispan.loaders.remote;
+
+import org.infinispan.client.hotrod.TestHelper;
+import org.infinispan.config.Configuration;
+import org.infinispan.container.entries.InternalCacheEntry;
+import org.infinispan.container.entries.InternalEntryFactory;
+import org.infinispan.eviction.EvictionStrategy;
+import org.infinispan.loaders.BaseCacheStoreTest;
+import org.infinispan.loaders.CacheLoaderException;
+import org.infinispan.loaders.CacheStore;
+import org.infinispan.manager.EmbeddedCacheManager;
+import org.infinispan.server.hotrod.HotRodServer;
+import org.infinispan.test.fwk.TestCacheManagerFactory;
+import org.infinispan.util.logging.Log;
+import org.infinispan.util.logging.LogFactory;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.Test;
+
+import java.io.IOException;
+import java.util.Properties;
+
+/**
+ * @author Mircea.Markus at jboss.com
+ * @since 4.1
+ */
+ at Test(testName = "loaders.remote.RemoteCacheStoreTest", groups = "functional")
+public class RemoteCacheStoreTest extends BaseCacheStoreTest {
+
+   private EmbeddedCacheManager localCacheManager;
+   private HotRodServer hrServer;
+
+   @Override
+   protected CacheStore createCacheStore() throws Exception {
+      RemoteCacheStoreConfig remoteCacheStoreConfig = new RemoteCacheStoreConfig();
+      remoteCacheStoreConfig.setUseDefaultRemoteCache(true);
+      assert remoteCacheStoreConfig.isUseDefaultRemoteCache();
+      
+      localCacheManager = TestCacheManagerFactory.createLocalCacheManager();
+      Configuration configuration = localCacheManager.getDefaultConfiguration();
+      configuration.setEvictionWakeUpInterval(10);
+      configuration.setEvictionStrategy(EvictionStrategy.UNORDERED);
+      hrServer = TestHelper.startHotRodServer(localCacheManager);
+      Properties properties = new Properties();
+      properties.put("hotrod-servers", "localhost:" + hrServer.getPort());
+      remoteCacheStoreConfig.setHotRodClientProperties(properties);
+
+      RemoteCacheStore remoteCacheStore = new RemoteCacheStore();
+      remoteCacheStore.init(remoteCacheStoreConfig, getCache(), getMarshaller());
+      remoteCacheStore.start();
+      super.supportsLoadAll = false;
+      return remoteCacheStore;
+   }
+
+   @AfterTest
+   public void tearDown() {
+      hrServer.stop();
+      localCacheManager.stop();
+   }
+
+   @Override
+   public void testLoadKeys() throws CacheLoaderException {
+      //not applicable as relies on loadAll
+   }
+
+   @Override
+   protected void purgeExpired() throws CacheLoaderException {
+      localCacheManager.getCache().clear();
+   }
+
+   @Override
+   public void testPreload() throws CacheLoaderException {
+      //not applicable as relies on loadAll
+   }
+
+   @Override
+   public void testPreloadWithMaxSize() throws CacheLoaderException {
+      //not applicable as relies on loadAll
+   }
+
+   protected void sleepForStopStartTest() throws InterruptedException {
+      Thread.sleep(3000);
+   }
+
+
+   @Override
+   public void testStoreAndRemoveAll() throws CacheLoaderException {
+      //not applicable as relies on loadAll
+   }
+
+   @Override
+   public void testStreamingAPI() throws IOException, ClassNotFoundException, CacheLoaderException {
+      //not applicable as relies on loadAll
+   }
+
+   @Override
+   public void testStreamingAPIReusingStreams() throws IOException, ClassNotFoundException, CacheLoaderException {
+      //not applicable as relies on loadAll
+   }
+}

Deleted: trunk/cachestore/remote/src/test/java/org.infinispan.loaders.remote/RemoteCacheStoreConfigTest.java
===================================================================
--- trunk/cachestore/remote/src/test/java/org.infinispan.loaders.remote/RemoteCacheStoreConfigTest.java	2010-06-13 20:55:36 UTC (rev 1912)
+++ trunk/cachestore/remote/src/test/java/org.infinispan.loaders.remote/RemoteCacheStoreConfigTest.java	2010-06-16 07:11:35 UTC (rev 1913)
@@ -1,64 +0,0 @@
-package org.infinispan.loaders.remote;
-
-import org.infinispan.Cache;
-import org.infinispan.loaders.CacheLoader;
-import org.infinispan.manager.CacheManager;
-import org.infinispan.manager.DefaultCacheManager;
-import org.infinispan.manager.EmbeddedCacheManager;
-import org.infinispan.server.hotrod.HotRodServer;
-import org.infinispan.server.hotrod.test.HotRodTestingUtil;
-import org.infinispan.test.TestingUtil;
-import org.infinispan.test.fwk.TestCacheManagerFactory;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Test;
-
-import java.io.IOException;
-
-import static junit.framework.Assert.assertEquals;
-
-/**
- * Simple test to sample how remote cache store is configured.
- *
- * @author Mircea.Markus at jboss.com
- * @since 4.1
- */
- at Test(testName = "loaders.remote.RemoteCacheStoreConfigTest", groups = "functional")
-public class RemoteCacheStoreConfigTest {
-
-   public static final String CACHE_LOADER_CONFIG = "remote-cl-config.xml";
-   private EmbeddedCacheManager cacheManager;
-   private HotRodServer hotRodServer;
-
-   @BeforeTest
-   public void startUp() {
-      cacheManager = TestCacheManagerFactory.createLocalCacheManager();
-      assertEquals(cacheManager.getCache().size(), 0);
-      hotRodServer = HotRodTestingUtil.startHotRodServer(cacheManager, 19711);
-   }
-
-   public void simpleTest() throws IOException {
-      CacheManager cm = new DefaultCacheManager(CACHE_LOADER_CONFIG);
-      Cache<Object, Object> cache = cm.getCache();
-      CacheLoader cacheLoader = TestingUtil.getCacheLoader(cache);
-      assert cacheLoader != null;
-      assert cacheLoader instanceof RemoteCacheStore;
-
-
-      cache.put("k", "v");
-
-      assertEquals(1, cacheManager.getCache().size());
-      cache.stop();
-      assertEquals(1, cacheManager.getCache().size());
-      cm.stop();
-      cm = new DefaultCacheManager(CACHE_LOADER_CONFIG);
-      cache = cm.getCache();
-      assertEquals("v", cache.get("k"));
-   }
-
-   @AfterTest
-   public void tearDown() {
-      hotRodServer.stop();
-      cacheManager.stop();
-   }
-}

Deleted: trunk/cachestore/remote/src/test/java/org.infinispan.loaders.remote/RemoteCacheStoreFunctionalTest.java
===================================================================
--- trunk/cachestore/remote/src/test/java/org.infinispan.loaders.remote/RemoteCacheStoreFunctionalTest.java	2010-06-13 20:55:36 UTC (rev 1912)
+++ trunk/cachestore/remote/src/test/java/org.infinispan.loaders.remote/RemoteCacheStoreFunctionalTest.java	2010-06-16 07:11:35 UTC (rev 1913)
@@ -1,53 +0,0 @@
-package org.infinispan.loaders.remote;
-
-import org.infinispan.client.hotrod.TestHelper;
-import org.infinispan.loaders.BaseCacheStoreFunctionalTest;
-import org.infinispan.loaders.CacheStoreConfig;
-import org.infinispan.manager.DefaultCacheManager;
-import org.infinispan.manager.EmbeddedCacheManager;
-import org.infinispan.server.hotrod.HotRodServer;
-import org.infinispan.test.fwk.TestCacheManagerFactory;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.Test;
-
-import java.util.Properties;
-
-/**
- * @author Mircea.Markus at jboss.com
- * @since 4.1
- */
- at Test(testName = "loaders.remote.RemoteCacheStoreFunctionalTest", groups = "functional")
-public class RemoteCacheStoreFunctionalTest extends BaseCacheStoreFunctionalTest {
-   private EmbeddedCacheManager localCacheManager;
-   private HotRodServer hrServer;
-
-   @Override
-   protected CacheStoreConfig createCacheStoreConfig() throws Exception {
-      RemoteCacheStoreConfig remoteCacheStoreConfig = new RemoteCacheStoreConfig();
-      localCacheManager = TestCacheManagerFactory.createLocalCacheManager();
-      hrServer = TestHelper.startHotRodServer(localCacheManager);
-
-      remoteCacheStoreConfig.setRemoteCacheName(DefaultCacheManager.DEFAULT_CACHE_NAME);
-      Properties properties = new Properties();
-      properties.put("hotrod-servers", "localhost:"+ hrServer.getPort());
-      remoteCacheStoreConfig.setHotRodClientProperties(properties);
-
-      return remoteCacheStoreConfig;
-   }
-
-   @AfterTest
-   public void tearDown() {
-      hrServer.stop();
-      localCacheManager.stop();
-   }
-
-   @Override
-   public void testPreloadAndExpiry() {
-      assert true : "Remote cache store does not support preload";
-   }
-
-   @Override
-   public void testTwoCachesSameCacheStore() {
-      //not applicable
-   }
-}

Deleted: trunk/cachestore/remote/src/test/java/org.infinispan.loaders.remote/RemoteCacheStoreTest.java
===================================================================
--- trunk/cachestore/remote/src/test/java/org.infinispan.loaders.remote/RemoteCacheStoreTest.java	2010-06-13 20:55:36 UTC (rev 1912)
+++ trunk/cachestore/remote/src/test/java/org.infinispan.loaders.remote/RemoteCacheStoreTest.java	2010-06-16 07:11:35 UTC (rev 1913)
@@ -1,99 +0,0 @@
-package org.infinispan.loaders.remote;
-
-import org.infinispan.client.hotrod.TestHelper;
-import org.infinispan.config.Configuration;
-import org.infinispan.container.entries.InternalCacheEntry;
-import org.infinispan.container.entries.InternalEntryFactory;
-import org.infinispan.eviction.EvictionStrategy;
-import org.infinispan.loaders.BaseCacheStoreTest;
-import org.infinispan.loaders.CacheLoaderException;
-import org.infinispan.loaders.CacheStore;
-import org.infinispan.manager.EmbeddedCacheManager;
-import org.infinispan.server.hotrod.HotRodServer;
-import org.infinispan.test.fwk.TestCacheManagerFactory;
-import org.infinispan.util.logging.Log;
-import org.infinispan.util.logging.LogFactory;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.Test;
-
-import java.io.IOException;
-import java.util.Properties;
-
-/**
- * @author Mircea.Markus at jboss.com
- * @since 4.1
- */
- at Test(testName = "loaders.remote.RemoteCacheStoreTest", groups = "functional")
-public class RemoteCacheStoreTest extends BaseCacheStoreTest {
-
-   private EmbeddedCacheManager localCacheManager;
-   private HotRodServer hrServer;
-
-   @Override
-   protected CacheStore createCacheStore() throws Exception {
-      RemoteCacheStoreConfig remoteCacheStoreConfig = new RemoteCacheStoreConfig();
-      remoteCacheStoreConfig.setUseDefaultRemoteCache(true);
-      assert remoteCacheStoreConfig.isUseDefaultRemoteCache();
-      
-      localCacheManager = TestCacheManagerFactory.createLocalCacheManager();
-      Configuration configuration = localCacheManager.getDefaultConfiguration();
-      configuration.setEvictionWakeUpInterval(10);
-      configuration.setEvictionStrategy(EvictionStrategy.UNORDERED);
-      hrServer = TestHelper.startHotRodServer(localCacheManager);
-      Properties properties = new Properties();
-      properties.put("hotrod-servers", "localhost:" + hrServer.getPort());
-      remoteCacheStoreConfig.setHotRodClientProperties(properties);
-
-      RemoteCacheStore remoteCacheStore = new RemoteCacheStore();
-      remoteCacheStore.init(remoteCacheStoreConfig, getCache(), getMarshaller());
-      remoteCacheStore.start();
-      super.supportsLoadAll = false;
-      return remoteCacheStore;
-   }
-
-   @AfterTest
-   public void tearDown() {
-      hrServer.stop();
-      localCacheManager.stop();
-   }
-
-   @Override
-   public void testLoadKeys() throws CacheLoaderException {
-      //not applicable as relies on loadAll
-   }
-
-   @Override
-   protected void purgeExpired() throws CacheLoaderException {
-      localCacheManager.getCache().clear();
-   }
-
-   @Override
-   public void testPreload() throws CacheLoaderException {
-      //not applicable as relies on loadAll
-   }
-
-   @Override
-   public void testPreloadWithMaxSize() throws CacheLoaderException {
-      //not applicable as relies on loadAll
-   }
-
-   protected void sleepForStopStartTest() throws InterruptedException {
-      Thread.sleep(3000);
-   }
-
-
-   @Override
-   public void testStoreAndRemoveAll() throws CacheLoaderException {
-      //not applicable as relies on loadAll
-   }
-
-   @Override
-   public void testStreamingAPI() throws IOException, ClassNotFoundException, CacheLoaderException {
-      //not applicable as relies on loadAll
-   }
-
-   @Override
-   public void testStreamingAPIReusingStreams() throws IOException, ClassNotFoundException, CacheLoaderException {
-      //not applicable as relies on loadAll
-   }
-}



More information about the infinispan-commits mailing list