ACBasicUsage1Perform above test.
| App | Step | Details |
|---|---|---|
| B | 1.Retrieve Channel |
Retrieve a Channel object representing an 'App' channel called test-channel using: const testChannel = await fdc3.getOrCreateChannel("test-channel") |
| B | 2.Broadcast | Broadcast an fdc3.instrument to the channel using: testChannel.broadcast(<fdc3.instrument context>) |
| A | 3.Retrieve Channel |
Retrieve a Channel object representing the same 'App' channel B did (test-channel) |
| A | 4.Retrieve Current Context | A gets the current context of the user channel. via: await testChannel.getCurrentContext() Ensure that the instrument received by A is identical to that sent by B |
ACBasicUsage2Perform above test
ACFilteredContext1: Perform above testACFilteredContext2: Perform above test, but add listeners for bothfdc3.instrumentandfdc3.contactin step2. Ensure that both context objects are received.ACFilteredContext3: Perform above test, except creating a different channel in app B. Check that you don't receive anything (as the channels don't match).ACFilteredContext4: Perform above test, except that after creating the channel A creates another channel with a further different channel id and adds a further context listener to it. Ensure that A is still able to receive context on the first channel (i.e. it is unaffected by the additional channel) and does NOT receive anything on the second channel.ACUnsubscribe: Perform above test, except that after creating the channel A thenunsubscribe()s the listener it added to the channel. Check that A does NOT receive anything.
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 viaconst currentContext = await testChannel.getCurrentContext(). Ensure that A receives only the very last broadcast context item of any type.ACClearHistorySpecificContext: Perform the above test, except after step 3 clear context withawait testChannel.clearContext('fdc3.instrument'). Ensure that in step 5 nothing is received forconst instrument = await testChannel.getCurrentContext('fdc3.instrument')and context is received successfully forconst instrument = await testChannel.getCurrentContext('fdc3.contact')ACClearHistoryAllContexts: Perform the above test, except after step 3 clear context withawait testChannel.clearContext('fdc3.nothing'). Ensure that in step 5 nothing is received forconst instrument = await testChannel.getCurrentContext('fdc3.instrument')and forconst instrument = await testChannel.getCurrentContext('fdc3.contact')ACClearHistoryAllContextsSubscribedToNothing: Perform the above test, except after step 3 clear context withawait testChannel.clearContext('fdc3.nothing')and in step 4 callawait testChannel.addContextListener("fdc3.nothing", handler)instead. Ensure that after clearing context, the handler is called.