Skip to main content
Version: 2.0

User Channel Tests 1.2 2.0

NB: User Channels were called System Channels in FDC3 1.2. The new terminology is used in this specification

Basic Broadcast

AppStepDetails
A1.addContextListenerA adds an unfiltered Context Listener using addContextListener(null, handler).
1.2 A Listener object is returned
2.0 A promise resolving a Listener object is returned
Check that this has an unsubscribe method.
A2.joinUserChannelA joins the first available (non-global) user channel. The available Channels are retrieved with:
1.2 fdc3.getSystemChannels() Check channels are returned.
2.0 fdc3.getUserChannels()
The first channel (that does not have the id 'global') is joined with:
1.2 fdc3.joinChannel(<channelId>) Check channels are returned.
2.0 fdc3.joinUserChannel(<channelId>)
B3.joinUserChannelB joins the same channel as A, via the same process in 2.
B4.BroadcastB broadcasts an fdc3.instrument context to the channel using fdc3.broadcast(<the instrument>).
2.0 Check a void promise is returned.
A5.Receive ContextA receives the instrument object, matching the one broadcast by B.
  • UCBasicUsage1 Perform above test
  • UCBasicUsage2 Perform steps in order: 2,1,3,4,5 to confirm that the order of joinUserChannel and addContextListener calls doesn't matter
  • UCBasicUsage3 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

AppStepDetails
A1.addContextListenerA adds a fdc3.instrument typed Context Listener using addContextListener("fdc3.instrument", handler).
1.2 A Listener object is returned
2.0 A promise resolving a Listener object is returned
Check that this has an unsubscribe method.
A2.joinUserChannelA joins the first available user channel using:
1.2 getSystemChannels() Check channels are returned.
2.0 getUserChannels() Check user channels are returned.
Call fdc3.joinChannel() on the first non-global channel.
B3.joinUserChannelB joins the same channel as A, via the same process in 2.
B4.BroadcastB broadcasts:
1.fdc3.broadcast(<the instrument>).
2. fdc3.broadcast(<a contact>)
2.0 Check a void promise is returned.
A5.Receive ContextA receives the fdc3.instrument object, matching the one broadcast by B.
Check that the fdc3.contact is NOT received.
  • UCFilteredUsage1 Perform above test
  • UCFilteredUsage2 Perform steps in order: 2,1,3,4,5
  • UCFilteredUsage3 Perform steps in order: 3,4,1,2,5
  • UCFilteredUsage4 Perform steps in order: 3,4,2,1,5

Broadcast With Multiple Listeners

AppStepDetails
A1.addContextListenersA sets up two Context Listeners. One for fdc3.instrument and one for fdc3.contact by calling: addContextListener ("fdc3.instrument", handler)
addContextListener ("fdc3.contact", handler)
1.2 A Listener object is returned for each.
2.0 A promise resolving a Listener object is returned for each.
Check that this has an unsubscribe method for each.
A2.joinUserChannelA joins the first available user channel using:
1.2 getSystemChannels() Check channels are returned.
2.0 getUserChannels() Check user channels are returned.
Call fdc3.joinChannel() on the first non-global channel.
B3.joinUserChannelB joins the same channel as A, via the same process in 2.
B4.Broadcastfdc3.broadcast(<instrument context>)
fdc3.broadcast(<contact context>) .
A5.Receive ContextA'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 test
  • UCFilteredUsage6: 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 to fdc3.joinUserChannel. Check that A does NOT receive anything.
  • 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.