Revision 1dcdb672
Added by Katja Luther about 2 years ago
cdmlib-commons/src/test/java/eu/etaxonomy/cdm/common/UriTest.java | ||
---|---|---|
41 | 41 |
} |
42 | 42 |
|
43 | 43 |
} |
44 |
|
|
45 |
@Test |
|
46 |
public void testFragment() { |
|
47 |
try { |
|
48 |
//see example in #9111 |
|
49 |
URI uri = new URI("https://max:muster@www.example.com:8080/index.html?p1=A&p2=B#ressource"); |
|
50 |
Assert.assertEquals( |
|
51 |
"ressource", |
|
52 |
uri.getFragment()); |
|
53 |
|
|
54 |
} catch (URISyntaxException e) { |
|
55 |
Assert.fail("Parsing example URI should find fragment"); |
|
56 |
} |
|
57 |
|
|
58 |
try { |
|
59 |
//see example in #9111 |
|
60 |
URI uri = new URI("http:\\www.fail.de"); |
|
61 |
Assert.fail("Using backslash in URI instead of slash should fail"); |
|
62 |
} catch (URISyntaxException e) { |
|
63 |
//OK |
|
64 |
} |
|
65 |
|
|
66 |
} |
|
44 | 67 |
|
45 | 68 |
} |
Also available in: Unified diff
ref #9114: adapt parsing of fragment and add test