Package com.findwise.hydra.local

Examples of com.findwise.hydra.local.HttpRemotePipeline.deleteFile()


  }
 
  @Test
  public void testDeleteFile() throws Exception {   
    RemotePipeline rp = new HttpRemotePipeline("localhost", server.getPort(), "stage");
    if(rp.deleteFile("name", new LocalDocumentID("id"))) {
      fail("Got positive response for non-existant document and non-existant file");
    }
   
    MemoryDocument testDoc = new MemoryDocument();
    mc.getDocumentWriter().insert(testDoc);
View Full Code Here


    String fileName2 = "test2.txt";
   
    mc.getDocumentWriter().write(new DocumentFile<MemoryType>(testDoc.getID(), fileName, IOUtils.toInputStream(content, "UTF-8"), "stage"));
    mc.getDocumentWriter().write(new DocumentFile<MemoryType>(testDoc.getID(), fileName2, IOUtils.toInputStream(content, "UTF-8"), "stage"));
   
    rp.deleteFile(fileName, LocalDocumentID.getDocumentID(testDoc.getID().toJSON()));
   
    if(mc.getDocumentReader().getDocumentFileNames(testDoc).size()!=1) {
      fail("Incorrect amount of files attached to document after delete");
    }
   
View Full Code Here

   
    if(!mc.getDocumentReader().getDocumentFileNames(testDoc).get(0).equals(fileName2)) {
      fail("Wrong file left after delete");
    }

    rp.deleteFile(fileName2, LocalDocumentID.getDocumentID(testDoc.getID().toJSON()));
   
    if(mc.getDocumentReader().getDocumentFileNames(testDoc).size()!=0) {
      fail("Still some files after both should have been deleted");
    }
  }
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.