Package org.infinispan.remoting.transport.jgroups

Examples of org.infinispan.remoting.transport.jgroups.JGroupsAddress


      Map m1 = new HashMap();
      Map m2 = new TreeMap();
      Map m3 = new HashMap();
      Map<Integer, GlobalTransaction> m4 = new FastCopyHashMap<Integer, GlobalTransaction>();
      for (int i = 0; i < 10; i++) {
         JGroupsAddress jGroupsAddress = new JGroupsAddress(new IpAddress(1000 * i));
         GlobalTransaction gtx = new GlobalTransaction(jGroupsAddress, false);
         m1.put(1000 * i, gtx);
         m2.put(1000 * i, gtx);
         m4.put(1000 * i, gtx);
      }
View Full Code Here


      assert rmv.equals(mv) : "Writen[" + mv + "] and read[" + rmv + "] objects should be the same";
      assert rmv.get() instanceof Pojo;        
   }

   public void testSingletonListMarshalling() throws Exception {
      GlobalTransaction gtx = new GlobalTransaction(new JGroupsAddress(new IpAddress(12345)), false);
      List l = Collections.singletonList(gtx);
      marshallAndAssertEquality(l);
   }
View Full Code Here

      List l = Collections.singletonList(gtx);
      marshallAndAssertEquality(l);
   }

   public void testTransactionLogMarshalling() throws Exception {
      GlobalTransaction gtx = new GlobalTransaction(new JGroupsAddress(new IpAddress(12345)), false);
      PutKeyValueCommand command = new PutKeyValueCommand("k", "v", false, null, 0, 0);
      TransactionLog.LogEntry entry = new TransactionLog.LogEntry(gtx, command);
      byte[] bytes = marshaller.objectToByteBuffer(entry);
      TransactionLog.LogEntry readObj = (TransactionLog.LogEntry) marshaller.objectFromByteBuffer(bytes);
      assert Arrays.equals(readObj.getModifications(), entry.getModifications()) :
View Full Code Here

      assert rc9.getCommandId() == c9.getCommandId() : "Writen[" + c9.getCommandId() + "] and read[" + rc9.getCommandId() + "] objects should be the same";
      assert Arrays.equals(rc9.getParameters(), c9.getParameters()) : "Writen[" + c9.getParameters() + "] and read[" + rc9.getParameters() + "] objects should be the same";

      Map m1 = new HashMap();
      for (int i = 0; i < 10; i++) {
         GlobalTransaction gtx = new GlobalTransaction(new JGroupsAddress(new IpAddress(1000 * i)), false);
         m1.put(1000 * i, gtx);
      }
      PutMapCommand c10 = new PutMapCommand(m1, null, 0, 0);
      marshallAndAssertEquality(c10);

      Address local = new JGroupsAddress(new IpAddress(12345));
      GlobalTransaction gtx = new GlobalTransaction(local, false);
      PrepareCommand c11 = new PrepareCommand(gtx, true, c5, c6, c8, c10);
      marshallAndAssertEquality(c11);

      CommitCommand c12 = new CommitCommand(gtx);
View Full Code Here

   public void tearDown() {
      jboss.stop();
   }

   public void testJGroupsAddressMarshalling() throws Exception {
      JGroupsAddress address = new JGroupsAddress(new IpAddress(12345));
      checkEqualityAndSize(address);
   }
View Full Code Here

      JGroupsAddress address = new JGroupsAddress(new IpAddress(12345));
      checkEqualityAndSize(address);
   }
  
   public void testGlobalTransactionMarshalling() throws Exception {
      GlobalTransaction gtx = new GlobalTransaction(new JGroupsAddress(new IpAddress(12345)), false);
      checkEqualityAndSize(gtx);
   }
View Full Code Here

  
   public void testListMarshalling() throws Exception {
      List l1 = new ArrayList();
      List l2 = new LinkedList();
      for (int i = 0; i < 10; i++) {
         GlobalTransaction gtx = new GlobalTransaction(new JGroupsAddress(new IpAddress(1000 * i)), false);
         l1.add(gtx);
         l2.add(gtx);
      }
      checkEqualityAndSize(l1);
      checkEqualityAndSize(l2);
View Full Code Here

      Map m1 = new HashMap();
      Map m2 = new TreeMap();
      Map m3 = new HashMap();
      Map<Integer, GlobalTransaction> m4 = new FastCopyHashMap<Integer, GlobalTransaction>();
      for (int i = 0; i < 10; i++) {
         GlobalTransaction gtx = new GlobalTransaction(new JGroupsAddress(new IpAddress(1000 * i)), false);
         m1.put(1000 * i, gtx);
         m2.put(1000 * i, gtx);
         m4.put(1000 * i, gtx);
      }
      Map m5 = Immutables.immutableMapWrap(m3);
View Full Code Here

      checkEqualityAndSize(s1);
      checkEqualityAndSize(s2);
   }

   public void testMarshalledValueMarshalling() throws Exception {
      GlobalTransaction gtx = new GlobalTransaction(new JGroupsAddress(new IpAddress(12345)), false);
      int bytesH = marshallAndAssertEquality(home, new MarshalledValue(gtx, true, home));
      int bytesJ = marshallAndAssertEquality(jboss, new MarshalledValue(gtx, true, jboss));
      assert bytesJ < bytesH : "JBoss Marshaller should write less bytes: bytesJBoss=" + bytesJ + ", bytesHome=" + bytesH;
   }
View Full Code Here

      int bytesJ = marshallAndAssertEquality(jboss, new MarshalledValue(gtx, true, jboss));
      assert bytesJ < bytesH : "JBoss Marshaller should write less bytes: bytesJBoss=" + bytesJ + ", bytesHome=" + bytesH;
   }

   public void testSingletonListMarshalling() throws Exception {
      GlobalTransaction gtx = new GlobalTransaction(new JGroupsAddress(new IpAddress(12345)), false);
      List l = Collections.singletonList(gtx);
      checkEqualityAndSize(l);
   }
View Full Code Here

TOP

Related Classes of org.infinispan.remoting.transport.jgroups.JGroupsAddress

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.