FileDocCategorySizeDatePackage
TestBoundSheetRecord.javaAPI DocApache Poi 3.0.12774Mon Jan 01 12:39:46 GMT 2007org.apache.poi.hssf.record

TestBoundSheetRecord

public class TestBoundSheetRecord extends TestCase
Tests BoundSheetRecord.
see
BoundSheetRecord
author
Glen Stampoultzis (glens at apache.org)

Fields Summary
Constructors Summary
public TestBoundSheetRecord(String s)

        super( s );
    
Methods Summary
public voidtestName()

        BoundSheetRecord record = new BoundSheetRecord();
        record.setSheetname("1234567890223456789032345678904");
        assertTrue("Success", true);
        try {
            record.setSheetname("12345678902234567890323456789042");
            assertTrue("Should have thrown IllegalArgumentException, but didnt", false);
        } catch (IllegalArgumentException e) {
            assertTrue("succefully threw exception",true);
        }
        
        try {
            record.setSheetname("s//*s");
            assertTrue("Should have thrown IllegalArgumentException, but didnt", false);
        } catch (IllegalArgumentException e) {
            assertTrue("succefully threw exception",true);
        }
            
    
public voidtestRecordLength()

        BoundSheetRecord record = new BoundSheetRecord();
        record.setCompressedUnicodeFlag((byte)0x00);
        record.setSheetname("Sheet1");
        record.setSheetnameLength((byte)6);

        assertEquals(" 2  +  2  +  4  +   2   +    1     +    1    + len(str)", 18, record.getRecordSize());
    
public voidtestWideRecordLength()

        BoundSheetRecord record = new BoundSheetRecord();        
        record.setSheetname("Sheet\u20ac");
        record.setSheetnameLength((byte)6);

        assertEquals(" 2  +  2  +  4  +   2   +    1     +    1    + len(str) * 2", 24, record.getRecordSize());