001: package test.net.sourceforge.pmd.renderers;
002:
003: import net.sourceforge.pmd.PMD;
004: import net.sourceforge.pmd.Report.ProcessingError;
005: import net.sourceforge.pmd.renderers.AbstractRenderer;
006: import net.sourceforge.pmd.renderers.VBHTMLRenderer;
007:
008: public class VBHTMLRendererTest extends AbstractRendererTst {
009:
010: public AbstractRenderer getRenderer() {
011: return new VBHTMLRenderer();
012: }
013:
014: public String getExpected() {
015: return "<html><head><title>PMD</title></head><style type=\"text/css\"><!--"
016: + PMD.EOL
017: + "body { background-color: white; font-family:verdana, arial, helvetica, geneva; font-size: 16px; font-style: italic; color: black; }"
018: + PMD.EOL
019: + ".title { font-family: verdana, arial, helvetica,geneva; font-size: 12px; font-weight:bold; color: white; }"
020: + PMD.EOL
021: + ".body { font-family: verdana, arial, helvetica, geneva; font-size: 12px; font-weight:plain; color: black; }"
022: + PMD.EOL
023: + "#TableHeader { background-color: #003366; }"
024: + PMD.EOL
025: + "#RowColor1 { background-color: #eeeeee; }"
026: + PMD.EOL
027: + "#RowColor2 { background-color: white; }"
028: + PMD.EOL
029: + "--></style><body><center><table border=\"0\" width=\"80%\"><tr id=TableHeader><td colspan=\"2\"><font class=title> n/a</font></tr>"
030: + PMD.EOL
031: + "<tr id=RowColor2><td width=\"50\" align=\"right\"><font class=body>1 </font></td><td><font class=body>msg</font></td></tr>"
032: + PMD.EOL + "</table><br></center></body></html>";
033: }
034:
035: public String getExpectedEmpty() {
036: return "<html><head><title>PMD</title></head><style type=\"text/css\"><!--"
037: + PMD.EOL
038: + "body { background-color: white; font-family:verdana, arial, helvetica, geneva; font-size: 16px; font-style: italic; color: black; }"
039: + PMD.EOL
040: + ".title { font-family: verdana, arial, helvetica,geneva; font-size: 12px; font-weight:bold; color: white; }"
041: + PMD.EOL
042: + ".body { font-family: verdana, arial, helvetica, geneva; font-size: 12px; font-weight:plain; color: black; }"
043: + PMD.EOL
044: + "#TableHeader { background-color: #003366; }"
045: + PMD.EOL
046: + "#RowColor1 { background-color: #eeeeee; }"
047: + PMD.EOL
048: + "#RowColor2 { background-color: white; }"
049: + PMD.EOL
050: + "--></style><body><center><br></center></body></html>";
051: }
052:
053: public String getExpectedMultiple() {
054: return "<html><head><title>PMD</title></head><style type=\"text/css\"><!--"
055: + PMD.EOL
056: + "body { background-color: white; font-family:verdana, arial, helvetica, geneva; font-size: 16px; font-style: italic; color: black; }"
057: + PMD.EOL
058: + ".title { font-family: verdana, arial, helvetica,geneva; font-size: 12px; font-weight:bold; color: white; }"
059: + PMD.EOL
060: + ".body { font-family: verdana, arial, helvetica, geneva; font-size: 12px; font-weight:plain; color: black; }"
061: + PMD.EOL
062: + "#TableHeader { background-color: #003366; }"
063: + PMD.EOL
064: + "#RowColor1 { background-color: #eeeeee; }"
065: + PMD.EOL
066: + "#RowColor2 { background-color: white; }"
067: + PMD.EOL
068: + "--></style><body><center><table border=\"0\" width=\"80%\"><tr id=TableHeader><td colspan=\"2\"><font class=title> n/a</font></tr>"
069: + PMD.EOL
070: + "<tr id=RowColor2><td width=\"50\" align=\"right\"><font class=body>1 </font></td><td><font class=body>msg</font></td></tr>"
071: + PMD.EOL
072: + "<tr id=RowColor1><td width=\"50\" align=\"right\"><font class=body>1 </font></td><td><font class=body>msg</font></td></tr>"
073: + PMD.EOL + "</table><br></center></body></html>";
074: }
075:
076: public String getExpectedError(ProcessingError error) {
077: return "<html><head><title>PMD</title></head><style type=\"text/css\"><!--"
078: + PMD.EOL
079: + "body { background-color: white; font-family:verdana, arial, helvetica, geneva; font-size: 16px; font-style: italic; color: black; }"
080: + PMD.EOL
081: + ".title { font-family: verdana, arial, helvetica,geneva; font-size: 12px; font-weight:bold; color: white; }"
082: + PMD.EOL
083: + ".body { font-family: verdana, arial, helvetica, geneva; font-size: 12px; font-weight:plain; color: black; }"
084: + PMD.EOL
085: + "#TableHeader { background-color: #003366; }"
086: + PMD.EOL
087: + "#RowColor1 { background-color: #eeeeee; }"
088: + PMD.EOL
089: + "#RowColor2 { background-color: white; }"
090: + PMD.EOL
091: + "--></style><body><center><br><table border=\"0\" width=\"80%\"><tr id=TableHeader><td><font class=title> Problems found</font></td></tr><tr id=RowColor2><td><font class=body>"
092: + error
093: + "\"</font></td></tr></table></center></body></html>";
094: }
095:
096: public static junit.framework.Test suite() {
097: return new junit.framework.JUnit4TestAdapter(
098: VBHTMLRendererTest.class);
099: }
100: }
|