adds footer to the HTML report.
authorChris Jaekl <cejaekl@yahoo.com>
Mon, 9 Jan 2017 12:44:19 +0000 (21:44 +0900)
committerChris Jaekl <cejaekl@yahoo.com>
Mon, 9 Jan 2017 12:44:19 +0000 (21:44 +0900)
Links back to the web site, describing what CFB is.

prod/net/jaekl/cfb/analyze/HtmlReport.java
test/net/jaekl/cfb/analyze/HtmlReportTest.java

index 75e39a94c4d09933a63a83a426337a325d0f292d..a531143e5aebef72412b3b5cf3354a2c17faaed5 100644 (file)
@@ -62,6 +62,7 @@ public class HtmlReport {
                writeBugs(pw, CfbBundle.NEW_BUGS,   m_delta.getNew());
                writeBugs(pw, CfbBundle.FIXED_BUGS, m_delta.getFixed());
                writeBugs(pw, CfbBundle.OLD_BUGS,   m_delta.getCommon());
+               writeFooter(pw);
        }
        
        void writeBugLocations(PrintWriter pw, BugInstance bug)
@@ -138,6 +139,11 @@ public class HtmlReport {
                }
        }
        
+       void writeFooter(PrintWriter pw)
+       {
+               pw.println("    <DIV CLASS=\"Footer\">Report generated by <A HREF=\"https://jaekl.net/cfb/\">CFB</A></DIV>");
+       }
+       
        void writeHeader(PrintWriter pw)
        {
                String title = trans(CfbBundle.CFB_REPORT);
@@ -200,6 +206,8 @@ public class HtmlReport {
                pw.println("                   body { background-color: #F0F0FF; }");
            pw.println("    .CategoryName  { text-align: right; }");
            pw.println("    .CategoryValue { text-align: left; }");
+           pw.println("    div.Footer     { background-color: #0000FF; color: #FFFFFF; font-size: 0.9em; text-align: right; }");
+           pw.println("    div.Footer a:link { color: #FFFFFF }");
                pw.println("    .Loc           { font-family: monospace; }");
            pw.println("    .SectionHead   td { background-color: #0000FF; color: #FFFFFF; font-size: 1.25em; font-weight: bold; }");
                pw.println("    .Var           { font-family: monospace; }");
index 0938cb73f186102c10e77ca5eca5c094b8ec6ce5..154a29187704a7967106fc13e74d2cb517f52494 100644 (file)
@@ -149,6 +149,9 @@ public class HtmlReportTest {
                                
                // The character set UTF-8 should be specified
                assertTrue(html.contains("<META CHARSET=\"UTF-8\"/>"));         
+               
+               // The footer should be present
+               assertTrue(html.contains("DIV CLASS=\"Footer\">Report generated by <A HREF=\"https://jaekl.net/cfb/\">CFB</A></DIV>"));
        }
        
        @Before