Discovery Management Tests

 

Test Name & Motivation

Description

Categorization

Specification Requirements

DiscoveryManagementIFTest (DMIF) - Only tests interface semantics.

1.        Create ClientLookupManager with null arguments [CLM 9,11,12]

2.        Call getDiscoveryManager() [CLM 50]

3.        Add multiple discovery listeners [DMI 1]

4.        Add a null discovery listener  [DMI 5]

5.        Add duplicate listeners again [DMI TBD]

6.        Remove all listeners  [DMI 6]

7.        Remove null listener [DMI TBD]

8.        Remove all listeners again [DMI 7]

9.        Call getRegistrars and verify that it is empty  [DMI 9]

10.     Call getRegistrars again and verify that you get a new array [DMI 10]

11.     Call discard with null  [DMI 12]

12.     Call terminate [DMI 15]

A1, M1

CLM: 9, 11, 12, 50

DMI: 1, 5, 6, 7, 9, 10, 12, 15, TBD

DiscoveryManagementAddRemoveTest (DMAR) - Tests the (default) functional semantics of the DiscoveryManagement interface without relying upon the DiscoveryGroupManagement or DiscoveryLocatorManagement interfaces.

1.       Start N lookup services initially configured to run in no groups

2.       Create ClientLookupManager with null arguments (this should create a default LookupDiscoveryManager that is interested in the public group) and call getDiscoveryManager to obtain a DiscoveryManagement reference. [CLM 9, 11, 12, 50]

3.       Call getRegistrars() and verify that no LUS have been discovered [CLM 11] [DMI 9]

4.       Configure one LUS to the public group via it's admin IF

5.       Call getRegistrars() to see when the public LUS is found [CLM 11] [DMI 9]

6.       Add a listener and verify that a discovery event is sent for the discovered (public) lookup service [DMI 1, 2]

7.       Call getRegistrars() and verify that the set from prev step matches this set from this step

8.       Assert that the array reference from 7 doesn't equal the ref from 5 [DMI 10]

9.       Configure (N-2) LUS to join the public group

10.    Verify that the appropriate number of discovered events occur [DMI 3]

11.    Call getRegistrars() and verify that the set from prev step matches the set from this step (minus the initial LUS)

12.    Discard an LUS and verify that a discard event occurs [DMI 4]

13.    Call getRegistrars() and verify that the set does not contain this LUS [1]

14.    Verify that the same LUS is rediscovered

15.    Add a null listener and verify that nothing happens [DMI 5]

16.    Add another listener and verify that a discovered event is sent with the full set of LUS

17.    Call getRegistrars() and verify that the two sets match

18.    Discard an LUS and verify that a discard event occurs on both listener objects

19.    Verify that the same LUS is rediscovered and both listeners are notified

20.    Add the 2nd listener again [DMI TBD]

21.    Discard an LUS and verify that a discard event occurs on both listener objects

22.    Verify that the same LUS is rediscovered and both listeners are notified

23.    Remove one listener [DMI 6]

24.    Discard a LUS [DMI 14]

25.    Verify that only the proper listener is notified

26.    Discard null argument [DMI 12]

27.    Verify that no events are generated and the set hasn't changed

28.    Remove remaining listener

29.    Discard LUS

30.    Verify that no listeners are notified

31.    Add a listener and verify that the full set is returned in the discovery event

32.    Call getRegistrars and verify that the two sets match.

33.    Discard a null reference and verify that nothing happens [DMI 12]

34.    Remove listener

35.    Remove listener again [DMI 7]

36.    Remove null listener [DMI TBD]

37.    Discard all LUS and verify that no events are generated

38.    Discard all LUS again and verify that no events are generated [DMI 13]

39.    Call getRegistrars and wait until all the LUS are rediscovered

40.    Add a listener and verify that the full set is returned in the discovery event(s)

41.    Configure 1 LUS to leave the public group

42.    Verify that the appropriate discard event is generated

43.    Call terminate [Note: can no longer call any methods on the DM interface] [DMI 15]

