Subscription Transfer

Support TransferSubscriptions Service to transfer a Subscription from one Session to another.


Questions? Contact us
Generated: 30/20/2020 at 15:30:46 p.m.
Subscription Transfer - 27 Test Cases
Test Case Id Test Type Keywords Test Case Description Test Requirements Expected Result

001

CTT CloseSession()  TransferSubscriptions()  DeleteSubscriptions = FALSE, check if associated subscriptions were not deleted: create another session and try to transfer the subscriptions using the TransferSubscriptions() service. ServiceResult = `Good` (CloseSession).
ServiceResult = `Good` and operation level result = `Good` (TransferSubscriptions)
StatusChangeNotification notification message with status `Good_SubscriptionTransferred` is received on the new session.

002

CTT CloseSession()  TransferSubscriptions()  Use default parameters, check if associated subscriptions were deleted: create another session and try to transfer the subscriptions using the TransferSubscriptions() service. ServiceResult = `Good` (CloseSession).
ServiceResult = `Good` and operation level result = `Bad_SubscriptionIdInvalid` (TransferSubscriptions)

003

CTT ModifySubscription()  TransferSubscriptions()  Modify a subscription that had been transferred to another session. ServiceResult = Bad_SubscriptionIdInvalid.
Verify the subscription was not modified in the session it was transferred to.
The old session receives a StatusChange notification that it lost the subscription.

004

