Adding persistent subscription support
This commit is contained in:
@ -281,7 +281,36 @@ module.exports = {
|
||||
test.done(err);
|
||||
});
|
||||
},
|
||||
//TODO: Persistent Subscription
|
||||
'Test Create Persistent Subscription': function(test) {
|
||||
var settings = client.PersistentSubscriptionSettings.create();
|
||||
this.conn.createPersistentSubscription(testStreamName, 'consumer-1', settings, userCredentialsForAll)
|
||||
.then(function(result) {
|
||||
test.done();
|
||||
})
|
||||
.catch(function(err) {
|
||||
test.done(err);
|
||||
});
|
||||
},
|
||||
//TODO: Update Persistent Subscription
|
||||
'Test ConnectTo Persistent Subscription': function(test) {
|
||||
function eventAppeared(s, e) {
|
||||
s.stop();
|
||||
}
|
||||
function subscriptionDropped(connection, reason, error) {
|
||||
test.done(error);
|
||||
}
|
||||
var subscription = this.conn.connectToPersistentSubscription(testStreamName, 'consumer-1', eventAppeared, subscriptionDropped);
|
||||
this.conn.appendToStream(testStreamName, client.expectedVersion.any, [createRandomEvent()]);
|
||||
},
|
||||
'Test Delete Persistent Subscription': function(test) {
|
||||
this.conn.deletePersistentSubscription(testStreamName, 'consumer-1', userCredentialsForAll)
|
||||
.then(function(result) {
|
||||
test.done();
|
||||
})
|
||||
.catch(function(err) {
|
||||
test.done(err);
|
||||
});
|
||||
},
|
||||
'Test Delete Stream': function(test) {
|
||||
this.conn.deleteStream(testStreamName, client.expectedVersion.any)
|
||||
.then(function(result) {
|
||||
|
Reference in New Issue
Block a user