Class simu.test.TestSCPCommunicator
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class simu.test.TestSCPCommunicator

java.lang.Object
   |
   +----simu.test.TestSCPCommunicator

public class TestSCPCommunicator
extends Object
Version:
1.0 20-Mar-97
Author:
Andre Campeau

The TestSCPCommunicator class is a test harness for the SCPCommunicator class. Testing of both sending and receiving capabilities of the SCPCommunicator is done.

See Also:
SCPCommunicator, TestCommunicator

Constructor Index

 o TestSCPCommunicator()

Method Index

 o main(String[])
The main method executes a number of test scenarios.

Constructors

 o TestSCPCommunicator
  public TestSCPCommunicator()

Methods

 o main
  public static void main(String args[])
The main method executes a number of test scenarios. These scenarios are:
  1. Verify the SCPCommunicator class listener thread constructors by creating two listener threads. First, create a SCPCommunicator listener daemon thread on port 1100. Through interaction with the TestCommunicator class test harness (or similar program), verify that it can send data from the SNED (Simulated Network Element Database), and receive data and update the SNED.
  2. Second, create a SCPCommunicator listener daemon thread on port 1101, and verify the same operations as in the previous test. Note that there are no commands to print the SNED contents to the standard output. To verify the SNED contents for both this and the previous test, a debugger should be used to inpect the data.

Susequent tests exercise the send constructor for the SCPCommunicator class. Data is sent, and any replies are returned in the local Hashtable. After the last test is executed, the contents of the local Hashtable are printed to the standard output to verify its contents.

  1. Send the data "SHIP key5 value5" to a Communicator class (or equivalent) to set a remote attribute in the remote database.
  2. Send the data "SHIP REMOVE key5" to verify that an attribute can be removed from the remote database.
  3. Send the data "SHIP key6 value6" and "SHIP key7 value7" to set more remote attributes.
  4. Send the data "RECEIVE key6" to verify that the value of the attribute corresponding to key6 can be retrieved from the remote object.
  5. Send the data "RECEIVE REMOTE ALL" to verify that all of the remote attributes can be retrieved.

Preconditions: A communicator thread, which adheres to the Communicator class protocol, is listening on port 1102. Note that this test harness was designed to run in conjunction with the TestCommunicator class test harness, which exercises the Communicator class. In general, however, any communicator thread that adheres to the Communicator class protocol would be sufficient.

Postconditions: The operation of the SCPCommunicator class is verified.

Parameters:
args[] - No command line arguments are required.

See Also:
Communicator

All Packages  Class Hierarchy  This Package  Previous  Next  Index