Package org.infinispan.client.hotrod.impl.consistenthash

Examples of org.infinispan.client.hotrod.impl.consistenthash.ConsistentHashFactory


   public void testPropertyCorrectlyRead() {
      Properties propos = new Properties();
      String value = "org.infinispan.client.hotrod.impl.consistenthash.SomeCustomConsitentHashV1";
      propos.put(ConfigurationProperties.HASH_FUNCTION_PREFIX + ".1", value);
      ConsistentHashFactory chf = new ConsistentHashFactory();
      chf.init(new ConfigurationProperties(propos), Thread.currentThread().getContextClassLoader());
      String s = chf.getVersion2ConsistentHash().get(1);
      assert s != null;
      assert value.equals(s);
   }
View Full Code Here


      assert s != null;
      assert value.equals(s);
   }

   public void testNoChDefined() {
      ConsistentHashFactory chf = new ConsistentHashFactory();
      ConsistentHash hash = chf.newConsistentHash(1);
      assert hash != null;
      assert hash.getClass().equals(ConsistentHashV1.class);
   }
View Full Code Here

public class ConsistentHashFactoryTest {

   public void testPropertyCorrectlyRead() {
      ConfigurationBuilder builder = new ConfigurationBuilder();
      builder.consistentHashImpl(1, SomeCustomConsistentHashV1.class);
      ConsistentHashFactory chf = new ConsistentHashFactory();
      chf.init(builder.build());
      ConsistentHash hash = chf.newConsistentHash(1);
      assertNotNull(hash);
      assertEquals(hash.getClass(), SomeCustomConsistentHashV1.class);
   }
View Full Code Here

      assertEquals(hash.getClass(), SomeCustomConsistentHashV1.class);
   }

   public void testNoChDefined() {
      ConfigurationBuilder builder = new ConfigurationBuilder();
      ConsistentHashFactory chf = new ConsistentHashFactory();
      chf.init(builder.build());
      ConsistentHash hash = chf.newConsistentHash(1);
      assertNotNull(hash);
      assertEquals(hash.getClass(), ConsistentHashV1.class);
   }
View Full Code Here

TOP

Related Classes of org.infinispan.client.hotrod.impl.consistenthash.ConsistentHashFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.