var should = require('should'); var pomelo = require('../../'); var remote = require('../../lib/common/remote/frontend/channelRemote'); var SessionService = require('../../lib/common/service/sessionService'); var ChannelService = require('../../lib/common/service/channelService'); var countDownLatch = require('../../lib/util/countDownLatch'); var MockChannelManager = require('../manager/mockChannelManager'); var mockBase = process.cwd() + '/test'; var WAIT_TIME = 200; describe('channel remote test', function() { describe('#pushMessage', function() { it('should push message the the specified clients', function(done) { var sids = [1, 2, 3, 4, 5, 6]; var uids = [11, 12, 13]; var frontendId = 'frontend-server-id'; var mockRoute = 'mock-route-string'; var mockMsg = {msg: 'some test msg'}; var invokeCount = 0; var invokeUids = []; var sessionService = new SessionService(); sessionService.sendMessageByUid = function(uid, msg) { mockMsg.should.eql(msg); invokeCount++; invokeUids.push(uid); }; var session; for(var i=0, l=sids.length, j=0; i