UT: Initial tests of creating and connecting to a standalone store.

This commit is contained in:
Arthur Britto
2012-09-25 15:14:27 -07:00
parent 195cd9eade
commit 04f0b12a13
2 changed files with 49 additions and 6 deletions

View File

@@ -9,15 +9,17 @@ exports.newcoind = path.join(process.cwd(), "newcoind");
// Configuration for servers.
exports.servers = {
// A local test server.
alpha : {
'trusted' : true,
// "peer_ip" : "0.0.0.0",
// "peer_port" : 51235,
"rpc_ip" : "0.0.0.0",
"rpc_port" : 5005,
"websocket_ip" : "127.0.0.1",
"websocket_port" : 6005,
"validation_seed" : "shhDFVsmS2GSu5vUyZSPXYfj1r79h",
"validators" : "n9L8LZZCwsdXzKUN9zoVxs4YznYXZ9hEhsQZY7aVpxtFaSceiyDZ beta"
'rpc_ip' : "0.0.0.0",
'rpc_port' : 5005,
'websocket_ip' : "127.0.0.1",
'websocket_port' : 6005,
'validation_seed' : "shhDFVsmS2GSu5vUyZSPXYfj1r79h",
'validators' : "n9L8LZZCwsdXzKUN9zoVxs4YznYXZ9hEhsQZY7aVpxtFaSceiyDZ beta"
}
};
// vim:ts=4

View File

@@ -4,6 +4,7 @@ var fs = require("fs");
var buster = require("buster");
var server = require("./server.js");
var remote = require("../js/remote.js");
buster.testCase("Check standalone server startup", {
"server start and stop": function(done) {
@@ -18,4 +19,44 @@ buster.testCase("Check standalone server startup", {
}
});
buster.testCase("Check websocket connection", {
'setUp' :
function(done) {
server.start("alpha",
function(e) {
buster.refute(e);
done();
});
},
'tearDown' :
function(done) {
server.stop("alpha", function(e) {
buster.refute(e);
done();
});
},
"websocket connect and disconnect" :
function(done) {
var alpha = remote.remoteConfig("alpha");
alpha.connect(function(stat) {
buster.assert(1 == stat); // OPEN
alpha.disconnect(function(stat) {
buster.assert(3 == stat); // CLOSED
done();
});
});
},
});
buster.testCase("Check assert", {
"assert" :
function() {
buster.assert(true);
}
});
// vim:ts=4