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);
}
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);
}
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]);
}
Aggregations