test_class.declarator: TIME = 1596173397167L
test_class.modifier: private static final
test_class.original_string: private static final long TIME = 1596173397167L;
test_class.type: long
test_class.var_name: TIME
test_class.file: modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/diagnostic/pagelocktracker/dumpprocessors/ToStringDumpHelperTest.java
test_class.identifier: ToStringDumpHelperTest
test_class.superclass: extends GridCommonAbstractTest
test_case.body: @Test
      public void toStringSharedPageLockTrackerTest() throws Exception {
          SharedPageLockTracker pageLockTracker = new SharedPageLockTracker();
  
          pageLockTracker.onReadLock(1, 2, 3, 4);
  
          pageLockTracker.onReadUnlock(1, 2, 3, 4);
  
          Thread asyncLockUnlock = new Thread(() -> {
              pageLockTracker.onReadLock(4, 32, 1, 64);
          }, "async-lock-unlock");
          asyncLockUnlock.start();
          asyncLockUnlock.join();
          long threadIdInLog = asyncLockUnlock.getId();
  
          SharedPageLockTrackerDump pageLockDump = pageLockTracker.dump();
  
          // Hack to have same timestamp in test.
          for (ThreadPageLockState state : pageLockDump.threadPageLockStates)
              GridTestUtils.setFieldValue(state.pageLockDump, PageLockDump.class, "time", TIME);
  
          assertNotNull(pageLockDump);
  
          String dumpStr = ToStringDumpHelper.toStringDump(pageLockDump);
  
          String expectedLog = "Page locks dump:" + U.nl() +
              U.nl() +
              "Thread=[name=async-lock-unlock, id=" + threadIdInLog + "], state=TERMINATED" + U.nl() +
              "Locked pages = [32[0000000000000020](r=1|w=0)]" + U.nl() +
              "Locked pages log: name=async-lock-unlock time=(1596173397167, " +
              ToStringDumpHelper.DATE_FMT.format(new java.util.Date(TIME)) + ")" + U.nl() +
              "L=1 -> Read lock pageId=32, structureId=null [pageIdHex=0000000000000020, partId=0, pageIdx=32, flags=00000000]" + U.nl() +
              U.nl() +
              U.nl() +
              U.nl();
  
          assertEquals(expectedLog, dumpStr);
      }
test_case.class_method_signature: ToStringDumpHelperTest.toStringSharedPageLockTrackerTest()
test_case.full_signature: @Test public void toStringSharedPageLockTrackerTest()
test_case.identifier: toStringSharedPageLockTrackerTest
test_case.invocations: onReadLock onReadUnlock onReadLock start join getId dump setFieldValue assertNotNull toStringDump nl nl nl nl format nl nl nl nl nl assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void toStringSharedPageLockTrackerTest()
focal_class.declarator: DATE_FMT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS")
focal_class.modifier: public static final
focal_class.original_string: public static final SimpleDateFormat DATE_FMT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
focal_class.type: SimpleDateFormat
focal_class.var_name: DATE_FMT
focal_class.file: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/diagnostic/pagelocktracker/dumpprocessors/ToStringDumpHelper.java
focal_class.identifier: ToStringDumpHelper
focal_class.class_method_signature: ToStringDumpHelper.toStringDump(PageLockDump pageLockDump)
focal_class.full_signature: public static String toStringDump(PageLockDump pageLockDump)
focal_class.identifier: toStringDump
focal_class.modifiers: public static
focal_class.parameters: (PageLockDump pageLockDump)
focal_class.return: String
focal_class.signature: String toStringDump(PageLockDump pageLockDump)
focal_class.class_method_signature: ToStringDumpHelper.toStringDump(SharedPageLockTrackerDump pageLockDump)
focal_class.full_signature: public static String toStringDump(SharedPageLockTrackerDump pageLockDump)
focal_class.identifier: toStringDump
focal_class.modifiers: public static
focal_class.parameters: (SharedPageLockTrackerDump pageLockDump)
focal_class.return: String
focal_class.signature: String toStringDump(SharedPageLockTrackerDump pageLockDump)
focal_method.body: public static String toStringDump(PageLockDump pageLockDump) {
          StringBuilder sb = new StringBuilder();
  
          ToStringDumpProcessor proc = new ToStringDumpProcessor(sb, String::valueOf);
  
          proc.processDump(pageLockDump);
  
          return sb.toString();
      }
focal_method.class_method_signature: ToStringDumpHelper.toStringDump(PageLockDump pageLockDump)
focal_method.full_signature: public static String toStringDump(PageLockDump pageLockDump)
focal_method.identifier: toStringDump
focal_method.invocations: processDump toString
focal_method.modifiers: public static
focal_method.parameters: (PageLockDump pageLockDump)
focal_method.return: String
focal_method.signature: String toStringDump(PageLockDump pageLockDump)