Add a third level construct under Profile and Client, Instance. This allows more than one connected object with the same client credentials.

This commit is contained in:
Ian Gulliver
2014-05-23 10:31:52 -07:00
parent 0d821547e3
commit 6bfa10e82a
5 changed files with 91 additions and 33 deletions

View File

@@ -441,6 +441,32 @@ asyncTest('sendMessage ACL', function() {
});
});
asyncTest('Two channels, one client', function() {
expect(2);
var namespace = randstring();
var subject = randstring();
var message = randstring();
var callbacks = {
'onMessage': function(msg) {
console.log('onMessage');
equal(msg['subject']['name'], subject, 'subject matches');
equal(msg['message'], message, 'message matches');
cosmo1.shutdown();
start();
},
};
var cosmo1 = new Cosmopolite(callbacks, null, namespace);
cosmo1.subscribe(subject).then(function() {
var cosmo2 = new Cosmopolite({}, null, namespace);
cosmo2.sendMessage(subject, message).then(function() {
cosmo2.shutdown();
});
});
});
module('dev_appserver only');