private void checkNodes(Node node, int position)
{
OdfTextListStyle theStyle;
OdfTextListLevelStyleBullet bullet;
OdfTextListLevelStyleNumber number;
TextListLevelStyleElementBase base;
int i = 0;
theStyle = (OdfTextListStyle) node;
Assert.assertTrue("Style name " +
theStyle.getStyleNameAttribute() + " incorrect",
theStyle.getStyleNameAttribute().equals("list" + position));
node = node.getFirstChild();
while (node != null)
{
Assert.assertTrue("More nodes than specifiers",
i < levelType[position].length);
String[] surround;
if (prefixSuffix[position][i].equals("/"))
{
surround = new String[2];
surround[0] = "";
surround[1] = "";
}
else
{
surround = prefixSuffix[position][i].split("/");
}
if (levelType[position][i].equals("B"))
{
Assert.assertTrue("Class is not bullet",
node instanceof OdfTextListLevelStyleBullet);
bullet = (OdfTextListLevelStyleBullet) node;
base = bullet;
Assert.assertEquals("Prefix incorrect",
surround[0], bullet.getStyleNumPrefixAttribute());
Assert.assertEquals("Suffix incorrect", surround[1],
bullet.getStyleNumSuffixAttribute());
}
else
{
Assert.assertTrue("Class is not number",
node instanceof OdfTextListLevelStyleNumber);
number = (OdfTextListLevelStyleNumber) node;
Assert.assertEquals(formatChar[position][i],
number.getStyleNumFormatAttribute());
base = number;
Assert.assertEquals("Prefix incorrect",
surround[0], number.getStyleNumPrefixAttribute());
Assert.assertEquals("Suffix incorrect", surround[1],
number.getStyleNumSuffixAttribute());
}
Assert.assertEquals("Level incorrect",
i+1, base.getTextLevelAttribute().intValue());
checkNumber(
"SpaceBefore",
base.getProperty(OdfListLevelProperties.SpaceBefore),
i+1);
checkNumber(
"MinLabelWidth",
base.getProperty(OdfListLevelProperties.MinLabelWidth),
1.0);
node = node.getNextSibling();
i++;
}