- for (String s : refNames) {
- assertThat(trimmedServices, JUnitMatchers.containsString(s));
- }
+ @Override
+ public void testElement(Element element) throws NodeTestException {
+ if(element.getNodeName() != null) {
+ if(element.getNodeName().equals("name")) {
+ String elmText = element.getTextContent();
+ if(refNames.contains(elmText)) {
+ refNames.remove(elmText);
+ return;
+ } else {
+ throw new NodeTestException("Unexpected services defined: " + elmText);
+ }
+ }
+ }
+ }
+
+ @Override
+ public void noMoreNodes(NodeTest forTest) throws NodeTestException {
+ assertTrue(refNames.isEmpty());
+ }
+ };
+ nt.performTest(tester, Node.ELEMENT_NODE);