summaryrefslogtreecommitdiff
path: root/tests/auto/nokia_services
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@jollamobile.com>2014-01-16 11:04:47 +1000
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-20 02:11:19 +0100
commit86db3df8cea7b9ac1e4ae078639de5fb5a43ca69 (patch)
tree2f63fba9da3e91d9e1a78921585066b011581277 /tests/auto/nokia_services
parente584af651f5b7b2855a37cee7d94999ce3374b5c (diff)
downloadqtlocation-86db3df8cea7b9ac1e4ae078639de5fb5a43ca69.tar.gz
Fix Nokia place recommendation search parsing.
Place recommendations are no longer wrapped in a "results" object like other search requests. Change-Id: Idef11bf08818e07192657ffbadca0e0d610b6137 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'tests/auto/nokia_services')
-rw-r--r--tests/auto/nokia_services/places_semiauto/tst_places.cpp33
1 files changed, 18 insertions, 15 deletions
diff --git a/tests/auto/nokia_services/places_semiauto/tst_places.cpp b/tests/auto/nokia_services/places_semiauto/tst_places.cpp
index e6e7859f..82853a7f 100644
--- a/tests/auto/nokia_services/places_semiauto/tst_places.cpp
+++ b/tests/auto/nokia_services/places_semiauto/tst_places.cpp
@@ -90,7 +90,7 @@ private:
QList<QPlaceReply::Error> *errors,
QList<ExpectedResults> *results);
- static const QLatin1String AuvergneEmbassyId;
+ static const QLatin1String ValidKnownPlaceId;
static const QLatin1String ProxyEnv;
static const QLatin1String AppIdEnv;
static const QLatin1String TokenEnv;
@@ -100,7 +100,10 @@ private:
Q_DECLARE_METATYPE(tst_QPlaceManagerNokia::ExpectedResults)
-const QLatin1String tst_QPlaceManagerNokia::AuvergneEmbassyId("250u09tv-be16478e55314b338c551aab2651c9d3");
+// ValidKnownPlaceId is the id of a place with a full complement of place content. Editorials,
+// reviews, images, recommendations. If it disappears these tests will fail.
+// Currently it is set to an Eiffel Tower tourist office.
+const QLatin1String tst_QPlaceManagerNokia::ValidKnownPlaceId("250u09tu-4561b8da952f4fd79c4e1998c3fcf032");
const QLatin1String tst_QPlaceManagerNokia::ProxyEnv("NOKIA_PLUGIN_PROXY");
const QLatin1String tst_QPlaceManagerNokia::AppIdEnv("NOKIA_APP_ID");
@@ -335,7 +338,7 @@ void tst_QPlaceManagerNokia::recommendations_data()
eatDrinkCat.setCategoryId(QStringLiteral("eat-drink"));
QTest::newRow("search recommendations with valid id")
- << QString(AuvergneEmbassyId)
+ << QString(ValidKnownPlaceId)
<< QString()
<< QGeoShape()
<< QList<QPlaceCategory>()
@@ -349,28 +352,28 @@ void tst_QPlaceManagerNokia::recommendations_data()
<< QPlaceReply::PlaceDoesNotExistError;
QTest::newRow("search for recommendations with id and search term")
- << QString(AuvergneEmbassyId)
+ << QString(ValidKnownPlaceId)
<< QStringLiteral("sushi")
<< QGeoShape()
<< QList<QPlaceCategory>()
<< QPlaceReply::BadArgumentError;
QTest::newRow("search for recommendations with an id and category")
- << QString(AuvergneEmbassyId)
+ << QString(ValidKnownPlaceId)
<< QString()
<< QGeoShape()
<< (QList<QPlaceCategory>() << eatDrinkCat)
<< QPlaceReply::BadArgumentError;
QTest::newRow("search for recommendations with id, search term and category")
- << QString(AuvergneEmbassyId)
+ << QString(ValidKnownPlaceId)
<< QStringLiteral("sushi")
<< QGeoShape()
<< (QList<QPlaceCategory>() << eatDrinkCat)
<< QPlaceReply::BadArgumentError;
QTest::newRow("search for recommendations with an id and search area")
- << QString(AuvergneEmbassyId)
+ << QString(ValidKnownPlaceId)
<< QString()
<< static_cast<QGeoShape>(QGeoCircle(QGeoCoordinate(-27.5, 153)))
<< QList<QPlaceCategory>()
@@ -381,7 +384,7 @@ void tst_QPlaceManagerNokia::details()
{
//fetch the details of a valid place
QPlace place;
- QVERIFY(doFetchDetails(AuvergneEmbassyId, &place));
+ QVERIFY(doFetchDetails(ValidKnownPlaceId, &place));
QVERIFY(!place.name().isEmpty());
QVERIFY(!place.icon().url().isEmpty());
QStringList contactTypes = place.contactTypes();
@@ -586,11 +589,11 @@ void tst_QPlaceManagerNokia::locale()
//check that setting a locale will affect place detail fetches.
QPlace place;
placeManager->setLocale(QLocale("en"));
- QVERIFY(doFetchDetails(AuvergneEmbassyId,
+ QVERIFY(doFetchDetails(ValidKnownPlaceId,
&place));
QString englishName = place.name();
placeManager->setLocale(QLocale("fr"));
- QVERIFY(doFetchDetails(AuvergneEmbassyId,
+ QVERIFY(doFetchDetails(ValidKnownPlaceId,
&place));
QVERIFY(englishName != place.name());
}
@@ -603,7 +606,7 @@ void tst_QPlaceManagerNokia::content()
QPlaceContentRequest request;
request.setContentType(type);
QPlaceContent::Collection results;
- QVERIFY(doFetchContent(AuvergneEmbassyId,
+ QVERIFY(doFetchContent(ValidKnownPlaceId,
request, &results));
QVERIFY(results.count() > 0);
@@ -639,7 +642,7 @@ void tst_QPlaceManagerNokia::content()
//check total count
QPlaceContentReply *contentReply =
- placeManager->getPlaceContent(AuvergneEmbassyId,
+ placeManager->getPlaceContent(ValidKnownPlaceId,
request);
QSignalSpy contentSpy(contentReply, SIGNAL(finished()));
QTRY_VERIFY_WITH_TIMEOUT(contentSpy.count() ==1, Timeout);
@@ -649,7 +652,7 @@ void tst_QPlaceManagerNokia::content()
//try testing with an offset
request.setOffset(1);
QPlaceContent::Collection newResults;
- QVERIFY(doFetchContent(AuvergneEmbassyId,
+ QVERIFY(doFetchContent(ValidKnownPlaceId,
request, &newResults));
QVERIFY(!newResults.keys().contains(0));
QCOMPARE(newResults.value(1), results.value(1));
@@ -657,7 +660,7 @@ void tst_QPlaceManagerNokia::content()
//try testing with a limit
request.setOffset(0);
request.setLimit(1);
- QVERIFY(doFetchContent(AuvergneEmbassyId,
+ QVERIFY(doFetchContent(ValidKnownPlaceId,
request, &newResults));
QCOMPARE(newResults.count(), 1);
QCOMPARE(newResults.values().first(), results.value(0));
@@ -666,7 +669,7 @@ void tst_QPlaceManagerNokia::content()
if (contentReply->totalCount() >= 3) {
request.setLimit(1);
request.setOffset(1);
- QVERIFY(doFetchContent(AuvergneEmbassyId,
+ QVERIFY(doFetchContent(ValidKnownPlaceId,
request, &newResults));
QCOMPARE(newResults.count(), 1);
QCOMPARE(newResults.values().first(), results.value(1));