44.    Configure the non-public LUS to rejoin the public group

45.    Verify that no discover event is sent

A1, M1

CLM: 9, 11, 12, 50

DMI: 1-7, 9-15, TBD

 

Assumptions:

-          LUS send announcement packets at a reasonable rate

-          DM impl notifies DL/entity in a timely manner

-          Isolated network in order to avoid other "public" groups from affecting the test

-          LUS services behave properly via their admin IF

 

Notes:

-          [1] timing dependency -- what's the interval between a discard & rediscovery?

-          Need a minimum of 3 LUS

-          - Just tests public groups. Still need one for locators, non-public groups, and mixed mode (command line option?)

DiscoveryGroupManagementIFTest (DGMIF) - Only tests interface semantics of the DiscoveryGroupManagement interface

1.        Create ClientLookupManager with null arguments (this should create a default LookupDiscoveryManager that is interested in the public group) and call getDiscoveryManager and cast it to a DiscoveryGroupManagement reference [CLM 9, 11, 12, 50]

2.        Call getGroups and verify that that null (public) is returned (default setting for the CLM in step 1) [DGM 5]

3.        Call setGroups with the empty set [DGM 15]

4.        Call getGroups and verify that the empty set returned [DGM 2, 6]

5.        Call addGroups with an array containing duplicates [DGM 4, 8]

6.        Verify that an UnsupportedOperationException is thrown [DGM 12]

7.        Call getGroups and verify that it returns the empty set

8.        Verify that the refs from the two prev calls to getGroups are different [DGM 7]

9.        Call setGroups with an array containing duplicate entries

10.     Call getGroups and verify that a set containing no duplicates is returned

11.     Call addGroups with a null argument and verify that a NullPointerException is thrown [DGM 13]

12.     Call getGroups and verify that the returned set matches the set from the prev call to getGroups and that the array refs are different

13.     Call addGroups with the empty set [DGM 14]

14.     Call getGroups and verify that the returned set matches the one returned from the previous call to getGroups

15.     Verify that the refs from the two prev calls to getGroups are different

16.     Call setGroups with an array containing a new set of duplicate entries

17.     Call getGroups and verify that the proper set containing no duplicates is returned

18.     Call setGroups with a null [DGM 3]

19.     Call getGroups and verify that null is returned.

20.     Call setGroups with a duplicate set of entries

21.     Call getGroups and verify that the proper set containing no duplicates is returned

22.     Call removeGroups with the empty set [DGM 25]

23.     Call getGroups and verify that the returned set hasn't changed

24.     Call removeGroups with a subset of entries [DGM 22]

25.     Verify that the proper set is returned by getGroups

26.     Call removeGroups with the same subset of entries [DGM TBD]

27.     Verify that getGroups returns the proper set (should match the one from the last call to getGroups)

28.     Call removeGroups with the remaining entries

29.     Call getGroups and verify that the empty set is returned

30.     Call removeGroups with a set and verify that an UnsupportedOperationException is thrown. [DGM 23]

31.     Call removeGroups with a null and verify that a NullPointerException is thrown.[DGM 24]

A1, M1

CLM: 9, 11, 12, 50

DGM: 2-8, 12-15, 22-25

 

Notes:

- try running with and w/o active services

- try running with an active listener object

- try adding sets that contain null elements? What happens?

DiscoveryGroupManagementAddRemoveTest1 (DGMAR1) - Tests the  functional semantics of the DiscoveryGroupManagement and DiscoveryManagement interfaces in conjunction. In particular, this tests the default semantics using public groups.

1.        Start N lookup services initially configured to run in no groups

2.        Create ClientLookupManager with null arguments (this should create a default LookupDiscoveryManager that is interested in the public group), call getDiscoveryManager and cast it to a LookupDiscoveryManager object. [CLM: 9, 11, 12, 50]

3.        Call getGroups() and verify that null (no set) is returned [DGMI 3,5]

4.        Call getRegistrars() and verify that no LUS have been discovered [DMI 9]

