Package com.findwise.hydra.local

Examples of com.findwise.hydra.local.LocalDocumentID


    ((Map<String, Object>) getMetadataMap().get(tag)).put(stage, date);
  }

  @Override
  public void setID(DocumentID<MemoryType> id) {
    doc.setID(new LocalDocumentID(id.getID()));
  }
View Full Code Here


    when(writer.insert(any(DatabaseDocument.class))).thenReturn(false);
   
    DatabaseDocument dbdoc = mock(DatabaseDocument.class);
    when(dbc.convert(any(LocalDocument.class))).thenReturn(dbdoc);
   
    LocalDocumentID id = new LocalDocumentID(1);
   
    when(dbdoc.getID()).thenReturn(id);
    when(reader.getDocumentById(id)).thenReturn(dbdoc);
   
    RemotePipeline rp = new HttpRemotePipeline("localhost", server.getPort(), "stage");
View Full Code Here

  }
 
  @Test
  public void testFileList() throws Exception {   
    RemotePipeline rp = new HttpRemotePipeline("localhost", server.getPort(), "stage");
    if(rp.getFileNames(new LocalDocumentID(""))!=null) {
      fail("Got filenames for non-existant document");
    }
   
    MemoryDocument testDoc = new MemoryDocument();
    mc.getDocumentWriter().insert(testDoc);
View Full Code Here

  }
 
  @Test
  public void testGetFile() throws Exception {   
    RemotePipeline rp = new HttpRemotePipeline("localhost", server.getPort(), "stage");
    if(rp.getFile("id", new LocalDocumentID("file"))!=null) {
      fail("Got non-null for non-existant document and non-existant file");
    }
   
    MemoryDocument testDoc = new MemoryDocument();
    mc.getDocumentWriter().insert(testDoc);

    if(rp.getFile(testDoc.getID().getID().toString(), new LocalDocumentID("file"))!=null) {
      fail("Got non-null for non-existant file");
    }
   
    String content = "adsafgoaiuhgahgo\ndndasasddåäöäöåäöäas";
    String fileName = "test.txt";
View Full Code Here

  }
 
  @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

  }

  @Override
  public boolean insert(DatabaseDocument<MemoryType> d) {
    MemoryDocument md = (MemoryDocument) d;
    md.setID(new MemoryDocumentID(new LocalDocumentID(md.hashCode() + ""
        + System.currentTimeMillis())));
    removeNullFields(md);
    set.put(md, false);
    md.markSynced();
    return true;
View Full Code Here

  }

  @Override
  public DocumentID<MemoryType> toDocumentId(Object jsonPrimitive) {
    return new MemoryDocumentID(new LocalDocumentID(jsonPrimitive));
  }
View Full Code Here

TOP

Related Classes of com.findwise.hydra.local.LocalDocumentID

Copyright © 2018 www.massapicom. 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.