mirror of
https://github.com/Netflix/dial-reference.git
synced 2026-06-09 11:29:57 +00:00
use sprintf-js to format console logs
This commit is contained in:
@@ -9,7 +9,7 @@ function test() {
|
||||
|
||||
return new Q()
|
||||
.then(function () {
|
||||
console.log("TEST " + __filename + ": Perform DIAL discovery and ensure that the server under test is discovered");
|
||||
utils.printTestInfo(__filename.slice(__dirname.length + 1) , "Perform DIAL discovery and ensure that the server under test is discovered");
|
||||
})
|
||||
.then(dial.discover)
|
||||
.then(function findServerInList(servers) {
|
||||
@@ -24,10 +24,10 @@ function test() {
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
console.log("TEST PASSED");
|
||||
utils.printSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
console.log("TEST FAILED " + err);
|
||||
utils.printFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ function test() {
|
||||
|
||||
return new Q()
|
||||
.then(function () {
|
||||
console.log("TEST " + __filename + ": Try to hide " + app + " when it is already in hidden state and expect response code 200 from the DIAL server");
|
||||
utils.printTestInfo(__filename.slice(__dirname.length + 1), "Try to hide " + app + " when it is already in hidden state and expect response code 200 from the DIAL server");
|
||||
})
|
||||
.then(dial.getApplicationStatus.bind(null, host, app))
|
||||
.then(function hideApp(result) {
|
||||
@@ -67,10 +67,10 @@ function test() {
|
||||
})
|
||||
|
||||
.then(function () {
|
||||
console.log("TEST PASSED");
|
||||
utils.printSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
console.error("TEST FAILED " + err);
|
||||
utils.printFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ function test() {
|
||||
|
||||
return new Q()
|
||||
.then(function () {
|
||||
console.log("TEST " + __filename + ": Hide " + app + " application when it is running and expect response code 200");
|
||||
utils.printTestInfo(__filename.slice(__dirname.length + 1), "Hide " + app + " application when it is running and expect response code 200");
|
||||
})
|
||||
.then(dial.getApplicationStatus.bind(null, host, app))
|
||||
.then(function getCurrentAppState(result) {
|
||||
@@ -60,10 +60,10 @@ function test() {
|
||||
})
|
||||
|
||||
.then(function () {
|
||||
console.log("TEST PASSED");
|
||||
utils.printSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
console.error("TEST FAILED " + err);
|
||||
utils.printFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ function test() {
|
||||
|
||||
return new Q()
|
||||
.then(function () {
|
||||
console.log("TEST " + __filename + ": Try to hide an invalid instance of " + app + " application and expect status code 404");
|
||||
utils.printTestInfo(__filename.slice(__dirname.length + 1), "Try to hide an invalid instance of " + app + " application and expect status code 404");
|
||||
})
|
||||
.then(dial.launchApplication.bind(null, host, app))
|
||||
.then(function (response) {
|
||||
@@ -50,10 +50,10 @@ function test() {
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
console.log("TEST PASSED");
|
||||
utils.printSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
console.error("TEST FAILED " + err);
|
||||
utils.printFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ function test() {
|
||||
|
||||
return new Q()
|
||||
.then(function () {
|
||||
console.log("TEST " + __filename + " Launch " + app + " application using DIAL server when app is in hidden state and check for response code 201 ");
|
||||
utils.printTestInfo(__filename.slice(__dirname.length + 1), "Launch " + app + " application using DIAL server when app is in hidden state and check for response code 201 ");
|
||||
})
|
||||
.then(dial.getApplicationStatus.bind(null, host, app))
|
||||
.then(function hideApp(result) {
|
||||
@@ -60,10 +60,10 @@ function test() {
|
||||
})
|
||||
.delay(timeToWaitForStateChange)
|
||||
.then(function () {
|
||||
console.log("TEST PASSED");
|
||||
utils.printSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
console.error("TEST FAILED " + err);
|
||||
utils.printFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ function test() {
|
||||
|
||||
return new Q()
|
||||
.then(function () {
|
||||
console.log("TEST " + __filename + " Launch " + app + " application with payload using DIAL server when app is in hidden state and check for response code 201 ");
|
||||
utils.printTestInfo(__filename.slice(__dirname.length + 1), "Launch " + app + " application with payload using DIAL server when app is in hidden state and check for response code 201 ");
|
||||
})
|
||||
.then(dial.getApplicationStatus.bind(null, host, app))
|
||||
.then(function hideApp(result) {
|
||||
@@ -60,10 +60,10 @@ function test() {
|
||||
})
|
||||
.delay(timeToWaitForStateChange)
|
||||
.then(function () {
|
||||
console.log("TEST PASSED");
|
||||
utils.printSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
console.error("TEST FAILED " + err);
|
||||
utils.printFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ function test() {
|
||||
|
||||
return new Q()
|
||||
.then(function () {
|
||||
console.log("TEST " + __filename + ": Launch " + app + " without payload using DIAL server when application is already running and check for response code 201");
|
||||
utils.printTestInfo(__filename.slice(__dirname.length + 1), "Launch " + app + " without payload using DIAL server when application is already running and check for response code 201");
|
||||
})
|
||||
.then(dial.getApplicationStatus.bind(null, host, app))
|
||||
.then(function getCurrentAppState(result) {
|
||||
@@ -58,10 +58,10 @@ function test() {
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
console.log("TEST PASSED");
|
||||
utils.printSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
console.error("TEST FAILED " + err);
|
||||
utils.printFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ function test() {
|
||||
|
||||
return new Q()
|
||||
.then(function () {
|
||||
console.log("TEST " + __filename + ": Launch " + app + " with payload using DIAL server when application is already running and check for response code 201");
|
||||
utils.printTestInfo(__filename.slice(__dirname.length + 1), "Launch " + app + " with payload using DIAL server when application is already running and check for response code 201");
|
||||
})
|
||||
.then(dial.getApplicationStatus.bind(null, host, app))
|
||||
.then(function getCurrentAppState(result) {
|
||||
@@ -59,10 +59,10 @@ function test() {
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
console.log("TEST PASSED");
|
||||
utils.printSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
console.error("TEST FAILED " + err);
|
||||
utils.printFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ function test() {
|
||||
|
||||
return new Q()
|
||||
.then(function () {
|
||||
console.log("TEST " + __filename + ": Launch " + app + " application using DIAL server when the application is in STOPPED state and expect response code 201");
|
||||
utils.printTestInfo(__filename.slice(__dirname.length + 1), "Launch " + app + " application using DIAL server when the application is in STOPPED state and expect response code 201");
|
||||
})
|
||||
.then(dial.getApplicationStatus.bind(null, host, app))
|
||||
.then(function stopAppIfNecessary(result) {
|
||||
@@ -60,10 +60,10 @@ function test() {
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
console.log("TEST PASSED");
|
||||
utils.printSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
console.error("TEST FAILED " + err);
|
||||
utils.printFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ function test() {
|
||||
|
||||
return new Q()
|
||||
.then(function () {
|
||||
console.log("TEST " + __filename + ": Launch " + app + " application with payload using DIAL server when the application is in STOPPED state and expect response code 201");
|
||||
utils.printTestInfo(__filename.slice(__dirname.length + 1), "Launch " + app + " application with payload using DIAL server when the application is in STOPPED state and expect response code 201");
|
||||
})
|
||||
.then(dial.getApplicationStatus.bind(null, host, app))
|
||||
.then(function stopAppIfNecessary(result) {
|
||||
@@ -60,10 +60,10 @@ function test() {
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
console.log("TEST PASSED");
|
||||
utils.printSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
console.error("TEST FAILED " + err);
|
||||
utils.printFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ function test() {
|
||||
|
||||
return new Q()
|
||||
.then(function () {
|
||||
console.log("TEST " + __filename + ": Launch an application that is not recognized by DIAL server and check for response code 404");
|
||||
utils.printTestInfo(__filename.slice(__dirname.length + 1), "Launch an application that is not recognized by DIAL server and check for response code 404");
|
||||
})
|
||||
.then(dial.launchApplication.bind(null, host, "ApplicationNotRecognized"))
|
||||
.then(function (response) {
|
||||
@@ -19,10 +19,10 @@ function test() {
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
console.log("TEST PASSED");
|
||||
utils.printSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
console.error("TEST FAILED " + err);
|
||||
utils.printFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ function test() {
|
||||
|
||||
return new Q()
|
||||
.then(function () {
|
||||
console.log("TEST " + __filename + ": Try to launch " + app + " application with excess payload and ensure DIAL server returns response code 413");
|
||||
utils.printTestInfo(__filename.slice(__dirname.length + 1), "Try to launch " + app + " application with excess payload and ensure DIAL server returns response code 413");
|
||||
})
|
||||
.then(dial.launchApplication.bind(null, host, app, payload))
|
||||
.then(function (response) {
|
||||
@@ -53,10 +53,10 @@ function test() {
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
console.log("TEST PASSED");
|
||||
utils.printSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
console.error("TEST FAILED " + err);
|
||||
utils.printFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ function test() {
|
||||
|
||||
return new Q()
|
||||
.then(function () {
|
||||
console.log("TEST " + __filename + ": Stop " + app + " application using DIAL server when the application is in hidden state and expect response code 200");
|
||||
utils.printTestInfo(__filename.slice(__dirname.length + 1), "Stop " + app + " application using DIAL server when the application is in hidden state and expect response code 200");
|
||||
})
|
||||
.then(dial.getApplicationStatus.bind(null, host, app))
|
||||
.then(function hideApp(result) {
|
||||
@@ -67,10 +67,10 @@ function test() {
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
console.log("TEST PASSED");
|
||||
utils.printSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
console.error("TEST FAILED " + err);
|
||||
utils.printFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ function test() {
|
||||
|
||||
return new Q()
|
||||
.then(function () {
|
||||
console.log("TEST " + __filename + ": Stop " + app + " application when it is running and check for response code 200 from DIAL server ");
|
||||
utils.printTestInfo(__filename.slice(__dirname.length + 1), "Stop " + app + " application when it is running and check for response code 200 from DIAL server ");
|
||||
})
|
||||
.then(dial.getApplicationStatus.bind(null, host, app))
|
||||
.then(function getCurrentAppState(result) {
|
||||
@@ -59,10 +59,10 @@ function test() {
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
console.log("TEST PASSED");
|
||||
utils.printSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
console.error("TEST FAILED " + err);
|
||||
utils.printFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ function test() {
|
||||
|
||||
return new Q()
|
||||
.then(function () {
|
||||
console.log("TEST " + __filename + ": Try to stop " + app + " application using DIAL server when the application is already stopped and expect response code 200.");
|
||||
utils.printTestInfo(__filename.slice(__dirname.length + 1), "Try to stop " + app + " application using DIAL server when the application is already stopped and expect response code 200.");
|
||||
})
|
||||
.then(dial.getApplicationStatus.bind(null, host, app))
|
||||
.then(function getCurrentAppState(result) {
|
||||
@@ -86,10 +86,10 @@ function test() {
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
console.log("TEST PASSED");
|
||||
utils.printSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
console.error("TEST FAILED " + err);
|
||||
utils.printFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ function test() {
|
||||
|
||||
return new Q()
|
||||
.then(function () {
|
||||
console.log("TEST " + __filename + ": Try to stop invalid " + app + " application instance and check for DIAL server response code 404");
|
||||
utils.printTestInfo(__filename.slice(__dirname.length + 1), "Try to stop invalid " + app + " application instance and check for DIAL server response code 404");
|
||||
})
|
||||
.then(dial.launchApplication.bind(null, host, app))
|
||||
.delay(timeToWaitForStateChange)
|
||||
@@ -46,10 +46,10 @@ function test() {
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
console.log("TEST PASSED");
|
||||
utils.printSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
console.error("TEST FAILED " + err);
|
||||
utils.printFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user