HarReader { public Har readFromFile(File har) throws HarReaderException { return this.readFromFile(har, HarReaderMode.STRICT); } HarReader(MapperFactory mapperFactory);  HarReader(); Har readFromFile(File har); Har readFromFile(File har, HarReaderMode mode); Har readFromString(String har); Har readFromString(String har, HarReaderMode mode);  }
@Test public void test() throws HarReaderException { File harFile = new File("src/test/resources/sstoehr.har"); Har har = harReader.readFromFile(harFile); Assert.assertNotNull(har); }
@Test(expected = HarReaderException.class) public void invalidDateStrict() throws HarReaderException { File harFile = new File("src/test/resources/sstoehr.invalid-date.har"); harReader.readFromFile(harFile); }
@Test public void invalidDateLax() throws HarReaderException { File harFile = new File("src/test/resources/sstoehr.invalid-date.har"); Har har = harReader.readFromFile(harFile, HarReaderMode.LAX); Assert.assertNotNull(har); }
@Test(expected = HarReaderException.class) public void invalidIntegerStrict() throws HarReaderException { File harFile = new File("src/test/resources/sstoehr.invalid-integer.har"); harReader.readFromFile(harFile); }
@Test public void invalidIntegerLax() throws HarReaderException { File harFile = new File("src/test/resources/sstoehr.invalid-integer.har"); Har har = harReader.readFromFile(harFile, HarReaderMode.LAX); Assert.assertNotNull(har); }
@Test public void testEquals() throws HarReaderException { File harFile = new File("src/test/resources/sstoehr.har"); Har har1 = harReader.readFromFile(harFile); Har har2 = harReader.readFromFile(harFile); Assert.assertTrue(har1.equals(har2)); }
@Test public void testHashCode() throws HarReaderException { File harFile = new File("src/test/resources/sstoehr.har"); Har har1 = harReader.readFromFile(harFile); Har har2 = harReader.readFromFile(harFile); Assert.assertEquals(har1.hashCode(), har2.hashCode()); }