Examples of RecordCollector


Examples of org.apache.poi.hssf.usermodel.RecordInspector.RecordCollector

    };
    RecordStream rs = new RecordStream(Arrays.asList(recs), 0);
    PageSettingsBlock psb = new PageSettingsBlock(rs);

    // serialize the PSB to see what records come out
    RecordCollector rc = new RecordCollector();
    psb.visitContainedRecords(rc);
    Record[] outRecs = rc.getRecords();

    if (outRecs.length == 2) {
      throw new AssertionFailedError("PageSettingsBlock didn't add missing header/footer records");
    }
    assertEquals(4, outRecs.length);
View Full Code Here

Examples of org.apache.poi.hssf.usermodel.RecordInspector.RecordCollector

      }
      throw e;
    }

    // serialize the PSB to see what records come out
    RecordCollector rc = new RecordCollector();
    psb.visitContainedRecords(rc);
    Record[] outRecs = rc.getRecords();

    // records were assembled in standard order, so this simple check is OK
    assertArrayEquals(recs, outRecs);
  }
View Full Code Here

Examples of org.apache.poi.hssf.usermodel.RecordInspector.RecordCollector

                throw new AssertionFailedError("Identified bug 48026");
            }
            throw e;
        }

        RecordCollector rv = new RecordCollector();
        sheet.visitContainedRecords(rv, 0);
        Record[] outRecs = rv.getRecords();

        assertEquals(recs.length, outRecs.length);
        //expected order of records:
        Record[] expectedRecs = {
                recs[0]//BOFRecord
View Full Code Here

Examples of org.apache.poi.hssf.usermodel.RecordInspector.RecordCollector

  private static InternalSheet createSheet(List<Record> inRecs) {
    return InternalSheet.createSheet(new RecordStream(inRecs, 0));
  }

  private static Record[] getSheetRecords(InternalSheet s, int offset) {
    RecordCollector rc = new RecordCollector();
    s.visitContainedRecords(rc, offset);
    return rc.getRecords();
  }
View Full Code Here

Examples of org.apache.poi.hssf.usermodel.RecordInspector.RecordCollector

        throw new AssertionFailedError("Identified bug 46206");
      }
      throw e;
    }

    RecordCollector rv = new RecordCollector();
    sheet.visitContainedRecords(rv, rowIx);
    Record[] outRecs = rv.getRecords();
    assertEquals(8, outRecs.length);
    DimensionsRecord dims = (DimensionsRecord) outRecs[5];
    assertEquals(rowIx, dims.getFirstRow());
    assertEquals(rowIx, dims.getLastRow());
    assertEquals(colIx, dims.getFirstCol());
View Full Code Here

Examples of org.apache.poi.hssf.usermodel.RecordInspector.RecordCollector

        throw new AssertionFailedError("Identified bug 46776");
      }
      throw e;
    }

    RecordCollector rc = new RecordCollector();
    sheet2.visitContainedRecords(rc, 0);
    Record[] clonedRecs = rc.getRecords();
    assertEquals(recs.length+2, clonedRecs.length); // +2 for INDEX and DBCELL
  }
View Full Code Here

Examples of org.apache.poi.hssf.usermodel.RecordInspector.RecordCollector

  private static Sheet createSheet(List<Record> inRecs) {
    return Sheet.createSheet(new RecordStream(inRecs, 0));
  }

  private static Record[] getSheetRecords(Sheet s, int offset) {
    RecordCollector rc = new RecordCollector();
    s.visitContainedRecords(rc, offset);
    return rc.getRecords();
  }
View Full Code Here

Examples of org.apache.poi.hssf.usermodel.RecordInspector.RecordCollector

        throw new AssertionFailedError("Identified bug 46206");
      }
      throw e;
    }

    RecordCollector rv = new RecordCollector();
    sheet.visitContainedRecords(rv, rowIx);
    Record[] outRecs = rv.getRecords();
    assertEquals(8, outRecs.length);
    DimensionsRecord dims = (DimensionsRecord) outRecs[5];
    assertEquals(rowIx, dims.getFirstRow());
    assertEquals(rowIx, dims.getLastRow());
    assertEquals(colIx, dims.getFirstCol());
View Full Code Here

Examples of org.apache.poi.hssf.usermodel.RecordInspector.RecordCollector

      if (e.getMessage().startsWith("Unexpected record type")) {
        throw new AssertionFailedError("Identified bug 46280a");
      }
      throw e;
    }
    RecordCollector rv = new RecordCollector();
    rra.visitContainedRecords(rv);
    Record[] outRecs = rv.getRecords();
    assertEquals(5, outRecs.length);
  }
View Full Code Here

Examples of org.apache.poi.hssf.usermodel.RecordInspector.RecordCollector

        throw new AssertionFailedError("Identified bug 46480");
      }
      throw e;
    }

    RecordCollector rv = new RecordCollector();
    sheet.visitContainedRecords(rv, rowIx);
    Record[] outRecs = rv.getRecords();
    assertEquals(13, outRecs.length);
  }
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.