144145146147148149150151152153154
@Test public void get_URL_for_missing_resource() throws Exception { Resource r = new ClasspathResource(FOLDER + "/missing-resource.txt"); assertNull(r.toURL()); } @Test public void localization_of_resource() throws Exception {
209210211212213214215216217218219
public void with_extension_missing_resource_is_null() { Resource r = new ClasspathResource(PATH); Resource e = r.withExtension("does-not-exist"); assertNull(e.toURL()); } @Test public void localization_of_missing_resource() throws Exception {
5455565758596061626364
// No line number? then nothing more to render. if (line <= 0) return; URL url = r.toURL(); if (url == null) return; int start = line - RANGE; int end = line + RANGE;