Hi all,
Merry Xmas and Happy Coding!
So I thought I cracked this one.
All my local tests work as expected. However, when I come to verify the code it fails on tests, 3, 4 and 11. Tests 3 and 4 cover get ip for event and get ip for status. Test 11 is get date for event. So my first thought is I'm filtering event and status information incorrectly?
Well, the weird thing is that other permutations that use for event and for status, verify OK e.g. test 6 - get user for event, test 7 - get user for status, and, test 12 - get date for status. Also, other permutations that use get ip and get date, verify OK.
And, as I say, my own tests using get ip for event, get ip for status and get date for event seem to work OK.
Help!!
package com.codegym.task.task39.task3913;
import java.nio.file.Paths;
import java.util.Date;
public class Solution {
public static void main(String[] args) {
String path = "c:/logs/";
LogParser logParser = new LogParser(Paths.get(path));
// System.out.println(logParser.getNumberOfUniqueIPs(null, new Date()));
// System.out.println(logParser.getIPsForEvent(Event.LOGIN, null, null));
// System.out.println(logParser.getDateWhenUserLoggedInFirstTime("Eduard Bentley", null, null));
// System.out.println(logParser.getNumberOfAttemptsToCompleteTask(18, null, null));
// System.out.println(logParser.execute("get ip"));
// System.out.println(logParser.execute("get ip for user = \"Eduard Bentley\""));
// System.out.println(logParser.execute("get ip for date = \"12.12.2013 16:08:13\""));
System.out.println(logParser.execute("get ip for event = \"DOWNLOAD_PLUGIN\" and date between \"30.08.2012 0:00:00\" and \"03.01.2014 23:59:59\""));
System.out.println(logParser.execute("get ip for status = \"FAILED\" and date between \"30.08.2012 0:00:00\" and \"03.01.2014 23:59:59\""));
System.out.println(logParser.execute("get date for event = \"DOWNLOAD_PLUGIN\" and date between \"30.08.2012 0:00:00\" and \"03.01.2014 23:59:59\""));
System.out.println(logParser.execute("get date for event = \"ATTEMPT_TASK\" and date between \"30.08.2012 0:00:00\" and \"29.2.2028 5:4:7\""));
}
}