mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-19 01:55:48 +00:00
Further testing
This commit is contained in:
Binary file not shown.
@@ -40,10 +40,10 @@ buster.testCase("Fee Changes", {
|
||||
*/
|
||||
|
||||
buster.testCase("Sending", {
|
||||
'setUp' : testutils.build_setup(),
|
||||
'setUp' : testutils.build_setup(), //
|
||||
'tearDown' : testutils.build_teardown(),
|
||||
|
||||
"send XRP to non-existent account with insufficent fee" :
|
||||
"send XRP to non-existent account with insufficent fee" : // => to run only that.
|
||||
function (done) {
|
||||
var self = this;
|
||||
var ledgers = 20;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
var buster = require("buster");
|
||||
|
||||
var testutils = require("./testutils.js");
|
||||
var Server = require("./server.js").Server;
|
||||
|
||||
// How long to wait for server to start.
|
||||
@@ -8,6 +8,8 @@ var Server = require("./server.js").Server;
|
||||
var alpha;
|
||||
|
||||
buster.testCase("Standalone server startup", {
|
||||
|
||||
|
||||
"server start and stop" : function (done) {
|
||||
alpha = Server.from_config("alpha",true); //ADD ,true for verbosity
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ var Server = function (name, config, verbose) {
|
||||
this.config = config;
|
||||
this.started = false;
|
||||
this.quiet = !verbose;
|
||||
this.stopping = false; //Not sure if we need this...
|
||||
this.stopping = false;
|
||||
};
|
||||
|
||||
Server.prototype = new EventEmitter;
|
||||
@@ -100,7 +100,7 @@ Server.prototype._serverSpawnSync = function() {
|
||||
this.child.on('exit', function(code, signal) {
|
||||
// If could not exec: code=127, signal=null
|
||||
// If regular exit: code=0, signal=null
|
||||
buster.assert(!self.stopping); //Fail the test if the server is exiting without having called "stop"
|
||||
buster.assert(!self.stopping); //Fail the test if the server has called "stop"
|
||||
if (!self.quiet) console.log("server: spawn: server exited code=%s: signal=%s", code, signal);
|
||||
});
|
||||
};
|
||||
@@ -150,7 +150,7 @@ Server.prototype.start = function () {
|
||||
// Stop a standalone server.
|
||||
Server.prototype.stop = function () {
|
||||
var self = this;
|
||||
self.stopping = true; //Tell the caller that the server is properly stopping.
|
||||
self.stopping = true;
|
||||
if (this.child) {
|
||||
// Update the on exit to invoke done.
|
||||
this.child.on('exit', function (code, signal) {
|
||||
|
||||
@@ -6,6 +6,9 @@ var Remote = require("../src/js/remote.js").Remote;
|
||||
var Server = require("./server.js").Server;
|
||||
|
||||
|
||||
var child = require("child_process"); //Testing spawn
|
||||
|
||||
|
||||
var testutils = require("./testutils.js");
|
||||
|
||||
buster.spec.expose();
|
||||
@@ -14,8 +17,27 @@ describe("My thing", function () {
|
||||
it("states the obvious", function () {
|
||||
expect(true).toBe(true);;
|
||||
});
|
||||
|
||||
//var spawn = child.spawn,
|
||||
|
||||
ls = child.spawn('ls', ['-lh', '/']);
|
||||
|
||||
ls.stdout.on('data', function (data) {
|
||||
console.log('stdout: ' + data);
|
||||
});
|
||||
|
||||
ls.stderr.on('data', function (data) {
|
||||
console.log('stderr: ' + data);
|
||||
});
|
||||
|
||||
ls.on('exit', function (code) {
|
||||
console.log('child process exited with code ' + code);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
/*
|
||||
|
||||
buster.testCase("Basic Path finding", {
|
||||
'setUp' : testutils.build_setup(),
|
||||
'tearDown' : testutils.build_teardown(),
|
||||
@@ -64,3 +86,5 @@ buster.testCase("Basic Path finding", {
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
*/
|
||||
Reference in New Issue
Block a user