User Channel Tests
Basic Broadcast
App | Step | Details |
---|---|---|
A | 1.addContextListener | A 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. |
A | 2.joinUserChannel | A 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>) |
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 test.UCBasicUsage2
Perform steps in order: 2,1,3,4,5 to confirm that the order ofjoinUserChannel
andaddContextListener
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
App | Step | Details |
---|---|---|
A | 1.addContextListener | A 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. |
A | 2.joinUserChannel | A joins the first available user channel using: 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 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
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 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: 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 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 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.
Event on channel changed
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.
App | Step | Details |
---|---|---|
ChannelChangedEvent | 1. Open the test application | A dedicated test application for FDC3ChannelChangedEvent should be opened. |
ChannelChangedEvent | 2. Register for userChannelChanged event | await fdc3.addEventListener("userChannelChanged", handler); The handler function should log or render details of events received |
User | 3. Set User Channel | The 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
: Perform the above test.