From f963e8ee5d7453bce5e3fed4530d7dbc44262be6 Mon Sep 17 00:00:00 2001 From: kemerava Date: Fri, 25 Oct 2024 14:14:59 -0400 Subject: [PATCH] Test definitions added --- toolbox/fdc3-conformance/App-Channel-Tests.md | 17 ++++++++++++++++- toolbox/fdc3-conformance/User-Channel-Tests.md | 14 ++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/toolbox/fdc3-conformance/App-Channel-Tests.md b/toolbox/fdc3-conformance/App-Channel-Tests.md index 597d0bc28..4e977bbdf 100644 --- a/toolbox/fdc3-conformance/App-Channel-Tests.md +++ b/toolbox/fdc3-conformance/App-Channel-Tests.md @@ -28,7 +28,7 @@ | App | Step | Details | |-----|--------------------|-----------------------------------------------------------------| | A | 1.Retrieve `Channel` |Retrieve a `Channel` object representing an 'App' channel called `test-channel` using:
`const testChannel = await fdc3.getOrCreateChannel("test-channel")` | -| A | 2.Add Context Listener |Add an _typed_ context listener for `fdc3.instrument`, using:
![2.0](https://img.shields.io/badge/FDC3-2.0-blue) `await testChannel.addContextListener("fdc3.instrument", handler)`
![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:
![2.0](https://img.shields.io/badge/FDC3-2.0-blue) `await testChannel.addContextListener("fdc3.instrument", handler)`
![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:
`testChannel.broadcast()`
`testChannel.broadcast()`| | A | 5.Receive Context | An fdc3.instrument context is received by the handler added in step 2.
Ensure that the fdc3.instrument received by A is identical to that sent by B
Ensure that the fdc3.contact context is NOT received. | @@ -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:
`const testChannel = await fdc3.getOrCreateChannel("test-channel")` | +| A | 2.Add Context Listener |Add an _untyped_ context listener to the channel, using:
![2.0](https://img.shields.io/badge/FDC3-2.0-blue) `await testChannel.addContextListener(null, handler1)`
![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:
![2.0](https://img.shields.io/badge/FDC3-2.0-blue) `await testChannel.addContextListener("fdc3.instrument", handler2)`
![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:
`testChannel.broadcast()`| +| 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) \ No newline at end of file diff --git a/toolbox/fdc3-conformance/User-Channel-Tests.md b/toolbox/fdc3-conformance/User-Channel-Tests.md index 923a5332c..eba6bbbce 100644 --- a/toolbox/fdc3-conformance/User-Channel-Tests.md +++ b/toolbox/fdc3-conformance/User-Channel-Tests.md @@ -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)`
`addContextListener ("fdc3.contact", handler)`
![1.2](https://img.shields.io/badge/FDC3-1.2-green) A `Listener` object is returned for each.
![2.0](https://img.shields.io/badge/FDC3-2.0-blue) A promise resolving a `Listener` object is returned for each.
Check that this has an `unsubscribe` method for each. | +| A | 2.joinUserChannel |A joins the first available user channel using:
![1.2](https://img.shields.io/badge/FDC3-1.2-green) `getSystemChannels()` Check channels are returned.
![2.0](https://img.shields.io/badge/FDC3-2.0-blue) `getUserChannels()` Check **user** channels are returned.
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()` . | +| 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) \ No newline at end of file