예제 #1
0
  private void removeHeader(NormalizedMessage msg) {
    for (Iterator i = msg.getPropertyNames().iterator(); i.hasNext(); ) {
      String name = (String) i.next();
      Object value = msg.getProperty(name);

      if ("javax.jbi.messaging.protocol.headers".equals(name)) {
        Map headers = (Map) value;
        headers.remove("Transfer-Encoding");
      }

      if ("org.apache.servicemix.soap.headers".equals(name)) {
        Map headers = (Map) value;
        for (Iterator j = headers.entrySet().iterator(); j.hasNext(); ) {
          Entry entry = (Entry) j.next();
          Object entryKey = entry.getKey();
          Object entryValue = entry.getValue();
          String out = entryKey.toString();
          if (entryValue != null) {
            out += "=" + entryValue.getClass().getName();
          } else {
            out += "=null";
          }
          System.out.println("SOAP HEADER: " + out);
        }
      }

      //            System.out.println("### " + name + "=" + value + " ###");
    }
  }
  @Override
  protected void checkResult(MessageExchange exchange) {
    NormalizedMessage fault = exchange.getMessage("fault");

    assertNotNull(fault);
    assertNotNull(fault.getContent());
    assertEquals(VALUE, fault.getProperty(KEY));
  }