Formatting and cleanup
This commit is contained in:
@@ -33,7 +33,7 @@ import static org.mockito.Mockito.when;
|
||||
|
||||
/**
|
||||
* Tests for {@link ExecutableArchiveLauncher}
|
||||
*
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
*/
|
||||
public class ExecutableArchiveLauncherTests {
|
||||
@@ -74,16 +74,17 @@ public class ExecutableArchiveLauncherTests {
|
||||
|
||||
when(this.javaAgentDetector.isJavaAgentJar(javaAgent)).thenReturn(true);
|
||||
|
||||
doWithTccl(new URLClassLoader(new URL[] { javaAgent, one }), new Callable<Void>() {
|
||||
doWithTccl(new URLClassLoader(new URL[] { javaAgent, one }),
|
||||
new Callable<Void>() {
|
||||
|
||||
@Override
|
||||
public Void call() throws Exception {
|
||||
ClassLoader classLoader = ExecutableArchiveLauncherTests.this.launcher
|
||||
.createClassLoader(new URL[0]);
|
||||
assertClassLoaderUrls(classLoader, new URL[] { one });
|
||||
return null;
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public Void call() throws Exception {
|
||||
ClassLoader classLoader = ExecutableArchiveLauncherTests.this.launcher
|
||||
.createClassLoader(new URL[0]);
|
||||
assertClassLoaderUrls(classLoader, new URL[] { one });
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void assertClassLoaderUrls(ClassLoader classLoader, URL[] urls) {
|
||||
@@ -92,7 +93,7 @@ public class ExecutableArchiveLauncherTests {
|
||||
}
|
||||
|
||||
private static final class UnitTestExecutableArchiveLauncher extends
|
||||
ExecutableArchiveLauncher {
|
||||
ExecutableArchiveLauncher {
|
||||
|
||||
public UnitTestExecutableArchiveLauncher(JavaAgentDetector javaAgentDetector) {
|
||||
super(javaAgentDetector);
|
||||
|
||||
@@ -28,7 +28,7 @@ import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* Tests for {@link InputArgumentsJavaAgentDetector}
|
||||
*
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
*/
|
||||
public class InputArgumentsJavaAgentDetectorTests {
|
||||
@@ -39,7 +39,7 @@ public class InputArgumentsJavaAgentDetectorTests {
|
||||
InputArgumentsJavaAgentDetector detector = new InputArgumentsJavaAgentDetector(
|
||||
Arrays.asList("-javaagent:my-agent.jar"));
|
||||
assertFalse(detector.isJavaAgentJar(new File("something-else.jar")
|
||||
.getCanonicalFile().toURI().toURL()));
|
||||
.getCanonicalFile().toURI().toURL()));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -78,16 +78,15 @@ public class JarFileArchiveTests {
|
||||
@Test
|
||||
public void getUrl() throws Exception {
|
||||
URL url = this.archive.getUrl();
|
||||
assertThat(url.toString(), equalTo("jar:" + this.rootJarFileUrl
|
||||
+ "!/"));
|
||||
assertThat(url.toString(), equalTo("jar:" + this.rootJarFileUrl + "!/"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getNestedArchive() throws Exception {
|
||||
Entry entry = getEntriesMap(this.archive).get("nested.jar");
|
||||
Archive nested = this.archive.getNestedArchive(entry);
|
||||
assertThat(nested.getUrl().toString(),
|
||||
equalTo("jar:" + this.rootJarFileUrl + "!/nested.jar!/"));
|
||||
assertThat(nested.getUrl().toString(), equalTo("jar:" + this.rootJarFileUrl
|
||||
+ "!/nested.jar!/"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user