TestPublicSuffixMatcher.java (httpcomponents-client-4.5.8-src) | : | TestPublicSuffixMatcher.java (httpcomponents-client-4.5.9-src) | ||
---|---|---|---|---|
skipping to change at line 66 | skipping to change at line 66 | |||
matcher = new PublicSuffixMatcher(suffixList.getRules(), suffixList.getE xceptions()); | matcher = new PublicSuffixMatcher(suffixList.getRules(), suffixList.getE xceptions()); | |||
} | } | |||
@Test | @Test | |||
public void testGetDomainRoot() throws Exception { | public void testGetDomainRoot() throws Exception { | |||
Assert.assertEquals("example.xx", matcher.getDomainRoot("example.XX")); | Assert.assertEquals("example.xx", matcher.getDomainRoot("example.XX")); | |||
Assert.assertEquals("example.xx", matcher.getDomainRoot("www.example.XX" )); | Assert.assertEquals("example.xx", matcher.getDomainRoot("www.example.XX" )); | |||
Assert.assertEquals("example.xx", matcher.getDomainRoot("www.blah.blah.e xample.XX")); | Assert.assertEquals("example.xx", matcher.getDomainRoot("www.blah.blah.e xample.XX")); | |||
Assert.assertEquals(null, matcher.getDomainRoot("xx")); | Assert.assertEquals(null, matcher.getDomainRoot("xx")); | |||
Assert.assertEquals(null, matcher.getDomainRoot("jp")); | Assert.assertEquals(null, matcher.getDomainRoot("jp")); | |||
Assert.assertEquals(null, matcher.getDomainRoot("example")); | ||||
Assert.assertEquals("example.example", matcher.getDomainRoot("example.ex | ||||
ample")); | ||||
Assert.assertEquals(null, matcher.getDomainRoot("ac.jp")); | Assert.assertEquals(null, matcher.getDomainRoot("ac.jp")); | |||
Assert.assertEquals(null, matcher.getDomainRoot("any.tokyo.jp")); | Assert.assertEquals(null, matcher.getDomainRoot("any.tokyo.jp")); | |||
Assert.assertEquals("metro.tokyo.jp", matcher.getDomainRoot("metro.tokyo .jp")); | Assert.assertEquals("metro.tokyo.jp", matcher.getDomainRoot("metro.tokyo .jp")); | |||
Assert.assertEquals("blah.blah.tokyo.jp", matcher.getDomainRoot("blah.bl ah.tokyo.jp")); | Assert.assertEquals("blah.blah.tokyo.jp", matcher.getDomainRoot("blah.bl ah.tokyo.jp")); | |||
Assert.assertEquals("blah.ac.jp", matcher.getDomainRoot("blah.blah.ac.jp ")); | Assert.assertEquals("blah.ac.jp", matcher.getDomainRoot("blah.blah.ac.jp ")); | |||
Assert.assertEquals("garbage", matcher.getDomainRoot("garbage")); | ||||
Assert.assertEquals("garbage.garbage", matcher.getDomainRoot("garbage.ga | ||||
rbage")); | ||||
} | } | |||
@Test | @Test | |||
public void testMatch() throws Exception { | public void testMatch() throws Exception { | |||
Assert.assertTrue(matcher.matches(".jp")); | Assert.assertTrue(matcher.matches(".jp")); | |||
Assert.assertTrue(matcher.matches(".ac.jp")); | Assert.assertTrue(matcher.matches(".ac.jp")); | |||
Assert.assertTrue(matcher.matches(".any.tokyo.jp")); | Assert.assertTrue(matcher.matches(".any.tokyo.jp")); | |||
// exception | // exception | |||
Assert.assertFalse(matcher.matches(".metro.tokyo.jp")); | Assert.assertFalse(matcher.matches(".metro.tokyo.jp")); | |||
} | } | |||
End of changes. 2 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added |