Asserts that the given SIP message contains a body. Assertion failure output includes the given
message text.

@param msg message text to output if the assertion fails.
@param sipMessage the SIP message.
779820
public static void assertBodyPresent(String msg, SipMessage sipMessage) {
    assertNotNull("Null assert object passed in", sipMessage);
    assertTrue(msg, sipMessage.getContentLength() > 0);
  }
1239228
@Nonnull
  protected static EValidity validateMessage (@Nonnull final String sMsg)
  {
    ValueEnforcer.notNull (sMsg, "Msg");

    return validateMessage (sMsg.toCharArray ());
  }
1323803
public static void e(String msg, Element element) {
		messager.printMessage(Diagnostic.Kind.ERROR, msg, element);
	}
953817
public void sendConsoleMessage(Level level, String msg) {
        if (!(getServerCaller() instanceof UnitTestServerCaller)) {
            getLogger().log(level, msg);
        }
    }
135348
public static function assert($assertion, string $message = '')
    {
        self::$count += 1;
        assert($assertion, new AssertionError($message));
    }
1101093
public void processMessage(JsMessage jsMsg) throws SIResourceException
   {
     if (tc.isEntryEnabled())
       SibTr.entry(tc, "processMessage", new Object[] { jsMsg });
    
     int priority = jsMsg.getPriority().intValue();
     Reliability reliability = jsMsg.getReliability();
       
     SIBUuid12 streamID = jsMsg.getGuaranteedStreamUUID();
     StreamSet streamSet = getStreamSet(streamID, true);
     
     InternalInputStream internalInputStream = null;
     synchronized(streamSet)
     {
       internalInputStream = (InternalInputStream) streamSet.getStream(priority, reliability);        

       // This may be the first message which has required this stream    
       if(internalInputStream == null && 
        (reliability.compareTo(Reliability.BEST_EFFORT_NONPERSISTENT) > 0))
       {
         internalInputStream = createStream(streamSet, priority, reliability);      
       }
     }
        
     if (tc.isEntryEnabled())
       SibTr.exit(tc, "processMessage");
   }
156052
public static RuntimeException codeBug(String msg)
        throws RuntimeException
    {
        msg = "FAILED ASSERTION: " + msg;
        RuntimeException ex = new IllegalStateException(msg);
        // Print stack trace ASAP
        ex.printStackTrace(System.err);
        throw ex;
    }
627967
public void e(final String msg) {
        logMgr.log(tag, LogLevelConst.ERROR, msg, null);
    }
713886
@Override
	public void messageSent(IoSession session, Object message) throws Exception {
		log.debug("{} --> {}", message, session);
		if (this.sensorIoAdapter == null) {
			log.warn("No SensorIoAdapter defined. Ignoring message to {}: {}",
					session, message);
			return;
		}

		if (message instanceof HandshakeMessage) {
			log.debug("Handshake message sent to {}: {}", session, message);
			if (this.sensorIoAdapter != null) {
				this.sensorIoAdapter.handshakeMessageSent(session,
						(HandshakeMessage) message);
			}
		} else if (message instanceof SampleMessage) {
			if (this.sensorIoAdapter != null) {
				this.sensorIoAdapter.sensorSampleSent(session,
						(SampleMessage) message);
			}
		} else {
			log.warn("Unhandled message type sent to {}: {}", session, message);
		}

	}
1116928
public static void assertNotAnswered(String msg, SipCall call) {
    assertNotNull("Null assert object passed in", call);
    assertFalse(msg, call.isCallAnswered());
  }
