Package org.mokai.persist.jdbc

Examples of org.mokai.persist.jdbc.JdbcMessageStore.updateStatus()


  public void testUpdateStatusWithEmptyCriteria() throws Exception {
    MessageHandler handler = mock(MessageHandler.class);
    DataSource dataSource = mockDataSource();
    JdbcMessageStore messageStore = createMessageStore(dataSource, handler);

    messageStore.updateStatus(new MessageCriteria(), Message.STATUS_RETRYING);

    verify(handler)
      .updateMessagesStatus(any(Connection.class), any(MessageCriteria.class), anyByte());
  }
View Full Code Here


  public void testUpdateStatusWithNullMessageCriteria() throws Exception {
    MessageHandler handler = mock(MessageHandler.class);
    DataSource dataSource = mockDataSource();
    JdbcMessageStore messageStore = createMessageStore(dataSource, handler);

    messageStore.updateStatus(null, Message.STATUS_RETRYING);

    verify(handler)
      .updateMessagesStatus(any(Connection.class), any(MessageCriteria.class), anyByte());
  }
View Full Code Here

    DataSource dataSource = mockDataSource();
    JdbcMessageStore messageStore = createMessageStore(dataSource, handler);

    MessageCriteria criteria = new MessageCriteria()
      .direction(Direction.TO_APPLICATIONS);
    messageStore.updateStatus(criteria, Message.STATUS_RETRYING);

    verify(handler)
      .updateMessagesStatus(any(Connection.class), any(MessageCriteria.class), anyByte());
  }
View Full Code Here

    DataSource dataSource = mockDataSource();
    JdbcMessageStore messageStore = createMessageStore(dataSource, handler);

    MessageCriteria criteria = new MessageCriteria()
      .direction(Direction.TO_APPLICATIONS);
    messageStore.updateStatus(criteria, Message.STATUS_RETRYING);

    verify(handler, never())
      .updateMessagesStatus(any(Connection.class), any(MessageCriteria.class), anyByte());
  }
View Full Code Here

  }

  @Test(expectedExceptions=IllegalStateException.class)
  public void shouldFailUpdateStatusWithNullDataSource() throws Exception {
    JdbcMessageStore messageStore = createMessageStoreNoDataSource();
    messageStore.updateStatus(new MessageCriteria(), Message.STATUS_CREATED);
  }

  @Test(expectedExceptions=IllegalStateException.class)
  public void shouldFailListWithNullDataSource() throws Exception {
    JdbcMessageStore messageStore = createMessageStoreNoDataSource();
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.