TestInteractiveInfopublic class TestInteractiveInfo extends TestCase Tests that InteractiveInfoAtom works properly. |
Fields Summary |
---|
private byte[] | data_a |
Methods Summary |
---|
public void | testCreate()
InteractiveInfo ii = new InteractiveInfo();
InteractiveInfoAtom ia = ii.getInteractiveInfoAtom();
// Set values
ia.setHyperlinkID(1);
ia.setSoundRef(0);
ia.setAction((byte)4);
ia.setHyperlinkType((byte)8);
// Check it's now the same as a
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ii.writeOut(baos);
byte[] b = baos.toByteArray();
assertEquals(data_a.length, b.length);
for(int i=0; i<data_a.length; i++) {
assertEquals(data_a[i],b[i]);
}
| public void | testGetChildDetails()
InteractiveInfo ii = new InteractiveInfo(data_a, 0, data_a.length);
InteractiveInfoAtom ia = ii.getInteractiveInfoAtom();
assertEquals(1, ia.getHyperlinkID());
| public void | testRecordType()
InteractiveInfo ii = new InteractiveInfo(data_a, 0, data_a.length);
assertEquals(4082, ii.getRecordType());
| public void | testWrite()
InteractiveInfo ii = new InteractiveInfo(data_a, 0, data_a.length);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ii.writeOut(baos);
byte[] b = baos.toByteArray();
assertEquals(data_a.length, b.length);
for(int i=0; i<data_a.length; i++) {
assertEquals(data_a[i],b[i]);
}
|
|