01: /**
02: * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
03: */package test.net.sourceforge.pmd.ant;
04:
05: import static org.junit.Assert.assertFalse;
06: import static org.junit.Assert.assertTrue;
07: import net.sourceforge.pmd.ant.Formatter;
08:
09: import org.junit.Ignore;
10: import org.junit.Test;
11:
12: import java.io.File;
13:
14: public class FormatterTest {
15:
16: @Ignore
17: @Test
18: public void testType() {
19: /*
20: Formatter f = new Formatter();
21: f.setType("xml");
22: assertTrue(f.getRenderer() instanceof XMLRenderer);
23: f.setType("text");
24: assertTrue(f.getRenderer() instanceof TextRenderer);
25: f.setType("csv");
26: assertTrue(f.getRenderer() instanceof CSVRenderer);
27: f.setType("html");
28: assertTrue(f.getRenderer() instanceof HTMLRenderer);
29: try {
30: f.setType("FAIL");
31: f.getRenderer();
32: throw new RuntimeException("Should have failed!");
33: } catch (BuildException be) {
34: // cool
35: }
36: */
37: }
38:
39: @Test
40: public void testNull() {
41: Formatter f = new Formatter();
42: assertTrue("Formatter toFile should start off null!", f
43: .isNoOutputSupplied());
44: f.setToFile(new File("foo"));
45: assertFalse("Formatter toFile should not be null!", f
46: .isNoOutputSupplied());
47: }
48:
49: public static junit.framework.Test suite() {
50: return new junit.framework.JUnit4TestAdapter(
51: FormatterTest.class);
52: }
53: }
|