Package org.mokai.persist.mongo

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


    createMessageForUpdate(applicationsCol, Message.STATUS_FAILED);

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

    Collection<Message> messages = store.list(new MessageCriteria());
    Assert.assertNotNull(messages);
    Assert.assertEquals(messages.size(), 2);
  }

  @Test
View Full Code Here


    createMessageForUpdate(applicationsCol, Message.STATUS_FAILED);

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

    Collection<Message> messages = store.list(null);
    Assert.assertNotNull(messages);
    Assert.assertEquals(messages.size(), 2);
  }

  @Test
View Full Code Here

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

    MessageCriteria criteria = new MessageCriteria()
      .direction(Direction.TO_APPLICATIONS);
    Collection<Message> messages = store.list(criteria);

    Assert.assertEquals(messages.size(), 1);
  }

  @Test(expectedExceptions=IllegalStateException.class)
View Full Code Here

  }

  @Test(expectedExceptions=IllegalStateException.class)
  public void shouldFailListWithNullDB() throws Exception {
    MongoMessageStore store = new MongoMessageStore();
    store.list(null);
  }

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