@Test public void tc003_t1_t2_before_available_data() { long t1 = TestUtils.stringToDate(dateFormat, fileDate0 + " 00:00:00").getTime(); long t2 = TestUtils.stringToDate(dateFormat, fileDate0 + " 00:59:59").getTime(); LogFileReader fr = new LogFileReader(TestUtils.TESTFOLDERPATH, channelTestImpl); List<Record> records = fr.getValues(t1, t2); long expectedRecords = 0; System.out.print(Thread.currentThread().getStackTrace()[1].getMethodName()); boolean result = true; int wrong = 0; int ok = 0; for (int i = 0; records.size() > i; i++) { if (records.get(i).getFlag().equals(Flag.NO_VALUE_RECEIVED_YET)) { ++ok; } else { ++wrong; result = false; } } System.out.print(" records = " + records.size() + " (" + expectedRecords + " expected); "); System.out.println("wrong = " + wrong + ", ok(with Flag 7) = " + ok); assertTrue(result); }
@Test public void tc002_t2_after_available_data() { long t1 = TestUtils.stringToDate(dateFormat, fileDate0 + " 01:00:00").getTime(); long t2 = TestUtils.stringToDate(dateFormat, fileDate0 + " 02:00:00").getTime(); LogFileReader fr = new LogFileReader(TestUtils.TESTFOLDERPATH, channelTestImpl); List<Record> records = fr.getValues(t1, t2); long expectedRecords = 361; // boolean result; if (records.size() == expectedRecords) { result = true; } else { result = false; } System.out.print(Thread.currentThread().getStackTrace()[1].getMethodName()); System.out.println(" records = " + records.size() + " (" + expectedRecords + " expected)"); assertTrue(result); }