951506
public boolean addMessage(SIMPMessage msgItem) throws SIResourceException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "addMessage", new Object[] { msgItem });
  
    // Get the JsMessage as we need to update the Guaranteed fields
    JsMessage jsMsg = msgItem.getMessage();
  
    StreamSet streamSet = getStreamSet();
  
    // Stamp the message with the stream ID
    msgItem.setGuaranteedStreamUuid(streamSet.getStreamID());
  
    //  NOTE: no synchronization with flush necessary here since startFlush
    // is not supposed to be called until all competing producer threads have
    // exited.
    Reliability reliability = msgItem.getReliability();
  
    if(reliability == Reliability.BEST_EFFORT_NONPERSISTENT)
    {
      addBestEffortMessage(msgItem);
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "addMessage", false);
      return false;
    }
    else
    {
      SourceStream sourceStream = null;
      int priority = msgItem.getPriority();
      synchronized(streamSet)
      {        
        sourceStream = (SourceStream) streamSet.getStream(priority, reliability);
    
        if(sourceStream == null)
        {
          sourceStream = createStream(streamSet,
                                      priority,
                                      reliability,
                                      streamSet.getPersistentData(priority, reliability),
                                      false );
        }
      }
    
      synchronized(sourceStream)
      {    
        long tick = this.messageProcessor.nextTick();
    
        //Set a unique id in the message if explicitly told to or
        //if one has not already been set
        if(msgItem.getRequiresNewId()  ||  jsMsg.getSystemMessageId()==null)
        {
          jsMsg.setSystemMessageSourceUuid(this.messageProcessor.getMessagingEngineUuid());
          jsMsg.setSystemMessageValue(tick);
          msgItem.setRequiresNewId(false);
        }
    
        jsMsg.setGuaranteedValueEndTick(tick);
        jsMsg.setGuaranteedValueValueTick(tick);
        jsMsg.setGuaranteedValueRequestedOnly(false);
    
        jsMsg.setGuaranteedValueStartTick(sourceStream.getLastMsgAdded() + 1);
        jsMsg.setGuaranteedValueCompletedPrefix(sourceStream.getCompletedPrefix());
    
        sourceStream.writeUncommitted(msgItem);
      } // end sync
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "addMessage", true);
    
      return true;
    }    
  }
233110
def assert test, msg = nil
      msg ||= "Failed assertion, no message given."
      # comment out self.assertions += 1 to counting assertions
      unless test then
        msg = msg.call if Proc === msg
        raise RWebSpec::Assertion, msg
      end
      true
    end
1103345
public static void d(String msg) {
		if (!debug) {
			return;
		}
		if (messager == null) {
			return;
		}
		messager.printMessage(Diagnostic.Kind.NOTE, msg);
	}
1058190
public void verifyMIC(byte[] inTok, int tokOff, int tokLen, // mic
                          byte[] inMsg, int msgOff, int msgLen, // real msg
                          MessageProp prop)
        throws GSSException {
        throw new GSSException(GSSException.UNAVAILABLE);
/*TODO

        checkContext();

        logger.debug("enter verifyMic");

        SSLCipherState st = this.conn.getReadCipherState();
        SSLCipherSuite cs = st.getCipherSuite();

        logger.debug("digest algorithm: " + cs.getDigestAlg());

        if (tokLen != (GSI_MESSAGE_DIGEST_PADDING + cs.getDigestOutputLength())) {
            throw new GlobusGSSException(GSSException.DEFECTIVE_TOKEN,
                                         GlobusGSSException.TOKEN_FAIL,
                                         "tokenFail00",
                                         new Object[] {new Integer(tokLen),
                                                       new Integer(GSI_MESSAGE_DIGEST_PADDING +
                                                                   cs.getDigestOutputLength())});
        }

        int bufLen = SSLUtil.toInt(inTok, tokOff+GSI_SEQUENCE_SIZE);
        if (bufLen != msgLen) {
            throw new GlobusGSSException(GSSException.DEFECTIVE_TOKEN,
                                         GlobusGSSException.TOKEN_FAIL,
                                         "tokenFail01",
                                         new Object[] {new Integer(msgLen), new Integer(bufLen)});
        }

        int pad_ct = (cs.getDigestOutputLength()==16) ? 48 : 40;

        byte [] digest = null;

        try {
            MessageDigest md =
                MessageDigest.getInstance(cs.getDigestAlg());

            md.update(st.getMacKey());
            for(int i=0;i<pad_ct;i++) {
                md.update(SSLHandshake.pad_1);
            }
            md.update(inTok, tokOff, GSI_MESSAGE_DIGEST_PADDING);
            md.update(inMsg, msgOff, msgLen);

            digest = md.digest();
        } catch (NoSuchAlgorithmException e) {
            throw new GlobusGSSException(GSSException.FAILURE, e);
        }

        byte [] token = new byte[tokLen-GSI_MESSAGE_DIGEST_PADDING];
        System.arraycopy(inTok, tokOff+GSI_MESSAGE_DIGEST_PADDING, token, 0, token.length);

        if (!Arrays.equals(digest, token)) {
            throw new GlobusGSSException(GSSException.BAD_MIC,
                                         GlobusGSSException.BAD_MIC,
                                         "tokenFail02");
        }

        long tokSeq = SSLUtil.toLong(inTok, tokOff);
        long readSeq = this.conn.getReadSequence();
        long seqTest = tokSeq - readSeq;

        logger.debug("Token seq#   : " + tokSeq);
        logger.debug("Current seq# : " + readSeq);

        if (seqTest > 0) {
            // gap token
            throw new GSSException(GSSException.GAP_TOKEN);
        } else if (seqTest < 0) {
            // old token
            throw new GSSException(GSSException.OLD_TOKEN);
        } else {
            this.conn.incrementReadSequence();
        }

        if (prop != null) {
            prop.setPrivacy(false);
            prop.setQOP(0);
        }

        logger.debug("exit verifyMic");
*/
    }
