summaryrefslogtreecommitdiffstats
path: root/storage/src/tests/distributor/pendingmessagetrackertest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'storage/src/tests/distributor/pendingmessagetrackertest.cpp')
-rw-r--r--storage/src/tests/distributor/pendingmessagetrackertest.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/storage/src/tests/distributor/pendingmessagetrackertest.cpp b/storage/src/tests/distributor/pendingmessagetrackertest.cpp
index fa36b4e6305..1fc12821e1d 100644
--- a/storage/src/tests/distributor/pendingmessagetrackertest.cpp
+++ b/storage/src/tests/distributor/pendingmessagetrackertest.cpp
@@ -7,9 +7,12 @@
#include <vespa/storageapi/message/persistence.h>
#include <vespa/storageframework/defaultimplementation/clock/fakeclock.h>
#include <tests/common/dummystoragelink.h>
+#include <tests/common/make_document_bucket.h>
#include <vespa/vdslib/state/random.h>
#include <vespa/vdstestlib/cppunit/macros.h>
+using storage::test::makeDocumentBucket;
+
namespace storage {
namespace distributor {
@@ -185,7 +188,7 @@ private:
std::shared_ptr<api::PutCommand> createPutToNode(uint16_t node) const {
document::BucketId bucket(16, 1234);
std::shared_ptr<api::PutCommand> cmd(
- new api::PutCommand(bucket,
+ new api::PutCommand(makeDocumentBucket(bucket),
createDummyDocumentForBucket(bucket),
api::Timestamp(123456)));
cmd->setAddress(makeStorageAddress(node));
@@ -197,7 +200,7 @@ private:
{
document::BucketId bucket(16, 1234);
std::shared_ptr<api::RemoveCommand> cmd(
- new api::RemoveCommand(bucket,
+ new api::RemoveCommand(makeDocumentBucket(bucket),
document::DocumentId(
createDummyIdString(bucket)),
api::Timestamp(123456)));
@@ -239,7 +242,7 @@ PendingMessageTrackerTest::testSimple()
std::shared_ptr<api::RemoveCommand> remove(
new api::RemoveCommand(
- document::BucketId(16, 1234),
+ makeDocumentBucket(document::BucketId(16, 1234)),
document::DocumentId("userdoc:footype:1234:foo"), 1001));
remove->setAddress(
api::StorageMessageAddress("storage", lib::NodeType::STORAGE, 0));
@@ -280,7 +283,7 @@ PendingMessageTrackerTest::insertMessages(PendingMessageTracker& tracker)
ost << "userdoc:footype:1234:" << i;
std::shared_ptr<api::RemoveCommand> remove(
new api::RemoveCommand(
- document::BucketId(16, 1234),
+ makeDocumentBucket(document::BucketId(16, 1234)),
document::DocumentId(ost.str()), 1000 + i));
remove->setAddress(
api::StorageMessageAddress("storage",
@@ -291,7 +294,7 @@ PendingMessageTrackerTest::insertMessages(PendingMessageTracker& tracker)
for (uint32_t i = 0; i < 4; i++) {
std::ostringstream ost;
ost << "userdoc:footype:4567:" << i;
- std::shared_ptr<api::RemoveCommand> remove(new api::RemoveCommand(document::BucketId(16, 4567), document::DocumentId(ost.str()), 2000 + i));
+ std::shared_ptr<api::RemoveCommand> remove(new api::RemoveCommand(makeDocumentBucket(document::BucketId(16, 4567)), document::DocumentId(ost.str()), 2000 + i));
remove->setAddress(api::StorageMessageAddress("storage", lib::NodeType::STORAGE, i % 2));
tracker.insert(remove);
}
@@ -434,7 +437,7 @@ PendingMessageTrackerTest::testGetPendingMessageTypes()
std::shared_ptr<api::RemoveCommand> remove(
new api::RemoveCommand(
- bid,
+ makeDocumentBucket(bid),
document::DocumentId("userdoc:footype:1234:foo"), 1001));
remove->setAddress(
api::StorageMessageAddress("storage", lib::NodeType::STORAGE, 0));
@@ -474,7 +477,7 @@ PendingMessageTrackerTest::testHasPendingMessage()
{
std::shared_ptr<api::RemoveCommand> remove(
new api::RemoveCommand(
- bid,
+ makeDocumentBucket(bid),
document::DocumentId("userdoc:footype:1234:foo"), 1001));
remove->setAddress(
api::StorageMessageAddress("storage", lib::NodeType::STORAGE, 1));