fixed #23 stopRetrying issue. Also added test stopRetrying-unix-socket

This commit is contained in:
Brandon Nozaki Miller 2014-09-04 22:29:12 -07:00
parent 111cb81dde
commit 788c47c528
4 changed files with 83 additions and 1 deletions

View file

@ -13,6 +13,8 @@ function init(config,log){
} }
new pubsub(client); new pubsub(client);
console.log(this)
return client; return client;
} }

View file

@ -0,0 +1,32 @@
var ipc = require('../../../node-ipc'),
server=__dirname.split('/'),
server=server[server.length-1]
ipc.config.id = server+'-client';
ipc.config.stopRetrying=true;
//Wait to connect to ensure test server is started
setTimeout(
function(){
ipc.connectTo(
server,
function(){
ipc.of[server].on(
'connect',
function(){
ipc.disconnect(server);
//wait long enough that the test will fail if disconnect does not happen
setTimeout(
function(){
process.exit(0);
},
2000
);
}
);
}
);
},
400
);

View file

@ -0,0 +1,48 @@
var ipc = require('../../../node-ipc'),
expectedClient=ipc.config.id+'-client';
ipc.config.id = __dirname.split('/');
ipc.config.id = ipc.config.id[ipc.config.id.length-1]
ipc.config.maxRetries=1;
ipc.connectTo(
'testHarness',
function(){
ipc.of.testHarness.on(
'connect',
function(){
ipc.of.testHarness.emit(
'start.test',
{
id : ipc.config.id,
duration: 1800
}
);
}
)
}
);
ipc.serve(
function(){
}
);
ipc.server.on(
'socket.disconnected',
function(socket,id){
ipc.of.testHarness.emit(
'pass',
'stopRetrying-unix-server'
);
ipc.of.testHarness.emit(
'end.test'
);
process.exit(0);
}
)
ipc.server.start();

View file

@ -79,6 +79,6 @@ ipc.server.on(
} }
); );
ipc.server.define.listen['app.message']='This event type listens for message strings as value of data key.'; ipc.server.define.listen['test-test']='Registers and tests ipc communication.';
ipc.server.start(); ipc.server.start();