public final URL getURL() throws IOException { P root = getRoot(); return getURL(root); }
public final URL getURL() throws IOException { P root = getRoot(); return getURL(root); }
public final void traverse(Visitor<P> visitor) throws IOException { traverse(getRoot(), visitor); }
public final P getPath(Iterable<String> names) throws IOException { return getPath(getRoot(), names); }
public final void dump(Appendable appendable) throws IOException { dump(getRoot(), appendable); }
public final void traverse(Filter<P> filter, Visitor<P> visitor) throws IOException { traverse(getRoot(), filter, visitor); }
public final void traverse(Filter<P> filter, Visitor<P> visitor) throws IOException { traverse(getRoot(), filter, visitor); }
public final void traverse(Visitor<P> visitor) throws IOException { traverse(getRoot(), visitor); }
public final P getPath(Iterable<String> names) throws IOException { return getPath(getRoot(), names); }
public final void dump(Appendable appendable) throws IOException { dump(getRoot(), appendable); }
@Override public P getRoot() throws IOException { P root = filtered.getRoot(); String name = filtered.getName(root); if (filter.acceptDir(root, name)) { return root; } else { throw new IOException("Cannot access root"); } }
@Override public P getRoot() throws IOException { P root = filtered.getRoot(); String name = filtered.getName(root); if (filter.acceptDir(root, name)) { return root; } else { throw new IOException("Cannot access root"); } }
public <D> void copy(Filter<P> filter, ReadWriteFileSystem<D> dst) throws IOException { copy(getRoot(), filter, dst, dst.getRoot()); }
public <D> void copy(ReadWriteFileSystem<D> dst, D dstPath) throws IOException { copy(getRoot(), new Filter.Default<P>(), dst, dstPath); }
public <D> void copy(Filter<P> filter, ReadWriteFileSystem<D> dst) throws IOException { copy(getRoot(), filter, dst, dst.getRoot()); }
public <D> void copy(ReadWriteFileSystem<D> dst, D dstPath) throws IOException { copy(getRoot(), new Filter.Default<P>(), dst, dstPath); }
@Test public void testCreate() throws Exception { MockApplication<File> app = application("plugin.binding.provider.factory.create"); File root = app.getClasses().getRoot(); File services = new File(root, "META-INF/services"); assertTrue(services.mkdirs()); File providers = new File(services, ProviderFactory.class.getName()); FileWriter writer = new FileWriter(providers); writer.append("plugin.binding.provider.factory.create.ProviderFactoryImpl"); writer.close(); app.init(); // MockClient client = app.client(); MockViewBridge render = client.render(); assertEquals("pass", render.assertStringResponse()); }
@Test public void testCreate() throws Exception { MockApplication<File> app = application("plugin.binding.provider.factory.create"); File root = app.getClasses().getRoot(); File services = new File(root, "META-INF/services"); assertTrue(services.mkdirs()); File providers = new File(services, ProviderFactory.class.getName()); FileWriter writer = new FileWriter(providers); writer.append("plugin.binding.provider.factory.create.ProviderFactoryImpl"); writer.close(); app.init(); // MockClient client = app.client(); MockViewBridge render = client.render(); assertEquals("pass", render.assertStringResponse()); }
@Test public void testPrecompileGroovy() throws Exception { MockApplication<File> app = application("plugin.template.simple").init(); ReadFileSystem<File> fs = app.getClasses(); File groovy = fs.getPath("plugin", "template", "simple", "templates", "index_.groovy"); assertNotNull(groovy); CompilerConfiguration config = new CompilerConfiguration(); config.setTargetDirectory(fs.getRoot()); CompilationUnit cu = new CompilationUnit(config); cu.addSource(groovy); cu.compile(); assertTrue(groovy.delete()); MockClient client = app.client(); assertEquals("hello", client.render().assertStringResponse()); } }
@Test public void testPrecompileGroovy() throws Exception { MockApplication<File> app = application("plugin.template.simple").init(); ReadFileSystem<File> fs = app.getClasses(); File groovy = fs.getPath("plugin", "template", "simple", "templates", "index_.groovy"); assertNotNull(groovy); CompilerConfiguration config = new CompilerConfiguration(); config.setTargetDirectory(fs.getRoot()); CompilationUnit cu = new CompilationUnit(config); cu.addSource(groovy); cu.compile(); assertTrue(groovy.delete()); MockClient client = app.client(); assertEquals("hello", client.render().assertStringResponse()); } }