This document describes each of the tests in the Jini(TM) Technology Lookup, Discovery, and Join Compatibility Kit (LDJ Kit). The LDJ Kit tests the conformance of clients, services, and lookup services (hereafter referred to as "programs") to the Jini technology specifications.
The Jini(TM) Technology Lookup, Discovery, and Join Compatibility Kit Test Descriptions rely on the following specifications:
The remainder of this document consists of a list of the tests, in alphabetical order by name, that are in the LDJ Kit. This section describes the kind of information contained in each test description, presented in the following format:
This section defines a generalization of the assertions being tested.
This section describes a set of conditions that must be met for the test results to be valid.
This section describes the test design and the criteria for passing or failing the test. In this section, variable names are used for programmed delays and waits. These variables are implemented as properties in test implementations. Multiples of these times are used in most tests. The variables referred to in this document are:
failureTime
- This variable represents a time value in milliseconds. It indicates the smallest unit of time that is useful for failure detection.
quietTime
- This variable represents a time value in milliseconds. It indicates the number of milliseconds that the LDJ Kit should wait to ensure that an action or event does not occur. For example, a test that wishes to collect all the multicast requests from a service may enter a listening period that is a multiple of this value.
Each of the tests included in the LDJ Kit follows the design described in the previous section, and implements the variables described in that section as properties.
This section describes the following characteristics of the test implementation:
The purpose of this test is to verify that a service sends a properly formatted unicast request as part of the Multicast Announcement Protocol.
If the LDJ Kit and the program are run on the same machine, there should be no other Jini technology-enabled programs running on that machine. If the LDJ Kit and program are run on two different machines, there should be no other Jini technology-enabled programs running on either of these two machines.
This test sends a public
group multicast announcement packet every second. Simultaneously, the test waits up to failureTime
milliseconds for the service to open a socket and send a unicast request packet as outlined in the Multicast Announcement Protocol. The test then checks that the received unicast request is properly formatted.
If the service does not open a socket within failureTime
, or if the service sends an improperly formatted unicast request packet, then the test stops and returns a failure status. Otherwise, the test stops and returns a pass status.
The purpose of this test is to verify that a program downloads the lookup service's proxy from the codebase provided by the lookup service.
If the LDJ Kit and the program are run on the same machine, there should be no other Jini technology-enabled programs running on that machine. If the LDJ Kit and program are run on two different machines, there should be no other Jini technology-enabled programs running on either of these two machines.
The test copies the lookup service's downloadable JAR file to a JAR file with a randomly generated name (the new file is created to prevent caching from causing false negative results). The test then starts an instrumented class server on port 8080 and a lookup service with the HTTP URL codebase of the copied JAR file. The test starts the program and waits up to five times failureTime
milliseconds.
If the copied JAR file was not downloaded from the class server, then the test deletes the JAR file and returns a failure status. Otherwise, the test deletes the JAR file and returns a pass status.
The purpose of this test is to verify that the lookup service being tested properly and promptly expires registered event listeners.
If the LDJ Kit and the program are run on the same machine, there should be no other Jini technology-enabled programs running on that machine. If the LDJ Kit and program are run on two different machines, there should be no other Jini technology-enabled programs running on either of these two machines.
The test creates a test service and registers it with the lookup service being tested. The test then registers an event listener, requesting a lease duration of failureTime
milliseconds, that will be notified of all changes in the lookup service pertaining to the test service. The test waits for two times the event listener lease duration granted by the lookup service. This wait period should ensure that the event listener lease has expired. The test then cancels the test service's lookup lease. Finally, the test waits quietTime
milliseconds to collect events related to the test service.
If during the final wait period the test receives any events, the test stops and returns a failure status. Otherwise, the test stops and returns a pass status.
The purpose of this test is to verify that the service being tested maintains its lookup service registration lease.
If the LDJ Kit and the program are run on the same machine, there should be no other Jini technology-enabled programs running on that machine. If the LDJ Kit and program are run on two different machines, there should be no other Jini technology-enabled programs running on either of these two machines.
This test starts a lookup service that grants leases with a maximum duration of failureTime
milliseconds. The test then starts the service being tested and waits up to four times failureTime
milliseconds for the service to register. Once the service has registered with the lookup service, the test registers with the lookup service to be notified if the service is removed from the lookup service, and waits for three times the provided lease duration. If the test was not notified of the service being removed, the test queries the lookup service to ensure the service is still registered.
If the service never registered with the lookup service or the service, once registered, is removed from the lookup service, then the test stops and returns a failure status. Otherwise, the test stops and returns a pass status.
The purpose of this test is to verify that the lookup service being tested can perform a lookup by a service's class type.
If the LDJ Kit and the program are run on the same machine, there should be no other Jini technology-enabled programs running on that machine. If the LDJ Kit and program are run on two different machines, there should be no other Jini technology-enabled programs running on either of these two machines.
The test creates a unique test service, with a unique class type, and registers it with the lookup service being tested. The test uses a LeaseRenewalManager
to maintain the service's lease while the test is in progress. The test then looks up the test service using the service's class type.
If the lookup service returns nothing or the wrong service, then the test stops and returns a failure status. Otherwise, the test stops and returns a pass status.
The purpose of this test is to verify that the lookup service being tested can perform a lookup by a service's interface type.
If the LDJ Kit and the program are run on the same machine, there should be no other Jini technology-enabled programs running on that machine. If the LDJ Kit and program are run on two different machines, there should be no other Jini technology-enabled programs running on either of these two machines.
The test creates a unique test service that implements a unique interface type and registers it with the lookup service being tested. The test uses a LeaseRenewalManager
to maintain the service's lease while the test is in progress. The test then looks up the test service using the service's interface type.
If the lookup service returns nothing or the wrong service, then the test stops and returns a failure status. Otherwise, the test stops and returns a pass status.
The purpose of this test is to verify that the lookup service being tested can perform a lookup by a service's interface type ServiceID
.
If the LDJ Kit and the program are run on the same machine, there should be no other Jini technology-enabled programs running on that machine. If the LDJ Kit and program are run on two different machines, there should be no other Jini technology-enabled programs running on either of these two machines.
The test creates a unique test service, registers it with the lookup service being tested, and stores the ServiceID
returned by the lookup service. The test uses a LeaseRenewalManager
to maintain the service's lease while the test is in progress. The test then looks up the test service using the service's stored ServiceID
.
If the lookup service returns nothing or the wrong service, then the test stops and returns a failure status. Otherwise, the test stops and returns a pass status.
The purpose of this test is to verify that the lookup service being tested can perform a lookup by a service's superclass type.
If the LDJ Kit and the program are run on the same machine, there should be no other Jini technology-enabled programs running on that machine. If the LDJ Kit and program are run on two different machines, there should be no other Jini technology-enabled programs running on either of these two machines.
The test creates a unique test service, with unique class and superclass types, and registers it with the lookup service being tested. The test uses a LeaseRenewalManager
to maintain the service's lease while the test is in progress. The test then looks up the test service using the service's superclass type.
If the lookup service returns nothing or the wrong service, then the test stops and returns a failure status. Otherwise, the test stops and returns a pass status.
The purpose of this test is to verify that the lookup service being tested properly handles events, specifically multiple renewals and transitions.
If the LDJ Kit and the program are run on the same machine, there should be no other Jini technology-enabled programs running on that machine. If the LDJ Kit and program are run on two different machines, there should be no other Jini technology-enabled programs running on either of these two machines.
This test also assumes that service registration, lease renewal, and lease cancellation each take less than 1/4 the granted lease duration, which is requested to be eight times failureTime
milliseconds.
The test creates a test service item and registers it with the lookup service being tested. The test uses a LeaseRenewalManager
to prevent the service lease from expiring while the test is in progress, because the maximum lease duration that a lookup service will grant is not guaranteed to be configurable.
The test registers an event listener with the lookup service, requesting a lease time of eight times failureTime
milliseconds. The test then performs five iterations of these steps:
failureTime
milliseconds
If, for each iteration, the expected transition events for the test service are not received, the test stops and returns a failure status. Otherwise, the test stops and returns a pass status.
The purpose of this test is to verify that the service being tested registers with a lookup service belonging to multiple groups, including the public
group.
If the LDJ Kit and the program are run on the same machine, there should be no other Jini technology-enabled programs running on that machine. If the LDJ Kit and program are run on two different machines, there should be no other Jini technology-enabled programs running on either of these two machines.
To ensure that the service being tested discovers the lookup service through multicast announcements, the test starts the service being tested and waits quietTime
milliseconds before starting the lookup service. The lookup service belongs to three groups: the public
group and two groups with randomly generated names.
If the service does not register within six times failureTime
milliseconds, the service and the lookup service are stopped and the test returns a failure status. Otherwise, the service and the lookup service are stopped but the test is repeated from the beginning two more times, with the public
group being the second group and then the third group in the lookup service's group list. If all registration attempts succeed, the test stops and returns a pass status.
The purpose of this test is to verify that the service being tested properly registers with multiple lookup services, including registering the same information (ServiceID
and attributes) with all of the lookup services.
If the LDJ Kit and the program are run on the same machine, there should be no other Jini technology-enabled programs running on that machine. If the LDJ Kit and program are run on two different machines, there should be no other Jini technology-enabled programs running on either of these two machines.
The test starts three lookup services, all of which at least belong to the public
group (some are in multiple groups), and then starts the service being tested. The test then waits up to twelve times failureTime
milliseconds for the service to register in all lookup services. Finally, if the service is in all three lookup services, the test compares the ServiceID
and the attributes that are registered with the three lookup services to make sure they are the same.
If the service does not register in all three of the lookup services, or the registration information is different between the three lookup services, then the test stops and returns a failure status. Otherwise, the test stops and returns a pass status.
The purpose of this test is to verify that the lookup service being tested allows a service to renew a lease multiple times.
If the LDJ Kit and the program are run on the same machine, there should be no other Jini technology-enabled programs running on that machine. If the LDJ Kit and program are run on two different machines, there should be no other Jini technology-enabled programs running on either of these two machines.
This test also assumes that lease renewal and service lookup each take less than 1/4 the granted lease duration, which is requested to be four times failureTime
milliseconds.
The test creates a test service and registers it with the lookup service being tested, requesting a lease duration of four times failureTime
milliseconds. The test then waits for 3/4 of the granted lease duration time and renews the lease. Half way through this new lease duration, the test looks up the test service (by ServiceID
) to make sure the service is still registered with the lookup service. The process repeats at 3/4 through the new lease duration by renewing the lease again. This renewal and lookup process happens a total of five times.
If any of the service lookups fail, the test stops and returns a failure status. Otherwise, the test stops and returns a pass status.
The purpose of this test is to verify that the service being tested does not register indiscriminately with a lookup service belonging to any group.
If the LDJ Kit and the program are run on the same machine, there should be no other Jini technology-enabled programs running on that machine. If the LDJ Kit and program are run on two different machines, there should be no other Jini technology-enabled programs running on either of these two machines.
To ensure that the service being tested discovers the lookup service through multicast announcements, the test starts the service being tested and waits quietTime
milliseconds before starting the lookup service. The lookup service belongs to a group whose name is randomly generated.
If the service does register within quietTime
milliseconds, the service and the lookup service are stopped and the test returns a failure status. Otherwise, the test stops and returns a pass status.
The purpose of this test is to verify that the service being tested does register with a lookup service belonging to the public
group.
If the LDJ Kit and the program are run on the same machine, there should be no other Jini technology-enabled programs running on that machine. If the LDJ Kit and program are run on two different machines, there should be no other Jini technology-enabled programs running on either of these two machines.
To ensure that the service being tested discovers the lookup service through multicast announcements, the test starts the service being tested and waits quietTime
milliseconds before starting the lookup service. The lookup service belongs to the public
group.
If the service does not register within six times failureTime
milliseconds, the service and the lookup service are stopped and the test returns a failure status. Otherwise, the test stops and returns a pass status.
The purpose of this test is to verify that the service being tested properly registers with a lookup service that is already running and that the service's service ID conforms to the ServiceID
specification.
If the LDJ Kit and the program are run on the same machine, there should be no other Jini technology-enabled programs running on that machine. If the LDJ Kit and program are run on two different machines, there should be no other Jini technology-enabled programs running on either of these two machines.
The test starts a lookup service, which belongs to the public
group, and then starts the service being tested. The test then waits up to four times failureTime
milliseconds for the service to register.
If the service does not register in the lookup service, then the test stops and returns a failure status. Otherwise, the test checks that the service's service ID conforms to the ServiceID
specification before stopping the service and returning a pass status.
The purpose of this test is to verify that a program sends a properly formatted multicast request as part of the Multicast Request Protocol.
If the LDJ Kit and the program are run on the same machine, there should be no other Jini technology-enabled programs running on that machine. If the LDJ Kit and program are run on two different machines, there should be no other Jini technology-enabled programs running on either of these two machines.
The test listens to the appropriate multicast group for a multicast request from the service being tested.
If the service does not send a multicast request within failureTime
milliseconds, or if the service sends an improperly formatted multicast request, then the test stops and returns a failure status. Otherwise, the test stops and returns a pass status.
The purpose of this test is to verify that the lookup service being tested generates a service ID that conforms to the ServiceID
specification.
If the LDJ Kit and the program are run on the same machine, there should be no other Jini technology-enabled programs running on that machine. If the LDJ Kit and program are run on two different machines, there should be no other Jini technology-enabled programs running on either of these two machines.
The test checks that the service ID of the registered service returned by the lookup service conforms to the ServiceID
specification before stopping the lookup service and returning a pass status or a failure status.
The purpose of this test is to verify that the lookup service being tested properly and promptly expires service registrations.
If the LDJ Kit and the program are run on the same machine, there should be no other Jini technology-enabled programs running on that machine. If the LDJ Kit and program are run on two different machines, there should be no other Jini technology-enabled programs running on either of these two machines.
The test creates a test service and registers it with the lookup service being tested, requesting a lease duration of failureTime
milliseconds. The test then performs a lookup to make sure the service is registered. After waiting for the lease duration, the test uses the ServiceID
to perform both a simple lookup and a matching lookup.
If the test service does not register with the lookup service or either lookup returns a non-null result, then the test stops and returns a failure status. Otherwise, the test stops and returns a pass status.
The purpose of this test is to verify that a program sends a properly formatted unicast request as part of the Multicast Request Protocol.
If the LDJ Kit and the program are run on the same machine, there should be no other Jini technology-enabled programs running on that machine. If the LDJ Kit and program are run on two different machines, there should be no other Jini technology-enabled programs running on either of these two machines.
The test listens to the appropriate multicast group for a multicast request from the service being tested. If the test receives a multicast request within failureTime
milliseconds, it makes a socket connection back to the service as outlined in the Multicast Request Protocol. The test then listens for a unicast request on that socket.
If the service does not send a unicast request within failureTime
milliseconds, or if the service sends an improperly formatted unicast request, then the test stops and returns a failure status. Otherwise, the test stops and returns a pass status.