1   package test.net.sourceforge.pmd.renderers;
2   
3   import net.sourceforge.pmd.PMD;
4   import net.sourceforge.pmd.Report.ProcessingError;
5   import net.sourceforge.pmd.renderers.AbstractRenderer;
6   import net.sourceforge.pmd.renderers.VBHTMLRenderer;
7   
8   public class VBHTMLRendererTest extends AbstractRendererTst {
9   
10      public AbstractRenderer getRenderer() {
11          return new VBHTMLRenderer();
12      }
13  
14      public String getExpected() {
15          return  "<html><head><title>PMD</title></head><style type=\"text/css\"><!--" + PMD.EOL + 
16                  "body { background-color: white; font-family:verdana, arial, helvetica, geneva; font-size: 16px; font-style: italic; color: black; }" + PMD.EOL + 
17                  ".title { font-family: verdana, arial, helvetica,geneva; font-size: 12px; font-weight:bold; color: white; }" + PMD.EOL + 
18                  ".body { font-family: verdana, arial, helvetica, geneva; font-size: 12px; font-weight:plain; color: black; }" + PMD.EOL + 
19                  "#TableHeader { background-color: #003366; }" + PMD.EOL + 
20                  "#RowColor1 { background-color: #eeeeee; }" + PMD.EOL + 
21                  "#RowColor2 { background-color: white; }" + PMD.EOL + 
22                  "--></style><body><center><table border=\"0\" width=\"80%\"><tr id=TableHeader><td colspan=\"2\"><font class=title>&nbsp;n/a</font></tr>" + PMD.EOL + 
23                  "<tr id=RowColor2><td width=\"50\" align=\"right\"><font class=body>1&nbsp;&nbsp;&nbsp;</font></td><td><font class=body>msg</font></td></tr>" + PMD.EOL + 
24                  "</table><br></center></body></html>";
25      }
26  
27      public String getExpectedEmpty() {
28          return "<html><head><title>PMD</title></head><style type=\"text/css\"><!--" + PMD.EOL + 
29          "body { background-color: white; font-family:verdana, arial, helvetica, geneva; font-size: 16px; font-style: italic; color: black; }" + PMD.EOL + 
30          ".title { font-family: verdana, arial, helvetica,geneva; font-size: 12px; font-weight:bold; color: white; }" + PMD.EOL + 
31          ".body { font-family: verdana, arial, helvetica, geneva; font-size: 12px; font-weight:plain; color: black; }" + PMD.EOL + 
32          "#TableHeader { background-color: #003366; }" + PMD.EOL + 
33          "#RowColor1 { background-color: #eeeeee; }" + PMD.EOL + 
34          "#RowColor2 { background-color: white; }" + PMD.EOL + 
35          "--></style><body><center><br></center></body></html>";
36      }
37  
38      public String getExpectedMultiple() {
39          return  "<html><head><title>PMD</title></head><style type=\"text/css\"><!--" + PMD.EOL + 
40                  "body { background-color: white; font-family:verdana, arial, helvetica, geneva; font-size: 16px; font-style: italic; color: black; }" + PMD.EOL + 
41                  ".title { font-family: verdana, arial, helvetica,geneva; font-size: 12px; font-weight:bold; color: white; }" + PMD.EOL + 
42                  ".body { font-family: verdana, arial, helvetica, geneva; font-size: 12px; font-weight:plain; color: black; }" + PMD.EOL + 
43                  "#TableHeader { background-color: #003366; }" + PMD.EOL + 
44                  "#RowColor1 { background-color: #eeeeee; }" + PMD.EOL + 
45                  "#RowColor2 { background-color: white; }" + PMD.EOL + 
46                  "--></style><body><center><table border=\"0\" width=\"80%\"><tr id=TableHeader><td colspan=\"2\"><font class=title>&nbsp;n/a</font></tr>" + PMD.EOL + 
47                  "<tr id=RowColor2><td width=\"50\" align=\"right\"><font class=body>1&nbsp;&nbsp;&nbsp;</font></td><td><font class=body>msg</font></td></tr>" + PMD.EOL + 
48                  "<tr id=RowColor1><td width=\"50\" align=\"right\"><font class=body>1&nbsp;&nbsp;&nbsp;</font></td><td><font class=body>msg</font></td></tr>" + PMD.EOL +
49                  "</table><br></center></body></html>";
50      }
51      
52      public String getExpectedError(ProcessingError error) {
53          return  "<html><head><title>PMD</title></head><style type=\"text/css\"><!--" + PMD.EOL + 
54                  "body { background-color: white; font-family:verdana, arial, helvetica, geneva; font-size: 16px; font-style: italic; color: black; }" + PMD.EOL + 
55                  ".title { font-family: verdana, arial, helvetica,geneva; font-size: 12px; font-weight:bold; color: white; }" + PMD.EOL + 
56                  ".body { font-family: verdana, arial, helvetica, geneva; font-size: 12px; font-weight:plain; color: black; }" + PMD.EOL + 
57                  "#TableHeader { background-color: #003366; }" + PMD.EOL + 
58                  "#RowColor1 { background-color: #eeeeee; }" + PMD.EOL + 
59                  "#RowColor2 { background-color: white; }" + PMD.EOL + 
60                  "--></style><body><center><br><table border=\"0\" width=\"80%\"><tr id=TableHeader><td><font class=title>&nbsp;Problems found</font></td></tr><tr id=RowColor2><td><font class=body>" + error +"\"</font></td></tr></table></center></body></html>";
61      }
62  
63      public static junit.framework.Test suite() {
64          return new junit.framework.JUnit4TestAdapter(VBHTMLRendererTest.class);
65      }
66  }