コード例 #1
0
 @Override
 public boolean doAction() {
   try {
     //   takeRight.start();
     MsgSender.sndMsg("train::car_" + (carNum) + "::left_wheel_joint -10");
     System.out.println(carNum + "right");
     Thread.sleep(300);
     MsgSender.sndMsg("train::car_" + (carNum) + "::left_wheel_joint 0");
     //   relax.start();
   } // catch (java.io.IOException ex) {}
   catch (InterruptedException ex) {
   }
   return true;
 }
コード例 #2
0
  @Test
  public void test3XAOperationsRollback() {
    String msgText = "Msg rollback " + new Date() + " " + System.currentTimeMillis();
    msgSender.send(msgText);
    sleep(2000);
    try {

      boolean msgInDB = checkForMessageInDB(msgText);
      boolean msgInIncomingQueue = checkForMessageInQueue(msgText, "MY_INCOMING_QUEUE", 1);
      boolean msgInOutgoingQueue = checkForMessageInQueue(msgText, "MY_OUTGOING_QUEUE", 2);
      boolean messageInDLQ = checkForMessageInQueue(msgText, "DLQ.MY_INCOMING_QUEUE", 1);
      log.info(
          "\nROLLBACK TEST CASE -- MSG:"
              + msgText
              + "\nmsgInDB:"
              + msgInDB
              + "\nmsgInIncomingQueue:"
              + msgInIncomingQueue
              + "\nmsgInOutgoingQueue:"
              + msgInOutgoingQueue
              + "\nmessageInDLQ:"
              + messageInDLQ);
      assertTrue(!msgInDB && !msgInIncomingQueue && !msgInOutgoingQueue && messageInDLQ);

    } catch (Exception e) {
      fail();
    }
  }
コード例 #3
0
 private boolean checkForMessageInQueue(String msgText, String queueName, int activeMqSystem)
     throws Exception {
   return msgSender.checkForMessageInQueue(msgText, queueName, activeMqSystem);
 }