FileDocCategorySizeDatePackage
TestFontTable.javaAPI DocApache Poi 3.0.12271Mon Jan 01 18:55:36 GMT 2007org.apache.poi.hwpf.model

TestFontTable

public class TestFontTable extends TestCase

Fields Summary
private FontTable
_fontTable
private HWPFDocFixture
_hWPFDocFixture
Constructors Summary
public TestFontTable(String name)


    
  
    super(name);
  
Methods Summary
protected voidsetUp()

    super.setUp();
    /**@todo verify the constructors*/
    _hWPFDocFixture = new HWPFDocFixture(this);

    _hWPFDocFixture.setUp();
  
protected voidtearDown()

    _hWPFDocFixture.tearDown();

    _hWPFDocFixture = null;
    super.tearDown();
  
public voidtestReadWrite()

    FileInformationBlock fib = _hWPFDocFixture._fib;
    byte[] tableStream = _hWPFDocFixture._tableStream;

    int fcSttbfffn = fib.getFcSttbfffn();
    int lcbSttbfffn = fib.getLcbSttbfffn();

    _fontTable = new FontTable(tableStream, fcSttbfffn, lcbSttbfffn);

    HWPFFileSystem fileSys = new HWPFFileSystem();

    _fontTable.writeTo(fileSys);
    HWPFOutputStream  tableOut = fileSys.getStream("1Table");


    byte[] newTableStream = tableOut.toByteArray();


    FontTable newFontTable = new FontTable(newTableStream, 0, newTableStream.length);

	  assertTrue(_fontTable.equals(newFontTable));