OPCUA::Open62541::Test::Client - run open62541 client for testing
use OPCUA::Open62541::Test::Client; use Test::More tests => OPCUA::Open62541::Test::Client::planning(); my $client = OPCUA::Open62541::Test::Client->new();
In a module test start and run an open62541 OPC UA client that connects to a server. The client is considered part of the test and will write to the TAP stream.
Return the number of tests results that running one client will create. Add this to your number of planned tests.
Create a new test client instance.
Required port number of the server.
Maximum time the client will run during iterate. Defaults to 10 seconds.
Optionally set the url. Returns the url created from localhost and port. Must be called after start() for that.
Configure the client.
Connect the client to the open62541 server.
Run the iterate function of the client for up to 5 seconds. This has to be done to complete asynchronous calls. The scalar reference to $end is used to finish the iteration loop successfully when set to true in a callback. Otherwise the loop terminates with failure if the status of client run_iterate() is not good or after calling it 50 times. If $ident is set, it is used to identify a passed or failed test. This one test is not included in planning().
If $end is undef, the iteration will continue until the client has disconnected. If $end is an array or hash reference, the iteration will continue until the array or hash is empty. If $end is a code reference, the iteration will continue until the function call returns true.
Disconnect the client from the open62541 server.
OPCUA::Open62541, OPCUA::Open62541::Test::Server, OPCUA::Open62541::Test::Logger
Alexander Bluhm <bluhm@genua.de>,
Copyright (c) 2020 Alexander Bluhm
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Thanks to genua GmbH, https://www.genua.de/ for sponsoring this work.
To install OPCUA::Open62541, copy and paste the appropriate command in to your terminal.
cpanm
cpanm OPCUA::Open62541
CPAN shell
perl -MCPAN -e shell install OPCUA::Open62541
For more information on module installation, please visit the detailed CPAN module installation guide.