Partial implementation of XML parse for FindBugs output
[cfb.git] / test / net / jaekl / cfb / analyze / AnalyzerTest.java
1 package net.jaekl.cfb.analyze;
2
3 import static org.junit.Assert.*;
4
5 import java.io.File;
6
7 import org.junit.Test;
8
9 public class AnalyzerTest {
10
11         @Test
12         public void testOutputWorkFile() {
13                 final String[][] DATA = {
14                                 // findBugsDir, workDir, FBP,        expectedOutputXml
15                                 { "foo",        "bar",   "baz.fbp",  "bar" + File.separator + "baz.xml" },
16                                 { 
17                                         File.separator + "findbugs-3.01",
18                                         "." + File.separator + "work",
19                                         "project.fbp",
20                                         "." + File.separator + "work" + File.separator + "project.xml"
21                                 }
22                         };
23                 
24                 for (String[] datum : DATA) {
25                         File findBugsDir = new File(datum[0]);
26                         File workDir     = new File(datum[1]);
27                         File fbp         = new File(datum[2]);
28                         File expected    = new File(datum[3]);
29
30                         Analyzer analyzer = new Analyzer(findBugsDir);
31                         File actual = analyzer.outputWorkFile(workDir, fbp);
32                         assertEquals(expected.getAbsolutePath(), actual.getAbsolutePath());
33                 }
34         }
35
36 }