summaryrefslogtreecommitdiffstats
path: root/documentapi/src/tests
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@broadpark.no>2018-09-25 14:43:55 +0200
committerTor Egge <Tor.Egge@broadpark.no>2018-09-25 15:41:09 +0200
commit7d61a960839ea0400cd2e345997425419ab697f4 (patch)
treef99fabb2631f7d67b270d1dd928df36494369735 /documentapi/src/tests
parent8c58a2f4ed9b873c712c41f7e1f407d078b9a4d4 (diff)
Remove BatchDocumentUpdateMessage and BatchDocumentUpdateReply from
C++ portion of documentapi. Remove corresponding document api cross language files. Remove corresponding storageapi messages.
Diffstat (limited to 'documentapi/src/tests')
-rw-r--r--documentapi/src/tests/messages/messages50test.cpp86
-rw-r--r--documentapi/src/tests/messages/messages50test.h2
2 files changed, 0 insertions, 88 deletions
diff --git a/documentapi/src/tests/messages/messages50test.cpp b/documentapi/src/tests/messages/messages50test.cpp
index 6705277d5c3..8da7b692802 100644
--- a/documentapi/src/tests/messages/messages50test.cpp
+++ b/documentapi/src/tests/messages/messages50test.cpp
@@ -22,7 +22,6 @@ Messages50Test::Messages50Test()
{
// This list MUST mirror the list of routable factories from the DocumentProtocol constructor that support
// version 5.0. When adding tests to this list, please KEEP THEM ORDERED alphabetically like they are now.
- putTest(DocumentProtocol::MESSAGE_BATCHDOCUMENTUPDATE, TEST_METHOD(Messages50Test::testBatchDocumentUpdateMessage));
putTest(DocumentProtocol::MESSAGE_CREATEVISITOR, TEST_METHOD(Messages50Test::testCreateVisitorMessage));
putTest(DocumentProtocol::MESSAGE_DESTROYVISITOR, TEST_METHOD(Messages50Test::testDestroyVisitorMessage));
putTest(DocumentProtocol::MESSAGE_DOCUMENTLIST, TEST_METHOD(Messages50Test::testDocumentListMessage));
@@ -41,7 +40,6 @@ Messages50Test::Messages50Test()
putTest(DocumentProtocol::MESSAGE_UPDATEDOCUMENT, TEST_METHOD(Messages50Test::testUpdateDocumentMessage));
putTest(DocumentProtocol::MESSAGE_VISITORINFO, TEST_METHOD(Messages50Test::testVisitorInfoMessage));
- putTest(DocumentProtocol::REPLY_BATCHDOCUMENTUPDATE, TEST_METHOD(Messages50Test::testBatchDocumentUpdateReply));
putTest(DocumentProtocol::REPLY_CREATEVISITOR, TEST_METHOD(Messages50Test::testCreateVisitorReply));
putTest(DocumentProtocol::REPLY_DESTROYVISITOR, TEST_METHOD(Messages50Test::testDestroyVisitorReply));
putTest(DocumentProtocol::REPLY_DOCUMENTLIST, TEST_METHOD(Messages50Test::testDocumentListReply));
@@ -693,90 +691,6 @@ Messages50Test::testUpdateDocumentMessage()
}
bool
-Messages50Test::testBatchDocumentUpdateMessage()
-{
- const DocumentTypeRepo &repo = getTypeRepo();
- const document::DocumentType &docType = *repo.getDocumentType("testdoc");
-
- BatchDocumentUpdateMessage msg(1234);
-
- {
- document::DocumentUpdate::SP upd;
- upd.reset(new document::DocumentUpdate(repo, docType, document::DocumentId("userdoc:footype:1234:foo")));
- upd->addFieldPathUpdate(document::FieldPathUpdate::CP(
- new document::RemoveFieldPathUpdate("intfield", "testdoc.intfield > 0")));
- msg.addUpdate(upd);
- }
- {
- document::DocumentUpdate::SP upd;
- upd.reset(new document::DocumentUpdate(repo, docType, document::DocumentId("orderdoc(32,17):footype:1234:123456789:foo")));
- upd->addFieldPathUpdate(document::FieldPathUpdate::CP(
- new document::RemoveFieldPathUpdate("intfield", "testdoc.intfield > 0")));
- msg.addUpdate(upd);
- }
- try {
- document::DocumentUpdate::SP upd;
- upd.reset(new document::DocumentUpdate(repo, docType, document::DocumentId("userdoc:footype:5678:foo")));
- upd->addFieldPathUpdate(document::FieldPathUpdate::CP(
- new document::RemoveFieldPathUpdate("intfield", "testdoc.intfield > 0")));
- msg.addUpdate(upd);
- EXPECT_TRUE(false);
- } catch (...) {
- }
- try {
- document::DocumentUpdate::SP upd;
- upd.reset(new document::DocumentUpdate(repo, docType, document::DocumentId("groupdoc:footype:hable:foo")));
- upd->addFieldPathUpdate(document::FieldPathUpdate::CP(
- new document::RemoveFieldPathUpdate("intfield", "testdoc.intfield > 0")));
- msg.addUpdate(upd);
- EXPECT_TRUE(false);
- } catch (...) {
- }
-
- EXPECT_EQUAL(MESSAGE_BASE_LENGTH + 202u, serialize("BatchDocumentUpdateMessage", msg));
- for (uint32_t lang = 0; lang < NUM_LANGUAGES; ++lang) {
- mbus::Routable::UP obj = deserialize("BatchDocumentUpdateMessage", DocumentProtocol::MESSAGE_BATCHDOCUMENTUPDATE, lang);
- if (EXPECT_TRUE(obj.get() != NULL)) {
- BatchDocumentUpdateMessage &ref = static_cast<BatchDocumentUpdateMessage&>(*obj);
- EXPECT_EQUAL(2u, ref.getUpdates().size());
- }
- }
-
- return true;
-}
-
-bool
-Messages50Test::testBatchDocumentUpdateReply()
-{
- BatchDocumentUpdateReply reply;
- reply.setHighestModificationTimestamp(30);
- {
- std::vector<bool> notFound(3);
- notFound[0] = false;
- notFound[1] = true;
- notFound[2] = true;
- reply.getDocumentsNotFound() = notFound;
- }
-
- EXPECT_EQUAL(20u, serialize("BatchDocumentUpdateReply", reply));
-
- for (uint32_t lang = 0; lang < NUM_LANGUAGES; ++lang) {
- mbus::Routable::UP obj = deserialize("BatchDocumentUpdateReply", DocumentProtocol::REPLY_BATCHDOCUMENTUPDATE, lang);
- if (EXPECT_TRUE(obj.get() != NULL)) {
- BatchDocumentUpdateReply &ref = dynamic_cast<BatchDocumentUpdateReply&>(*obj);
- EXPECT_EQUAL(30u, ref.getHighestModificationTimestamp());
- {
- const std::vector<bool>& notFound = ref.getDocumentsNotFound();
- EXPECT_TRUE(notFound[0] == false);
- EXPECT_TRUE(notFound[1] == true);
- EXPECT_TRUE(notFound[2] == true);
- }
- }
- }
- return true;
-}
-
-bool
Messages50Test::testQueryResultMessage()
{
QueryResultMessage srm;
diff --git a/documentapi/src/tests/messages/messages50test.h b/documentapi/src/tests/messages/messages50test.h
index c764f814a45..96c1be78c27 100644
--- a/documentapi/src/tests/messages/messages50test.h
+++ b/documentapi/src/tests/messages/messages50test.h
@@ -13,8 +13,6 @@ protected:
public:
Messages50Test();
- bool testBatchDocumentUpdateMessage();
- bool testBatchDocumentUpdateReply();
bool testCreateVisitorMessage();
bool testCreateVisitorReply();
bool testDestroyVisitorMessage();