Skip to main content
Version: Next

User Channel Tests

Basic Broadcast

AppStepDetails
A1.addContextListenerA adds an unfiltered Context Listener using addContextListener(null, handler).
A promise resolving to 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:
fdc3.getUserChannels()
The first channel (that does not have the id 'global') is joined with:
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>).
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).
A promise resolving a Listener object is returned
Check that this has an unsubscribe function.
A2.joinUserChannelA joins the first available user channel using:
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>)
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)
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:
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.

Event on channel changed

2.2+ In FDC3 2.2, a new interface addEventListener function was added allowing an app to listen for events raised. In 2.2 only one event is supported, userChannelChanged.

An FDC3 Desktop Agent MUST provide a method to set the current User Channel for an application. This is often accomplished by providing a control within the user interface of a window or frame, allowing the user to select the desired channel.

As the method of setting the user channel is user interactive, it is either difficult or impossible to implement an automated test for this. Hence, manual tests should be performed as a final step in a conformance test. A separate manual test app should be provided to enable the test.

AppStepDetails
ChannelChangedEvent1. Open the test applicationA dedicated test application for FDC3ChannelChangedEvent should be opened.
ChannelChangedEvent2. Register for userChannelChanged eventawait fdc3.addEventListener("userChannelChanged", handler);
The handler function should log or render details of events received
User3. Set User ChannelThe user should set the current user channel of the app and change it a few times. Details of each change should be displayed by the test app.
  • 2.2-ChannelChangedEvent: 2.2+ Perform the above test.