예제 #1
0
 private void setupInitialFaultyTransitions(List initialFaultyTransList) {
   if (0 < initialFaultyTransList.size()) {
     LoggingBase.logMessage(
         "PatternTest.setupInitialFaultyTransitions blocking incoming messages to set up faulty initial messages");
     ep.blockReceivedMessages();
   }
 }
예제 #2
0
  private void transmitBrokenMessage(MALMessageHeader srcHdr, IPTestTransitionType transitionType)
      throws Exception {
    boolean isError = false;

    if ((IPTestTransitionType.ACK_ERROR == transitionType)
        || (IPTestTransitionType.UPDATE_ERROR == transitionType)
        || (IPTestTransitionType.RESPONSE_ERROR == transitionType)) {
      isError = true;
    }

    MALMessageHeader brokenHeader =
        new TestMessageHeader(
            srcHdr.getURIFrom(),
            srcHdr.getAuthenticationId(),
            srcHdr.getURITo(),
            srcHdr.getTimestamp(),
            srcHdr.getQoSlevel(),
            srcHdr.getPriority(),
            srcHdr.getDomain(),
            srcHdr.getNetworkZone(),
            srcHdr.getSession(),
            srcHdr.getSessionName(),
            srcHdr.getInteractionType(),
            transitionTypeToInteractionStage(transitionType, srcHdr.getInteractionType()),
            srcHdr.getTransactionId(),
            srcHdr.getServiceArea(),
            srcHdr.getService(),
            srcHdr.getOperation(),
            srcHdr.getAreaVersion(),
            isError);

    MALMessage brokenMessage;
    if (isError) {
      brokenMessage =
          ep.createTestMessage(
              brokenHeader,
              new MALStandardError(MALHelper.INTERNAL_ERROR_NUMBER, null),
              new HashMap());
    } else {
      brokenMessage = ep.createTestMessage(brokenHeader, (Element) null, new HashMap());
    }
    LoggingBase.logMessage("Sending brokenMessage = " + brokenMessage);

    ep.receive(brokenMessage);
  }
예제 #3
0
  private void sendInitialFaultyTransitions(List initialFaultyTransList, MALMessageHeader hdr)
      throws Exception {
    if (0 < initialFaultyTransList.size()) {
      for (int i = 0; i < initialFaultyTransList.size(); i++) {
        IPTestTransitionType transition = (IPTestTransitionType) initialFaultyTransList.get(i);

        transmitBrokenMessage(hdr, transition);
      }

      LoggingBase.logMessage(
          "PatternTest.sendInitialFaultyTransitions unblocking incoming messages");
      ep.releaseReceivedMessages();
    }
  }