Package org.infinispan.tree

Examples of org.infinispan.tree.Fqn


   }

   public void testSyncRepl() {
      assertClusterSize("Should only be 2  caches in the cluster!!!", 2);

      Fqn fqn = Fqn.fromString("/JSESSIONID/1010.10.5:3000/1234567890/1");
      cache1.getCache().getCacheConfiguration().transaction().syncCommitPhase(true);
      cache2.getCache().getCacheConfiguration().transaction().syncCommitPhase(true);


      cache1.put(fqn, "age", 38);


   }

   public void testPutMap() {
      assertClusterSize("Should only be 2  caches in the cluster!!!", 2);

      Fqn fqn = Fqn.fromString("/JSESSIONID/10.10.10.5:3000/1234567890/1");
      Fqn fqn1 = Fqn.fromString("/JSESSIONID/10.10.10.5:3000/1234567890/2");

      Map<Object, Object> map = new HashMap<Object, Object>();
      map.put("1", "1");
      map.put("2", "2");
      cache1.getRoot().addChild(fqn).putAll(map, Flag.SKIP_LOCKING);

      Map<String, String> data = cache.getData(Fqn.fromRelativeFqn(Fqn.fromString("STATUS"), Fqn.fromString("TRADE")));
      assertNotNull(data);
   }

   public void testConvenienceMethods() {
      Fqn fqn = Fqn.fromString("/test/fqn");
      String key = "key", value = "value";
      Map<String, String> data = new HashMap<String, String>();
      data.put(key, value);

      assertNull(cache.get(fqn, key));

      assertEquals(vB, cache2.getRoot().getChild(B).get(k));
   }

   public void testReplTxCommit() throws Exception {
      Node<Object, Object> rootNode = cache1.getRoot();
      Fqn A_B = Fqn.fromRelativeFqn(A, B);
      Node<Object, Object> nodeA = rootNode.addChild(A);
      Node<Object, Object> nodeB = nodeA.addChild(B);

      nodeA.put(k, vA);
      nodeB.put(k, vB);

import java.util.HashMap;

@Test(groups = "unit", testName = "FqnTest")
public class FqnTest {
   public void testNull() {
      Fqn fqn = Fqn.ROOT;
      assert 0 == fqn.size();
      int hcode = fqn.hashCode();
      assert hcode != -1;
   }

      int hcode = fqn.hashCode();
      assert hcode != -1;
   }

   public void testOne() {
      Fqn fqn = Fqn.fromElements(22);
      assert 1 == fqn.size();
      int hcode = fqn.hashCode();
      assert hcode != -1;
   }

      int hcode = fqn.hashCode();
      assert hcode != -1;
   }

   public void testEmptyFqn() {
      Fqn f1 = Fqn.ROOT;
      Fqn f2 = Fqn.ROOT;
      assert f1.equals(f2);
   }

      Fqn f2 = Fqn.ROOT;
      assert f1.equals(f2);
   }

   public void testFqn() {
      Fqn fqn = Fqn.fromString("/a/b/c");
      assert 3 == fqn.size();

      Fqn fqn2 = Fqn.fromElements("a", "b", "c");
      assert 3 == fqn.size();
      assert fqn.equals(fqn2);
      assert fqn.hashCode() == fqn2.hashCode();
   }

      assert fqn.equals(fqn2);
      assert fqn.hashCode() == fqn2.hashCode();
   }

   public void testHereogeneousNames() {
      Fqn fqn = Fqn.fromElements("string", 38, true);
      assert 3 == fqn.size();

      Fqn fqn2 = Fqn.fromElements("string", 38, true);
      assert fqn.equals(fqn2);
      assert fqn.hashCode() == fqn2.hashCode();
   }

      assert fqn.equals(fqn2);
      assert fqn.hashCode() == fqn2.hashCode();
   }

   public void testHashcode() {
      Fqn fqn1, fqn2;
      fqn1 = Fqn.fromElements("a", "b", "c");
      fqn2 = Fqn.fromString("/a/b/c");
      assert fqn1.equals(fqn2);

      HashMap<Fqn, Integer> map = new HashMap<Fqn, Integer>();
      map.put(fqn1, 33);
      map.put(fqn2, 34);
      assert map.size() == 1;

TOP

Related Classes of org.infinispan.tree.Fqn

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.