use of io.vertx.core.file.impl.FileResolverImpl in project vert.x by eclipse.
the class FileResolverTestBase method testResolveAfterCloseThrowsISE.
@Test
public void testResolveAfterCloseThrowsISE() throws Exception {
FileResolver resolver2 = new FileResolverImpl();
File file = resolver2.resolveFile("webroot/somefile.html");
assertTrue(file.exists());
File cacheDir = file.getParentFile().getParentFile();
assertTrue(cacheDir.exists());
resolver2.close();
assertFalse(cacheDir.exists());
try {
resolver2.resolveFile("webroot/somefile.html");
fail("Should fail");
} catch (IllegalStateException e) {
// OK
}
}
use of io.vertx.core.file.impl.FileResolverImpl in project vert.x by eclipse.
the class FileResolverTestBase method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
testCL = Thread.currentThread().getContextClassLoader();
File baseDir = new File(new File(new File(new File("src"), "test"), "classpath"), "fileresolver");
assertTrue(baseDir.exists() && baseDir.isDirectory());
ClassLoader resourcesLoader = resourcesLoader(baseDir);
Thread.currentThread().setContextClassLoader(resourcesLoader);
resolver = new FileResolverImpl();
}
use of io.vertx.core.file.impl.FileResolverImpl in project vert.x by eclipse.
the class FileResolverTestBase method testDeleteCacheDir.
@Test
public void testDeleteCacheDir() throws Exception {
FileResolver resolver2 = new FileResolverImpl();
File file = resolver2.resolveFile("webroot/somefile.html");
assertTrue(file.exists());
File cacheDir = file.getParentFile().getParentFile();
assertTrue(cacheDir.exists());
resolver2.close();
assertFalse(cacheDir.exists());
}
Aggregations