assertEquals(601, plc18.getAllTextEndAt());
}
public void testSimpleHyperlink() throws Exception {
File f;
HPBFDocument doc;
QuillContents qc;
Type12 hlBit;
// Link at 10
f = new File(dir, "LinkAt10.pub");
doc = new HPBFDocument(
new FileInputStream(f)
);
qc = doc.getQuillContents();
hlBit = (Type12)qc.getBits()[12];
assertEquals(1, hlBit.getNumberOfPLCs());
assertEquals(1, hlBit.getNumberOfHyperlinks());
assertEquals(10, hlBit.getTextStartAt(0));
assertEquals(15, hlBit.getAllTextEndAt());
assertEquals("http://poi.apache.org/", hlBit.getHyperlink(0));
// Longer link at 10
f = new File(dir, "LinkAt10Longer.pub");
doc = new HPBFDocument(
new FileInputStream(f)
);
qc = doc.getQuillContents();
hlBit = (Type12)qc.getBits()[12];
assertEquals(1, hlBit.getNumberOfPLCs());
assertEquals(1, hlBit.getNumberOfHyperlinks());
assertEquals(10, hlBit.getTextStartAt(0));
assertEquals(15, hlBit.getAllTextEndAt());
assertEquals("http://poi.apache.org/hpbf/", hlBit.getHyperlink(0));
// Link at 20
f = new File(dir, "LinkAt20.pub");
doc = new HPBFDocument(
new FileInputStream(f)
);
qc = doc.getQuillContents();
hlBit = (Type12)qc.getBits()[12];
assertEquals(1, hlBit.getNumberOfPLCs());
assertEquals(1, hlBit.getNumberOfHyperlinks());