Search in sources :

Example 16 with MutableDigest

use of org.jgroups.util.MutableDigest in project JGroups by belaban.

the class DigestTest method testEquals2.

public void testEquals2() {
    md = new MutableDigest(d);
    System.out.println("d: " + d + "\nmd= " + md);
    Assert.assertEquals(d, d);
    Assert.assertEquals(d, md);
    System.out.println("d: " + d + "\nmd= " + md);
    md = new MutableDigest(members).set(a1, 1, 2).set(a2, 3, 4);
    Assert.assertNotEquals(d, md);
}
Also used : MutableDigest(org.jgroups.util.MutableDigest)

Example 17 with MutableDigest

use of org.jgroups.util.MutableDigest in project JGroups by belaban.

the class DigestTest method testEquals3.

public void testEquals3() {
    Digest digest = d;
    Assert.assertEquals(d, digest);
    digest = new Digest(members, new long[] { 500, 501, 26, 26, 25, 33 });
    Assert.assertEquals(d, digest);
    digest = new Digest(members, new long[] { 500, 501, 26, 26, 25, 37 });
    Assert.assertNotEquals(d, digest);
    digest = new MutableDigest(members).set(a1, 500, 501).set(a2, 26, 26);
    Assert.assertNotEquals(d, digest);
}
Also used : MutableDigest(org.jgroups.util.MutableDigest) Digest(org.jgroups.util.Digest) MutableDigest(org.jgroups.util.MutableDigest)

Example 18 with MutableDigest

use of org.jgroups.util.MutableDigest in project JGroups by belaban.

the class DigestTest method testImmutablity.

public void testImmutablity() {
    md = new MutableDigest(d);
    System.out.println("d = " + d);
    System.out.println("md = " + md);
    long[] before = d.get(a1);
    md.set(a1, 1, 1);
    System.out.println("d = " + d);
    System.out.println("md = " + md);
    long[] after = d.get(a1);
    Assert.assertEquals(after[0], before[0]);
    Assert.assertEquals(after[1], before[1]);
}
Also used : MutableDigest(org.jgroups.util.MutableDigest)

Aggregations

MutableDigest (org.jgroups.util.MutableDigest)18 Digest (org.jgroups.util.Digest)4 NAKACK2 (org.jgroups.protocols.pbcast.NAKACK2)3 Address (org.jgroups.Address)2 GMS (org.jgroups.protocols.pbcast.GMS)2 Protocol (org.jgroups.stack.Protocol)2 ArrayList (java.util.ArrayList)1 ConcurrentLinkedQueue (java.util.concurrent.ConcurrentLinkedQueue)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 AtomicLong (java.util.concurrent.atomic.AtomicLong)1 Condition (java.util.concurrent.locks.Condition)1 Lock (java.util.concurrent.locks.Lock)1 ReentrantLock (java.util.concurrent.locks.ReentrantLock)1 View (org.jgroups.View)1 NakAckHeader2 (org.jgroups.protocols.pbcast.NakAckHeader2)1 MessageBatch (org.jgroups.util.MessageBatch)1 BeforeMethod (org.testng.annotations.BeforeMethod)1