5.        Configure M (where M < N) LUS to join the public group via its DiscoveryAdmin IF

6.        Call getRegistrars() to see when the M LUS are discovered

7.        Add a listener and verify that a discovery event(s) is sent that contains the discovered LUS [DMI 1, 2]

8.        Call getRegistrars() and verify that the set from prev step matches this set from this step

9.        Assert that the array reference from step 8 doesn't equal the ref from step 6 [DMI 10]

10.     Configure remaining LUS to join the public group

11.     Verify that discovered event(s) occur, which contain the remaining LUS [DMI 3]

12.     Call getRegistrars() and verify that the set from prev step matches the set from this step (minus the original LUS set)

13.     Add a null listener and verify that nothing happens [DMI 5]

14.     Add another listener and verify that a discovered event is sent with the full LUS set

15.     Call getRegistrars() and verify that the two sets match

16.     Discard an LUS and verify that a discard event occurs on both listener objects [DMI 11, 14]

17.     Verify that the same LUS is rediscovered and both listeners are notified [DMI 4]

18.     Add the same listener again [DMI TBD]

19.     Discard an LUS and verify that a discard event occurs on both listener objects

20.     Verify that the same LUS is rediscovered and both listeners are notified

21.     Remove one listener [DMI 6]

22.     Discard a LUS

23.     Verify that only the proper listener is notified

24.     Wait for the LUS to be rediscovered

25.     Call setGroups with a null argument [DGM 18]

26.     Verify that no discovery events are sent (since all the LUS should already be discovered)

27.     Remove remaining listener

28.     Discard LUS

29.     Verify that no listeners are notified

30.     Call getRegistrars to ensure that the discarded LUS is rediscovered

31.     Add a listener and verify that the full LUS set is returned in the discovery event

32.     Call getRegistrars and verify that the two sets match.

33.     Discard a null reference and verify that nothing happens [DMI 12]

34.     Remove listener

35.     Remove listener again [DMI 7]

36.     Remove null listener [DMI TBD]

37.     Discard all LUS and verify that no events are generated

38.     Call getRegistrars to ensure that the discarded LUS are rediscovered

39.     Add a listener and verify that the full LUS set is returned in the discovery event

40.     Call setGroups with the empty set [DGM 19]

41.     Discard all LUS and verify that the proper discard events are generated

42.     Verify that no discovery events occur and that getRegistrars returns the empty set

43.     Configure all LUS to leave the public group

44.     Call setGroups with null

45.     Configure M LUS to join the public group

46.     Verify that the M LUS are discovered

47.     Call terminate [DMI 15]

48.     Configure remaining LUS to join the public group

49.     Verify that no discovery events are sent

A1, M1

CLM: 9, 11, 12, 50

DMI: 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 14, 15, TBD

DGM:3, 5, 18, 19

 

Assumptions:

-          LUS send announcement packets at a reasonable rate

-          DM impl notifies DL/entity in a timely manner

-          Isolated network in order to avoid other "public" groups from affecting the test

-          LUS services behave properly via their admin IF

 

Notes:

-          [1] timing dependency -- what's the interval between a discard & rediscovery?

-          [3] LookupDiscoveryManager does not actively poll its Registrars. Therefore will not get discard events for LUS that go down or are reconfigured. This is implementation specific, though, since it is possible to create your own LDM.

 

- Need to test against public, unique, and mixed groups

DiscoveryGroupManagementAddRemoveTest2 (DGMAR2) - Tests the  functional semantics of the DiscoveryGroupManagement and DiscoveryManagement interfaces in conjunction.  In particular, this tests the IF semantics using public and non-public groups.

1.        Start N lookup services initially configured to each run in a unique, non-public group

2.        Create ClientLookupManager with null arguments (this should create a default LookupDiscoveryManager that is interested in the public group), call getDiscoveryManager and cast it to a LookupDiscoveryManager object. [CLM: 9, 11, 12, 50]

3.        Call getGroups and verify that null (no set) is returned [DGM 3,5]

