Package org.iosgi.outpost

Examples of org.iosgi.outpost.Client.perform()


    Client c = new Client("localhost");
    c.connect(5, TimeUnit.SECONDS);
    File dir = new File(new File("."), "test");
    Assert.assertFalse(dir.exists());
    MkDir mkdir = new MkDir(dir);
    c.perform(mkdir);
    Assert.assertTrue(dir.exists());
    Assert.assertTrue(dir.isDirectory());
    dir.delete();
  }
 
View Full Code Here


    File target = new File(new File("."), "test");
    Assert.assertFalse(target.exists());
    byte[] data = new byte[RANDOM.nextInt(1024 * 1024) + 1];
    RANDOM.nextBytes(data);
    Put put = new Put(target, data);
    c.perform(put);
    Assert.assertTrue(target.exists());
    Assert.assertTrue(target.isFile());
    Assert.assertTrue(Arrays.equals(data, Put.toByteArray(target)));
    target.delete();
  }
View Full Code Here

  public void test() throws Exception {
    Client c = new Client("localhost");
    c.connect(5, TimeUnit.SECONDS);
    File dir = new File(new File("."), "subdir");
    MkDir mkdir = new MkDir(dir);
    c.perform(mkdir);
    Assert.assertTrue(dir.exists());
    File target = new File(dir, "test");
    byte[] data = new byte[RANDOM.nextInt(1024 * 1024) + 1];
    RANDOM.nextBytes(data);
    Put put = new Put(target, data);
View Full Code Here

    Assert.assertTrue(dir.exists());
    File target = new File(dir, "test");
    byte[] data = new byte[RANDOM.nextInt(1024 * 1024) + 1];
    RANDOM.nextBytes(data);
    Put put = new Put(target, data);
    c.perform(put);
    Assert.assertTrue(target.exists());
    Delete d = new Delete(dir);
    c.perform(d);
    Assert.assertFalse(target.exists());
    Assert.assertFalse(dir.exists());
View Full Code Here

    RANDOM.nextBytes(data);
    Put put = new Put(target, data);
    c.perform(put);
    Assert.assertTrue(target.exists());
    Delete d = new Delete(dir);
    c.perform(d);
    Assert.assertFalse(target.exists());
    Assert.assertFalse(dir.exists());
  }
}
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.