[webbeans-commits] Webbeans SVN: r1394 - tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/report.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Tue Feb 3 07:17:38 EST 2009


Author: shane.bryzak at jboss.com
Date: 2009-02-03 07:17:38 -0500 (Tue, 03 Feb 2009)
New Revision: 1394

Modified:
   tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/report/CoverageProcessor.java
   tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/report/CoverageReport.java
Log:
improved style

Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/report/CoverageProcessor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/report/CoverageProcessor.java	2009-02-03 08:20:03 UTC (rev 1393)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/report/CoverageProcessor.java	2009-02-03 12:17:38 UTC (rev 1394)
@@ -169,7 +169,7 @@
          SpecAssertion annotation = d.getAnnotation( SpecAssertion.class );
          SpecReference ref = new SpecReference(
                annotation.section(), annotation.id(), 
-               d.getDeclaringType().getQualifiedName(), d.getSimpleName()); 
+               d.getDeclaringType().getSimpleName(), d.getSimpleName()); 
          references.add( ref );
       }
    }   

Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/report/CoverageReport.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/report/CoverageReport.java	2009-02-03 08:20:03 UTC (rev 1393)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/report/CoverageReport.java	2009-02-03 12:17:38 UTC (rev 1394)
@@ -58,8 +58,33 @@
    
    private void writeHeader(OutputStream out) throws IOException
    {
-      out.write("<html><head><title>JSR-299 TCK Coverage Report</title></head><body".getBytes());
-      out.write("<h1>TCK Coverage Report</h1>".getBytes());
+      StringBuilder sb = new StringBuilder();
+           
+      sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+      sb.append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\n");
+      sb.append("\"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">");
+      sb.append("<html><head><title>JSR-299 TCK Coverage Report</title>\n");
+      
+      sb.append("<style type=\"text/css\">\n");
+      sb.append("  .code {\n");
+      sb.append("    float: left;\n");
+      sb.append("    font-weight: bold;\n");
+      sb.append("    width: 50px;\n");
+      sb.append("    margin-top: 0px;\n");
+      sb.append("    height: 100%; }\n");
+      sb.append("  .results {\n");
+      sb.append("    margin-left: 50px; }\n");
+      sb.append("  #pass {\n");
+      sb.append("    background-color: #fdd; }\n");
+      sb.append("  #fail {\n");
+      sb.append("    background-color: #dfd; }\n");
+      
+      sb.append("</style>\n");
+      
+      sb.append("</head><body>");
+      sb.append("<h1>JSR-299 TCK Coverage</h1>");      
+      
+      out.write(sb.toString().getBytes());
    }
    
    private void writeBody(OutputStream out) throws IOException
@@ -69,7 +94,7 @@
       
       for (String key : keys)
       {         
-         out.write(("<h2>Section " + key + " - " + sections.get(key) + "</h2>").getBytes());
+         out.write(("<h2>Section " + key + " - " + sections.get(key) + "</h2>\n").getBytes());
          
          List<AuditAssertion> sectionAssertions = assertions.get(key);
          
@@ -81,31 +106,35 @@
             
             for (AuditAssertion assertion : sectionAssertions)
             {
-               sb.append("<div>");
+               sb.append("  <div class=\"assertion\">\n");
                
-               sb.append("<div style='float:left'>");
+               sb.append("    <span class=\"code\">");
                sb.append(assertion.getId());
                sb.append(")");
-               sb.append("</div>");
+               sb.append("</span>\n");
                
-               sb.append("<div style='float:left;margin-left:50px'>");
+               sb.append("    <div class=\"results\">");
+               sb.append("<p class=\"description\">");
                sb.append(assertion.getText());
-               sb.append("</div>");
+               sb.append("</p>\n");
                
-               sb.append("<br style='clear:both'/>");
-               
+               sb.append("    <div class=\"coverage\">\n");
+               sb.append("      <h4>Coverage</h4>\n");
+                              
                if (references.get(key) != null)
                {
                   for (SpecReference ref : references.get(key))
                   {
+                     sb.append("        <p>");
                      sb.append(ref.getClassName());
                      sb.append(".");
                      sb.append(ref.getMethodName());
                      sb.append("()");
+                     sb.append("</p>\n");
                   }
                }
                
-               sb.append("</div>");
+               sb.append("    </div>\n  </div>\n");
             }
             
             out.write(sb.toString().getBytes());




More information about the weld-commits mailing list