Examples of RecordCollector


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

            if (expMsg.equals(e.getMessage())) {
                throw new AssertionFailedError("Identified bug 47363b");
            }
            throw e;
        }
        RecordCollector rc;
        rc = new RecordCollector();
        sheet.getSheet().visitContainedRecords(rc, 0);
        int nRecsWithProtection = rc.getRecords().length;

        sheet.protectSheet(null);
        rc = new RecordCollector();
        sheet.getSheet().visitContainedRecords(rc, 0);
        int nRecsWithoutProtection = rc.getRecords().length;

        assertEquals(4, nRecsWithProtection - nRecsWithoutProtection);
    }
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

     */
    public void testProtectSheetRecordOrder_bug47363a() {
        HSSFWorkbook wb = new HSSFWorkbook();
        HSSFSheet s = wb.createSheet();
        s.protectSheet("secret");
        RecordCollector rc = new RecordCollector();
        s.getSheet().visitContainedRecords(rc, 0);
        Record[] recs = rc.getRecords();
        int nRecs = recs.length;
        if (recs[nRecs-2] instanceof PasswordRecord && recs[nRecs-5] instanceof DimensionsRecord) {
           throw new AssertionFailedError("Identified bug 47363a - PASSWORD after DIMENSION");
        }
        // Check that protection block is together, and before DIMENSION
View Full Code Here

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

            if (expMsg.equals(e.getMessage())) {
                throw new AssertionFailedError("Identified bug 47363b");
            }
            throw e;
        }
        RecordCollector rc;
        rc = new RecordCollector();
        sheet.getSheet().visitContainedRecords(rc, 0);
        int nRecsWithProtection = rc.getRecords().length;

        sheet.protectSheet(null);
        rc = new RecordCollector();
        sheet.getSheet().visitContainedRecords(rc, 0);
        int nRecsWithoutProtection = rc.getRecords().length;

        assertEquals(4, nRecsWithProtection - nRecsWithoutProtection);
    }
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 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
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.