diff options
author | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-10-13 10:37:49 +0400 |
---|---|---|
committer | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-10-13 11:29:52 +0400 |
commit | d9512997b317c7a01d480e9b9a81422996146c88 (patch) | |
tree | 9cf68ebb7b112439a4891f6a36cd88f299ff012d /sonar-batch | |
parent | f8d5c0849d003e8b62c2c06f03428c33fddf4a2a (diff) | |
download | sonarqube-d9512997b317c7a01d480e9b9a81422996146c88.tar.gz sonarqube-d9512997b317c7a01d480e9b9a81422996146c88.zip |
Improve unit tests
Diffstat (limited to 'sonar-batch')
-rw-r--r-- | sonar-batch/src/test/java/org/sonar/batch/bootstrap/JdbcDriverHolderTest.java (renamed from sonar-batch/src/test/java/org/sonar/batch/bootstrap/BootstrapClassLoaderTest.java) | 13 | ||||
-rw-r--r-- | sonar-batch/src/test/resources/org/sonar/batch/bootstrap/JdbcDriverHolderTest/foo.jar (renamed from sonar-batch/src/test/resources/org/sonar/batch/bootstrap/BootstrapClassLoaderTest/foo.jar) | bin | 537 -> 537 bytes |
2 files changed, 8 insertions, 5 deletions
diff --git a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BootstrapClassLoaderTest.java b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/JdbcDriverHolderTest.java index 81790aeb189..223842a08d4 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BootstrapClassLoaderTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/JdbcDriverHolderTest.java @@ -19,26 +19,29 @@ */ package org.sonar.batch.bootstrap; -import org.junit.Test; +import static junit.framework.Assert.assertNotNull; +import static junit.framework.Assert.assertNull; import java.io.File; import java.net.URISyntaxException; import java.net.URL; -import static junit.framework.Assert.assertNotNull; -import static junit.framework.Assert.assertNull; +import org.junit.Test; -public class BootstrapClassLoaderTest { +public class JdbcDriverHolderTest { @Test public void testClassLoader() throws URISyntaxException { /* foo.jar has just one file /foo/foo.txt */ assertNull(getClass().getClassLoader().getResource("foo/foo.txt")); - URL url = getClass().getResource("/org/sonar/batch/bootstrap/BootstrapClassLoaderTest/foo.jar"); + URL url = getClass().getResource("/org/sonar/batch/bootstrap/JdbcDriverHolderTest/foo.jar"); JdbcDriverHolder classloader = new JdbcDriverHolder(new File(url.toURI())); assertNotNull(classloader.getClassLoader()); assertNotNull(classloader.getClassLoader().getResource("foo/foo.txt")); + classloader.stop(); + assertNull(classloader.getClassLoader()); } + } diff --git a/sonar-batch/src/test/resources/org/sonar/batch/bootstrap/BootstrapClassLoaderTest/foo.jar b/sonar-batch/src/test/resources/org/sonar/batch/bootstrap/JdbcDriverHolderTest/foo.jar Binary files differindex c2bde4e5fff..c2bde4e5fff 100644 --- a/sonar-batch/src/test/resources/org/sonar/batch/bootstrap/BootstrapClassLoaderTest/foo.jar +++ b/sonar-batch/src/test/resources/org/sonar/batch/bootstrap/JdbcDriverHolderTest/foo.jar |