This commit is contained in:
Phillip Webb
2013-08-08 21:49:38 -07:00
parent 7bea9dd973
commit cf655945aa
37 changed files with 49 additions and 157 deletions

View File

@@ -33,8 +33,6 @@ import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.springframework.boot.loader.Archive;
import org.springframework.boot.loader.ExplodedArchive;
import org.springframework.boot.loader.Archive.Entry;
import static org.hamcrest.Matchers.equalTo;
@@ -76,6 +74,7 @@ public class ExplodedArchiveTests {
}
}
this.archive = new ExplodedArchive(this.rootFolder);
jarFile.close();
}
private void copy(InputStream in, OutputStream out) throws IOException {
@@ -141,6 +140,7 @@ public class ExplodedArchiveTests {
new URL[] { filteredArchive.getUrl() });
assertThat(classLoader.getResourceAsStream("1.dat").read(), equalTo(1));
assertThat(classLoader.getResourceAsStream("2.dat"), nullValue());
classLoader.close();
}
private Map<String, Archive.Entry> getEntriesMap(Archive archive) {

View File

@@ -34,8 +34,6 @@ import org.junit.rules.ExpectedException;
import org.junit.rules.TemporaryFolder;
import org.springframework.boot.loader.TestJarCreator;
import org.springframework.boot.loader.data.RandomAccessDataFile;
import org.springframework.boot.loader.jar.JarEntryFilter;
import org.springframework.boot.loader.jar.RandomAccessJarFile;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;
@@ -75,6 +73,7 @@ public class RandomAccessJarFileTests {
public void createFromFile() throws Exception {
RandomAccessJarFile jarFile = new RandomAccessJarFile(this.rootJarFile);
assertThat(jarFile.getName(), notNullValue(String.class));
jarFile.close();
}
@Test
@@ -83,6 +82,7 @@ public class RandomAccessJarFileTests {
this.rootJarFile, 1);
RandomAccessJarFile jarFile = new RandomAccessJarFile(randomAccessDataFile);
assertThat(jarFile.getName(), notNullValue(String.class));
jarFile.close();
}
@Test