Examples of requireContentFieldExists()


Examples of com.findwise.hydra.local.LocalQuery.requireContentFieldExists()

  public void testMongoDatabaseQuery() throws JsonException {
    MongoConnector mdc = mongoConnectorResource.getConnector();
    LocalQuery lq = new LocalQuery();
    lq.requireTouchedByStage("test");
    lq.requireNotTouchedByStage("test2");
    lq.requireContentFieldExists("exists");
    MongoQuery q = new MongoQuery(lq.toJson());
    Document<MongoType> d = mdc.getDocumentReader().getDocument(q);
    if(d!=null) {
      fail("Expected no document to be returned");
    }
View Full Code Here

Examples of com.findwise.hydra.local.LocalQuery.requireContentFieldExists()

  @Test
  public void testRequireContentFieldExists() throws JsonException {
    MongoConnector mdc = mongoConnectorResource.getConnector();
    LocalQuery q = new LocalQuery();
    q.requireContentFieldExists("number");
    List<DatabaseDocument<MongoType>> ds = mdc.getDocumentReader().getDocuments(new MongoQuery(q.toJson()), 3);
    if(ds.size()!=1) {
      fail("Received incorrect number of documents..");
    }
    q = new LocalQuery();
View Full Code Here

Examples of com.findwise.hydra.local.LocalQuery.requireContentFieldExists()

    List<DatabaseDocument<MongoType>> ds = mdc.getDocumentReader().getDocuments(new MongoQuery(q.toJson()), 3);
    if(ds.size()!=1) {
      fail("Received incorrect number of documents..");
    }
    q = new LocalQuery();
    q.requireContentFieldExists("name");
    ds = mdc.getDocumentReader().getDocuments(new MongoQuery(q.toJson()), 3);
    if(ds.size()!=2) {
      fail("Received incorrect number of documents..");
    }
  }
View Full Code Here

Examples of com.findwise.hydra.local.LocalQuery.requireContentFieldExists()

    mdq.fromJson(q.toJson());
    if(mdq.toDBObject().keySet().size()!=0) {
      fail("Expected query to be empty");
    }
   
    q.requireContentFieldExists("name");
    mdq.fromJson(q.toJson());
    if(mdq.toDBObject().keySet().size()!=1) {
      fail("Expected query to have one value");
    }
    List<DatabaseDocument<MongoType>> list = mdc.getDocumentReader().getDocuments(mdq, 142);
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.