Package org.infinispan.util

Examples of org.infinispan.util.ByteArrayKey


         assert inf.toString().contains("in object java.lang.Object@");
      }
   }

   public void testByteArrayKey() throws Exception {
      ByteArrayKey o = new ByteArrayKey("123".getBytes());
      marshallAndAssertEquality(o);
   }
View Full Code Here


         assert inf.toString().contains("in object java.lang.Object@");
      }
   }

   public void testByteArrayKey() throws Exception {
      ByteArrayKey o = new ByteArrayKey("123".getBytes());
      marshallAndAssertEquality(o);
   }
View Full Code Here

         barrier.await();

         try {
            for (int i = 0; i < 10; i ++) {
               String decimal = Integer.toString(i);
               ByteArrayKey key = new ByteArrayKey(
                     ("key-" + Thread.currentThread().getName() + decimal).getBytes());
               ByteArrayKey value = new ByteArrayKey(
                     ("value-" + Thread.currentThread().getName() + decimal).getBytes());
               cache.put(key, value);
            }
            return null;
         } finally {
View Full Code Here

   public void testByteArrayKey(Method m) {
      CacheContainer localCacheContainer = getContainerWithCacheLoader();
      try {
         Cache<ByteArrayKey, Object> cache = localCacheContainer.getCache();
         cache.put(new ByteArrayKey(m.getName().getBytes()), "hello");
      } finally {
         TestingUtil.killCacheManagers(localCacheContainer);
      }
   }
View Full Code Here

      assert d == 3.141592d;

      byte[] bytes = new byte[] { 0, 1, 2, 40, -128, -127, 127, 126, 0 };

      skey = mapper.getStringMapping(new ByteArrayKey(bytes));

      assert !skey.equals("\000\001\002\050\0377\0376\0177\0176\000");
   }
View Full Code Here

      assert mapper.isSupportedType(String.class);
      assert mapper.isSupportedType(ByteArrayKey.class);
   }

   public void testTwoWayContract() {
      Object[] toTest = { 0, new Byte("1"), new Short("2"), (long) 3, new Double("3.4"), new Float("3.5"), Boolean.FALSE, "some string", new ByteArrayKey("\000\001\002\050\0377\0376\0177\0176\000".getBytes()) };
      for (Object o : toTest) {
         Class<?> type = o.getClass();
         String rep = mapper.getStringMapping(o);
         assert o.equals(mapper.getKeyMapping(rep)) : String.format("Failed on type %s and value %s", type, rep);
      }
View Full Code Here

      assert assertWorks(false);
   }

   public void testByteArrayKey() {
      assert mapper.isSupportedType(ByteArrayKey.class);
      assert assertWorks(new ByteArrayKey("\000\001\002\050\0377\0376\0177\0176\000".getBytes()));
   }
View Full Code Here

TOP

Related Classes of org.infinispan.util.ByteArrayKey

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.