554359
private static boolean isDataMessage(final ByteBuf msg) {
    return DcpMutationMessage.is(msg) || DcpDeletionMessage.is(msg) || DcpExpirationMessage.is(msg);
  }
54835
public boolean evaluateMessage(
    Selector selectorTree,
    Selector discriminatorTree,
    SIBusMessage msg)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "evaluateMessage", new Object[] { selectorTree, msg });

    boolean ret = false;
    Object result = null;
    boolean discriminatorMatches = true; //assume it does match

    // Use the dummy evaluation cache, we don't need one hear as we're not
    // searching the MatchSpace
    EvalCache cache = EvalCache.DUMMY;

    try
    {
      Evaluator evaluator = Matching.getEvaluator();
      //    See if we need to process a discriminator expression first
      if (discriminatorTree != null)
      {
        discriminatorMatches = false; //can no longer assume it does match
        String discriminator = msg.getDiscriminator();

        MatchSpaceKey msk = new DiscriminatorMatchSpaceKey(discriminator);
        // Evaluate message against selector tree
        result = evaluator.eval(discriminatorTree, msk, cache, null, false);
        if (result != null && ((Boolean) result).booleanValue())
        {
          discriminatorMatches = true;
        }
      }

      // Evaluate message against selector tree
      if (selectorTree != null && discriminatorMatches)
      {
        result =
          evaluator.eval(selectorTree, (MatchSpaceKey) msg, cache, null, false);
      }

    }
    catch (BadMessageFormatMatchingException qex)
    {
      FFDCFilter.processException(
        qex,
        "com.ibm.ws.sib.processor.matching.MessageProcessorMatching.evaluateMessage",
        "1:1824:1.117.1.11",
        this);

      SibTr.exception(tc, qex);

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "evaluateMessage", "SICoreException");

      SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
        new Object[] {
          "com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
          "1:1834:1.117.1.11",
          qex });

      // For now, I'll throw a core exception, but in due course this (or something with a
      // better name) will be externalised in the Core API.
      throw new SIErrorException(
        nls.getFormattedMessage(
          "INTERNAL_MESSAGING_ERROR_CWSIP0002",
          new Object[] {
            "com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
            "1:1844:1.117.1.11",
            qex },
          null),
        qex);
    }

    // The result of expression evaluation can be either a
    // boolean, or not, which is interpreted as false.
    if (result instanceof Boolean)
    {
      // This turns a BooleanValue into a boolean
      // it will return false for unknown which is what we want.
      ret = ((Boolean) result).booleanValue();
    }
    else if (result == null)
    {
      ret = false;
    }
    else
    {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "evaluateMessage", "SICoreException");
      // For now, I'll throw a core exception, but in due course this (or something with a
      // better name) will be externalised in the Core API.
      SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0001",
        new Object[] {
          "com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
          "1:1870:1.117.1.11" });

      throw new SIErrorException(
        nls.getFormattedMessage(
          "INTERNAL_MESSAGING_ERROR_CWSIP0001",
          new Object[] {
            "com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
            "1:1877:1.117.1.11" },
          null));
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "evaluateMessage", Boolean.valueOf(ret));
    return ret;
  }
295506
protected void dbg(String msg, Throwable t) {
        System.out.println(msg + (t != null ? ("\n" + t.getMessage()) : "")
                + (t != null ? ("\n" + t.getStackTrace()) : ""));
    }