@Test public void testWithGlowrootJar() throws Exception { File glowrootJar = new File("x/glowroot.jar").getAbsoluteFile(); CodeSource codeSource = new CodeSource(glowrootJar.toURI().toURL(), new Certificate[0]); assertThat(ToolMain.getGlowrootJarFile(codeSource)).isEqualTo(glowrootJar); }
@VisibleForTesting static @Nullable File getGlowrootJarFile(@Nullable CodeSource codeSource) throws URISyntaxException { if (codeSource == null) { return null; } File codeSourceFile = new File(codeSource.getLocation().toURI()); if (codeSourceFile.getName().endsWith(".jar")) { return codeSourceFile; } return null; }
ToolMain { @VisibleForTesting static @Nullable File getGlowrootJarFile(@Nullable CodeSource codeSource) throws URISyntaxException { if (codeSource == null) { return null; } File codeSourceFile = new File(codeSource.getLocation().toURI()); if (codeSourceFile.getName().endsWith(".jar")) { return codeSourceFile; } return null; } }
ToolMain { @VisibleForTesting static @Nullable File getGlowrootJarFile(@Nullable CodeSource codeSource) throws URISyntaxException { if (codeSource == null) { return null; } File codeSourceFile = new File(codeSource.getLocation().toURI()); if (codeSourceFile.getName().endsWith(".jar")) { return codeSourceFile; } return null; } private  ToolMain(); }
ToolMain { @VisibleForTesting static @Nullable File getGlowrootJarFile(@Nullable CodeSource codeSource) throws URISyntaxException { if (codeSource == null) { return null; } File codeSourceFile = new File(codeSource.getLocation().toURI()); if (codeSourceFile.getName().endsWith(".jar")) { return codeSourceFile; } return null; } private  ToolMain(); static void main(String[] args, Directories directories); }
ToolMain { @VisibleForTesting static @Nullable File getGlowrootJarFile(@Nullable CodeSource codeSource) throws URISyntaxException { if (codeSource == null) { return null; } File codeSourceFile = new File(codeSource.getLocation().toURI()); if (codeSourceFile.getName().endsWith(".jar")) { return codeSourceFile; } return null; } private  ToolMain(); static void main(String[] args, Directories directories);  }