Skip to content

Commit

Permalink
Test definitions added
Browse files Browse the repository at this point in the history
  • Loading branch information
kemerava committed Oct 25, 2024
1 parent 13f8e8c commit f963e8e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
17 changes: 16 additions & 1 deletion toolbox/fdc3-conformance/App-Channel-Tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
| App | Step | Details |
|-----|--------------------|-----------------------------------------------------------------|
| A | 1.Retrieve `Channel` |Retrieve a `Channel` object representing an 'App' channel called `test-channel` using: <br/>`const testChannel = await fdc3.getOrCreateChannel("test-channel")` |
| A | 2.Add Context Listener |Add an _typed_ context listener for `fdc3.instrument`, using: <br/> ![2.0](https://img.shields.io/badge/FDC3-2.0-blue) `await testChannel.addContextListener("fdc3.instrument", handler)` <br/>![1.2](https://img.shields.io/badge/FDC3-1.2-green) `testChannel.addContextListener("fdc3.instrument", handler)`
| A | 2.Add Context Listener |Add a _typed_ context listener for `fdc3.instrument`, using: <br/> ![2.0](https://img.shields.io/badge/FDC3-2.0-blue) `await testChannel.addContextListener("fdc3.instrument", handler)` <br/>![1.2](https://img.shields.io/badge/FDC3-1.2-green) `testChannel.addContextListener("fdc3.instrument", handler)`
| B | 3.Retrieve `Channel` |Retrieve a `Channel` object representing the same 'App' channel A did (`test-channel`)|
| B | 4.Broadcast | B broadcasts both an `fdc3.instrument` context and an `fdc3.contact` context, using: <br /> `testChannel.broadcast(<fdc3.instrument context>)` <br /> `testChannel.broadcast(<fdc3.contact context>)`|
| A | 5.Receive Context | An fdc3.instrument context is received by the handler added in step 2.<br />Ensure that the fdc3.instrument received by A is identical to that sent by B<br />Ensure that the fdc3.contact context is NOT received. |
Expand All @@ -52,3 +52,18 @@
- `ACContextHistoryTyped`: Perform above test.
- `ACContextHistoryMultiple`: **B** Broadcasts multiple history items of both types. Ensure that only the last version of each type is received by **A**.
- `ACContextHistoryLast`: In step 5. **A** retrieves the _untyped_ current context of the channel via `const currentContext = await testChannel.getCurrentContext()`. Ensure that A receives only the very last broadcast context item _of any type_.


## Multipe listeners On The Same Or Overlapping Ccontext types

| App | Step | Details |
|-----|--------------------|----------------------------------------------------------------------------|
| A | 1.Retrieve `Channel` |Retrieve a `Channel` object representing an 'App' channel called `test-channel` using: <br/>`const testChannel = await fdc3.getOrCreateChannel("test-channel")` |
| A | 2.Add Context Listener |Add an _untyped_ context listener to the channel, using: <br/> ![2.0](https://img.shields.io/badge/FDC3-2.0-blue) `await testChannel.addContextListener(null, handler1)` <br/>![1.2](https://img.shields.io/badge/FDC3-1.2-green) `testChannel.addContextListener(null, handler1)` |
| A | 3.Add Context Listener |Add a _typed_ context listener for `fdc3.instrument` with a different handler, using: <br/> ![2.0](https://img.shields.io/badge/FDC3-2.0-blue) `await testChannel.addContextListener("fdc3.instrument", handler2)` <br/>![1.2](https://img.shields.io/badge/FDC3-1.2-green) `testChannel.addContextListener("fdc3.instrument", handler2)`|
| B | 4.Retrieve `Channel` | Retrieve a `Channel` object representing the same 'App' channel A did (`test-channel`)|
| B | 5.Broadcast | Broadcast an `fdc3.instrument` Context to the channel with: <br/>`testChannel.broadcast(<fdc3.instrument context>)`|
| A | 6.Receive Context | The handlers added in step 2 and 3 will receive the instrument context. Ensure that the instrument received by A is identical to that sent by B. |

- ACMultipleOverlappingListeners1: Perform above test
- ACMultipleOverlappingListeners2: Perform above test, but instead of _untyped_ context listener, in step 2, use `fdc3.instrument` (handler should remain different)
14 changes: 14 additions & 0 deletions toolbox/fdc3-conformance/User-Channel-Tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,17 @@ _NB: User Channels were called System Channels in FDC3 1.2. The new terminolog
- `UCFilteredUsageUnsubscribe`: Perform above test, except that after joining, **A** then `unsubscribe()`s from the channel using the `listener.unsubscribe` function. Check that **A** does NOT receive anything.
- `UCFilteredUsageLeave`: Perform above test, except that immediately after joining, **A** _leaves the channel_, and so receives nothing.
- `UCFilteredUsageNoJoin`: Perform the above test, but skip step 2 so that **A** does NOT join a channel. Confirm that the _current channel_ for **A** is NOT set before continuing with the rest of the test. **A** should receive nothing.


## Broadcast With Multiple Listeners On The Same or Overlapping Types

| App | Step | Details |
|-----|--------------------|-------------------------------------------------------------------------------------------------------------|
| A | 1.addContextListeners | A sets up two Context Listeners. One _untyped_ and one for `fdc3.contact` by calling: `addContextListener (null, handler)` <br/> `addContextListener ("fdc3.contact", handler)` <br/>![1.2](https://img.shields.io/badge/FDC3-1.2-green) A `Listener` object is returned for each. <br />![2.0](https://img.shields.io/badge/FDC3-2.0-blue) A promise resolving a `Listener` object is returned for each. <br />Check that this has an `unsubscribe` method for each. |
| A | 2.joinUserChannel |A joins the first available user channel using: <br/>![1.2](https://img.shields.io/badge/FDC3-1.2-green) `getSystemChannels()` Check channels are returned. <br/>![2.0](https://img.shields.io/badge/FDC3-2.0-blue) `getUserChannels()` Check **user** channels are returned.<br/>Call `fdc3.joinChannel()` on the first non-global channel.|
| B | 3.joinUserChannel |B joins the same channel as A, via the same process in 2. |
| B | 4.Broadcast |`fdc3.broadcast(<contact context>)` . |
| A | 5.Receive Context | A's `fdc3.contact` object matches the one broadcast by B, both handlers from step 1 are triggered, and broadcast arrives on the correct listener. |

- UCMultipleOverlappingListeners1: Perform above test
- UCMultipleOverlappingListeners2: Perform above test, but instead of _untyped_ context listener, in step 2, use `fdc3.instrument` (handler should remain different)

0 comments on commit f963e8e

Please sign in to comment.