Jini(TM) Technology Lookup, Discovery, and Join Compatibility Kit Test Descriptions
v1.0


1   Introduction

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.

1.1   Dependencies

The Jini(TM) Technology Lookup, Discovery, and Join Compatibility Kit Test Descriptions rely on the following specifications:

2   Test Descriptions


2.1   About the Test Descriptions

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:

2.1.1   Purpose

This section defines a generalization of the assertions being tested.

2.1.2   Assumptions

This section describes a set of conditions that must be met for the test results to be valid.

2.1.3   Test Design

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:

2.1.4   Implementation

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:


2.2   AnnouncementResponseTest

2.2.1   Purpose

The purpose of this test is to verify that a service sends a properly formatted unicast request as part of the Multicast Announcement Protocol.

2.2.2   Assumptions

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.

2.2.3   Test Design

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.

2.2.4   Implementation


2.3   CodeDownloadTest

2.3.1   Purpose

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.

2.3.2   Assumptions

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.

2.3.3   Test Design

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.

2.3.4   Implementation


2.4   EventLeaseExpirationTest

2.4.1   Purpose

The purpose of this test is to verify that the lookup service being tested properly and promptly expires registered event listeners.

2.4.2   Assumptions

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.

2.4.3   Test Design

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.

2.4.4   Implementation


2.5   LeaseTest

2.5.1   Purpose

The purpose of this test is to verify that the service being tested maintains its lookup service registration lease.

2.5.2   Assumptions

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.

2.5.3   Test Design

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.

2.5.4   Implementation


2.6   LookupByClassTest

2.6.1   Purpose

The purpose of this test is to verify that the lookup service being tested can perform a lookup by a service's class type.

2.6.2   Assumptions

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.

2.6.3   Test Design

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.

2.6.4   Implementation


2.7   LookupByInterfaceTest

2.7.1   Purpose

The purpose of this test is to verify that the lookup service being tested can perform a lookup by a service's interface type.

2.7.2   Assumptions

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.

2.7.3   Test Design

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.

2.7.4   Implementation


2.8   LookupByServiceIDTest

2.8.1   Purpose

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.

2.8.2   Assumptions

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.

2.8.3   Test Design

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.

2.8.4   Implementation


2.9   LookupBySuperClassTest

2.9.1   Purpose

The purpose of this test is to verify that the lookup service being tested can perform a lookup by a service's superclass type.

2.9.2   Assumptions

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.

2.9.3   Test Design

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.

2.9.4   Implementation


2.10   MultipleEventLeaseRenewalTest

2.10.1   Purpose

The purpose of this test is to verify that the lookup service being tested properly handles events, specifically multiple renewals and transitions.

2.10.2   Assumptions

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.

2.10.3   Test Design

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:

  1. Waits for 3/4 of the current granted event lease duration, then renews the lease
  2. Waits for half of the newly granted lease duration
  3. On odd iterations, cancels the service's lease; on even iterations, reregisters the service
  4. Waits failureTime milliseconds
  5. Checks to see if the proper events were received

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.

2.10.4   Implementation


2.11   MultipleGroupTest

2.11.1   Purpose

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.

2.11.2   Assumptions

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.

2.11.3   Test Design

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.

2.11.4   Implementation


2.12   MultipleRegistrationTest

2.12.1   Purpose

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.

2.12.2   Assumptions

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.

2.12.3   Test Design

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.

2.12.4   Implementation


2.13   MultipleServiceLeaseRenewalTest

2.13.1   Purpose

The purpose of this test is to verify that the lookup service being tested allows a service to renew a lease multiple times.

2.13.2   Assumptions

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.

2.13.3   Test Design

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.

2.13.4   Implementation


2.14   NonPublicGroupTest

2.14.1   Purpose

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.

2.14.2   Assumptions

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.

2.14.3   Test Design

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.

2.14.4   Implementation


2.15   PublicGroupTest

2.15.1   Purpose

The purpose of this test is to verify that the service being tested does register with a lookup service belonging to the public group.

2.15.2   Assumptions

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.

2.15.3   Test Design

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.

2.15.4   Implementation


2.16   RegistrationTest

2.16.1   Purpose

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.

2.16.2   Assumptions

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.

2.16.3   Test Design

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.

2.16.4   Implementation


2.17   RequestPacketTest

2.17.1   Purpose

The purpose of this test is to verify that a program sends a properly formatted multicast request as part of the Multicast Request Protocol.

2.17.2   Assumptions

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.

2.17.3   Test Design

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.

2.17.4   Implementation


2.18   ServiceIDTest

2.18.1   Purpose

The purpose of this test is to verify that the lookup service being tested generates a service ID that conforms to the ServiceID specification.

2.18.2   Assumptions

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.

2.18.3   Test Design

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.

2.18.4   Implementation


2.19   ServiceLeaseExpirationTest

2.19.1   Purpose

The purpose of this test is to verify that the lookup service being tested properly and promptly expires service registrations.

2.19.2   Assumptions

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.

2.19.3   Test Design

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.

2.19.4   Implementation


2.20   UnicastRequestTest

2.20.1   Purpose

The purpose of this test is to verify that a program sends a properly formatted unicast request as part of the Multicast Request Protocol.

2.20.2   Assumptions

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.

2.20.3   Test Design

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.

2.20.4   Implementation


Copyright 2005, Sun Microsystems, Inc.
Licensed under the Apache License, Version 2.0.