c = adaptor.nextChunk(102);
assertTrue(ConstRateAdaptor.checkChunk(c));
}
public void testBasicSM() throws Exception {
ValidatorSM sm = new ValidatorSM();
byte[] dat = "test".getBytes();
ChunkImpl c = new ChunkImpl("Data", "aname", dat.length, dat, null);
ByteRange b = new ByteRange(c);
assertEquals(4, b.len);
assertEquals(0, b.start);
String t = sm.advanceSM(b);
assertNull(t);
if(t != null)
System.out.println(t);
dat = "ing".getBytes();
c = new ChunkImpl("Data", "aname", dat.length+4, dat, null);
b = new ByteRange(c);
assertEquals(4, b.start);
t = sm.advanceSM(b);
assertNull(t);
if(t != null)
System.out.println(t);
b = new ByteRange(new ChunkImpl("Data", "aname", 12, "more".getBytes(), null));
t= sm.advanceSM(b);
System.out.println(t);
}