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

TestFileInformationBlock

public class TestFileInformationBlock extends TestCase

Fields Summary
private FileInformationBlock
_fileInformationBlock
private HWPFDocFixture
_hWPFDocFixture
Constructors Summary
public TestFileInformationBlock(String name)


    
  
    super(name);
  
Methods Summary
protected voidsetUp()

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

    _hWPFDocFixture.setUp();
    _fileInformationBlock = _hWPFDocFixture._fib;
  
protected voidtearDown()

    _fileInformationBlock = null;
    _hWPFDocFixture.tearDown();

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

    int size = _fileInformationBlock.getSize();
    byte[] buf = new byte[size];

    _fileInformationBlock.serialize(buf, 0);

    FileInformationBlock newFileInformationBlock =
      new FileInformationBlock(buf);

    Field[] fields = FileInformationBlock.class.getSuperclass().getDeclaredFields();
    AccessibleObject.setAccessible(fields, true);

    for (int x = 0; x < fields.length; x++)
    {
      assertEquals(fields[x].get(_fileInformationBlock), fields[x].get(newFileInformationBlock));
    }