1 package org.incava.analysis; 2 3 import java.io.*; 4 import java.util.*; 5 import junit.framework.TestCase; 6 7 8 public class TestReport extends TestCase 9 { 10 public TestReport(String name) 11 { 12 super(name); 13 } 14 15 public void testFlush() 16 { 17 Report r = new Report(System.out) { 18 protected String toString(Violation violation) 19 { 20 return ""; 21 } 22 }; 23 r.addViolation(new Violation("test", 3, 5, 4, 6)); 24 r.addViolation(new Violation("test2", 5, 3, 6, 4)); 25 assertEquals(2, r.getViolations().size()); 26 r.flush(); 27 assertEquals(0, r.getViolations().size()); 28 } 29 } 30 31 | Popular Tags |