CTT SetPublishingMode()  TransferSubscriptions()  For a subscription that was transferred, try modifying its publishing Enabled=FALSE from the original session where it used to reside.
For example:
1. CreateSession() `s1`
2. CreateSession() `s2`
3. `s1` create Subscription
4. `s1` transfer Subscription to `s2`.
5. `s1` calls ModifySubscription() that`s now in `s2`.
Verify the subscription was not modified in the session it was transferred to by calling Publish() in the `s2` session.
The call to SetPublishingMode:
ServiceResult = Good.
Results[1] = Bad_SubscriptionIdInvalid.
The call to Publish() in the `s2` session yields an initial dataChange.

005

CTT SetPublishingMode()  TransferSubscriptions()  For 2 subscriptions that were transferred, try modifying their publishing Enabled = FALSE from the original session where they used to reside. For example:
1. CreateSession() `s1`
2. CreateSession() `s2`
3. `s1` create 2 Subscriptions
4. `s1` transfer 2 Subscriptions to `s2`.
5. `s1` calls ModifySubscription() for both subscriptions that are now in `s2`.
Verify the subscription was not modified in the session it was transferred to by calling Publish() multiple times in the `s2` session.
The call to SetPublishingMode:
ServiceResult = Good.
Results[1] = Bad_SubscriptionIdInvalid.
The calls to Publish() in the `s2` session yields an initial dataChange for each subscription.

006

CTT Publish()  TransferSubscriptions()  Create a subscription and transfer it to another session.
Call Publish() from the original session.
ServiceResult = Bad_NoSubscription.
Results and availableSequenceNumbers will be empty.
The old Session should receive a StatusChange notification within the Publish call.

007

CTT Republish()  TransferSubscriptions()  Create a subscription using default values.
Monitor multiple monitoredItem(s).
Transfer the subscription to another Session.
Call Republish() from the original session.
The call to Republish returns a ServiceResult of Bad_SubscriptionIdInvalid and the notificationMessage is null.
The old Session should receive a StatusChange notification within the Publish call.

UA 1.03 Clarification: Republish() service is required; but behavior is optional and can return BadMessageNotAvailable

008

CTT Republish()  TransferSubscriptions()  Create a Subscription monitoring multiple items.
In a loop of 3 iteration invoke a Write() to all items and then call Publish() without acknowledging any sequence numbers.
Close the session and specify deleteSubscriptions=FALSE.
Create another session and then transfer the subscription.
In a loop, call Republish() (e.g. sequence #1, #2, #3 etc.) to obtain the expected notifications and then iteratively requesting the prior notification.
Call Publish().
All service and operation-level results are Good.
The values received for each notification match the values expected, e.g. Publish #2 matches the values from Write #2.
When all expected notifications are received then the server will return Bad_MessageNotAvailable.
The last Publish() call will send a KeepAlive and the sequenceNumber will be the same as when the Republish() call failed with the error code.

UA 1.03 Clarification: Republish() service is required; but behavior is optional and can return BadMessageNotAvailable

009

CTT Unavailable  TransferSubscriptions()  Create a new subscription and multiple monitored items.
Call Publish() (call #1) on the first Session.
Create a 2nd session and transfer the existing subscription to the new session: SendInitialValues=TRUE.
Call Publish() twice (call #2 and #3) on the first Session.
Call Publish() (call #4) on the second Session.
All service results and operation-level results are Good, except where stated otherwise.
Publish #1 receives a DataChange.
Publish #2 service result Good_SubscriptionTransferred and a StatusChangeNotification is received.
Publish #3 service result Bad_NoSubscription.
Publish #4 receives a DataChange.

010

CTT Unavailable  TransferSubscriptions()  Create a new subscription and monitored item.
Call Publish() (call #1) on the first Session.
Create a 2nd session and transfer the existing subscription to the new session: SendInitialValues=FALSE.
Call Publish() twice (call #2 and #3) on the first Session.
Call Publish() (call #4) on the second Session.
All service results and operation-level results are Good, except where stated otherwise.
Publish #1 receives a DataChange.
Publish #2 service result Good_SubscriptionTransferred and a StatusChangeNotification is received.
Publish #3 service result Bad_NoSubscription.
Publish #4 receives a KeepAlive.

011

CTT Unavailable  TransferSubscriptions()  Within an existing session, create 2 subscriptions with each monitoring an item (reporting mode).
Call Publish() twice (calls #1 and #2).
Create a 2nd session and transfer the 2nd subscription to the new session (SendInitialValues=TRUE).
Call Publish() on the first session (#3).
Call Publish() on the second session (#4).
Write a new value to the item in each subscription.
Call Publish() twice for each session.
All service results and operation-level results are Good.
Publish #1 and #2 receives the initial data, per subscription.
Publish #3 service result Good_SubscriptionTransferred and a StatusChangeNotification is received.
Publish #4 receives a DataChange.
The 2 publish calls for Session #1 will return a data change and a keep-alive, respectively.
The 2 publish calls for Session #2 will yield data changes.

012

CTT Unavailable  TransferSubscriptions()  Within an existing session, create 2 subscriptions with each monitoring an item (reporting mode).
Call Publish() twice (calls #1 and #2).
Create a 2nd session and transfer the 2nd subscription to the new session (SendInitialValues=FALSE).
Call Publish() on the first session (#3).
Call Publish() on the second session (#4).
Write a new value to the item in each subscription.
Call Publish() twice for each session.
All service results and operation-level results are Good.
Publish #1 and #2 receives the initial data, per subscription.
Publish #3 service result Good_SubscriptionTransferred and a StatusChangeNotification is received.
Publish #4 receives a keep-alive.
The 2 publish calls for Session #1 will return a data change and a keep-alive, respectively.
The 2 publish calls for Session #2 will return a data change and a keep-alive, respectively.

013

CTT Unavailable  TransferSubscriptions()  Within an existing session, create 2 subscriptions with each monitoring an item (reporting mode).
Call Publish() twice (calls #1 and #2).
Create a 2nd session and transfer 1 valid SubscriptionId, and one invalid SubscriptionId to the new session (SendInitialValues=TRUE).
Call Publish() twice on the old session (calls #3, #4).
Call Publish() twice on the new session (calls #5, #6).
All service results and operation-level results are Good, except where stated otherwise.
Publish #1 and #2 yield the initial data values.
TransferSubscription service result Good; operation-level results are Good and Bad_SubscriptionIdInvalid, respectively.
Publish #3 service result Good_SubscriptionTransferred and a StatusChangeNotification is received.
Publish #4 receives a KeepAlive.
Publish #5 receives a dataChange (for the subscription that was transferred).
Publish #6 receives a KeepAlive.

014

CTT Unavailable  TransferSubscriptions()  Within an existing session, create 2 subscriptions with each monitoring an item (reporting mode).
Call Publish() twice (calls #1 and #2).
Create a 2nd session and transfer 1 valid SubscriptionId, and one invalid SubscriptionId to the new session (SendInitialValues=FALSE).
Call Publish() twice on the old session (calls #3, #4).
Call Publish() twice on the new session (calls #5, #6).
All service results and operation-level results are Good, except where stated otherwise.
Publish #1 and #2 yield the initial data values.
TransferSubscription service result Good; operation-level results are Good and Bad_SubscriptionIdInvalid, respectively.
Publish #3 service result Good_SubscriptionTransferred and a StatusChangeNotification is received.
Publish #4 receives a KeepAlive.
Publish #5 and #6 receives a KeepAlive.

015

CTT TransferSubscriptions()  Create 2 sessions.
Create 1 subscription monitoring 1 or more items.
Call Publish() (#1) on session #1.
Transfer the subscription to the other session (SendInitialValues=TRUE).
Call Publish() (#2) on session #1.
Call Publish() (#3) on session #2.
Transfer the subscription to the other session (SendInitialValues=TRUE).
Call Publish() (#4) on session #1.
Session created successfully.
Subscription setup without error.
Publish #1 receives the initial data change.
Transfer is successful.
Publish #2 yields the initial data change.
Transfer is successful.
Publish #3 yields the initial data change.
Note: We assume that the server purges the prior StatusChange notification message that was in the queue.

016

CTT Unavailable  TransferSubscriptions()  Create a subscription that is monitoring events and data.
Transfer the subscription to another session where the client’s profile does not show support for either “DataChange Subscriber Client Facet” or “Event Subscriber Client Facet”.
TransferSubscription fails with error Bad_InsufficientClientProfile.

Err-001

CTT TransferSubscriptions()  DeleteSubscriptions()  Call DeleteSubscriptions() and specify a subscription that was transferred to another session. ServiceResult = Good.
results[0] = Bad_SubscriptionIdInvalid.
Verify it is not deleted from the session it was transferred to.

Err-002

CTT TransferSubscriptions()  DeleteSubscriptions()  Call DeleteSubscriptions() and specify multiple subscriptions that have been transferred to other sessions. ServiceResult = Good.
results[i] = Bad_SubscriptionIdInvalid.
Verify none are deleted from the sessions they were transferred to.

Err-003

CTT SetMonitoringMode()  TransferSubscriptions()  Create a subscription with 1 valid MonitoredItem.
Transfer the subscription to another session.
Call SetMonitoringMode() (default values) from the original session.
Initial service and operation level results are `Good`, except for the call to SetMonitoringMode where the Service result = Bad_InvalidSubscriptionId.
A StatusChange notification is received on the original session indicating the lost Subscription.

Err-004

CTT TransferSubscriptions()  DeleteSubscriptions()  Call DeleteSubscriptions() and specify multiple subscriptions where some are valid SubscriptionIds and others have been transferred to other sessions. responseHeader.ServiceResult = `Good`.
results[i] = Bad_SubscriptionIdInvalid (i = index of subscriptions that had been transferred to another session previously in subscriptionIds array).
results[j] = Good (j = index of valid subscriptions in subscriptionIds array).
Verify none are deleted from the sessions they were transferred to.

Err-005

CTT TransferSubscriptions()  Call TransferSubscriptions() without specifying any SubscriptionIds. ServiceResult is Bad_NothingToDo.

Err-006

Lab CTT Unavailable  TransferSubscriptions()  Call TransferSubscriptions() while specifying more SubscriptionIds than the server can handle. ServiceResult is Bad_TooManyOperations.

Err-007

CTT TransferSubscriptions()  Call TransferSubscription() while specifying an invalid/non-existent SubscriptionId. ServiceResult Good; Operation Level result is Bad_SubscriptionIdInvalid.

Err-008

CTT Unavailable  TransferSubscriptions()  Create a new subscription and monitored item (reporting mode) in a default session.
Create another session on another channel, to attempt to replicate a different client altogether.
Transfer the subscription to the new session.
ServiceResult Good; Operation Level result is Bad_UserAccessDenied.

Err-009

CTT Unavailable  TransferSubscriptions()  Create a session using a set of user credentials other than anonymous.
Create a subscription that is monitoring at least 1 item.
Create another session using anonymous login credentials.
Transfer the subscription.
TransferSubscription fails with error Bad_UserAccessDenied.

Err-010

CTT Unavailable  TransferSubscriptions()  Create a session using one set of user credentials.
Create a subscription that is monitoring at least 1 item.
Create another session using a different set of user credentials which belongs to a different group/role from the other user and does not have permissions to acquire the subscription (e.g. not an admin)..
Transfer the subscription.
TransferSubscription fails with error Bad_UserAccessDenied.

Err-011

Create a session using anonymous credentials.
Create a subscription that is monitoring at least 1 item.
Create another secure channel using a different set of client credentials (i.e. different x509 softwareCertificate) and establish another anonymous session.
Transfer the subscription.
TransferSubscription fails with error Bad_UserAccessDenied.