提交 71834f96 编写于 作者: Q quanli

quanli1@huawei.com

Signed-off-by: Nquanli <quanli1@huawei.com>
上级 1e02ff3e
...@@ -231,40 +231,62 @@ describe('geolocationTest_geo1', function () { ...@@ -231,40 +231,62 @@ describe('geolocationTest_geo1', function () {
*/ */
it('SUB_HSS_LocationSystem_Geo_0600', 0, async function (done) { it('SUB_HSS_LocationSystem_Geo_0600', 0, async function (done) {
let reverseGeocodeRequest1 = { "latitude": 90, "longitude": 121.62771, "maxItems": 1 }; let reverseGeocodeRequest1 = { "latitude": 90, "longitude": 121.62771, "maxItems": 1 };
await geolocation.getAddressesFromLocation(reverseGeocodeRequest1).then((data) => { try {
console.info('[lbs_js] getAddressesFromLocation0601 promise: ' + JSON.stringify(data)); await geolocation.getAddressesFromLocation(reverseGeocodeRequest1).then((data) => {
expect(true).assertEqual((JSON.stringify(data)) != null); console.info('[lbs_js] getAddressesFromLocation0601 promise: ' + JSON.stringify(data));
}).catch(error => { expect(true).assertEqual((JSON.stringify(data)) != null);
console.info("[lbs_js] getAddressesFromLocation0601 promise then error." + JSON.stringify(error)); }).catch(error => {
console.info('[lbs_js] not support now'); console.info("[lbs_js] getAddressesFromLocation0601 promise then error." + JSON.stringify(error));
expect(true).assertEqual(JSON.stringify(error) != null); expect(true).assertEqual(JSON.stringify(error) != null);
}); console.info('[lbs_js] not support now');
});
} catch (error) {
console.info("[lbs_js] getAddressesFromLocation message." + JSON.stringify(error.message));
expect(true).assertEqual((JSON.stringify(error.message)) != null);
}
let reverseGeocodeRequest2 = { "latitude": 90.1, "longitude": 121.62771, "maxItems": 1 }; let reverseGeocodeRequest2 = { "latitude": 90.1, "longitude": 121.62771, "maxItems": 1 };
await geolocation.getAddressesFromLocation(reverseGeocodeRequest2).then((data) => { try {
console.info('[lbs_js] getAddressesFromLocation promise: ' + JSON.stringify(data)); await geolocation.getAddressesFromLocation(reverseGeocodeRequest2).then((data) => {
expect(data.length).assertEqual(0); console.info('[lbs_js] getAddressesFromLocation promise: ' + JSON.stringify(data));
}).catch(error => { expect(data.length).assertEqual(0);
console.info("[lbs_js] getAddressesFromLocation0602 promise then error." + JSON.stringify(error)); }).catch(error => {
expect(true).assertEqual((JSON.stringify(error)) != null); console.info("[lbs_js] getAddressesFromLocation0602 promise then error." + JSON.stringify(error));
}); expect(true).assertEqual((JSON.stringify(error)) != null);
});
} catch (error) {
console.info("[lbs_js] getAddressesFromLocation message." + JSON.stringify(error.message));
expect(true).assertEqual((JSON.stringify(error.message)) != null);
}
let reverseGeocodeRequest3 = { "latitude": -90, "longitude": 121.62771, "maxItems": 1 }; let reverseGeocodeRequest3 = { "latitude": -90, "longitude": 121.62771, "maxItems": 1 };
await geolocation.getAddressesFromLocation(reverseGeocodeRequest3).then((data) => { try {
console.info('[lbs_js] getAddressesFromLocation0603 promise: ' + JSON.stringify(data)); await geolocation.getAddressesFromLocation(reverseGeocodeRequest3).then((data) => {
expect(true).assertEqual((JSON.stringify(data)) != null); console.info('[lbs_js] getAddressesFromLocation0603 promise: ' + JSON.stringify(data));
}).catch(error => { expect(true).assertEqual((JSON.stringify(data)) != null);
console.info("[lbs_js] getAddressesFromLocation0603 promise then error." + JSON.stringify(error)); }).catch(error => {
console.info('[lbs_js] not support now'); console.info("[lbs_js] getAddressesFromLocation0603 promise then error." + JSON.stringify(error));
expect(true).assertEqual(JSON.stringify(error) != null); console.info('[lbs_js] not support now');
}); expect(true).assertEqual(JSON.stringify(error) != null);
});
} catch (error) {
console.info("[lbs_js] getAddressesFromLocation message." + JSON.stringify(error.message));
expect(true).assertEqual((JSON.stringify(error.message)) != null);
}
let reverseGeocodeRequest4 = { "latitude": -90.1, "longitude": 121.62771, "maxItems": 1 }; let reverseGeocodeRequest4 = { "latitude": -90.1, "longitude": 121.62771, "maxItems": 1 };
await geolocation.getAddressesFromLocation(reverseGeocodeRequest4).then((data) => { try {
console.info('[lbs_js] getAddressesFromLocation0604 promise: ' + JSON.stringify(data)); await geolocation.getAddressesFromLocation(reverseGeocodeRequest4).then((data) => {
expect(data.length).assertEqual(0); console.info('[lbs_js] getAddressesFromLocation0604 promise: ' + JSON.stringify(data));
}).catch(error => { expect(data.length).assertEqual(0);
console.info("[lbs_js] getAddressesFromLocation0604 promise then error." + JSON.stringify(error)); }).catch(error => {
expect(true).assertEqual((JSON.stringify(error)) != null); console.info("[lbs_js] getAddressesFromLocation0604 promise then error." + JSON.stringify(error));
}); expect(true).assertEqual((JSON.stringify(error)) != null);
done() });
} catch (error) {
console.info("[lbs_js] getAddressesFromLocation message." + JSON.stringify(error.message));
expect(true).assertEqual((JSON.stringify(error.message)) != null);
}
done();
}) })
/** /**
...@@ -277,40 +299,60 @@ describe('geolocationTest_geo1', function () { ...@@ -277,40 +299,60 @@ describe('geolocationTest_geo1', function () {
*/ */
it('SUB_HSS_LocationSystem_Geo_0700', 0, async function (done) { it('SUB_HSS_LocationSystem_Geo_0700', 0, async function (done) {
let reverseGeocodeRequest = { "latitude": 31.265496, "longitude": 180, "maxItems": 1 }; let reverseGeocodeRequest = { "latitude": 31.265496, "longitude": 180, "maxItems": 1 };
await geolocation.getAddressesFromLocation(reverseGeocodeRequest).then((data) => { try {
console.info('[lbs_js] getAddressesFromLocation0701 promise: ' + JSON.stringify(data)); await geolocation.getAddressesFromLocation(reverseGeocodeRequest).then((data) => {
expect(true).assertEqual((JSON.stringify(data)) != null); console.info('[lbs_js] getAddressesFromLocation0701 promise: ' + JSON.stringify(data));
}).catch(error => { expect(true).assertEqual((JSON.stringify(data)) != null);
console.info("[lbs_js] getAddressesFromLocation0701 promise then error." + JSON.stringify(error)); }).catch(error => {
console.info('[lbs_js] not support now'); console.info("[lbs_js] getAddressesFromLocation0701 promise then error." + JSON.stringify(error));
expect(true).assertEqual(JSON.stringify(error) != null); console.info('[lbs_js] not support now');
}); expect(true).assertEqual(JSON.stringify(error) != null);
});
} catch (error) {
console.info("[lbs_js] getAddressesFromLocation message." + JSON.stringify(error.message));
expect(true).assertEqual((JSON.stringify(error.message)) != null);
}
let reverseGeocodeRequest1 = { "latitude": 31.265496, "longitude": -180.1, "maxItems": 1 }; let reverseGeocodeRequest1 = { "latitude": 31.265496, "longitude": -180.1, "maxItems": 1 };
await geolocation.getAddressesFromLocation(reverseGeocodeRequest1).then((data) => { try {
console.info('[lbs_js] getAddressesFromLocation0702 promise: ' + JSON.stringify(data)); await geolocation.getAddressesFromLocation(reverseGeocodeRequest1).then((data) => {
expect(data.length).assertEqual(0); console.info('[lbs_js] getAddressesFromLocation0702 promise: ' + JSON.stringify(data));
}).catch(error => { expect(data.length).assertEqual(0);
console.info("[lbs_js] getAddressesFromLocation0702 promise then error." + JSON.stringify(error)); }).catch(error => {
expect(true).assertEqual((JSON.stringify(error)) != null); console.info("[lbs_js] getAddressesFromLocation0702 promise then error." + JSON.stringify(error));
}); expect(true).assertEqual((JSON.stringify(error)) != null);
});
} catch (error) {
console.info("[lbs_js] getAddressesFromLocation message." + JSON.stringify(error.message));
expect(true).assertEqual((JSON.stringify(error.message)) != null);
}
let reverseGeocodeRequest2 = { "latitude": 31.265496, "longitude": 180, "maxItems": 1 }; let reverseGeocodeRequest2 = { "latitude": 31.265496, "longitude": 180, "maxItems": 1 };
await geolocation.getAddressesFromLocation(reverseGeocodeRequest2).then((data) => { try {
console.info('[lbs_js] getAddressesFromLocation0703 promise: ' + JSON.stringify(data)); await geolocation.getAddressesFromLocation(reverseGeocodeRequest2).then((data) => {
expect(true).assertEqual((JSON.stringify(data)) != null); console.info('[lbs_js] getAddressesFromLocation0703 promise: ' + JSON.stringify(data));
}).catch(error => { expect(true).assertEqual((JSON.stringify(data)) != null);
console.info("[lbs_js] getAddressesFromLocation0703 promise then error." + JSON.stringify(error)); }).catch(error => {
console.info('[lbs_js] not support now'); console.info("[lbs_js] getAddressesFromLocation0703 promise then error." + JSON.stringify(error));
expect(true).assertEqual(JSON.stringify(error) != null); console.info('[lbs_js] not support now');
}); expect(true).assertEqual(JSON.stringify(error) != null);
});
} catch (error) {
console.info("[lbs_js] getAddressesFromLocation message." + JSON.stringify(error.message));
expect(true).assertEqual((JSON.stringify(error.message)) != null);
}
let reverseGeocodeRequest3 = { "latitude": 31.265496, "longitude": 180.1, "maxItems": 1 }; let reverseGeocodeRequest3 = { "latitude": 31.265496, "longitude": 180.1, "maxItems": 1 };
await geolocation.getAddressesFromLocation(reverseGeocodeRequest3).then((data) => { try {
console.info('[lbs_js] getAddressesFromLocation0704 promise: ' + JSON.stringify(data)); await geolocation.getAddressesFromLocation(reverseGeocodeRequest3).then((data) => {
expect(data.length).assertEqual(0); console.info('[lbs_js] getAddressesFromLocation0704 promise: ' + JSON.stringify(data));
}).catch(error => { expect(data.length).assertEqual(0);
console.info("[lbs_js] getAddressesFromLocation0704 promise then error." + JSON.stringify(error)); }).catch(error => {
expect(true).assertEqual((JSON.stringify(error)) != null); console.info("[lbs_js] getAddressesFromLocation0704 promise then error." + JSON.stringify(error));
}); expect(true).assertEqual((JSON.stringify(error)) != null);
done() });
} catch (error) {
console.info("[lbs_js] getAddressesFromLocation message." + JSON.stringify(error.message));
expect(true).assertEqual((JSON.stringify(error.message)) != null);
}
done();
}) })
/** /**
...@@ -949,3 +991,4 @@ describe('geolocationTest_geo1', function () { ...@@ -949,3 +991,4 @@ describe('geolocationTest_geo1', function () {
}) })
}) })
...@@ -508,14 +508,20 @@ describe('geolocationTest_geo3', function () { ...@@ -508,14 +508,20 @@ describe('geolocationTest_geo3', function () {
*/ */
it('SUB_HSS_SendCommand_0100', 0, async function (done) { it('SUB_HSS_SendCommand_0100', 0, async function (done) {
let requestInfo = { 'scenairo': 0x301, 'command': "command_1" }; let requestInfo = { 'scenairo': 0x301, 'command': "command_1" };
await geolocation.sendCommand(requestInfo, (err, result) => { try {
if (err) { await geolocation.sendCommand(requestInfo, (err, result) => {
console.info('sendcommand callback err:' + JSON.stringify(err)); if (err) {
expect(true).assertEqual(JSON.stringify(err) != null); console.info('sendcommand callback err:' + JSON.stringify(err));
done(); expect(true).assertEqual(JSON.stringify(err) != null);
} done();
console.info('sendcommand callback result:' + JSON.stringify(result)); }
}); console.info('sendcommand callback result:' + JSON.stringify(result));
});
} catch (error) {
console.info('sendcommand callback err:' + JSON.stringify(error));
expect(true).assertEqual(JSON.stringify(error) != null);
}
done();
}) })
/** /**
...@@ -528,14 +534,20 @@ describe('geolocationTest_geo3', function () { ...@@ -528,14 +534,20 @@ describe('geolocationTest_geo3', function () {
*/ */
it('SUB_HSS_SendCommand_0200', 0, async function (done) { it('SUB_HSS_SendCommand_0200', 0, async function (done) {
let requestInfo = { 'scenairo': 0x301, 'command': "command_1" }; let requestInfo = { 'scenairo': 0x301, 'command': "command_1" };
geolocation.sendCommand(requestInfo).then((result) => { try {
console.info('sendCommand promise result:' + result); geolocation.sendCommand(requestInfo).then((result) => {
done(); console.info('sendCommand promise result:' + result);
}).catch(error => { done();
}).catch(error => {
console.info('sendcommand promise err:' + JSON.stringify(error));
expect(true).assertEqual(JSON.stringify(error) != null);
done();
})
} catch (error) {
console.info('sendcommand promise err:' + JSON.stringify(error)); console.info('sendcommand promise err:' + JSON.stringify(error));
expect(true).assertEqual(JSON.stringify(error) != null); expect(true).assertEqual(JSON.stringify(error) != null);
done(); }
}) done();
}) })
/** /**
...@@ -1249,3 +1261,4 @@ describe('geolocationTest_geo3', function () { ...@@ -1249,3 +1261,4 @@ describe('geolocationTest_geo3', function () {
}) })
}) })
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册