@Test(expected = NullPointerException.class) public void getResourceNullResource() { Application.getResource(null); }
public static URI getResource(final String resourceName) { checkNotNull(resourceName); try { final URL url = ClassLoader.getSystemResource(resourceName); checkArgument(url != null, "Could not find configuration file on classpath [%s]", resourceName); return url.toURI(); } catch (final URISyntaxException e) { throw new IllegalArgumentException(e); } }
Application { public static URI getResource(final String resourceName) { checkNotNull(resourceName); try { final URL url = ClassLoader.getSystemResource(resourceName); checkArgument(url != null, "Could not find configuration file on classpath [%s]", resourceName); return url.toURI(); } catch (final URISyntaxException e) { throw new IllegalArgumentException(e); } } }
Application { public static URI getResource(final String resourceName) { checkNotNull(resourceName); try { final URL url = ClassLoader.getSystemResource(resourceName); checkArgument(url != null, "Could not find configuration file on classpath [%s]", resourceName); return url.toURI(); } catch (final URISyntaxException e) { throw new IllegalArgumentException(e); } } private  Application(); }
Application { public static URI getResource(final String resourceName) { checkNotNull(resourceName); try { final URL url = ClassLoader.getSystemResource(resourceName); checkArgument(url != null, "Could not find configuration file on classpath [%s]", resourceName); return url.toURI(); } catch (final URISyntaxException e) { throw new IllegalArgumentException(e); } } private  Application(); static Cli cli(final String name, final GetOpt getopt, final String[] args); static URI getResource(final String resourceName); static T fromJson(final File json, final Class<T> cls, final Gson gson); static void exit(final int exitCode); }
Application { public static URI getResource(final String resourceName) { checkNotNull(resourceName); try { final URL url = ClassLoader.getSystemResource(resourceName); checkArgument(url != null, "Could not find configuration file on classpath [%s]", resourceName); return url.toURI(); } catch (final URISyntaxException e) { throw new IllegalArgumentException(e); } } private  Application(); static Cli cli(final String name, final GetOpt getopt, final String[] args); static URI getResource(final String resourceName); static T fromJson(final File json, final Class<T> cls, final Gson gson); static void exit(final int exitCode); static final int TEST_SUCCESS; static final int TEST_ERROR; static final int TEST_CONFIG_ERROR; static final int TEST_SHUTDOWN_ERROR; static final String TEST_SUCCESS_MSG; }