rectify error in sending clientDialVer in application status query

This commit is contained in:
Shruti Ranganathan Jothi
2017-03-08 12:57:50 -08:00
parent 6a0edc87dc
commit 11e4eaf2ac
11 changed files with 47 additions and 16 deletions

View File

@@ -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) {

View File

@@ -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"));

View File

@@ -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"));

View File

@@ -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"));

View File

@@ -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"));

View File

@@ -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"));

View File

@@ -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"));

View File

@@ -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"));

View File

@@ -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"));

View File

@@ -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"));

View File

@@ -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"));