User Channel Tests
NB: User Channels were called System Channels in FDC3 1.2. The new terminology is used in this specification
Basic Broadcast
App | Step | Details |
---|---|---|
A | 1.addContextListener | A adds an unfiltered Context Listener using addContextListener(null, handler) . A Listener object is returned A promise resolving a Listener object is returned Check that this has an unsubscribe method. |
A | 2.joinUserChannel | A joins the first available (non-global) user channel. The available Channels are retrieved with: fdc3.getSystemChannels() Check channels are returned. fdc3.getUserChannels() The first channel (that does not have the id 'global') is joined with: fdc3.joinChannel(<channelId>) Check channels are returned. fdc3.joinUserChannel(<channelId>) |
B | 3.joinUserChannel | B joins the same channel as A, via the same process in 2. |
B | 4.Broadcast | B broadcasts an fdc3.instrument context to the channel using fdc3.broadcast(<the instrument>) . Check a void promise is returned. |
A | 5.Receive Context | A receives the instrument object, matching the one broadcast by B. |
UCBasicUsage1
Perform above testUCBasicUsage2
Perform steps in order: 2,1,3,4,5 to confirm that the order ofjoinUserChannel
andaddContextListener
calls doesn't matterUCBasicUsage3
Perform steps in order: 3,4,1,2,5 to confirm that the current context is automatically received on joining a channel.UCBasicUsage4
Perform steps in order: 3,4,2,1,5 to confirm that the current context is automatically received on adding a context listener to an already joined a channel.
Filtered Broadcast
App | Step | Details |
---|---|---|
A | 1.addContextListener | A adds a fdc3.instrument typed Context Listener using addContextListener("fdc3.instrument", handler) . A Listener object is returned A promise resolving a Listener object is returned Check that this has an unsubscribe method. |
A | 2.joinUserChannel | A joins the first available user channel using: getSystemChannels() Check channels are returned. 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 | B broadcasts: 1. fdc3.broadcast(<the instrument>) . 2. fdc3.broadcast(<a contact>) Check a void promise is returned. |
A | 5.Receive Context | A receives the fdc3.instrument object, matching the one broadcast by B. Check that the fdc3.contact is NOT received. |
UCFilteredUsage1
Perform above testUCFilteredUsage2
Perform steps in order: 2,1,3,4,5UCFilteredUsage3
Perform steps in order: 3,4,1,2,5UCFilteredUsage4
Perform steps in order: 3,4,2,1,5
Broadcast With Multiple Listeners
App | Step | Details |
---|---|---|
A | 1.addContextListeners | A sets up two Context Listeners. One for fdc3.instrument and one for fdc3.contact by calling: addContextListener ("fdc3.instrument", handler) addContextListener ("fdc3.contact", handler) A Listener object is returned for each. 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: getSystemChannels() Check channels are returned. 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(<instrument context>) fdc3.broadcast(<contact context>) . |
A | 5.Receive Context | A's fdc3.instrument object matches the one broadcast by B, and arrives on the correct listener.A's fdc3.contact object matches the one broadcast by B, and arrives on the correct listener. |
UCFilteredUsage5
: Perform above testUCFilteredUsage6
: Perform above test, except B will join a different channel to A. Check that you don't receive anything.UCFilteredUsageChange
: Perform above test, except that after joining, A changes channel to a different channel via a further call tofdc3.joinUserChannel
. Check that A does NOT receive anything.UCFilteredUsageUnsubscribe
: Perform above test, except that after joining, A thenunsubscribe()
s from the channel using thelistener.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.