{
TableModel m = getModel();
TableTotaler tt = new TableTotaler();
m.setTotaler(tt);
tt.init(m);
XmlTotalsWriter tw = new XmlTotalsWriter(m);
tw.writeTable(m, "safd");
String xml = tw.getXml();
assertXpathEvaluatesTo("11.0", "//subgroup[@grouped-by=0]/subtotal/subtotal-cell[4]", xml);
assertXpathEvaluatesTo("7.0", "//subgroup[@grouped-by=1]/subtotal/subtotal-cell[4]", xml);
assertXpathEvaluatesTo("4.0", "//subgroup[@grouped-by=2]/subtotal/subtotal-cell[4]", xml);
assertXpathExists("//cell[@text-align='right']", xml);
File f = File.createTempFile("displaytag", "pdf");
FopExportView.transform(tw.getXml(), "/org/displaytag/export/asFo_us.xsl", f);
// verify that the total for the entire table is correct
// We want an overlay that gives us a model of the grouping, so
// Ant | Bee | Value grouping
// --------- --