Code example for ByteArrayOutputStream

Methods: toString

0
    return cpMult;
  } 
 
  @Test 
  void testCheckpoint() throws JsonGenerationException, JsonMappingException, IOException { 
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    Checkpoint cp = new Checkpoint();
    cp.setWindowOffset(10);
    cp.setWindowScn(100L);
    assertEquals((long)cp.getWindowOffset(), 10, "window offset mismatch");
    assertEquals(cp.getWindowScn(), 100L, "window scn mismatch");
    cp.serialize(baos);
    //System.out.println("TC: in: " + baos.toString()); 
    Checkpoint cp1 = new Checkpoint(baos.toString());
    assertEquals((long)cp1.getWindowOffset(), 10, "after deser window offset mismatch");
    assertEquals(cp1.getWindowScn(), 100L, "after deser window scn mismatch");
  } 
 
  public void validateCheckpoints() { 
    for(int id : pSrcIds.keySet()) {
      PhysicalPartition pPart = new PhysicalPartition(id, "name");