@Test
public void toFileDump() throws Exception {

    String igHome = U.defaultWorkDirectory();
    System.out.println("IGNITE_HOME:" + igHome);
    SharedPageLockTracker pageLockTracker = new SharedPageLockTracker();
    pageLockTracker.onBeforeReadLock(1, 2, 3);
    pageLockTracker.onReadLock(1, 2, 3, 4);
    SharedPageLockTrackerDump pageLockDump = pageLockTracker.dump();
    Assert.assertNotNull(pageLockDump);
    String expDumpStr = ToStringDumpHelper.toStringDump(pageLockDump);
    String filePath = ToFileDumpProcessor.toFileDump(pageLockDump, file = new File(igHome), "test");
    System.out.println("Dump saved:" + filePath);
    boolean found = false;
    for (File file : file.listFiles()) {
        if (file.getAbsolutePath().equals(filePath)) {
            found = true;
            break;
        }
    }
    Assert.assertTrue(found);
    String actDumpStr;
    try (FileChannel ch = FileChannel.open(get(filePath), StandardOpenOption.READ)) {
        long size = ch.size();
        ByteBuffer buf = ByteBuffer.allocate((int)size);
        while (buf.position() != buf.capacity())
            ch.read(buf);
        actDumpStr = new String(buf.array());
    }
    Assert.assertEquals(expDumpStr, actDumpStr);
}