Skip to content
Marvin Rausch edited this page Apr 1, 2023 · 7 revisions

Test the hub manually using the CLI

The hub has a command-line interface which implements the HubConnector interface to be able to test the ASAPHub manually. Each instance of the CLI represents an ASAPPeer. The CLI instances could be started on different machine to communicate with Hub over the network (TCP-IP). It's also possible to start multiple CLI instances on one machine.

How to use the CLI

Before you can use the CLI a Hub instance must be started. The CLI provides the following commands:

  • set-id [peer-id] [multichannel false/true] sets the peer-id
  • peers gets all registered peers from the hub
  • connect [target-peer-id] establishes a connection with the peer "target-peer-id" and sends the message "hello world"
  • help prints all available commands to the console
  • history prints the command history, which could be used as input (testplan) for the automated CLI tests
  • exit terminates the application

Automated CLI tests

The automated CLI tests can be used to implement integration tests. The test class reads all test plans from the testplans directory. A test plan is defined as .txt file which has one CLI command at each line. Each test plan file represents one test. This approach makes it possible to trace back bugs which were found while manual testing.

HubUsageTests

Clone this wiki locally