4.        Call getRegistrars and verify that no LUS have been discovered [DMI 9]

5.        Add a listener [DM 1]

6.        Call addGroups with M (where M < N) groups and duplicates [DGM 4, 8, 9]

7.        Verify that the proper discovery events occur [DM 3] [1]

8.        Call getGroups and verify that the proper set is returned (w/o duplicates) [DGM 5]

9.        Call getRegistrars and verify that the two sets match

10.     Add the same set of groups again

11.     Verify that no events are sent

12.     Call getGroups and getRegistrars and verify that the two sets match and haven't changed

13.     Verify that the two references  returned from getGroups and getRegistrars are different [DMI 10] [DGM 7]

14.     Add the empty set [DGM 14]

15.     Verify that no events are sent

16.     Call getGroups and getRegistrars and verify that the two sets match and haven't changed

17.     Add a null entry [DGM 13]

18.     Verify that a NullPointerException is thrown

19.     Verify that no events are sent

20.     Call getGroups and getRegistrars and verify that the two sets match and haven't changed

21.     Configure the M LUS to join the public group

22.     Verify that no discovery events occur (since they are already discovered)

23.     Add another listener

24.     Verify that the full set of M LUS is sent to the second listener [DM 2]

25.     Add a null listener [DMI 5]

26.     Verify that nothing happens

27.     Add the remaining groups (with duplicate entries) [DGM 4]

28.     Verify that both listeners are notified with the proper set of discovery events

29.     Call getGroups and verify that the proper set is returned (w/o duplicates)

30.     Discard one LUS [DM 11]

31.     Verify that the proper discard event is sent on both listeners [DM 4, 14]

32.     Verify that the proper (re)discovery event occurs on both listeners

33.     Remove one listener [DM 6]

34.     Discard one LUS

35.     Verify that the proper discard event is sent to the proper listener

36.     Verify that the proper (re)discovery event occurs on the proper listener

37.     Remove listener again [DM 7]

38.     Discard LUS again

39.     Verify that the proper discard event is sent to the proper listener

40.     Verify that the proper (re)discovery event occurs on the proper listener

41.     <Remove null listener?>

42.     Discard a null listener [DM 12]

43.     Verify that no events are sent

44.     Verify that the LUS set hasn't changed

45.     Configure one LUS to leave all groups

46.     Discard this LUS

47.     Verify that a discard event is sent

48.     Verify that a discovery event is not sent

49.     Discard this LUS again [DMI 13]

50.     Verify that no discard or discovery event occurs

51.     Call getRegistrars and verify that the LUS is not in the set

52.     Call getGroups and verify that the LUS group is still in the set

53.     Configure LUS to rejoin its initial group(s)

54.     Verify that a discovery event occurs

55.     Call removeGroups with all "named" groups (with duplicates) [DGM 4, 22]

56.     Verify that N-M discard events are sent (since M LUS are still in the public group) [DGM 26]

57.     Call getGroups and verify that null (no groups) is returned

58.     Call removeGroups with null [DGM 24]

59.     Verify that a NullPointerException is thrown

60.     Call getGroups and verify that null (no groups) is returned

61.     Call setGroups with M named groups

62.     Verify that no discovery events are sent

63.     Call addGroups with remaining N-M named groups

64.     Verify that the proper N-M discovery events are sent

65.     Call setGroups with null [DGM 15, 16, 18, 26]

