From 8fa3955f861fe1486c90580094eca11351f256d1 Mon Sep 17 00:00:00 2001 From: Hovsep Mkrtchyan Date: Thu, 19 May 2016 14:50:47 -0700 Subject: [PATCH] Changed the url for LROS and paging on the test server --- AutoRest/TestServer/server/routes/lros.js | 88 ++++++++++----------- AutoRest/TestServer/server/routes/paging.js | 18 ++--- 2 files changed, 53 insertions(+), 53 deletions(-) diff --git a/AutoRest/TestServer/server/routes/lros.js b/AutoRest/TestServer/server/routes/lros.js index ca11fa50082be..84300f3be69a0 100644 --- a/AutoRest/TestServer/server/routes/lros.js +++ b/AutoRest/TestServer/server/routes/lros.js @@ -58,7 +58,7 @@ var lros = function (coverage) { coverage['LROPut202Retry200'] = 0; router.put('/put/202/retry/200', function (req, res, next) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/put/202/retry/operationResults/200'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/put/202/retry/operationResults/200'; var headers = { 'Location': pollingUri }; @@ -146,7 +146,7 @@ var lros = function (coverage) { var scenario = getLROAsyncScenarioName("putasync", retry, finalState); if (scenario) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/putasync/' + retry + '/' + finalState.toLowerCase() + '/operationResults/200/'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/putasync/' + retry + '/' + finalState.toLowerCase() + '/operationResults/200/'; var headers = { 'Azure-AsyncOperation': pollingUri, 'Location': pollingUri @@ -183,7 +183,7 @@ var lros = function (coverage) { var scenario = getLROAsyncScenarioName(operation, retry, finalState); console.log('In scenario: ' + scenario + '\n'); if (scenario) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/' + operation + '/' + retry + '/' + finalState.toLowerCase() + '/operationResults/' + code; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/' + operation + '/' + retry + '/' + finalState.toLowerCase() + '/operationResults/' + code; var headers = { 'Azure-AsyncOperation': pollingUri, 'Location': pollingUri @@ -206,7 +206,7 @@ var lros = function (coverage) { coverage['LROPutNoHeaderInRetry'] = 0; router.put('/put/noheader/202/200', function (req, res, next) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/put/noheader/operationresults'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/put/noheader/operationresults'; var headers = { 'Location': pollingUri }; @@ -228,7 +228,7 @@ var lros = function (coverage) { coverage['LROPutAsyncNoHeaderInRetry'] = 0; router.put('/putasync/noheader/201/200', function (req, res, next) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/putasync/noheader/operationresults/123'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/putasync/noheader/operationresults/123'; var headers = { 'Azure-AsyncOperation': pollingUri, 'Location': 'somethingBadWhichShouldNotBeUsed' @@ -255,7 +255,7 @@ var lros = function (coverage) { coverage['LRODeleteNoHeaderInRetry'] = 0; router.delete('/delete/noheader', function (req, res, next) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/delete/noheader/operationresults/123'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/delete/noheader/operationresults/123'; var headers = { 'Location': pollingUri }; @@ -277,7 +277,7 @@ var lros = function (coverage) { coverage['LRODeleteAsyncNoHeaderInRetry'] = 0; router.delete('/deleteasync/noheader/202/204', function (req, res, next) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/deleteasync/noheader/operationresults/123'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/deleteasync/noheader/operationresults/123'; var headers = { 'Azure-AsyncOperation': pollingUri, 'Location': 'somethingBadWhichShouldNotBeUsed' @@ -300,7 +300,7 @@ var lros = function (coverage) { coverage['LROPutSubResourceInRetry'] = 0; router.put('/putsubresource/202/200', function (req, res, next) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/putsubresource/operationresults'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/putsubresource/operationresults'; var headers = { 'Location': pollingUri }; @@ -322,7 +322,7 @@ var lros = function (coverage) { coverage['LROPutSubResourceAsyncInRetry'] = 0; router.put('/putsubresourceasync/202/200', function (req, res, next) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/putsubresourceasync/operationresults/123'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/putsubresourceasync/operationresults/123'; var headers = { 'Azure-AsyncOperation': pollingUri, 'Location': 'somethingBadWhichShouldNotBeUsed' @@ -349,7 +349,7 @@ var lros = function (coverage) { coverage['LROPutNonResourceInRetry'] = 0; router.put('/putnonresource/202/200', function (req, res, next) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/putnonresource/operationresults'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/putnonresource/operationresults'; var headers = { 'Location': pollingUri }; @@ -371,7 +371,7 @@ var lros = function (coverage) { coverage['LROPutNonResourceAsyncInRetry'] = 0; router.put('/putnonresourceasync/202/200', function (req, res, next) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/putnonresourceasync/operationresults/123'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/putnonresourceasync/operationresults/123'; var headers = { 'Azure-AsyncOperation': pollingUri, 'Location': 'somethingBadWhichShouldNotBeUsed' @@ -419,7 +419,7 @@ var lros = function (coverage) { var finalCode = JSON.parse(req.params.finalCode); var scenario = getLRODeleteProvisioningScenarioName(initialCode, initialState, finalCode, finalState); if (scenario) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/delete/provisioning/' + initialCode + '/' + initialState.toLowerCase() + '/' + finalCode + '/' + finalState.toLowerCase(); + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/delete/provisioning/' + initialCode + '/' + initialState.toLowerCase() + '/' + finalCode + '/' + finalState.toLowerCase(); var headers = { 'Location': pollingUri, 'Retry-After': 0 @@ -469,7 +469,7 @@ var lros = function (coverage) { var finalCode = JSON.parse(req.params.finalCode); var scenario = getLRODeleteScenarioName(initialCode, retry, finalCode); if (scenario) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/delete/' + initialCode + '/' + retry + '/' + finalCode; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/delete/' + initialCode + '/' + retry + '/' + finalCode; var headers = { 'Location': pollingUri }; @@ -505,7 +505,7 @@ var lros = function (coverage) { var scenario = getLROAsyncScenarioName("deleteasync", retry, finalState); if (scenario) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/deleteasync/' + retry + '/' + finalState.toLowerCase() + '/operationResults/200/'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/deleteasync/' + retry + '/' + finalState.toLowerCase() + '/operationResults/200/'; var headers = { 'Azure-AsyncOperation': pollingUri, 'Location': pollingUri @@ -530,7 +530,7 @@ var lros = function (coverage) { var scenario = getLROAsyncScenarioName(operation, retry, finalState); console.log('In scenario: ' + scenario + '\n'); if (scenario) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/' + operation + '/' + retry + '/' + finalState.toLowerCase() + '/operationResults/' + code; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/' + operation + '/' + retry + '/' + finalState.toLowerCase() + '/operationResults/' + code; var headers = { 'Azure-AsyncOperation': pollingUri, 'Location': pollingUri @@ -568,7 +568,7 @@ var lros = function (coverage) { var finalCode = JSON.parse(req.params.finalCode); var scenario = getLROPostScenarioName(initialCode, retry, finalCode); if (scenario) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/post/' + initialCode + '/' + retry + '/' + finalCode; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/post/' + initialCode + '/' + retry + '/' + finalCode; var headers = { 'Location': pollingUri }; @@ -588,7 +588,7 @@ var lros = function (coverage) { var finalCode = JSON.parse(req.params.finalCode); var scenario = getLROPostScenarioName(initialCode, retry, finalCode); if (scenario) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/post/newuri/' + initialCode + '/' + retry + '/' + finalCode; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/post/newuri/' + initialCode + '/' + retry + '/' + finalCode; var headers = { 'Location': pollingUri }; @@ -621,7 +621,7 @@ var lros = function (coverage) { coverage['LROPost200'] = 0; router.post('/post/payload/200', function (req, res, next) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/post/payload/200'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/post/payload/200'; var headers = { 'Location': pollingUri, 'Retry-After' : 0 @@ -646,7 +646,7 @@ var lros = function (coverage) { var scenario = getLROAsyncScenarioName("postasync", retry, finalState); if (scenario) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/postasync/' + retry + '/' + finalState.toLowerCase() + '/operationResults/200/'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/postasync/' + retry + '/' + finalState.toLowerCase() + '/operationResults/200/'; var headers = { 'Azure-AsyncOperation': pollingUri, 'Location': pollingUri @@ -671,7 +671,7 @@ var lros = function (coverage) { var scenario = getLROAsyncScenarioName(operation, retry, finalState); console.log('In scenario: ' + scenario + '\n'); if (scenario) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/' + operation + '/' + retry + '/' + finalState.toLowerCase() + '/operationResults/' + code; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/' + operation + '/' + retry + '/' + finalState.toLowerCase() + '/operationResults/' + code; var headers = { 'Azure-AsyncOperation': pollingUri, 'Location': pollingUri @@ -736,7 +736,7 @@ var lros = function (coverage) { coverage['LRORetryErrorPutAsyncSucceededPolling'] = 0; router.put('/retryerror/putasync/retry/succeeded', function (req, res, next) { var scenario = 'LRORetryErrorPutAsyncSucceeded'; - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/retryerror/putasync/retry/succeeded/operationResults/200'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/retryerror/putasync/retry/succeeded/operationResults/200'; var headers = { 'Azure-AsyncOperation': pollingUri, 'Location': pollingUri, @@ -782,7 +782,7 @@ var lros = function (coverage) { addScenarioCookie(res, scenario); res.status(500).end(); } else { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/retryerror/delete/provisioning/202/accepted/200/succeeded'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/retryerror/delete/provisioning/202/accepted/200/succeeded'; var headers = { 'Location': pollingUri }; @@ -811,7 +811,7 @@ var lros = function (coverage) { addScenarioCookie(res, scenario); res.status(500).end(); } else { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/retryerror/delete/202/retry/200'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/retryerror/delete/202/retry/200'; var headers = { 'Location': pollingUri }; @@ -840,7 +840,7 @@ var lros = function (coverage) { addScenarioCookie(res, scenario); res.status(500).end(); } else { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/retryerror/deleteasync/retry/succeeded/operationResults/200'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/retryerror/deleteasync/retry/succeeded/operationResults/200'; var headers = { 'Location': '/foo', 'Azure-AsyncOperation': pollingUri, @@ -870,7 +870,7 @@ var lros = function (coverage) { addScenarioCookie(res, scenario); res.status(500).end(); } else { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/retryerror/post/202/retry/200/operationResults'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/retryerror/post/202/retry/200/operationResults'; var headers = { 'Location': pollingUri }; @@ -899,7 +899,7 @@ var lros = function (coverage) { addScenarioCookie(res, scenario); res.status(500).end(); } else { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/retryerror/postasync/retry/succeeded/operationResults/200'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/retryerror/postasync/retry/succeeded/operationResults/200'; var headers = { 'Location': '/foo', 'Azure-AsyncOperation': pollingUri, @@ -953,7 +953,7 @@ var lros = function (coverage) { coverage['LRONonRetryPutAsyncRetry400'] = 0; router.put('/nonretryerror/putasync/retry/400', function (req, res, next) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/nonretryerror/putasync/retry/failed/operationResults/400'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/nonretryerror/putasync/retry/failed/operationResults/400'; var headers = { 'Azure-AsyncOperation': pollingUri, 'Location': pollingUri, @@ -975,7 +975,7 @@ var lros = function (coverage) { coverage['LRONonRetryDelete202Retry400'] = 0; router.delete('/nonretryerror/delete/202/retry/400', function (req, res, next) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/nonretryerror/delete/202/retry/400'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/nonretryerror/delete/202/retry/400'; var headers = { 'Location': pollingUri, 'Retry-After': 0 @@ -990,7 +990,7 @@ var lros = function (coverage) { coverage['LRONonRetryDeleteAsyncRetry400'] = 0; router.delete('/nonretryerror/deleteasync/retry/400', function (req, res, next) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/nonretryerror/deleteasync/retry/failed/operationResults/400'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/nonretryerror/deleteasync/retry/failed/operationResults/400'; var headers = { 'Azure-AsyncOperation': pollingUri, 'Location': pollingUri, @@ -1012,7 +1012,7 @@ var lros = function (coverage) { coverage['LRONonRetryPost202Retry400'] = 0; router.post('/nonretryerror/post/202/retry/400', function (req, res, next) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/nonretryerror/post/202/retry/400'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/nonretryerror/post/202/retry/400'; var headers = { 'Location': pollingUri, 'Retry-After': 0 @@ -1027,7 +1027,7 @@ var lros = function (coverage) { coverage['LRONonRetryPostAsyncRetry400'] = 0; router.post('/nonretryerror/postasync/retry/400', function (req, res, next) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/nonretryerror/postasync/retry/failed/operationResults/400'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/nonretryerror/postasync/retry/failed/operationResults/400'; var headers = { 'Azure-AsyncOperation': pollingUri, 'Location': pollingUri, @@ -1054,7 +1054,7 @@ var lros = function (coverage) { coverage['LROErrorPutAsyncNoPollingStatus'] = 0; router.put('/error/putasync/retry/nostatus', function (req, res, next) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/error/putasync/retry/failed/operationResults/nostatus'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/error/putasync/retry/failed/operationResults/nostatus'; var headers = { 'Azure-AsyncOperation': pollingUri, 'Location': pollingUri, @@ -1074,7 +1074,7 @@ var lros = function (coverage) { coverage['LROErrorPutAsyncNoPollingStatusPayload'] = 0; router.put('/error/putasync/retry/nostatuspayload', function (req, res, next) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/error/putasync/retry/failed/operationResults/nostatuspayload'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/error/putasync/retry/failed/operationResults/nostatuspayload'; var headers = { 'Azure-AsyncOperation': pollingUri, 'Location': pollingUri, @@ -1116,7 +1116,7 @@ var lros = function (coverage) { coverage['LROErrorPutAsyncInvalidJsonPolling'] = 0; router.put('/error/putasync/retry/invalidjsonpolling', function (req, res, next) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/error/putasync/retry/failed/operationResults/invalidjsonpolling'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/error/putasync/retry/failed/operationResults/invalidjsonpolling'; var headers = { 'Azure-AsyncOperation': pollingUri, 'Location': pollingUri, @@ -1149,7 +1149,7 @@ var lros = function (coverage) { coverage['LROErrorDeleteAsyncNoPollingStatus'] = 0; router.delete('/error/deleteasync/retry/nostatus', function (req, res, next) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/error/deleteasync/retry/failed/operationResults/nostatus'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/error/deleteasync/retry/failed/operationResults/nostatus'; var headers = { 'Azure-AsyncOperation': pollingUri, 'Location': pollingUri, @@ -1177,7 +1177,7 @@ var lros = function (coverage) { coverage['LROErrorDeleteAsyncInvalidJsonPolling'] = 0; router.delete('/error/deleteasync/retry/invalidjsonpolling', function (req, res, next) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/error/deleteasync/retry/failed/operationResults/invalidjsonpolling'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/error/deleteasync/retry/failed/operationResults/invalidjsonpolling'; var headers = { 'Azure-AsyncOperation': pollingUri, 'Location': pollingUri, @@ -1210,7 +1210,7 @@ var lros = function (coverage) { coverage['LROErrorPostAsyncNoPollingPayload'] = 0; router.post('/error/postasync/retry/nopayload', function (req, res, next) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/error/postasync/retry/failed/operationResults/nopayload'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/error/postasync/retry/failed/operationResults/nopayload'; var headers = { 'Azure-AsyncOperation': pollingUri, 'Location': pollingUri, @@ -1238,7 +1238,7 @@ var lros = function (coverage) { coverage['LROErrorPostAsyncInvalidJsonPolling'] = 0; router.post('/error/postasync/retry/invalidjsonpolling', function (req, res, next) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/error/postasync/retry/failed/operationResults/invalidjsonpolling'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/error/postasync/retry/failed/operationResults/invalidjsonpolling'; var headers = { 'Azure-AsyncOperation': pollingUri, 'Location': pollingUri, @@ -1255,7 +1255,7 @@ var lros = function (coverage) { router.put('/customheader/putasync/retry/succeeded', function (req, res, next) { var header = req.get("x-ms-client-request-id"); if (header && header.toLowerCase() === "9C4D50EE-2D56-4CD3-8152-34347DC9F2B0".toLowerCase()) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/customheader/putasync/retry/succeeded/operationResults/200'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/customheader/putasync/retry/succeeded/operationResults/200'; var headers = { 'Azure-AsyncOperation': pollingUri, 'Location': pollingUri @@ -1281,7 +1281,7 @@ var lros = function (coverage) { var header = req.get("x-ms-client-request-id"); var scenario = 'CustomHeaderPutAsyncSucceded'; if (header && header.toLowerCase() === "9C4D50EE-2D56-4CD3-8152-34347DC9F2B0".toLowerCase()) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/customheader/putasync/retry/succeeded/operationResults/200'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/customheader/putasync/retry/succeeded/operationResults/200'; var headers = { 'Azure-AsyncOperation': pollingUri, 'Location': pollingUri @@ -1303,7 +1303,7 @@ var lros = function (coverage) { router.post('/customheader/postasync/retry/succeeded', function (req, res, next) { var header = req.get("x-ms-client-request-id"); if (header && header.toLowerCase() === "9C4D50EE-2D56-4CD3-8152-34347DC9F2B0".toLowerCase()) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/customheader/postasync/retry/succeeded/operationResults/200'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/customheader/postasync/retry/succeeded/operationResults/200'; var headers = { 'Azure-AsyncOperation': pollingUri, 'Location': pollingUri @@ -1319,7 +1319,7 @@ var lros = function (coverage) { var header = req.get("x-ms-client-request-id"); var scenario = 'CustomHeaderPostAsyncSucceded'; if (header && header.toLowerCase() === "9C4D50EE-2D56-4CD3-8152-34347DC9F2B0".toLowerCase()) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/customheader/postasync/retry/succeeded/operationResults/200'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/customheader/postasync/retry/succeeded/operationResults/200'; var headers = { 'Azure-AsyncOperation': pollingUri, 'Location': pollingUri @@ -1364,7 +1364,7 @@ var lros = function (coverage) { var scenario = 'CustomHeaderPostSucceeded'; var header = req.get("x-ms-client-request-id"); if (header && header.toLowerCase() === "9C4D50EE-2D56-4CD3-8152-34347DC9F2B0".toLowerCase()) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/customheader/post/202/retry/200'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/customheader/post/202/retry/200'; var headers = { 'Location': pollingUri }; @@ -1379,7 +1379,7 @@ var lros = function (coverage) { var scenario = 'CustomHeaderPostSucceeded'; var header = req.get("x-ms-client-request-id"); if (header && header.toLowerCase() === "9C4D50EE-2D56-4CD3-8152-34347DC9F2B0".toLowerCase()) { - var pollingUri = 'http://localhost.:' + utils.getPort() + '/lro/customheader/post/newuri/202/retry/200'; + var pollingUri = 'http://localhost:' + utils.getPort() + '/lro/customheader/post/newuri/202/retry/200'; var headers = { 'Location': pollingUri }; diff --git a/AutoRest/TestServer/server/routes/paging.js b/AutoRest/TestServer/server/routes/paging.js index dc435ecfb21f8..953fbf0fc1ff3 100644 --- a/AutoRest/TestServer/server/routes/paging.js +++ b/AutoRest/TestServer/server/routes/paging.js @@ -46,12 +46,12 @@ var paging = function(coverage) { router.get('/multiple', function(req, res, next) { coverage["PagingMultiple"]++; - res.status(200).end('{ "values" : [ {"properties":{"id": 1, "name": "Product" }}], "nextLink":"' + 'http://localhost.:' + utils.getPort() + '/paging/multiple/page/2" }') + res.status(200).end('{ "values" : [ {"properties":{"id": 1, "name": "Product" }}], "nextLink":"' + 'http://localhost:' + utils.getPort() + '/paging/multiple/page/2" }') }); router.get('/multiple/page/:pagenumber', function(req, res, next) { if (req.params.pagenumber < 10) { - res.status(200).end('{ "values": [ {"properties":{"id" : ' + req.params.pagenumber + ', "name": "product"}} ], "nextLink": "' + 'http://localhost.:' + utils.getPort() + '/paging/multiple/page/' + (++req.params.pagenumber) + '"}'); + res.status(200).end('{ "values": [ {"properties":{"id" : ' + req.params.pagenumber + ', "name": "product"}} ], "nextLink": "' + 'http://localhost:' + utils.getPort() + '/paging/multiple/page/' + (++req.params.pagenumber) + '"}'); } else { res.status(200).end('{"values": [ {"properties":{"id" : ' + req.params.pagenumber + ', "name": "product"}} ]}'); } @@ -60,12 +60,12 @@ var paging = function(coverage) { router.get('/multiple/withpath/:offset', function(req, res, next) { coverage["PagingMultiplePath"]++; - res.status(200).end('{ "values" : [ {"properties":{"id": 1, "name": "Product" }}], "nextLink":"' + 'http://localhost.:' + utils.getPort() + '/paging/multiple/withpath/page/' + req.params.offset + '/2" }'); + res.status(200).end('{ "values" : [ {"properties":{"id": 1, "name": "Product" }}], "nextLink":"' + 'http://localhost:' + utils.getPort() + '/paging/multiple/withpath/page/' + req.params.offset + '/2" }'); }); router.get('/multiple/withpath/page/:offset/:pagenumber', function(req, res, next) { if (req.params.pagenumber < 10) { - res.status(200).end('{ "values": [ {"properties":{"id" : ' + (parseInt(req.params.pagenumber) + parseInt(req.params.offset)) + ', "name": "product"}} ], "nextLink": "' + 'http://localhost.:' + utils.getPort() + '/paging/multiple/withpath/page/' + req.params.offset + "/" + (++req.params.pagenumber) + '"}'); + res.status(200).end('{ "values": [ {"properties":{"id" : ' + (parseInt(req.params.pagenumber) + parseInt(req.params.offset)) + ', "name": "product"}} ], "nextLink": "' + 'http://localhost:' + utils.getPort() + '/paging/multiple/withpath/page/' + req.params.offset + "/" + (++req.params.pagenumber) + '"}'); } else { res.status(200).end('{"values": [ {"properties":{"id" : ' + (parseInt(req.params.pagenumber) + parseInt(req.params.offset)) + ', "name": "product"}} ]}'); } @@ -79,12 +79,12 @@ var paging = function(coverage) { } else { coverage[scenario]++; removeScenarioCookie(res); - res.status(200).end('{ "values" : [ {"properties":{"id": 1, "name": "Product" }}], "nextLink": "' + 'http://localhost.:' + utils.getPort() + '/paging/multiple/page/2" }') + res.status(200).end('{ "values" : [ {"properties":{"id": 1, "name": "Product" }}], "nextLink": "' + 'http://localhost:' + utils.getPort() + '/paging/multiple/page/2" }') } }); router.get('/multiple/retrysecond', function(req, res, next) { - res.status(200).end('{ "values" : [ {"properties":{"id": 1, "name": "Product" }}], "nextLink": "' + 'http://localhost.:' + utils.getPort() + '/paging/multiple/retrysecond/page/2" }') + res.status(200).end('{ "values" : [ {"properties":{"id": 1, "name": "Product" }}], "nextLink": "' + 'http://localhost:' + utils.getPort() + '/paging/multiple/retrysecond/page/2" }') }); router.get('/multiple/retrysecond/page/:pagenumber', function(req, res, next) { @@ -96,10 +96,10 @@ var paging = function(coverage) { } else { coverage[scenario]++; removeScenarioCookie(res); - res.status(200).end('{ "values" : [ {"properties":{"id": 1, "name": "Product" }}], "nextLink": "' + 'http://localhost.:' + utils.getPort() + '/paging/multiple/retrysecond/page/3" }') + res.status(200).end('{ "values" : [ {"properties":{"id": 1, "name": "Product" }}], "nextLink": "' + 'http://localhost:' + utils.getPort() + '/paging/multiple/retrysecond/page/3" }') } } else if (req.params.pagenumber < 10) { - res.status(200).end('{ "values": [ {"properties":{"id" : ' + req.params.pagenumber + ', "name": "product"}} ], "nextLink": "' + 'http://localhost.:' + utils.getPort() + '/paging/multiple/retrysecond/page/' + (++req.params.pagenumber) + '"}'); + res.status(200).end('{ "values": [ {"properties":{"id" : ' + req.params.pagenumber + ', "name": "product"}} ], "nextLink": "' + 'http://localhost:' + utils.getPort() + '/paging/multiple/retrysecond/page/' + (++req.params.pagenumber) + '"}'); } else { res.status(200).end('{"values": [ {"properties":{"id" : ' + req.params.pagenumber + ', "name": "product"}} ]}'); } @@ -113,7 +113,7 @@ var paging = function(coverage) { router.get('/multiple/failure', function(req, res, next) { coverage["PagingMultipleFailure"]++; - res.status(200).end('{ "values" : [ {"properties":{"id": 1, "name": "Product" }}], "nextLink": "' + 'http://localhost.:' + utils.getPort() + '/paging/multiple/failure/page/2" }') + res.status(200).end('{ "values" : [ {"properties":{"id": 1, "name": "Product" }}], "nextLink": "' + 'http://localhost:' + utils.getPort() + '/paging/multiple/failure/page/2" }') }); router.get('/multiple/failure/page/:pagenumber', function(req, res, next) {