Adding persistent subscription support

This commit is contained in:
Nicolas Dextraze
2016-03-10 22:57:39 -08:00
parent 29f6bf210b
commit f1c3c42d46
25 changed files with 1939 additions and 117 deletions

View File

@ -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) {