src/test/java/pityoulish/sockets/server/TLVRequestParserImplTest.java
protected static void assertPX(Throwable cause, Object reason)
  {
    assertNotNull("no exception", cause);
    assertEquals("wrong exception",
                 ProtocolException.class,
                 cause.getClass());

    String msg = cause.getMessage();
    assertNotNull("no exception message", msg);
    assertNotEquals("empty exception message", "", msg);
    assertTrue("missing NLS code", msg.indexOf(MSGCODE_PREFIX) >= 0);

    if (reason != null)
     {
       String why = reason.toString();
       assertTrue("wrong reason for exception",
                  cause.getMessage().indexOf(why) >= 0);
     }
  }
/**
   * Checks for {@link ProtocolException} and certain elements of the message.
   * The message is expected to contain a message code.
   * If a <code>reason</code> is given, it must appear in the message too.
   *
   * @param cause    the exception to check
   * @param reason   a string expected in the message,
   *                 or <code>null</code> to skip this check.
   *                 Non-string arguments are converted to String first.
   */
Checks for  ProtocolException and certain elements of the message.
The message is expected to contain a message code.
If a reason is given, it must appear in the message too.

@param cause    the exception to check
@param reason   a string expected in the message,
or null to skip this check.
Non-string arguments are converted to String first.
Checks for ProtocolException and certain elements of the message . The message is expected to contain a message code . If a reason is given it must appear in the message too . @param cause the exception to check @param reason a string expected in the message or null to skip this check . Non - string arguments are converted to String first .
protected static void assertPX(Throwable cause, Object reason)
  {
    assertNotNull("no exception", cause);
    assertEquals("wrong exception",
                 ProtocolException.class,
                 cause.getClass());
    String msg = cause.getMessage();
    assertNotNull("no exception message", msg);
    assertNotEquals("empty exception message", "", msg);
    assertTrue("missing NLS code", msg.indexOf(MSGCODE_PREFIX) >= 0);
    if (reason != null)
     {
       String why = reason.toString();
       assertTrue("wrong reason for exception",
                  cause.getMessage().indexOf(why) >= 0);
     }
  }
protected static void assertPX ( Throwable cause , Object reason ) { assertNotNull ( "no exception" , cause ) ; assertEquals ( "wrong exception" , ProtocolException . class , cause . getClass ( ) ) ; String msg = cause . getMessage ( ) ; assertNotNull ( "no exception message" , msg ) ; assertNotEquals ( "empty exception message" , "" , msg ) ; assertTrue ( "missing NLS code" , msg . indexOf ( MSGCODE_PREFIX ) >= 0 ) ; if ( reason != null ) { String why = reason . toString ( ) ; assertTrue ( "wrong reason for exception" , cause . getMessage ( ) . indexOf ( why ) >= 0 ) ; } }
Checks for {@link ProtocolException} and certain elements of the message.
Checks for { @link ProtocolException } and certain elements of the message .