Examples of RAMDriver


Examples of org.crsh.vfs.spi.ram.RAMDriver

    this(new SimplePluginDiscovery(plugins), Thread.currentThread().getContextClassLoader());
  }

  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/")),
View Full Code Here

Examples of org.crsh.vfs.spi.ram.RAMDriver

    i.next();
    assertFalse(i.hasNext());
  }

  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);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.