@Override public Mount<Path> create(Path path) throws IOException { // Not a great implementation return new Mount<Path>(new RAMDriver(), null); } }
public void testRAM() throws Exception { RAMDriver driver = new RAMDriver(); driver.add("/foo", "bar"); Path root = driver.root(); assertEquals(Path.get("/"), root); Path foo = driver.child(root, "foo"); assertNotNull(foo); Iterator<InputStream> in = driver.open(foo); assertTrue(in.hasNext()); String file = Utils.readAsUTF8(in.next()); assertFalse(in.hasNext()); assertEquals("bar", file); }
@Override public Mount<Path> create(Path path) throws IOException { // Not a great implementation return new Mount<Path>(new RAMDriver(), null); } }
@Override public Mount<Path> create(Path path) throws IOException { // Not a great implementation return new Mount<Path>(new RAMDriver(), null); } }
private TestPluginLifeCycle(PluginDiscovery discovery, ClassLoader classLoader) throws Exception { this.attributes = new HashMap<String, Object>(); this.commands = new RAMDriver(); this.context = new PluginContext( discovery, attributes, new FS().mount(classLoader,Path.get("/crash/commands/")).mount(commands), new FS().mount(classLoader,Path.get("/crash/")), classLoader); this.crash = new CRaSH(context); }