[infinispan-commits] Infinispan SVN: r2042 - in trunk/client/hotrod-client/src: test/java/org/infinispan/client/hotrod and 1 other directory.

infinispan-commits at lists.jboss.org infinispan-commits at lists.jboss.org
Thu Jul 15 18:56:34 EDT 2010


Author: manik.surtani at jboss.com
Date: 2010-07-15 18:56:34 -0400 (Thu, 15 Jul 2010)
New Revision: 2042

Modified:
   trunk/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java
   trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/RemoteCacheManagerTest.java
Log:
[ISPN-534] (Standardise keys used for System properties, .properties and Properties entries) Fixed regression

Modified: trunk/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java
===================================================================
--- trunk/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java	2010-07-15 17:02:51 UTC (rev 2041)
+++ trunk/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java	2010-07-15 22:56:34 UTC (rev 2042)
@@ -124,7 +124,7 @@
 
    public static final String HOTROD_CLIENT_PROPERTIES = "hotrod-client.properties";
 
-   private ConfigurationProperties config;
+   ConfigurationProperties config;
    private TransportFactory transportFactory;
    private Marshaller marshaller;
    private boolean started = false;
@@ -258,7 +258,6 @@
       this(config, true);
    }
 
-
    public <K, V> RemoteCache<K, V> getCache(String cacheName) {
       return getCache(cacheName, forceReturnValueDefault);
    }

Modified: trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/RemoteCacheManagerTest.java
===================================================================
--- trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/RemoteCacheManagerTest.java	2010-07-15 17:02:51 UTC (rev 2041)
+++ trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/RemoteCacheManagerTest.java	2010-07-15 22:56:34 UTC (rev 2042)
@@ -1,5 +1,6 @@
 package org.infinispan.client.hotrod;
 
+import org.infinispan.client.hotrod.impl.ConfigurationProperties;
 import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.server.hotrod.HotRodServer;
 import org.infinispan.test.SingleCacheManagerTest;
@@ -19,11 +20,13 @@
 
    EmbeddedCacheManager cacheManager = null;
    HotRodServer hotrodServer = null;
+   int port;
 
    @Override
    protected EmbeddedCacheManager createCacheManager() throws Exception {
       cacheManager = TestCacheManagerFactory.createLocalCacheManager();
       hotrodServer = TestHelper.startHotRodServer(cacheManager);
+      port = hotrodServer.getPort();
       return cacheManager;
    }
 
@@ -49,34 +52,31 @@
       remoteCacheManager.start();
       remoteCacheManager.stop();
    }
-
-   public void testUrlConstructor() throws Exception {
-      URL resource = Thread.currentThread().getContextClassLoader().getResource("empty-config.properties");
-      assert resource != null;
-      RemoteCacheManager remoteCacheManager = new RemoteCacheManager(resource);
-      assertWorks(remoteCacheManager);
-      remoteCacheManager.stop();
-   }
    
    public void testUrlAndBooleanConstructor() throws Exception {
       URL resource = Thread.currentThread().getContextClassLoader().getResource("empty-config.properties");
       assert resource != null;
       RemoteCacheManager remoteCacheManager = new RemoteCacheManager(resource, false);
       assert !remoteCacheManager.isStarted();
+      remoteCacheManager.config.getProperties().setProperty(ConfigurationProperties.SERVER_LIST, "127.0.0.1:" + port);
       remoteCacheManager.start();
       assertWorks(remoteCacheManager);
       remoteCacheManager.stop();
    }
 
    public void testPropertiesConstructor() {
-      RemoteCacheManager remoteCacheManager = new RemoteCacheManager(new Properties());
+      Properties p = new Properties();
+      p.setProperty(ConfigurationProperties.SERVER_LIST, "127.0.0.1:" + port);
+      RemoteCacheManager remoteCacheManager = new RemoteCacheManager(p);
       assert remoteCacheManager.isStarted();
       assertWorks(remoteCacheManager);
       remoteCacheManager.stop();
    }
 
    public void testPropertiesAndBooleanConstructor() {
-      RemoteCacheManager remoteCacheManager = new RemoteCacheManager(new Properties(), false);
+      Properties p = new Properties();
+      p.setProperty(ConfigurationProperties.SERVER_LIST, "127.0.0.1:" + port);
+      RemoteCacheManager remoteCacheManager = new RemoteCacheManager(p, false);
       assert !remoteCacheManager.isStarted();
       remoteCacheManager.start();
       assertWorks(remoteCacheManager);



More information about the infinispan-commits mailing list