import java.util.Map;
import java.util.Set;
import javax.xml.transform.dom.DOMSource;
-import org.apache.xerces.dom.TextImpl;
import org.custommonkey.xmlunit.Diff;
import org.custommonkey.xmlunit.ElementNameAndAttributeQualifier;
import org.custommonkey.xmlunit.XMLUnit;
Node childName = childServer.getFirstChild();
checkNode(childName, "name", "name", qname.getNamespace().toString());
- TextImpl childTest = (TextImpl) childName.getFirstChild();
- assertEquals(childTest.getData(), "test");
+ Node childTest = childName.getFirstChild();
+ assertEquals(childTest.getNodeValue(), "test");
checkAction(actionResetQName, childName.getNextSibling(), "reset-at", "reset-at", "now");
}
assertEquals("now", leaf.getValue());
}
- private void checkAction(QName actionQname, Node action , String inputLocalName, String inputNodeName,
- String inputValue) {
+ private static void checkAction(final QName actionQname, final Node action , final String inputLocalName,
+ final String inputNodeName, final String inputValue) {
checkNode(action, null, actionQname.getLocalName(), null);
Node childResetAt = action.getFirstChild();
checkNode(childResetAt, inputLocalName, inputNodeName, actionQname.getNamespace().toString());
- TextImpl firstChild = (TextImpl) childResetAt.getFirstChild();
- assertEquals(firstChild.getData(), inputValue);
+ Node firstChild = childResetAt.getFirstChild();
+ assertEquals(firstChild.getNodeValue(), inputValue);
}
- private Node checkBasePartOfActionRequest(NetconfMessage actionRequest) {
+ private static Node checkBasePartOfActionRequest(final NetconfMessage actionRequest) {
Node baseRpc = actionRequest.getDocument().getFirstChild();
checkNode(baseRpc, "rpc", "rpc", NetconfMessageTransformUtil.NETCONF_QNAME.getNamespace().toString());
assertTrue(baseRpc.getLocalName().equals("rpc"));
return childAction;
}
- private DOMDataTreeIdentifier prepareDataTreeId(Set<PathArgument> nodeIdentifiers) {
+ private static DOMDataTreeIdentifier prepareDataTreeId(final Set<PathArgument> nodeIdentifiers) {
YangInstanceIdentifier yangInstanceIdentifier =
YangInstanceIdentifier.builder().append(nodeIdentifiers).build();
DOMDataTreeIdentifier domDataTreeIdentifier =
return domDataTreeIdentifier;
}
- private ContainerNode initInputAction(QName qname, String value) {
+ private static ContainerNode initInputAction(final QName qname, final String value) {
ImmutableLeafNodeBuilder<String> immutableLeafNodeBuilder = new ImmutableLeafNodeBuilder<>();
DataContainerChild<NodeIdentifier, String> build = immutableLeafNodeBuilder.withNodeIdentifier(
NodeIdentifier.create(qname)).withValue(value).build();
return data;
}
- private void checkNode(Node childServer, String expectedLocalName, String expectedNodeName,
- String expectedNamespace) {
+ private static void checkNode(final Node childServer, final String expectedLocalName, final String expectedNodeName,
+ final String expectedNamespace) {
assertNotNull(childServer);
assertEquals(childServer.getLocalName(), expectedLocalName);
assertEquals(childServer.getNodeName(), expectedNodeName);
assertEquals(childServer.getNamespaceURI(), expectedNamespace);
}
- private SchemaContext getActionSchema() {
+ private static SchemaContext getActionSchema() {
return YangParserTestUtils.parseYangResource("/schemas/example-server-farm.yang");
}
- private NetconfMessageTransformer getActionMessageTransformer() {
+ private static NetconfMessageTransformer getActionMessageTransformer() {
return new NetconfMessageTransformer(getActionSchema(), true);
}
}