66.     Verify that N-M discard events are sent (since you are discarding the LUS set that aren't in the public group)

67.     Call getGroups and verify that null is returned

68.     Call getRegistrars and verify that the set of M LUS is present

69.     Discard an LUS

70.     Verify that a discard and discovery event is generated [DGM 17]

71.     Call setGroups with the empty set [DGM 19]

72.     Verify that the proper M discard events are sent

73.     Verify that no discovery event is sent

74.     Call removeGroups with a named group [DGM 23]

75.     Verify that an UnsupportedException is thrown

76.     Call addGroups with a named group [DGM 12]

77.     Verify that an UnsupportedException is thrown

78.     Call getGroups and verify that the empty set is returned (ie hasn't changed) [DGM 6]

79.     Call removeGroups with the empty set [DGM 2, 25]

80.     Verify that no events are sent and the groups haven't changed

81.     Configure one LUS to leave its group(s)

82.     Call setGroups to add the group for that LUS

83.     Call terminate [DMI 15]

84.     Configure LUS to join its original groups

85.     Verify that no discovery event occurs

86.     [Can't call any IF methods after terminate]

A1, M1

CLM: 9, 11, 12, 50

DMI: 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15

DGMI: 2, 3, 4, 5, 6, 7, 8, 9, 12, 13, 14, 15, 16, 17, 18, 19, 22, 23, 24, 25, 26

 

Assumptions:

-          LUS send announcement packets at a reasonable rate

-          DM impl notifies DL/entity in a timely manner

-          Isolated network in order to avoid other "public" groups from affecting the test

-          LUS services behave properly via their admin IF

 

Notes:

[

DiscoveryGroupManagementPermissionTest

1.        Run test application without a policy file and no running services

87.     Create ClientLookupManager with null arguments (this should create a default LookupDiscoveryManager that is interested in the public group), call getDiscoveryManager and cast it to a LookupDiscoveryManager object. [CLM: 9, 11, 12, 50]

2.        Verify that an AccessControlException is thrown

3.        [How do we test add/setGroups functionality if we don't get past this point?] [DGM 10] [DGM 20]

A1, M1

CLM: 9, 11, 12, 50

DGM: 10, 20

 

Comments: Not sure if the SecurityException gets propagated outside the constructor argument.  If not, then the test needs to be changed so that it accesses the DGM interface and calls add/setGroups

DiscoveryGroupManagementIOTest

1.        Run test application with a policy file that 1) restricts socket connections, 2) allows DiscoveryPermission on all groups and no running services

2.        Create ClientLookupManager with null arguments (this should create a default LookupDiscoveryManager that is interested in the public group), call getDiscoveryManager and cast it to a LookupDiscoveryManager object. [CLM: 9, 11, 12, 50]

3.        Verify that an IOException is thrown

4.        [How do we test add/setGroups functionality if we don't get past this point?] [DGM 11] [DGM 21]

A1, M1

CLM: 9, 11, 12, 50

DGM: 11, 21

 

DiscoveryLocatorManagementIFTest (DLMIF) - Only tests interface semantics of the DiscoveryLocatorManagement interface

5.        Create ClientLookupManager with null arguments (this should create a default LookupDiscoveryManager that is configured with no locators) and call getDiscoveryManager() and cast it to a DiscoveryLocatorManagement reference

6.        Call getLocators and verify that the empty set (empty array) is returned [DLM 3, 4]

7.        Call addLocators with an array containing duplicates [DLM 7]

8.        Verify that an UnsupportedOperationException is thrown

9.        Call getLocators and verify that it returns the empty set

10.     Verify that the refs from the two prev calls to getLocators are different[DLM 5]

11.     Call setLocators with an array containing duplicate entries [DLM 2, 10]

12.     Call getLocators and verify that a set containing no duplicates is returned

13.     Call addLocators with a null argument and verify that a NullPointerException is thrown [DLM 8]

14.     Call getLocators and verify that the returned set matches the set from the prev call to getLocators and that the array refs are different

15.     Call addLocators with the empty set [DLM 9]

16.     Call getLocators and verify that the returned set matches the one returned from the previous call to getLocators

17.     Verify that the refs from the two prev calls to getLocators are different

18.     Call setLocators with an array containing a new set of duplicate entries [DLM 2, 6]

19.     Call getLocators and verify that the proper set containing no duplicates is returned

20.     Call addLocators with a duplicate set of entries

21.     Call getLocators and verify that the augmented set contains the proper entries and has no duplicates

22.     Call setLocators with a null argument [DLM 11]

23.     Verify that a NullPointerException is thrown

24.     Call getLocators and verify that the set hasn't changed

25.     Call removeLocators with a null argument [DLM 15]

26.     Verify that a NullPointerException is thrown

27.     Call getLocators and verify that the set hasn't changed

28.     Call removeLocators with an empty set [DLM 16]

29.     Call getLocators and verify that the set hasn't changed

30.     Call removeLocators with a set containing the existing managed set plus duplicates [DLM 2, 13]

31.     Call getLocators and verify that the empty set is returned

32.     Call removeLocators with a set containing the existing managed set plus duplicates (again) [DLM 14]

33.     Verify that an UnsupportedOperationException is thrown

A1, M1

CLM: 9, 11, 12, 50

DLM: 1-16

 

Notes:

- try running w/ and w/o active LUS

- try running with an active listener object

- try adding sets that contain null elements? What happens?

DiscoveryLocatorManagementAddRemoveTest (DLMAR) - Tests the functional semantics of the DiscoveryLocatorManagement and DiscoveryManagement interfaces in conjunction.

1.        Create ClientLookupManager with null arguments (this should create a default LookupDiscoveryManager that is configured with no locators) and call getDiscoveryManager() and cast it to a DiscoveryLocatorManagement reference [CLM 9 11 12 50]

2.        Start N LUS configured to join no groups

3.        Obtain the unicast port numbers of each LUS via its DiscoveryAdmin IF

4.        Call getLocators and verify that the empty set is returned [DLM 3, 4]

5.        Call getRegistrars and verify that no LUS have been discovered [DM 9]

6.        Call setLocators with M (M < N) locators containing duplicate entries [DLM 2, 10]

7.        Call getRegistrars and wait until all the desired LUS are discovered

8.        Add a listener and verify that a discovery event(s) is sent that contains the discovered LUS [DM 1, 2]

9.        Verify that the two sets match and contain no duplicates

10.     Call setGroups with the empty array [DLM 12]

11.     Verify that the sets from getRegistrars and getLocators hasn't changed

12.     Call addLocators with the same M locators as before [DLM 2, 6]

13.     Call getLocators and getRegistrars and verify that the set hasn't changed

14.     Verify that the the array references are different [DLM 5]

15.     Verify that no discovery events occur either.

16.     Call addLocators with the empty set and verify that the set doesn't change and that no discovery events are sent [DLM 9]

17.     Call addLocators with a null argument [DLM 8]

18.     Verify that a NullExceptionPointer is thrown

19.     Call addLocators with the remaining set of locators (w/ duplicates) [DM 3]

20.     Verify that the appropriate number of discovery events occur

21.     Call getLocators and getRegistrars and verify that the appropriate sets are returned and they match

22.     Call setLocators with the original set of M locators

23.     Verify that the appropriate number of discard events are sent [DM 4] [DLM 17]

24.     Call getLocators and getRegistrars and verify that the appropriate sets are returned and they match

25.     Call setGroups with a null argument [DLM 11]

26.     Verify that that a NullPointerException is thrown

27.     Call removeLocators with the remaining (N-M) set of locators

28.     Verify that the set doesn't change and no events are sent

29.     Add another listener and verify that the proper set of LUS is sent via discovery event(s) [DM 2]

30.     Call removeLocators with a null argument [DLM 15]

31.     Verify that a NullPointerException is thrown

32.     Call removeLocators with aan empty set [DLM 16]

33.     Verify that nothing happens

34.     Verify that nothing has changed

35.     Call removeLocators with the original set of M locators and verify that the appropriate number of discard events is sent to both listeners [DLM 13]

36.     Call getLocators and verify that the empty set is returned

37.     Call removeLocators with any locator [DLM 14]

38.     Verify that an UnsupportedOperationException is thrown

39.     Call addLocators with a Locator [DLM 7]

40.     Verify that an UnsupportedOperationException is thrown

41.     Add a locator using a non-configured port

42.     Call terminate

43.     Configure LUS to use desired port number

44.     Verify that no discovery event occurs

A1, M1

CLM: 9, 11, 12, 50

DM: 1, 2, 3, 4, 9

DLM: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17