import org.w3c.dom.Text;
public final class XmlUnitUtil {
+ private XmlUnitUtil() {
- private XmlUnitUtil() {}
+ }
public static void assertContainsElementWithText(final Document doc,
final String textToFind) throws NodeTestException {
boolean textFound = false;
@Override
- public void testText(Text text) throws NodeTestException {
+ public void testText(final Text text) throws NodeTestException {
if (!textFound) {
if (text.getData().equalsIgnoreCase(textToFind)) {
textFound = true;
}
@Override
- public void noMoreNodes(NodeTest forTest) throws NodeTestException {
+ public void noMoreNodes(final NodeTest forTest) throws NodeTestException {
assertTrue(textFound);
}
};
private boolean elementFound = false;
@Override
- public void testElement(Element element) throws NodeTestException {
+ public void testElement(final Element element) throws NodeTestException {
if (!elementFound) {
if (element.isEqualNode(testElement)) {
elementFound = true;
}
@Override
- public void noMoreNodes(NodeTest forTest) throws NodeTestException {
+ public void noMoreNodes(final NodeTest forTest) throws NodeTestException {
assertTrue(elementFound);
}
};
private boolean elementFound = false;
@Override
- public void testElement(Element element) throws NodeTestException {
+ public void testElement(final Element element) throws NodeTestException {
if (!elementFound) {
if (element.getNodeName() != null && element.getNodeName().equals(elementName)) {
elementFound = true;
}
@Override
- public void noMoreNodes(NodeTest forTest) throws NodeTestException {
+ public void noMoreNodes(final NodeTest forTest) throws NodeTestException {
assertTrue(XmlUtil.toString(doc), elementFound);
}
};
private int elementFound = 0;
@Override
- public void testElement(Element element) throws NodeTestException {
+ public void testElement(final Element element) throws NodeTestException {
if (element.getNodeName() != null && element.getNodeName().equals(elementName)) {
elementFound++;
}
}
@Override
- public void noMoreNodes(NodeTest forTest) throws NodeTestException {
+ public void noMoreNodes(final NodeTest forTest) throws NodeTestException {
assertEquals(expectedCount, elementFound);
}
};