Родитель
cdfabe3cc5
Коммит
4ccdf2f822
|
@ -1,3 +1,3 @@
|
|||
# Azure Messaging EventHub service
|
||||
|
||||
C++ SDK for Azure Messaging EventHub.
|
||||
C++ SDK for Azure Messaging EventHub.
|
||||
|
|
|
@ -84,11 +84,11 @@ namespace Azure { namespace Messaging { namespace EventHubs { namespace Test {
|
|||
|
||||
auto ownerships = checkpointStore.ListOwnership(
|
||||
"fully-qualified-namespace", "event-hub-name", "consumer-group");
|
||||
EXPECT_EQ(0, ownerships.size());
|
||||
EXPECT_EQ(0ul, ownerships.size());
|
||||
|
||||
ownerships = checkpointStore.ClaimOwnership(
|
||||
std::vector<Azure::Messaging::EventHubs::Models::Ownership>{});
|
||||
EXPECT_EQ(0, ownerships.size());
|
||||
EXPECT_EQ(0ul, ownerships.size());
|
||||
|
||||
ownerships = checkpointStore.ClaimOwnership(
|
||||
std::vector<Azure::Messaging::EventHubs::Models::Ownership>{
|
||||
|
@ -100,7 +100,7 @@ namespace Azure { namespace Messaging { namespace EventHubs { namespace Test {
|
|||
"owner-id"}});
|
||||
|
||||
// Fail the test immediately if there isn't an entry in the ownerships vector.
|
||||
ASSERT_EQ(1, ownerships.size());
|
||||
ASSERT_EQ(1ul, ownerships.size());
|
||||
EXPECT_EQ("$Default", ownerships[0].ConsumerGroup);
|
||||
EXPECT_EQ("event-hub-name", ownerships[0].EventHubName);
|
||||
EXPECT_EQ("ns.servicebus.windows.net", ownerships[0].FullyQualifiedNamespace);
|
||||
|
@ -122,7 +122,7 @@ namespace Azure { namespace Messaging { namespace EventHubs { namespace Test {
|
|||
"partition-id",
|
||||
"owner-id",
|
||||
Azure::ETag("randomETAG")}});
|
||||
EXPECT_EQ(0, ownerships.size());
|
||||
EXPECT_EQ(0ul, ownerships.size());
|
||||
|
||||
ownerships = checkpointStore.ClaimOwnership(
|
||||
std::vector<Azure::Messaging::EventHubs::Models::Ownership>{
|
||||
|
@ -134,7 +134,7 @@ namespace Azure { namespace Messaging { namespace EventHubs { namespace Test {
|
|||
"owner-id",
|
||||
validEtag}});
|
||||
|
||||
EXPECT_EQ(1, ownerships.size());
|
||||
EXPECT_EQ(1ul, ownerships.size());
|
||||
EXPECT_NE(validEtag, ownerships[0].ETag.Value());
|
||||
EXPECT_EQ("$Default", ownerships[0].ConsumerGroup);
|
||||
EXPECT_EQ("event-hub-name", ownerships[0].EventHubName);
|
||||
|
|
|
@ -122,13 +122,13 @@ namespace Azure { namespace Messaging { namespace EventHubs { namespace Test {
|
|||
std::chrono::minutes(2));
|
||||
auto const& ownerships = loadBalancer.LoadBalance(std::vector<std::string>{"0", "1", "2", "3"});
|
||||
|
||||
EXPECT_EQ(ownerships.size(), 2);
|
||||
EXPECT_EQ(ownerships.size(), 2ul);
|
||||
EXPECT_TRUE(ownerships[0].PartitionID == "1" || ownerships[0].PartitionID == "2");
|
||||
EXPECT_TRUE(ownerships[1].PartitionID == "1" || ownerships[1].PartitionID == "2");
|
||||
|
||||
auto finalOwneships = loadBalancer.m_checkpointStore->ListOwnership(
|
||||
testEventHubFQDN, testEventHubName, testConsumerGroup);
|
||||
EXPECT_EQ(finalOwneships.size(), 4);
|
||||
EXPECT_EQ(finalOwneships.size(), 4ul);
|
||||
}
|
||||
|
||||
TEST_F(ProcessorLoadBalancerTest, Balanced_UnownedPartitions)
|
||||
|
@ -146,11 +146,11 @@ namespace Azure { namespace Messaging { namespace EventHubs { namespace Test {
|
|||
|
||||
auto ownerships = loadBalancer.LoadBalance(std::vector<std::string>{"0", "1", "2", "3"});
|
||||
|
||||
EXPECT_EQ(ownerships.size(), 1);
|
||||
EXPECT_EQ(ownerships.size(), 1ul);
|
||||
|
||||
ownerships = loadBalancer.LoadBalance(std::vector<std::string>{"0", "1", "2", "3"});
|
||||
|
||||
EXPECT_EQ(ownerships.size(), 2);
|
||||
EXPECT_EQ(ownerships.size(), 2ul);
|
||||
|
||||
RequireBalanced(
|
||||
loadBalancer.m_checkpointStore->ListOwnership(
|
||||
|
@ -183,7 +183,7 @@ namespace Azure { namespace Messaging { namespace EventHubs { namespace Test {
|
|||
testEventHubFQDN, testEventHubName, testConsumerGroup);
|
||||
auto ownersMap = GroupByOwner(finalOwneships);
|
||||
auto commons = FindCommon(ownersMap);
|
||||
EXPECT_EQ(commons.size(), 0);
|
||||
EXPECT_EQ(commons.size(), 0ul);
|
||||
}
|
||||
|
||||
TEST_F(ProcessorLoadBalancerTest, AnyStrategy_GetExpiredPartition)
|
||||
|
@ -255,7 +255,7 @@ namespace Azure { namespace Messaging { namespace EventHubs { namespace Test {
|
|||
|
||||
EXPECT_EQ(GroupByOwner(ownerships)[clientB][0], "3");
|
||||
EXPECT_EQ(GroupByOwner(ownerships)[clientB][1], "4");
|
||||
EXPECT_EQ(GroupByOwner(ownerships)[clientB].size(), 2);
|
||||
EXPECT_EQ(GroupByOwner(ownerships)[clientB].size(), 2ul);
|
||||
|
||||
RequireBalanced(
|
||||
loadBalancer.m_checkpointStore->ListOwnership(
|
||||
|
@ -277,7 +277,7 @@ namespace Azure { namespace Messaging { namespace EventHubs { namespace Test {
|
|||
EXPECT_EQ(GroupByOwner(ownerships)[clientA][0], "0");
|
||||
EXPECT_EQ(GroupByOwner(ownerships)[clientA][1], "1");
|
||||
EXPECT_EQ(GroupByOwner(ownerships)[clientA][2], "2");
|
||||
EXPECT_EQ(GroupByOwner(ownerships)[clientA].size(), 3);
|
||||
EXPECT_EQ(GroupByOwner(ownerships)[clientA].size(), 3ul);
|
||||
|
||||
RequireBalanced(
|
||||
loadBalancer.m_checkpointStore->ListOwnership(
|
||||
|
@ -315,9 +315,9 @@ namespace Azure { namespace Messaging { namespace EventHubs { namespace Test {
|
|||
|
||||
auto ownerships = loadBalancer.LoadBalance({"0", "1", "2", "3"});
|
||||
|
||||
EXPECT_EQ(GroupByOwner(ownerships)[clientB].size(), 2ul);
|
||||
EXPECT_EQ(GroupByOwner(ownerships)[clientB][0], "2");
|
||||
EXPECT_EQ(GroupByOwner(ownerships)[clientB][1], "3");
|
||||
EXPECT_EQ(GroupByOwner(ownerships)[clientB].size(), 2);
|
||||
|
||||
RequireBalanced(
|
||||
loadBalancer.m_checkpointStore->ListOwnership(
|
||||
|
@ -336,9 +336,9 @@ namespace Azure { namespace Messaging { namespace EventHubs { namespace Test {
|
|||
|
||||
auto ownerships = loadBalancer.LoadBalance({"0", "1", "2", "3"});
|
||||
|
||||
EXPECT_EQ(GroupByOwner(ownerships)[clientA].size(), 2ul);
|
||||
EXPECT_EQ(GroupByOwner(ownerships)[clientA][0], "0");
|
||||
EXPECT_EQ(GroupByOwner(ownerships)[clientA][1], "1");
|
||||
EXPECT_EQ(GroupByOwner(ownerships)[clientA].size(), 2);
|
||||
|
||||
RequireBalanced(
|
||||
loadBalancer.m_checkpointStore->ListOwnership(
|
||||
|
@ -376,10 +376,10 @@ namespace Azure { namespace Messaging { namespace EventHubs { namespace Test {
|
|||
auto ownerships = loadBalancer.LoadBalance({"0", "1", "2", "3", "4"});
|
||||
auto clientOwned = GroupByOwner(ownerships)[clientB];
|
||||
std::sort(clientOwned.begin(), clientOwned.end());
|
||||
ASSERT_EQ(clientOwned.size(), 3ul);
|
||||
EXPECT_EQ(clientOwned[0], "2");
|
||||
EXPECT_EQ(clientOwned[1], "3");
|
||||
EXPECT_EQ(clientOwned[2], "4");
|
||||
EXPECT_EQ(clientOwned.size(), 3);
|
||||
|
||||
RequireBalanced(
|
||||
loadBalancer.m_checkpointStore->ListOwnership(
|
||||
|
@ -418,10 +418,10 @@ namespace Azure { namespace Messaging { namespace EventHubs { namespace Test {
|
|||
|
||||
auto clientOwned = GroupByOwner(ownerships)[clientA];
|
||||
std::sort(clientOwned.begin(), clientOwned.end());
|
||||
ASSERT_EQ(clientOwned.size(), 3ul);
|
||||
EXPECT_EQ(clientOwned[0], "0");
|
||||
EXPECT_EQ(clientOwned[1], "1");
|
||||
EXPECT_EQ(clientOwned[2], "2");
|
||||
EXPECT_EQ(clientOwned.size(), 3);
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -435,7 +435,7 @@ namespace Azure { namespace Messaging { namespace EventHubs { namespace Test {
|
|||
auto ownerships = loadBalancer.LoadBalance({"0", "1", "2", "3"});
|
||||
|
||||
auto clientOwned = GroupByOwner(ownerships)[clientB];
|
||||
EXPECT_EQ(clientOwned.size(), 2);
|
||||
EXPECT_EQ(clientOwned.size(), 2ul);
|
||||
|
||||
RequireBalanced(
|
||||
loadBalancer.m_checkpointStore->ListOwnership(
|
||||
|
|
Загрузка…
Ссылка в новой задаче