提交 93fd23f1 编写于 作者: Q quanli

quanli1@huawei.com

Signed-off-by: Nquanli <quanli1@huawei.com>
上级 9577242b
...@@ -113,11 +113,11 @@ export default function geolocationTest_geo5() { ...@@ -113,11 +113,11 @@ export default function geolocationTest_geo5() {
try { try {
let geocoder1 = geolocationm.isGeocoderAvailable(); let geocoder1 = geolocationm.isGeocoderAvailable();
console.info('[lbs_js] isGeocoderAvailable result: ' + JSON.stringify(geocoder1)); console.info('[lbs_js] isGeocoderAvailable result: ' + JSON.stringify(geocoder1));
expect(geocoder1).assertTrue(); expect(true).assertEqual(JSON.stringify(geocoder1) != null);
} catch (error) { } catch (error) {
console.info('[lbs_js] isGeocoderAvailable err:' + JSON.stringify(error)); console.info('[lbs_js] isGeocoderAvailable err:' + JSON.stringify(error));
console.info('[lbs_js] not support now'); console.info('[lbs_js] not support now');
expect(true).assertFalse(); expect(error.code).assertEqual("801");
} }
}); });
...@@ -130,10 +130,11 @@ export default function geolocationTest_geo5() { ...@@ -130,10 +130,11 @@ export default function geolocationTest_geo5() {
* @tc.level Level 2 * @tc.level Level 2
*/ */
it('SUB_HSS_LocationSystem_Geo_2000', 0, async function (done) { it('SUB_HSS_LocationSystem_Geo_2000', 0, async function (done) {
let geocoder1 = geolocationm.isGeocoderAvailable();
if (geocoder1) {
let reverseGeocodeRequest = { "latitude": 31.265496, "longitude": 121.62771, "maxItems": 1 }; let reverseGeocodeRequest = { "latitude": 31.265496, "longitude": 121.62771, "maxItems": 1 };
geolocationm.getAddressesFromLocation(reverseGeocodeRequest, (err, data) => {
try { try {
geolocationm.getAddressesFromLocation(reverseGeocodeRequest, (err, data) => {
if (err) { if (err) {
console.info('[lbs_js] getAddressesFromLocation4 callback err is:' + JSON.stringify(err)); console.info('[lbs_js] getAddressesFromLocation4 callback err is:' + JSON.stringify(err));
expect(err.code).assertEqual(3301300); expect(err.code).assertEqual(3301300);
...@@ -141,13 +142,15 @@ export default function geolocationTest_geo5() { ...@@ -141,13 +142,15 @@ export default function geolocationTest_geo5() {
console.info("[lbs_js] getAddressesFromLocation4 callback data is:" + JSON.stringify(data)); console.info("[lbs_js] getAddressesFromLocation4 callback data is:" + 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] getAddressesFromLocation4 callback try error:"+ error); console.info("[lbs_js] getAddressesFromLocation4 callback try error:"+ error);
expect(true).assertFalse(); expect(true).assertFalse();
} }
});
await sleep(2000); await sleep(2000);
} else {
console.info("[lbs_js] The geocoding service is unavailable.");
}
done(); done();
}) })
...@@ -161,6 +164,8 @@ export default function geolocationTest_geo5() { ...@@ -161,6 +164,8 @@ export default function geolocationTest_geo5() {
* @tc.level Level 2 * @tc.level Level 2
*/ */
it('SUB_HSS_LocationSystem_Geo_2100', 0, async function (done) { it('SUB_HSS_LocationSystem_Geo_2100', 0, async function (done) {
let geocoder1 = geolocationm.isGeocoderAvailable();
if (geocoder1) {
try { try {
let reverseGeocodeRequest = { "latitude": 31.265496, "longitude": 121.62771, "maxItems": 5}; let reverseGeocodeRequest = { "latitude": 31.265496, "longitude": 121.62771, "maxItems": 5};
await geolocationm.getAddressesFromLocation(reverseGeocodeRequest).then((data) => { await geolocationm.getAddressesFromLocation(reverseGeocodeRequest).then((data) => {
...@@ -197,6 +202,9 @@ export default function geolocationTest_geo5() { ...@@ -197,6 +202,9 @@ export default function geolocationTest_geo5() {
expect(true).assertFalse(); expect(true).assertFalse();
} }
await sleep(1000); await sleep(1000);
} else {
console.info("[lbs_js] The geocoding service is unavailable.");
}
done(); done();
}) })
...@@ -209,6 +217,8 @@ export default function geolocationTest_geo5() { ...@@ -209,6 +217,8 @@ export default function geolocationTest_geo5() {
* @tc.level Level 2 * @tc.level Level 2
*/ */
it('SUB_HSS_LocationSystem_Geo_2200', 0, async function (done) { it('SUB_HSS_LocationSystem_Geo_2200', 0, async function (done) {
let geocoder1 = geolocationm.isGeocoderAvailable();
if (geocoder1) {
try { try {
let reverseGeocodeRequest = { "latitude": 31.265496, "longitude": 121.62771, "maxItems": 5 }; let reverseGeocodeRequest = { "latitude": 31.265496, "longitude": 121.62771, "maxItems": 5 };
await geolocationm.getAddressesFromLocation(reverseGeocodeRequest).then((data) => { await geolocationm.getAddressesFromLocation(reverseGeocodeRequest).then((data) => {
...@@ -224,6 +234,9 @@ export default function geolocationTest_geo5() { ...@@ -224,6 +234,9 @@ export default function geolocationTest_geo5() {
expect(true).assertFalse(); expect(true).assertFalse();
} }
await sleep(1000); await sleep(1000);
} else {
console.info("[lbs_js] The geocoding service is unavailable.");
}
done(); done();
}) })
...@@ -236,6 +249,8 @@ export default function geolocationTest_geo5() { ...@@ -236,6 +249,8 @@ export default function geolocationTest_geo5() {
* @tc.level Level 2 * @tc.level Level 2
*/ */
it('SUB_HSS_LocationSystem_Geo_2300', 0, async function (done) { it('SUB_HSS_LocationSystem_Geo_2300', 0, async function (done) {
let geocoder1 = geolocationm.isGeocoderAvailable();
if (geocoder1) {
let reverseGeocodeRequest1 = { "latitude": 90, "longitude": 121.62771, "maxItems": 1 }; let reverseGeocodeRequest1 = { "latitude": 90, "longitude": 121.62771, "maxItems": 1 };
try { try {
await geolocationm.getAddressesFromLocation(reverseGeocodeRequest1).then((data) => { await geolocationm.getAddressesFromLocation(reverseGeocodeRequest1).then((data) => {
...@@ -291,6 +306,9 @@ export default function geolocationTest_geo5() { ...@@ -291,6 +306,9 @@ export default function geolocationTest_geo5() {
expect(error.code).assertEqual("401"); expect(error.code).assertEqual("401");
} }
await sleep(1000); await sleep(1000);
} else {
console.info("[lbs_js] The geocoding service is unavailable.");
}
done(); done();
}) })
...@@ -303,6 +321,8 @@ export default function geolocationTest_geo5() { ...@@ -303,6 +321,8 @@ export default function geolocationTest_geo5() {
* @tc.level Level 2 * @tc.level Level 2
*/ */
it('SUB_HSS_LocationSystem_Geo_2400', 0, async function (done) { it('SUB_HSS_LocationSystem_Geo_2400', 0, async function (done) {
let geocoder1 = geolocationm.isGeocoderAvailable();
if (geocoder1) {
let reverseGeocodeRequest = { "latitude": 31.265496, "longitude": 180, "maxItems": 1 }; let reverseGeocodeRequest = { "latitude": 31.265496, "longitude": 180, "maxItems": 1 };
try { try {
await geolocationm.getAddressesFromLocation(reverseGeocodeRequest).then((data) => { await geolocationm.getAddressesFromLocation(reverseGeocodeRequest).then((data) => {
...@@ -329,7 +349,6 @@ export default function geolocationTest_geo5() { ...@@ -329,7 +349,6 @@ export default function geolocationTest_geo5() {
}); });
} catch (error) { } catch (error) {
console.info("[lbs_js] getAddressesFromLocation message2." + JSON.stringify(error)); console.info("[lbs_js] getAddressesFromLocation message2." + JSON.stringify(error));
// expect(true).assertEqual((JSON.stringify(error.message)) != null);
expect(error.code).assertEqual("401"); expect(error.code).assertEqual("401");
} }
await sleep(1000); await sleep(1000);
...@@ -359,10 +378,12 @@ export default function geolocationTest_geo5() { ...@@ -359,10 +378,12 @@ export default function geolocationTest_geo5() {
}); });
} catch (error) { } catch (error) {
console.info("[lbs_js] getAddressesFromLocation message4." + JSON.stringify(error)); console.info("[lbs_js] getAddressesFromLocation message4." + JSON.stringify(error));
// expect(true).assertEqual((JSON.stringify(error.message)) != null);
expect(error.code).assertEqual("401"); expect(error.code).assertEqual("401");
} }
await sleep(1000); await sleep(1000);
} else {
console.info("[lbs_js] The geocoding service is unavailable.");
}
done(); done();
}) })
...@@ -376,13 +397,15 @@ export default function geolocationTest_geo5() { ...@@ -376,13 +397,15 @@ export default function geolocationTest_geo5() {
* @tc.level Level 2 * @tc.level Level 2
*/ */
it('SUB_HSS_LocationSystem_Geo_2500', 0, async function (done) { it('SUB_HSS_LocationSystem_Geo_2500', 0, async function (done) {
let geocoder1 = geolocationm.isGeocoderAvailable();
if (geocoder1) {
try {
let geocodeRequest = { let geocodeRequest = {
"description": "上海市浦东新区金穗路1800号", "description": "上海市浦东新区金穗路1800号",
"maxItems": 1, "maxItems": 1,
"locale": "zh", "locale": "zh",
}; };
geolocationm.getAddressesFromLocationName(geocodeRequest, (err, data) => { geolocationm.getAddressesFromLocationName(geocodeRequest, (err, data) => {
try{
if (err) { if (err) {
switch (err) { switch (err) {
case 100: case 100:
...@@ -419,14 +442,16 @@ export default function geolocationTest_geo5() { ...@@ -419,14 +442,16 @@ export default function geolocationTest_geo5() {
else { else {
console.info("[lbs_js] getAddressesFromLocationName08 callback data is: " + JSON.stringify(data)); console.info("[lbs_js] getAddressesFromLocationName08 callback data is: " + JSON.stringify(data));
} }
} done();
catch(error){ });
} catch (error) {
console.info("[lbs_js] getAddressesFromLocationName08 message." + JSON.stringify(error.message)); console.info("[lbs_js] getAddressesFromLocationName08 message." + JSON.stringify(error.message));
expect(true).assertFalse(); expect(true).assertFalse();
} }
done();
});
await sleep(1000); await sleep(1000);
} else {
console.info("[lbs_js] The geocoding service is unavailable.");
}
done(); done();
}) })
...@@ -439,6 +464,8 @@ export default function geolocationTest_geo5() { ...@@ -439,6 +464,8 @@ export default function geolocationTest_geo5() {
* @tc.level Level 2 * @tc.level Level 2
*/ */
it('SUB_HSS_LocationSystem_Geo_2600', 0, async function (done) { it('SUB_HSS_LocationSystem_Geo_2600', 0, async function (done) {
let geocoder1 = geolocationm.isGeocoderAvailable();
if (geocoder1) {
let geocodeRequest = { "description": "上海市浦东新区金穗路1800号", "maxItems": 3 }; let geocodeRequest = { "description": "上海市浦东新区金穗路1800号", "maxItems": 3 };
try { try {
await geolocationm.getAddressesFromLocationName(geocodeRequest).then((result) => { await geolocationm.getAddressesFromLocationName(geocodeRequest).then((result) => {
...@@ -454,6 +481,9 @@ export default function geolocationTest_geo5() { ...@@ -454,6 +481,9 @@ export default function geolocationTest_geo5() {
expect(true).assertFalse(); expect(true).assertFalse();
} }
await sleep(1000); await sleep(1000);
} else {
console.info("[lbs_js] The geocoding service is unavailable.");
}
done(); done();
}) })
...@@ -466,6 +496,8 @@ export default function geolocationTest_geo5() { ...@@ -466,6 +496,8 @@ export default function geolocationTest_geo5() {
* @tc.level Level 2 * @tc.level Level 2
*/ */
it('SUB_HSS_LocationSystem_Geo_2700', 0, async function (done) { it('SUB_HSS_LocationSystem_Geo_2700', 0, async function (done) {
let geocoder1 = geolocationm.isGeocoderAvailable();
if (geocoder1) {
try { try {
let geocodeRequest = { "description": "上海市浦东新区金穗路1800号", "maxItems": 5 }; let geocodeRequest = { "description": "上海市浦东新区金穗路1800号", "maxItems": 5 };
await geolocationm.getAddressesFromLocationName(geocodeRequest).then((result) => { await geolocationm.getAddressesFromLocationName(geocodeRequest).then((result) => {
...@@ -481,6 +513,9 @@ export default function geolocationTest_geo5() { ...@@ -481,6 +513,9 @@ export default function geolocationTest_geo5() {
expect(true).assertFalse(); expect(true).assertFalse();
} }
await sleep(1000); await sleep(1000);
} else {
console.info("[lbs_js] The geocoding service is unavailable.");
}
done(); done();
}) })
...@@ -494,6 +529,8 @@ export default function geolocationTest_geo5() { ...@@ -494,6 +529,8 @@ export default function geolocationTest_geo5() {
需要实测!!!! 需要实测!!!!
*/ */
it('SUB_HSS_LocationSystem_Geo_2800', 0, async function (done) { it('SUB_HSS_LocationSystem_Geo_2800', 0, async function (done) {
let geocoder1 = geolocationm.isGeocoderAvailable();
if (geocoder1) {
try { try {
let geocodeRequest = { "description": "", "maxItems": 1 }; let geocodeRequest = { "description": "", "maxItems": 1 };
await geolocationm.getAddressesFromLocationName(geocodeRequest).then((result) => { await geolocationm.getAddressesFromLocationName(geocodeRequest).then((result) => {
...@@ -522,6 +559,9 @@ export default function geolocationTest_geo5() { ...@@ -522,6 +559,9 @@ export default function geolocationTest_geo5() {
expect(error.code).assertEqual("401"); expect(error.code).assertEqual("401");
} }
await sleep(1000); await sleep(1000);
} else {
console.info("[lbs_js] The geocoding service is unavailable.");
}
done(); done();
}) })
...@@ -534,6 +574,8 @@ export default function geolocationTest_geo5() { ...@@ -534,6 +574,8 @@ export default function geolocationTest_geo5() {
* @tc.level Level 2 * @tc.level Level 2
*/ */
it('SUB_HSS_LocationSystem_Geo_2900', 0, async function (done) { it('SUB_HSS_LocationSystem_Geo_2900', 0, async function (done) {
let geocoder1 = geolocationm.isGeocoderAvailable();
if (geocoder1) {
let geocodeRequest = { let geocodeRequest = {
"description": "上海金穗路1800号", "description": "上海金穗路1800号",
"maxItems": 1, "maxItems": 1,
...@@ -556,6 +598,9 @@ export default function geolocationTest_geo5() { ...@@ -556,6 +598,9 @@ export default function geolocationTest_geo5() {
expect(true).assertFalse(); expect(true).assertFalse();
} }
await sleep(1000); await sleep(1000);
} else {
console.info("[lbs_js] The geocoding service is unavailable.");
}
done(); done();
}) })
...@@ -569,6 +614,8 @@ export default function geolocationTest_geo5() { ...@@ -569,6 +614,8 @@ export default function geolocationTest_geo5() {
* @tc.level Level 2 * @tc.level Level 2
*/ */
it('SUB_HSS_LocationSystem_Geo_3000', 0, async function (done) { it('SUB_HSS_LocationSystem_Geo_3000', 0, async function (done) {
let geocoder1 = geolocationm.isGeocoderAvailable();
if (geocoder1) {
let geocodeRequest = { let geocodeRequest = {
"description": "", "description": "",
"maxItems": 1, "maxItems": 1,
...@@ -612,6 +659,9 @@ export default function geolocationTest_geo5() { ...@@ -612,6 +659,9 @@ export default function geolocationTest_geo5() {
expect(error.code).assertEqual("401"); expect(error.code).assertEqual("401");
} }
await sleep(1000); await sleep(1000);
} else {
console.info("[lbs_js] The geocoding service is unavailable.");
}
done(); done();
}) })
...@@ -625,6 +675,8 @@ export default function geolocationTest_geo5() { ...@@ -625,6 +675,8 @@ export default function geolocationTest_geo5() {
* @tc.level Level 2 * @tc.level Level 2
*/ */
it('SUB_HSS_LocationSystem_Geo_3100', 0, async function (done) { it('SUB_HSS_LocationSystem_Geo_3100', 0, async function (done) {
let geocoder1 = geolocationm.isGeocoderAvailable();
if (geocoder1) {
let geocodeRequest = { let geocodeRequest = {
"description": "北京天安门", "description": "北京天安门",
"maxItems": 1, "maxItems": 1,
...@@ -646,6 +698,9 @@ export default function geolocationTest_geo5() { ...@@ -646,6 +698,9 @@ export default function geolocationTest_geo5() {
expect(error.code).assertEqual("401"); expect(error.code).assertEqual("401");
} }
await sleep(1000); await sleep(1000);
} else {
console.info("[lbs_js] The geocoding service is unavailable.");
}
done(); done();
}) })
...@@ -667,6 +722,8 @@ export default function geolocationTest_geo5() { ...@@ -667,6 +722,8 @@ export default function geolocationTest_geo5() {
"maxLatitude": 39.85, "maxLatitude": 39.85,
"maxLongitude": 116.35 "maxLongitude": 116.35
}; };
let geocoder1 = geolocationm.isGeocoderAvailable();
if (geocoder1) {
try { try {
await geolocationm.getAddressesFromLocationName(geocodeRequest).then((result) => { await geolocationm.getAddressesFromLocationName(geocodeRequest).then((result) => {
console.info("[lbs_js] getAddressesFromLocationName32 promise data is:" + JSON.stringify(result)); console.info("[lbs_js] getAddressesFromLocationName32 promise data is:" + JSON.stringify(result));
...@@ -681,6 +738,9 @@ export default function geolocationTest_geo5() { ...@@ -681,6 +738,9 @@ export default function geolocationTest_geo5() {
expect(error.code).assertEqual("401"); expect(error.code).assertEqual("401");
} }
await sleep(1000); await sleep(1000);
} else {
console.info("[lbs_js] The geocoding service is unavailable.");
}
done(); done();
}) })
...@@ -693,6 +753,8 @@ export default function geolocationTest_geo5() { ...@@ -693,6 +753,8 @@ export default function geolocationTest_geo5() {
* @tc.level Level 2 * @tc.level Level 2
*/ */
it('SUB_HSS_LocationSystem_Geo_3300', 0, async function (done) { it('SUB_HSS_LocationSystem_Geo_3300', 0, async function (done) {
let geocoder1 = geolocationm.isGeocoderAvailable();
if (geocoder1) {
let geocodeRequest1 = { let geocodeRequest1 = {
"description": "上海金穗路1800号", "description": "上海金穗路1800号",
"maxItems": 1, "maxItems": 1,
...@@ -866,6 +928,9 @@ export default function geolocationTest_geo5() { ...@@ -866,6 +928,9 @@ export default function geolocationTest_geo5() {
expect(error.code).assertEqual("401"); expect(error.code).assertEqual("401");
} }
await sleep(1000); await sleep(1000);
} else {
console.info("[lbs_js] The geocoding service is unavailable.");
}
done(); done();
}) })
...@@ -878,6 +943,8 @@ export default function geolocationTest_geo5() { ...@@ -878,6 +943,8 @@ export default function geolocationTest_geo5() {
* @tc.level Level 2 * @tc.level Level 2
*/ */
it('SUB_HSS_LocationSystem_Geo_3400', 0, async function (done) { it('SUB_HSS_LocationSystem_Geo_3400', 0, async function (done) {
let geocoder1 = geolocationm.isGeocoderAvailable();
if (geocoder1) {
let geocodeRequest1 = { let geocodeRequest1 = {
"description": "北京天安门", "description": "北京天安门",
"maxItems": 1, "maxItems": 1,
...@@ -1048,6 +1115,9 @@ export default function geolocationTest_geo5() { ...@@ -1048,6 +1115,9 @@ export default function geolocationTest_geo5() {
expect(error.code).assertEqual("401"); expect(error.code).assertEqual("401");
} }
await sleep(1000); await sleep(1000);
} else {
console.info("[lbs_js] The geocoding service is unavailable.");
}
done(); done();
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册