Examples of TestcaseRecordInputStream


Examples of org.apache.poi.hssf.record.TestcaseRecordInputStream

            throws Exception
    {
      byte[] header = HexRead.readData( _test_file_path + File.separator + "richtextdata.txt", "header" );
        byte[] continueBytes = HexRead.readData( _test_file_path + File.separator + "richtextdata.txt", "continue1" );
      continueBytes = TestcaseRecordInputStream.mergeDataAndSid(ContinueRecord.sid, (short)continueBytes.length, continueBytes);
      TestcaseRecordInputStream in = new TestcaseRecordInputStream((short)0, (short)header.length, joinArray(header, continueBytes));
     

        IntMapper strings = new IntMapper();
        SSTDeserializer deserializer = new SSTDeserializer( strings );
        deserializer.manufactureStrings(1, in );
View Full Code Here

Examples of org.apache.poi.hssf.record.TestcaseRecordInputStream

            throws Exception
    {
        byte[] header = HexRead.readData( _test_file_path + File.separator + "evencontinuation.txt", "header" );
        byte[] continueBytes = HexRead.readData( _test_file_path + File.separator + "evencontinuation.txt", "continue1" );
        continueBytes = TestcaseRecordInputStream.mergeDataAndSid(ContinueRecord.sid, (short)continueBytes.length, continueBytes);
        TestcaseRecordInputStream in = new TestcaseRecordInputStream((short)0, (short)header.length, joinArray(header, continueBytes));

        IntMapper strings = new IntMapper();
        SSTDeserializer deserializer = new SSTDeserializer( strings );
        deserializer.manufactureStrings( 2, in);
View Full Code Here

Examples of org.apache.poi.hssf.record.TestcaseRecordInputStream

        byte[] continue2 = HexRead.readData( _test_file_path + File.separator + "stringacross2continuations.txt", "continue2" );
        continue2 = TestcaseRecordInputStream.mergeDataAndSid(ContinueRecord.sid, (short)continue2.length, continue2);
       
        byte[] bytes = joinArray(header, continue1);
        bytes = joinArray(bytes, continue2);
        TestcaseRecordInputStream in = new TestcaseRecordInputStream((short)0, (short)header.length, bytes);

        IntMapper strings = new IntMapper();
        SSTDeserializer deserializer = new SSTDeserializer( strings );
        deserializer.manufactureStrings( 2, in);
View Full Code Here

Examples of org.apache.poi.hssf.record.TestcaseRecordInputStream

            throws Exception
    {
        byte[] header = HexRead.readData( _test_file_path + File.separator + "extendedtextstrings.txt", "rich-header" );
        byte[] continueBytes = HexRead.readData( _test_file_path + File.separator + "extendedtextstrings.txt", "rich-continue1" );
        continueBytes = TestcaseRecordInputStream.mergeDataAndSid(ContinueRecord.sid, (short)continueBytes.length, continueBytes);
        TestcaseRecordInputStream in = new TestcaseRecordInputStream((short)0, (short)header.length, joinArray(header, continueBytes));
       
        IntMapper strings = new IntMapper();
        SSTDeserializer deserializer = new SSTDeserializer( strings );
        deserializer.manufactureStrings( 1, in);

        assertEquals( "At a dinner party orAt At At ", strings.get( ) + "" );


        header = HexRead.readData( _test_file_path + File.separator + "extendedtextstrings.txt", "norich-header" );
        continueBytes = HexRead.readData( _test_file_path + File.separator + "extendedtextstrings.txt", "norich-continue1" );
        continueBytes = TestcaseRecordInputStream.mergeDataAndSid(ContinueRecord.sid, (short)continueBytes.length, continueBytes);
        in = new TestcaseRecordInputStream((short)0, (short)header.length, joinArray(header, continueBytes));
       
        strings = new IntMapper();
        deserializer = new SSTDeserializer( strings );
        deserializer.manufactureStrings( 1, in);
View Full Code Here

Examples of org.apache.poi.hssf.record.TestcaseRecordInputStream

        //fakeData[0] = (byte) 0x41;
        fakeData[0] = (byte) 0x20//function index
        fakeData[1] = (byte) 0;
        fakeData[2] = (byte) 8;

        FuncPtg ptg = new FuncPtg( new TestcaseRecordInputStream((short)0, (short)fakeData.length, fakeData) );
        assertEquals( "Len formula index is not 32(20H)", (int) 0x20, ptg.getFunctionIndex() );
        assertEquals( "Number of operands in the len formula", 1, ptg.getNumberOfOperands() );
        assertEquals( "Function Name", "LEN", ptg.getName() );
        assertEquals( "Ptg Size", 3, ptg.getSize() );
        //assertEquals("first leftover byte is not 0", (byte)0, ptg.leftOvers[0]);
View Full Code Here

Examples of org.apache.poi.hssf.record.TestcaseRecordInputStream

       
        bytes = bof.serialize();
        nbytes = new byte[bytes.length - 4];
        System.arraycopy(bytes,4,nbytes,0,nbytes.length);
           
        records = factory.createRecord(new TestcaseRecordInputStream(bof.getSid(),(short)nbytes.length,nbytes));
       
        assertTrue("record.length must be 1, was ="+records.length,records.length == 1);
        assertTrue("record is the same", compareRec(bof,records[0]));
       
    }
View Full Code Here

Examples of org.apache.poi.hssf.record.TestcaseRecordInputStream

       
        bytes = bof.serialize();
        nbytes = new byte[bytes.length - 4];
        System.arraycopy(bytes,4,nbytes,0,nbytes.length);
           
        records = factory.createRecord(new TestcaseRecordInputStream(bof.getSid(),(short)nbytes.length,nbytes));
       
        assertTrue("record.length must be 1, was ="+records.length,records.length == 1);
        assertTrue("record is the same", compareRec(bof,records[0]));
       
    }
View Full Code Here

Examples of org.apache.poi.hssf.record.TestcaseRecordInputStream

    if (!Arrays.equals(data, SAMPLE_ENCODING)) {
      fail("Encoding differs");
    }
  }
  public void testDecode() {
    RecordInputStream in = new TestcaseRecordInputStream(0x0001, SAMPLE_ENCODING);
   
    Object[] values = ConstantValueParser.parse(in, 4);
    for (int i = 0; i < values.length; i++) {
      if(!isEqual(SAMPLE_VALUES[i], values[i])) {
        fail("Decoded result differs");
View Full Code Here

Examples of org.apache.poi.hssf.record.TestcaseRecordInputStream

        //fakeData[0] = (byte) 0x41;
        fakeData[0] = (byte) 0x20//function index
        fakeData[1] = (byte) 0;
        fakeData[2] = (byte) 8;

        FuncPtg ptg = new FuncPtg( new TestcaseRecordInputStream((short)0, (short)fakeData.length, fakeData) );
        assertEquals( "Len formula index is not 32(20H)", (int) 0x20, ptg.getFunctionIndex() );
        assertEquals( "Number of operands in the len formula", 1, ptg.getNumberOfOperands() );
        assertEquals( "Function Name", "LEN", ptg.getName() );
        assertEquals( "Ptg Size", 3, ptg.getSize() );
        //assertEquals("first leftover byte is not 0", (byte)0, ptg.leftOvers[0]);
View Full Code Here

Examples of org.apache.poi.hssf.record.TestcaseRecordInputStream

            throws Exception
    {
      byte[] header = HexRead.readData( _test_file_path + File.separator + "richtextdata.txt", "header" );
        byte[] continueBytes = HexRead.readData( _test_file_path + File.separator + "richtextdata.txt", "continue1" );
      continueBytes = TestcaseRecordInputStream.mergeDataAndSid(ContinueRecord.sid, (short)continueBytes.length, continueBytes);
      TestcaseRecordInputStream in = new TestcaseRecordInputStream((short)0, (short)header.length, joinArray(header, continueBytes));
     

        IntMapper strings = new IntMapper();
        SSTDeserializer deserializer = new SSTDeserializer( strings );
        deserializer.manufactureStrings(1, in );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.