From 11e4eaf2ac491065b5b29d848085e2d5fbe7fa06 Mon Sep 17 00:00:00 2001 From: Shruti Ranganathan Jothi Date: Wed, 8 Mar 2017 12:57:50 -0800 Subject: [PATCH] rectify error in sending clientDialVer in application status query --- server/tests/js_tests/libs/dialClient.js | 2 +- .../tests/js_tests/tests/hideApplicationInHiddenState.js | 5 ++++- .../tests/launchApplicationInHiddenStateWithNoPayload.js | 4 +++- .../tests/launchApplicationInHiddenStateWithPayload.js | 4 +++- .../tests/launchApplicationInRunningStateWithNoPayload.js | 4 +++- .../tests/launchApplicationInRunningStateWithPayload.js | 4 +++- .../tests/launchApplicationInStoppedStateWithNoPayload.js | 8 ++++++-- .../tests/launchApplicationInStoppedStateWithPayload.js | 8 ++++++-- .../tests/js_tests/tests/stopApplicationInHiddenState.js | 8 ++++++-- .../tests/js_tests/tests/stopApplicationInRunningState.js | 8 ++++++-- .../tests/js_tests/tests/stopApplicationInStoppedState.js | 8 ++++++-- 11 files changed, 47 insertions(+), 16 deletions(-) diff --git a/server/tests/js_tests/libs/dialClient.js b/server/tests/js_tests/libs/dialClient.js index 2c90377..a451a0f 100644 --- a/server/tests/js_tests/libs/dialClient.js +++ b/server/tests/js_tests/libs/dialClient.js @@ -47,7 +47,7 @@ function getApplicationStatus(host, app, clientDialVer) { return new Q() .then(constructAppResourceUrl.bind(null, host, app)) .then(function (appResourceUrl) { - appResourceUrl += clientDialVer === "2.1" ? "?clientDialVer='2.1'" : ""; + appResourceUrl += clientDialVer === "2.1" ? "?clientDialVer=2.1" : ""; return appResourceUrl; }) .then(function (appResourceUrl) { diff --git a/server/tests/js_tests/tests/hideApplicationInHiddenState.js b/server/tests/js_tests/tests/hideApplicationInHiddenState.js index d68b446..73c15b9 100644 --- a/server/tests/js_tests/tests/hideApplicationInHiddenState.js +++ b/server/tests/js_tests/tests/hideApplicationInHiddenState.js @@ -52,6 +52,7 @@ function test() { if(result.state !== "running") { return Q.reject(new Error("Expected " + app + " app status to be running but the state was " + result.state)); } + console.log("app was running"); }) .then(dial.hideApplication.bind(null, host, app)) .delay(timeToWaitForStateChange); @@ -60,7 +61,9 @@ function test() { .delay(timeToWaitForStateChange); } }) - .then(dial.getApplicationStatus.bind(null, host, app)) + .then(function () { + return dial.getApplicationStatus(host, app) + }) .then(function checkAppStatus(result) { if(!result || !result.state) { return Q.reject(new Error("Could not retrieve current " + app + " application state")); diff --git a/server/tests/js_tests/tests/launchApplicationInHiddenStateWithNoPayload.js b/server/tests/js_tests/tests/launchApplicationInHiddenStateWithNoPayload.js index 52237fb..bd1ad84 100644 --- a/server/tests/js_tests/tests/launchApplicationInHiddenStateWithNoPayload.js +++ b/server/tests/js_tests/tests/launchApplicationInHiddenStateWithNoPayload.js @@ -63,7 +63,9 @@ function test() { } } }) - .then(dial.getApplicationStatus.bind(null, host, app)) + .then(function () { + return dial.getApplicationStatus(host, app) + }) .then(function checkAppStatus(result) { if(!result || !result.state) { return Q.reject(new Error("Error retrieving current " + app + " application state")); diff --git a/server/tests/js_tests/tests/launchApplicationInHiddenStateWithPayload.js b/server/tests/js_tests/tests/launchApplicationInHiddenStateWithPayload.js index 0d18d73..e65fe1b 100644 --- a/server/tests/js_tests/tests/launchApplicationInHiddenStateWithPayload.js +++ b/server/tests/js_tests/tests/launchApplicationInHiddenStateWithPayload.js @@ -63,7 +63,9 @@ function test() { } } }) - .then(dial.getApplicationStatus.bind(null, host, app)) + .then(function () { + return dial.getApplicationStatus(host, app) + }) .then(function checkAppStatus(result) { if(!result || !result.state) { return Q.reject(new Error("Error retrieving current " + app + " application state")); diff --git a/server/tests/js_tests/tests/launchApplicationInRunningStateWithNoPayload.js b/server/tests/js_tests/tests/launchApplicationInRunningStateWithNoPayload.js index 35eae0c..7003073 100644 --- a/server/tests/js_tests/tests/launchApplicationInRunningStateWithNoPayload.js +++ b/server/tests/js_tests/tests/launchApplicationInRunningStateWithNoPayload.js @@ -53,7 +53,9 @@ function test() { } }) .delay(timeToWaitForStateChange) - .then(dial.getApplicationStatus.bind(null, host, app)) + .then(function () { + return dial.getApplicationStatus(host, app) + }) .then(function getCurrentAppState(result) { if(!result || !result.state) { return Q.reject(new Error("Error retrieving current " + app + " application state")); diff --git a/server/tests/js_tests/tests/launchApplicationInRunningStateWithPayload.js b/server/tests/js_tests/tests/launchApplicationInRunningStateWithPayload.js index 1f1d187..3076e52 100644 --- a/server/tests/js_tests/tests/launchApplicationInRunningStateWithPayload.js +++ b/server/tests/js_tests/tests/launchApplicationInRunningStateWithPayload.js @@ -53,7 +53,9 @@ function test() { } }) .delay(timeToWaitForStateChange) - .then(dial.getApplicationStatus.bind(null, host, app)) + .then(function () { + return dial.getApplicationStatus(host, app) + }) .then(function getCurrentAppState(result) { if(!result || !result.state) { return Q.reject(new Error("Error retrieving current " + app + " application state")); diff --git a/server/tests/js_tests/tests/launchApplicationInStoppedStateWithNoPayload.js b/server/tests/js_tests/tests/launchApplicationInStoppedStateWithNoPayload.js index cd6e6bd..bcff4ef 100644 --- a/server/tests/js_tests/tests/launchApplicationInStoppedStateWithNoPayload.js +++ b/server/tests/js_tests/tests/launchApplicationInStoppedStateWithNoPayload.js @@ -51,7 +51,9 @@ function test() { } }) .delay(timeToWaitForStateChange) - .then(dial.getApplicationStatus.bind(null, host, app)) + .then(function () { + return dial.getApplicationStatus(host, app) + }) .then(function checkAppState(result) { if(!result || !result.state) { return Q.reject("Error retrieving " + app + " application state"); @@ -71,7 +73,9 @@ function test() { } }) .delay(timeToWaitForStateChange) - .then(dial.getApplicationStatus.bind(null, host, app)) + .then(function () { + return dial.getApplicationStatus(host, app) + }) .then(function getCurrentAppState(result) { if(!result || !result.state) { return Q.reject(new Error("Error retrieving current " + app + " application state")); diff --git a/server/tests/js_tests/tests/launchApplicationInStoppedStateWithPayload.js b/server/tests/js_tests/tests/launchApplicationInStoppedStateWithPayload.js index ca17e6e..2d6a582 100644 --- a/server/tests/js_tests/tests/launchApplicationInStoppedStateWithPayload.js +++ b/server/tests/js_tests/tests/launchApplicationInStoppedStateWithPayload.js @@ -51,7 +51,9 @@ function test() { } }) .delay(timeToWaitForStateChange) - .then(dial.getApplicationStatus.bind(null, host, app)) + .then(function () { + return dial.getApplicationStatus(host, app) + }) .then(function checkAppState(result) { if(!result || !result.state) { return Q.reject("Error retrieving " + app + " application state"); @@ -71,7 +73,9 @@ function test() { } }) .delay(timeToWaitForStateChange) - .then(dial.getApplicationStatus.bind(null, host, app)) + .then(function () { + return dial.getApplicationStatus(host, app) + }) .then(function getCurrentAppState(result) { if(!result || !result.state) { return Q.reject(new Error("Error retrieving current " + app + " application state")); diff --git a/server/tests/js_tests/tests/stopApplicationInHiddenState.js b/server/tests/js_tests/tests/stopApplicationInHiddenState.js index a8c23fd..9ea0898 100644 --- a/server/tests/js_tests/tests/stopApplicationInHiddenState.js +++ b/server/tests/js_tests/tests/stopApplicationInHiddenState.js @@ -61,7 +61,9 @@ function test() { .delay(timeToWaitForStateChange); } }) - .then(dial.getApplicationStatus.bind(null, host, app)) + .then(function () { + return dial.getApplicationStatus(host, app) + }) .then(function checkAppStatus(result) { if(!result || !result.state) { return Q.reject(new Error("Could not retrieve current " + app + " application state")); @@ -78,7 +80,9 @@ function test() { } }) .delay(timeToWaitForStateChange) - .then(dial.getApplicationStatus.bind(null, host, app)) + .then(function () { + return dial.getApplicationStatus(host, app) + }) .then(function checkAppStatus(result) { if(!result || !result.state) { return Q.reject(new Error("Could not retrieve current " + app + " application state")); diff --git a/server/tests/js_tests/tests/stopApplicationInRunningState.js b/server/tests/js_tests/tests/stopApplicationInRunningState.js index 90e1f29..8710153 100644 --- a/server/tests/js_tests/tests/stopApplicationInRunningState.js +++ b/server/tests/js_tests/tests/stopApplicationInRunningState.js @@ -53,7 +53,9 @@ function test() { } }) .delay(timeToWaitForStateChange) - .then(dial.getApplicationStatus.bind(null, host, app)) + .then(function () { + return dial.getApplicationStatus(host, app) + }) .then(function getCurrentAppState(result) { if(!result || !result.state) { return Q.reject(new Error("Error retrieving current " + app + " application state")); @@ -70,7 +72,9 @@ function test() { } }) .delay(timeToWaitForStateChange) - .then(dial.getApplicationStatus.bind(null, host, app)) + .then(function () { + return dial.getApplicationStatus(host, app) + }) .then(function getCurrentAppState(result) { if(!result || !result.state) { return Q.reject(new Error("Error retrieving current " + app + " application state")); diff --git a/server/tests/js_tests/tests/stopApplicationInStoppedState.js b/server/tests/js_tests/tests/stopApplicationInStoppedState.js index fa048c8..4f83f29 100644 --- a/server/tests/js_tests/tests/stopApplicationInStoppedState.js +++ b/server/tests/js_tests/tests/stopApplicationInStoppedState.js @@ -64,7 +64,9 @@ function test() { return new Q() .then(dial.launchApplication.bind(null, host, app)) .delay(timeToWaitForStateChange) - .then(dial.getApplicationStatus.bind(null, host, app)) + .then(function () { + return dial.getApplicationStatus(host, app) + }) .then(function getCurrentAppState(result) { if(!result || !result.state) { return Q.reject(new Error("Could not retrieve current " + app + " application state")); @@ -97,7 +99,9 @@ function test() { } }) .delay(timeToWaitForStateChange) - .then(dial.getApplicationStatus.bind(null, host, app)) + .then(function () { + return dial.getApplicationStatus(host, app) + }) .then(function getCurrentAppState(result) { if(!result || !result.state) { return Q.reject(new Error("Could not retrieve current " + app + " application state"));