use of org.jgroups.util.Range in project JGroups by belaban.
the class MessageTest method testComputeFragOffsets3.
public void testComputeFragOffsets3() {
byte[] buf = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
java.util.List<Range> retval = Util.computeFragOffsets(buf, 100);
System.out.println("list is " + retval);
Assert.assertEquals(1, retval.size());
Range r = retval.get(0);
Assert.assertEquals(0, r.low);
Assert.assertEquals(10, r.high);
}
use of org.jgroups.util.Range in project JGroups by belaban.
the class MessageTest method testComputeFragOffsets.
public void testComputeFragOffsets() {
byte[] buf = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
java.util.List<Range> retval = Util.computeFragOffsets(buf, 4);
System.out.println("list is " + retval);
Assert.assertEquals(3, retval.size());
Range r = retval.get(0);
Assert.assertEquals(0, r.low);
Assert.assertEquals(4, r.high);
r = retval.get(1);
Assert.assertEquals(4, r.low);
Assert.assertEquals(4, r.high);
r = retval.get(2);
Assert.assertEquals(8, r.low);
Assert.assertEquals(2, r.high);
}
Aggregations