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

TestStyleSheet

public class TestStyleSheet extends TestCase

Fields Summary
private StyleSheet
_styleSheet
private HWPFDocFixture
_hWPFDocFixture
Constructors Summary
public TestStyleSheet(String name)



    
  
    super(name);
  
Methods Summary
protected voidsetUp()

    super.setUp();
    /**@todo verify the constructors*/
    _hWPFDocFixture = new HWPFDocFixture(this);
    _hWPFDocFixture.setUp();
    FileInformationBlock fib = _hWPFDocFixture._fib;
    byte[] mainStream = _hWPFDocFixture._mainStream;
    byte[] tableStream = _hWPFDocFixture._tableStream;

    _hWPFDocFixture.setUp();
    _styleSheet = new StyleSheet(tableStream, fib.getFcStshf());
  
protected voidtearDown()

    _styleSheet = null;
    _hWPFDocFixture.tearDown();

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

    HWPFFileSystem fileSys = new HWPFFileSystem();


    HWPFOutputStream tableOut = fileSys.getStream("1Table");
    HWPFOutputStream mainOut =  fileSys.getStream("WordDocument");

    _styleSheet.writeTo(tableOut);

    byte[] newTableStream = tableOut.toByteArray();

    StyleSheet newStyleSheet = new StyleSheet(newTableStream, 0);
    assertEquals(newStyleSheet, _styleSheet);