use of com.prosysopc.ua.nodes.UaReference in project FAAAST-Service by FraunhoferIOSB.
the class TestUtils method checkType.
/**
* Checks if the given Node is of the desired type.
*
* @param client The OPC UA Client
* @param node The desired Node
* @param typeNode The expected type.
* @throws ServiceException If the operation fails
* @throws AddressSpaceException If the operation fails
* @throws ServiceResultException If the operation fails
*/
public static void checkType(UaClient client, NodeId node, NodeId typeNode) throws ServiceException, AddressSpaceException, ServiceResultException {
UaNode uanode = client.getAddressSpace().getNode(node);
Assert.assertNotNull("checkType UaNode Null", uanode);
UaReference ref = uanode.getReference(Identifiers.HasTypeDefinition, false);
Assert.assertNotNull("checkType Reference Null", ref);
NodeId refId = client.getAddressSpace().getNamespaceTable().toNodeId(ref.getTargetId());
Assert.assertEquals("type not equal", typeNode, refId);
}
Aggregations