private void assertURLDecodedTo(final Tokenizer t, final String uri, final String[] expectedStems, final String[] expectedTypes) throws IOException { this.assertURLDecodedTo(t, uri, expectedStems, expectedTypes, null); }
private void assertURLDecodedTo(final Tokenizer t, final String uri, final String[] expectedStems) throws IOException { this.assertURLDecodedTo(t, uri, expectedStems, null); }
@Test public void testBadMailto() throws Exception { this.assertURLDecodedTo(_t, "<mailto//stephane.net>", new String[] { "mailto//stephane.net" }); this.assertURLDecodedTo(_t, "<mailTo:stephane.net>", new String[] { "mailTo:stephane.net" }); }
@Test public void testNoMailto() throws Exception { this.assertURLDecodedTo(_t, "<http://stephane.net>", new String[] { "http://stephane.net" }); }
@Test public void testMailto() throws Exception { this.assertURLDecodedTo(_t, "<mailto:stephane.campinas@deri.org>", new String[] { "stephane.campinas@deri.org", "mailto:stephane.campinas@deri.org" }); }
@Test public void testShortURI() throws Exception { this.assertURLDecodedTo(_t, "<steph>", new String[] { "steph" }); }
@Test public void testDifferentTypes() throws Exception { this.assertURLDecodedTo(_t, "<mailto:stephane.net> \"literal\" <mailto:stephane.campinas@deri.org>", new String[] { "stephane.net", "mailto:stephane.net", "literal", "stephane.campinas@deri.org", "mailto:stephane.campinas@deri.org" }, new String[] { uritype, uritype, TupleTokenizer.getTokenTypes()[TupleTokenizer.LITERAL], uritype, uritype}, new int[] { 1, 0, 1, 1, 0 }); }