Package org.mokai.persist.mongo

Examples of org.mokai.persist.mongo.MongoMessageStore.updateStatus()


    createMessageForUpdate(connectionsCol, Message.STATUS_RETRYING);

    MongoMessageStore store = new MongoMessageStore();
    store.setMongo(db);

    store.updateStatus(new MessageCriteria(), Message.STATUS_PROCESSED);

    BasicDBObject obj = (BasicDBObject) applicationsCol.findOne();
    Assert.assertEquals( (byte) obj.getInt("status"), Message.STATUS_PROCESSED);

    obj = (BasicDBObject) connectionsCol.findOne();
View Full Code Here


    createMessageForUpdate(connectionsCol, Message.STATUS_RETRYING);

    MongoMessageStore store = new MongoMessageStore();
    store.setMongo(db);

    store.updateStatus(null, Message.STATUS_PROCESSED);

    BasicDBObject obj = (BasicDBObject) applicationsCol.findOne();
    Assert.assertEquals( (byte) obj.getInt("status"), Message.STATUS_PROCESSED);

    obj = (BasicDBObject) connectionsCol.findOne();
View Full Code Here

    MessageCriteria criteria = new MessageCriteria();
    criteria.setDirection(Direction.TO_CONNECTIONS);
    criteria.addStatus(Message.STATUS_FAILED);
    criteria.addStatus(Message.STATUS_RETRYING);
    store.updateStatus(criteria, Message.STATUS_PROCESSED);

    BasicDBObject obj = (BasicDBObject) applicationsCol.findOne();
    Assert.assertNotNull(obj);
    Assert.assertEquals( (byte) obj.getInt("status"), Message.STATUS_FAILED);
View Full Code Here

    MessageCriteria criteria = new MessageCriteria();
    criteria.setDirection(Direction.TO_APPLICATIONS);
    criteria.addStatus(Message.STATUS_FAILED);
    criteria.addStatus(Message.STATUS_RETRYING);
    store.updateStatus(criteria, Message.STATUS_PROCESSED);

    BasicDBObject obj = (BasicDBObject) connectionsCol.findOne();
    Assert.assertNotNull(obj);
    Assert.assertEquals( (byte) obj.getInt("status"), Message.STATUS_FAILED);
View Full Code Here

  }

  @Test(expectedExceptions=IllegalStateException.class)
  public void shouldFailUpdateStatusWithNullDB() throws Exception {
    MongoMessageStore store = new MongoMessageStore();
    store.updateStatus(null, Message.STATUS_CREATED);
  }

  @Test(expectedExceptions=IllegalStateException.class)
  public void shouldFailListWithNullDB() throws Exception {
    MongoMessageStore store = new MongoMessageStore();
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.