View Javadoc

1   package org.e2etrace.formatter;
2   
3   /*
4    * Copyright 2006 Gunther Popp
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *      http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  import java.io.IOException;
20  import java.io.StringWriter;
21  import java.io.Writer;
22  
23  import org.e2etrace.formatter.AbstractTraceFormatter;
24  import org.e2etrace.formatter.PlainTextTraceFormatter;
25  import org.e2etrace.trace.ITraceSession;
26  
27  import junit.framework.TestCase;
28  
29  /**
30   * JUnit testcase for {@link org.e2etrace.formatter.PlainTextTraceFormatter}.<p>
31   *
32   * Note: This test case is only intended for manual debugging.<p>
33   *
34   * @author Gunther Popp
35   *
36   */
37  public class PlainTextTraceFormatterDebug extends TestCase {
38  
39    public static void main(String[] args) {
40      junit.textui.TestRunner.run(PlainTextTraceFormatterDebug.class);
41    }
42  
43    /**
44     * Test case for <code>format</code>
45     *
46     * @throws IOException Error while generating test output
47     *
48     */
49    public void testFormat() throws IOException {
50      ITraceSession session;
51      Writer testOutput;
52      AbstractTraceFormatter formatter;
53  
54      session = GenerateTestSession.generate();
55      formatter = new PlainTextTraceFormatter();
56      testOutput = new StringWriter();
57  
58      formatter.format(session, testOutput);
59  
60      System.out.println(testOutput.toString());
61  
62    }
63  
64  }