use of org.xwiki.resource.CreateResourceReferenceException in project xwiki-platform by xwiki.
the class ExtendedURLTest method withInvalidPrefix.
@Test
public void withInvalidPrefix() throws Exception {
URL url = new URL("http://localhost:8080/some/path");
try {
new ExtendedURL(url, "/xwiki");
fail("Should have thrown an exception here");
} catch (CreateResourceReferenceException e) {
assertEquals("URL Path [/some/path] doesn't start with [/xwiki]", e.getMessage());
}
}
use of org.xwiki.resource.CreateResourceReferenceException in project xwiki-platform by xwiki.
the class ExtendedURLTest method invalidURL.
@Test
public void invalidURL() throws Exception {
try {
// Invalid URL since the space in the page name isn't encoded.
new ExtendedURL(new URL("http://host/xwiki/bin/view/space/page name"), null);
fail("Should have thrown an exception here");
} catch (CreateResourceReferenceException expected) {
assertEquals("Invalid URL [http://host/xwiki/bin/view/space/page name]", expected.getMessage());
}
}
Aggregations