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

quanli1@huawei.com

Signed-off-by: Nquanli <quanli1@huawei.com>
上级 1e02ff3e
......@@ -231,15 +231,22 @@ describe('geolocationTest_geo1', function () {
*/
it('SUB_HSS_LocationSystem_Geo_0600', 0, async function (done) {
let reverseGeocodeRequest1 = { "latitude": 90, "longitude": 121.62771, "maxItems": 1 };
try {
await geolocation.getAddressesFromLocation(reverseGeocodeRequest1).then((data) => {
console.info('[lbs_js] getAddressesFromLocation0601 promise: ' + JSON.stringify(data));
expect(true).assertEqual((JSON.stringify(data)) != null);
}).catch(error => {
console.info("[lbs_js] getAddressesFromLocation0601 promise then error." + JSON.stringify(error));
console.info('[lbs_js] not support now');
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 };
try {
await geolocation.getAddressesFromLocation(reverseGeocodeRequest2).then((data) => {
console.info('[lbs_js] getAddressesFromLocation promise: ' + JSON.stringify(data));
expect(data.length).assertEqual(0);
......@@ -247,7 +254,13 @@ describe('geolocationTest_geo1', function () {
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 };
try {
await geolocation.getAddressesFromLocation(reverseGeocodeRequest3).then((data) => {
console.info('[lbs_js] getAddressesFromLocation0603 promise: ' + JSON.stringify(data));
expect(true).assertEqual((JSON.stringify(data)) != null);
......@@ -256,7 +269,12 @@ describe('geolocationTest_geo1', function () {
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 };
try {
await geolocation.getAddressesFromLocation(reverseGeocodeRequest4).then((data) => {
console.info('[lbs_js] getAddressesFromLocation0604 promise: ' + JSON.stringify(data));
expect(data.length).assertEqual(0);
......@@ -264,7 +282,11 @@ describe('geolocationTest_geo1', function () {
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,6 +299,7 @@ describe('geolocationTest_geo1', function () {
*/
it('SUB_HSS_LocationSystem_Geo_0700', 0, async function (done) {
let reverseGeocodeRequest = { "latitude": 31.265496, "longitude": 180, "maxItems": 1 };
try {
await geolocation.getAddressesFromLocation(reverseGeocodeRequest).then((data) => {
console.info('[lbs_js] getAddressesFromLocation0701 promise: ' + JSON.stringify(data));
expect(true).assertEqual((JSON.stringify(data)) != null);
......@@ -285,7 +308,12 @@ describe('geolocationTest_geo1', function () {
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 };
try {
await geolocation.getAddressesFromLocation(reverseGeocodeRequest1).then((data) => {
console.info('[lbs_js] getAddressesFromLocation0702 promise: ' + JSON.stringify(data));
expect(data.length).assertEqual(0);
......@@ -293,7 +321,12 @@ describe('geolocationTest_geo1', function () {
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 };
try {
await geolocation.getAddressesFromLocation(reverseGeocodeRequest2).then((data) => {
console.info('[lbs_js] getAddressesFromLocation0703 promise: ' + JSON.stringify(data));
expect(true).assertEqual((JSON.stringify(data)) != null);
......@@ -302,7 +335,12 @@ describe('geolocationTest_geo1', function () {
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 };
try {
await geolocation.getAddressesFromLocation(reverseGeocodeRequest3).then((data) => {
console.info('[lbs_js] getAddressesFromLocation0704 promise: ' + JSON.stringify(data));
expect(data.length).assertEqual(0);
......@@ -310,7 +348,11 @@ describe('geolocationTest_geo1', function () {
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 () {
})
})
......@@ -508,6 +508,7 @@ describe('geolocationTest_geo3', function () {
*/
it('SUB_HSS_SendCommand_0100', 0, async function (done) {
let requestInfo = { 'scenairo': 0x301, 'command': "command_1" };
try {
await geolocation.sendCommand(requestInfo, (err, result) => {
if (err) {
console.info('sendcommand callback err:' + JSON.stringify(err));
......@@ -516,6 +517,11 @@ describe('geolocationTest_geo3', function () {
}
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,6 +534,7 @@ describe('geolocationTest_geo3', function () {
*/
it('SUB_HSS_SendCommand_0200', 0, async function (done) {
let requestInfo = { 'scenairo': 0x301, 'command': "command_1" };
try {
geolocation.sendCommand(requestInfo).then((result) => {
console.info('sendCommand promise result:' + result);
done();
......@@ -536,6 +543,11 @@ describe('geolocationTest_geo3', function () {
expect(true).assertEqual(JSON.stringify(error) != null);
done();
})
} catch (error) {
console.info('sendcommand promise err:' + JSON.stringify(error));
expect(true).assertEqual(JSON.stringify(error) != null);
}
done();
})
/**
......@@ -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.
先完成此消息的编辑!
想要评论请 注册