未验证 提交 1bb02829 编写于 作者: O openharmony_ci 提交者: Gitee

!7106 【location】适配失败用例

Merge pull request !7106 from 权力/myfeature2
...@@ -231,15 +231,22 @@ describe('geolocationTest_geo1', function () { ...@@ -231,15 +231,22 @@ 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 };
try {
await geolocation.getAddressesFromLocation(reverseGeocodeRequest1).then((data) => { await geolocation.getAddressesFromLocation(reverseGeocodeRequest1).then((data) => {
console.info('[lbs_js] getAddressesFromLocation0601 promise: ' + JSON.stringify(data)); console.info('[lbs_js] getAddressesFromLocation0601 promise: ' + JSON.stringify(data));
expect(true).assertEqual((JSON.stringify(data)) != null); expect(true).assertEqual((JSON.stringify(data)) != null);
}).catch(error => { }).catch(error => {
console.info("[lbs_js] getAddressesFromLocation0601 promise then error." + JSON.stringify(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); 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 };
try {
await geolocation.getAddressesFromLocation(reverseGeocodeRequest2).then((data) => { await geolocation.getAddressesFromLocation(reverseGeocodeRequest2).then((data) => {
console.info('[lbs_js] getAddressesFromLocation promise: ' + JSON.stringify(data)); console.info('[lbs_js] getAddressesFromLocation promise: ' + JSON.stringify(data));
expect(data.length).assertEqual(0); expect(data.length).assertEqual(0);
...@@ -247,7 +254,13 @@ describe('geolocationTest_geo1', function () { ...@@ -247,7 +254,13 @@ describe('geolocationTest_geo1', function () {
console.info("[lbs_js] getAddressesFromLocation0602 promise then error." + JSON.stringify(error)); console.info("[lbs_js] getAddressesFromLocation0602 promise then error." + JSON.stringify(error));
expect(true).assertEqual((JSON.stringify(error)) != null); 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 };
try {
await geolocation.getAddressesFromLocation(reverseGeocodeRequest3).then((data) => { await geolocation.getAddressesFromLocation(reverseGeocodeRequest3).then((data) => {
console.info('[lbs_js] getAddressesFromLocation0603 promise: ' + JSON.stringify(data)); console.info('[lbs_js] getAddressesFromLocation0603 promise: ' + JSON.stringify(data));
expect(true).assertEqual((JSON.stringify(data)) != null); expect(true).assertEqual((JSON.stringify(data)) != null);
...@@ -256,7 +269,12 @@ describe('geolocationTest_geo1', function () { ...@@ -256,7 +269,12 @@ describe('geolocationTest_geo1', function () {
console.info('[lbs_js] not support now'); console.info('[lbs_js] not support now');
expect(true).assertEqual(JSON.stringify(error) != null); 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 };
try {
await geolocation.getAddressesFromLocation(reverseGeocodeRequest4).then((data) => { await geolocation.getAddressesFromLocation(reverseGeocodeRequest4).then((data) => {
console.info('[lbs_js] getAddressesFromLocation0604 promise: ' + JSON.stringify(data)); console.info('[lbs_js] getAddressesFromLocation0604 promise: ' + JSON.stringify(data));
expect(data.length).assertEqual(0); expect(data.length).assertEqual(0);
...@@ -264,7 +282,11 @@ describe('geolocationTest_geo1', function () { ...@@ -264,7 +282,11 @@ describe('geolocationTest_geo1', function () {
console.info("[lbs_js] getAddressesFromLocation0604 promise then error." + JSON.stringify(error)); console.info("[lbs_js] getAddressesFromLocation0604 promise then error." + JSON.stringify(error));
expect(true).assertEqual((JSON.stringify(error)) != null); 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 () { ...@@ -277,6 +299,7 @@ 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 };
try {
await geolocation.getAddressesFromLocation(reverseGeocodeRequest).then((data) => { await geolocation.getAddressesFromLocation(reverseGeocodeRequest).then((data) => {
console.info('[lbs_js] getAddressesFromLocation0701 promise: ' + JSON.stringify(data)); console.info('[lbs_js] getAddressesFromLocation0701 promise: ' + JSON.stringify(data));
expect(true).assertEqual((JSON.stringify(data)) != null); expect(true).assertEqual((JSON.stringify(data)) != null);
...@@ -285,7 +308,12 @@ describe('geolocationTest_geo1', function () { ...@@ -285,7 +308,12 @@ describe('geolocationTest_geo1', function () {
console.info('[lbs_js] not support now'); console.info('[lbs_js] not support now');
expect(true).assertEqual(JSON.stringify(error) != null); 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 };
try {
await geolocation.getAddressesFromLocation(reverseGeocodeRequest1).then((data) => { await geolocation.getAddressesFromLocation(reverseGeocodeRequest1).then((data) => {
console.info('[lbs_js] getAddressesFromLocation0702 promise: ' + JSON.stringify(data)); console.info('[lbs_js] getAddressesFromLocation0702 promise: ' + JSON.stringify(data));
expect(data.length).assertEqual(0); expect(data.length).assertEqual(0);
...@@ -293,7 +321,12 @@ describe('geolocationTest_geo1', function () { ...@@ -293,7 +321,12 @@ describe('geolocationTest_geo1', function () {
console.info("[lbs_js] getAddressesFromLocation0702 promise then error." + JSON.stringify(error)); console.info("[lbs_js] getAddressesFromLocation0702 promise then error." + JSON.stringify(error));
expect(true).assertEqual((JSON.stringify(error)) != null); 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 };
try {
await geolocation.getAddressesFromLocation(reverseGeocodeRequest2).then((data) => { await geolocation.getAddressesFromLocation(reverseGeocodeRequest2).then((data) => {
console.info('[lbs_js] getAddressesFromLocation0703 promise: ' + JSON.stringify(data)); console.info('[lbs_js] getAddressesFromLocation0703 promise: ' + JSON.stringify(data));
expect(true).assertEqual((JSON.stringify(data)) != null); expect(true).assertEqual((JSON.stringify(data)) != null);
...@@ -302,7 +335,12 @@ describe('geolocationTest_geo1', function () { ...@@ -302,7 +335,12 @@ describe('geolocationTest_geo1', function () {
console.info('[lbs_js] not support now'); console.info('[lbs_js] not support now');
expect(true).assertEqual(JSON.stringify(error) != null); 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 };
try {
await geolocation.getAddressesFromLocation(reverseGeocodeRequest3).then((data) => { await geolocation.getAddressesFromLocation(reverseGeocodeRequest3).then((data) => {
console.info('[lbs_js] getAddressesFromLocation0704 promise: ' + JSON.stringify(data)); console.info('[lbs_js] getAddressesFromLocation0704 promise: ' + JSON.stringify(data));
expect(data.length).assertEqual(0); expect(data.length).assertEqual(0);
...@@ -310,7 +348,11 @@ describe('geolocationTest_geo1', function () { ...@@ -310,7 +348,11 @@ describe('geolocationTest_geo1', function () {
console.info("[lbs_js] getAddressesFromLocation0704 promise then error." + JSON.stringify(error)); console.info("[lbs_js] getAddressesFromLocation0704 promise then error." + JSON.stringify(error));
expect(true).assertEqual((JSON.stringify(error)) != null); 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,6 +508,7 @@ describe('geolocationTest_geo3', function () { ...@@ -508,6 +508,7 @@ 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" };
try {
await geolocation.sendCommand(requestInfo, (err, result) => { await geolocation.sendCommand(requestInfo, (err, result) => {
if (err) { if (err) {
console.info('sendcommand callback err:' + JSON.stringify(err)); console.info('sendcommand callback err:' + JSON.stringify(err));
...@@ -516,6 +517,11 @@ describe('geolocationTest_geo3', function () { ...@@ -516,6 +517,11 @@ describe('geolocationTest_geo3', function () {
} }
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,6 +534,7 @@ describe('geolocationTest_geo3', function () { ...@@ -528,6 +534,7 @@ 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" };
try {
geolocation.sendCommand(requestInfo).then((result) => { geolocation.sendCommand(requestInfo).then((result) => {
console.info('sendCommand promise result:' + result); console.info('sendCommand promise result:' + result);
done(); done();
...@@ -536,6 +543,11 @@ describe('geolocationTest_geo3', function () { ...@@ -536,6 +543,11 @@ describe('geolocationTest_geo3', function () {
expect(true).assertEqual(JSON.stringify(error) != null); expect(true).assertEqual(JSON.stringify(error) != null);
done(); 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 () { ...@@ -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.
先完成此消息的编辑!
想要评论请 注册