package com.example.servlet;

import junit.framework.TestCase;

public class LoggingFilterTest extends TestCase {

    LoggingFilter filter;

    protected void setUp() throws Exception {
        filter = new LoggingFilter();
        filter.init(null);
    }

    protected void tearDown() throws Exception {
        filter.destroy();
        filter = null;
    }

    public void testPrinter() throws Exception {
        String text =
            "<soap:Envelope " +
                "xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
              "<soap:Body>" +
                "<ns2:echo xmlns:ns2=\"http://echo.example.com/\">" +
                  "<text>Hello!</text>" +
                "</ns2:echo>" +
              "</soap:Body>" +
            "</soap:Envelope>";
        String actual = (String) filter.printer.transform(text);
        System.out.println(actual);
    }

}
