/**
   * Verifies that all operation sets have the type they are declarded to have.
   *
   * @throws java.lang.Exception if a class indicated in one of the keys could not be forName()ed.
   */
  public void testOperationSetTypes() throws Exception {
    Map<String, OperationSet> supportedOperationSets =
        fixture.provider1.getSupportedOperationSets();

    // make sure that keys (which are supposed to be class names) correspond
    // what the class of the values recorded against them.
    for (Map.Entry<String, OperationSet> entry : supportedOperationSets.entrySet()) {
      String setName = entry.getKey();
      Object opSet = entry.getValue();

      assertTrue(
          opSet + " was not an instance of " + setName + " as declared",
          Class.forName(setName).isInstance(opSet));
    }
  }
示例#2
0
  /**
   * Logs exceptions that have occurred in the application while processing events originating from
   * the stack.
   *
   * @param eventClass the class of the jain-sip event that we were handling when the exception was
   *     thrown.
   * @param exc the exception that we need to log.
   */
  private void logApplicationException(Class<DialogTerminatedEvent> eventClass, Throwable exc) {
    String message = "An error occurred while processing event of type: " + eventClass.getName();

    logger.error(message, exc);
    if (logger.isDebugEnabled()) logger.debug(message, exc);
  }