aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-runner-impl/src/test/java/org/sonar/runner/impl
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-runner-impl/src/test/java/org/sonar/runner/impl')
-rw-r--r--sonar-runner-impl/src/test/java/org/sonar/runner/impl/BatchLauncherMainTest.java2
-rw-r--r--sonar-runner-impl/src/test/java/org/sonar/runner/impl/IsolatedClassloaderTest.java11
-rw-r--r--sonar-runner-impl/src/test/java/org/sonar/runner/impl/ServerConnectionTest.java2
3 files changed, 9 insertions, 6 deletions
diff --git a/sonar-runner-impl/src/test/java/org/sonar/runner/impl/BatchLauncherMainTest.java b/sonar-runner-impl/src/test/java/org/sonar/runner/impl/BatchLauncherMainTest.java
index e959409..996fc42 100644
--- a/sonar-runner-impl/src/test/java/org/sonar/runner/impl/BatchLauncherMainTest.java
+++ b/sonar-runner-impl/src/test/java/org/sonar/runner/impl/BatchLauncherMainTest.java
@@ -50,7 +50,7 @@ public class BatchLauncherMainTest {
}), argThat(new ArgumentMatcher<List<Object>>() {
@Override
public boolean matches(Object o) {
- return ((List) o).isEmpty();
+ return ((List<?>) o).isEmpty();
}
}));
}
diff --git a/sonar-runner-impl/src/test/java/org/sonar/runner/impl/IsolatedClassloaderTest.java b/sonar-runner-impl/src/test/java/org/sonar/runner/impl/IsolatedClassloaderTest.java
index 1adaa0d..222a2f5 100644
--- a/sonar-runner-impl/src/test/java/org/sonar/runner/impl/IsolatedClassloaderTest.java
+++ b/sonar-runner-impl/src/test/java/org/sonar/runner/impl/IsolatedClassloaderTest.java
@@ -19,6 +19,8 @@
*/
package org.sonar.runner.impl;
+import java.io.IOException;
+
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
@@ -30,7 +32,7 @@ public class IsolatedClassloaderTest {
public ExpectedException thrown = ExpectedException.none();
@Test
- public void should_restrict_loading_from_parent() throws Exception {
+ public void should_restrict_loading_from_parent() throws IOException {
ClassLoader parentClassloader = getClass().getClassLoader();
IsolatedClassloader classLoader = new IsolatedClassloader(parentClassloader, new String[][] {new String[] {"UNMASK", "org.apache.ant."}});
@@ -39,10 +41,11 @@ public class IsolatedClassloaderTest {
assertThat(classLoader.canLoadFromParent("org.apache.ant.Foo")).isTrue();
assertThat(classLoader.canLoadFromParent("org.apache.ant.project.Project")).isTrue();
+ classLoader.close();
}
@Test
- public void should_use_isolated_system_classloader_when_parent_is_excluded() throws ClassNotFoundException {
+ public void should_use_isolated_system_classloader_when_parent_is_excluded() throws ClassNotFoundException, IOException {
thrown.expect(ClassNotFoundException.class);
thrown.expectMessage("org.junit.Test");
ClassLoader parent = getClass().getClassLoader();
@@ -51,14 +54,16 @@ public class IsolatedClassloaderTest {
// JUnit is available in the parent classloader (classpath used to execute this test) but not in the core JVM
assertThat(classLoader.loadClass("java.lang.String", false)).isNotNull();
classLoader.loadClass("org.junit.Test", false);
+ classLoader.close();
}
@Test
- public void should_find_in_parent_when_matches_unmasked_packages() throws ClassNotFoundException {
+ public void should_find_in_parent_when_matches_unmasked_packages() throws ClassNotFoundException, IOException {
ClassLoader parent = getClass().getClassLoader();
IsolatedClassloader classLoader = new IsolatedClassloader(parent, new String[][] {new String[] {"UNMASK", "org.junit."}});
// JUnit is available in the parent classloader (classpath used to execute this test) but not in the core JVM
assertThat(classLoader.loadClass("org.junit.Test", false)).isNotNull();
+ classLoader.close();
}
}
diff --git a/sonar-runner-impl/src/test/java/org/sonar/runner/impl/ServerConnectionTest.java b/sonar-runner-impl/src/test/java/org/sonar/runner/impl/ServerConnectionTest.java
index c8bf525..b1a94c7 100644
--- a/sonar-runner-impl/src/test/java/org/sonar/runner/impl/ServerConnectionTest.java
+++ b/sonar-runner-impl/src/test/java/org/sonar/runner/impl/ServerConnectionTest.java
@@ -28,8 +28,6 @@ import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import java.io.File;
-import java.io.IOException;
-import java.nio.file.Paths;
import java.util.Properties;
import static org.fest.assertions.Assertions.assertThat;