FileDocCategorySizeDatePackage
TestRawDataBlockList.javaAPI DocApache Poi 3.0.12904Mon Jan 01 12:39:44 GMT 2007org.apache.poi.poifs.storage

TestRawDataBlockList

public class TestRawDataBlockList extends TestCase
Class to test RawDataBlockList functionality
author
Marc Johnson

Fields Summary
Constructors Summary
public TestRawDataBlockList(String name)
Constructor TestRawDataBlockList

param
name

        super(name);
    
Methods Summary
public static voidmain(java.lang.String[] ignored_args)
main method to run the unit tests

param
ignored_args

        System.out
            .println("Testing org.apache.poi.poifs.storage.RawDataBlockList");
        junit.textui.TestRunner.run(TestRawDataBlockList.class);
    
public voidtestEmptyConstructor()
Test creating an empty RawDataBlockList

exception
IOException

        new RawDataBlockList(new ByteArrayInputStream(new byte[ 0 ]));
    
public voidtestNormalConstructor()
Test creating a normal RawDataBlockList

exception
IOException

        byte[] data = new byte[ 2560 ];

        for (int j = 0; j < 2560; j++)
        {
            data[ j ] = ( byte ) j;
        }
        new RawDataBlockList(new ByteArrayInputStream(data));
    
public voidtestShortConstructor()
Test creating a short RawDataBlockList

        for (int k = 2049; k < 2560; k++)
        {
            byte[] data = new byte[ k ];

            for (int j = 0; j < k; j++)
            {
                data[ j ] = ( byte ) j;
            }
            try
            {
                new RawDataBlockList(new ByteArrayInputStream(data));
                fail("Should have thrown IOException creating short block");
            }
            catch (IOException ignored)
            {

                // as expected
            }
        }