* @
*/
@Test
public void testHtmlDoc()
{
final HtmlExporter exporter = ExportUtils.createHtmlExporter();
exporter
.addCssStyle( "th { text-align:left;font-style:italic;font-weight:bold;font-size:medium;background-color:#C0C0FF; }" );
final Element body = exporter.getBody();
body.addChild( HtmlExporter.H2 ).addContent( "I2C Analysis results" );
body.addChild( HtmlExporter.HR );
body.addChild( HtmlExporter.DIV ).addAttribute( "style", "text-align: right; font-size: x-small;" ).addContent(
"today" );
body.addChild( HtmlExporter.P );
final Element table = body.addChild( "table" ).addAttribute( "style", "width: 100%" );
Element tr;
tr = table.addChild( "tr" );
tr.addChild( "td" ).addAttribute( "colspan", "2" ).addContent( "Bus configuration" );
tr = table.addChild( "tr" );
tr.addChild( "td" ).addAttribute( "style", "width:30%" ).addContent( "SDA" );
tr.addChild( "td" ).addContent( "<auto detect>" );
tr = table.addChild( "tr" );
tr.addChild( "td" ).addAttribute( "style", "width:30%" ).addContent( "SCL" );
tr.addChild( "td" ).addContent( "<auto detect>" );
body.addChild( HtmlExporter.P ).addContent( " " );
assertEquals(
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n"
+ "<html><head><title></title><style type='text/css'>th { text-align:left;font-style:italic;font-weight:bold;font-size:medium;background-color:#C0C0FF; }</style></head><body><h2>I2C Analysis results</h2><hr><div style='text-align: right; font-size: x-small;'>today</div><p></p><table style='width: 100%'><tr><td colspan='2'>Bus configuration</td></tr><tr><td style='width:30%'>SDA</td><td><auto detect></td></tr><tr><td style='width:30%'>SCL</td><td><auto detect></td></tr></table><p> </p></body></html>",
exporter.toString() );
}