01: package org.incava.analysis;
02:
03: import java.io.*;
04: import java.util.*;
05: import junit.framework.TestCase;
06:
07: public class TestReport extends TestCase {
08: public TestReport(String name) {
09: super (name);
10: }
11:
12: public void testFlush() {
13: Report r = new Report(System.out) {
14: protected String toString(Violation violation) {
15: return "";
16: }
17: };
18: r.addViolation(new Violation("test", 3, 5, 4, 6));
19: r.addViolation(new Violation("test2", 5, 3, 6, 4));
20: assertEquals(2, r.getViolations().size());
21: r.flush();
22: assertEquals(0, r.getViolations().size());
23: }
24: }
|