summaryrefslogtreecommitdiffstats
path: root/messagebus
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-08-23 21:45:36 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2017-08-23 21:45:36 +0200
commitefa813a34dc4decad2b145002798b9207e9753b8 (patch)
tree191c95698244e817bd962d7c6509205e663d8c45 /messagebus
parentf1376511dc20469576c0e3b2bceac151f9946054 (diff)
All you need is make_string.
Diffstat (limited to 'messagebus')
-rw-r--r--messagebus/src/tests/advancedrouting/advancedrouting.cpp4
-rw-r--r--messagebus/src/tests/messagebus/messagebus.cpp12
-rw-r--r--messagebus/src/tests/messageordering/messageordering.cpp14
-rw-r--r--messagebus/src/tests/routingcontext/routingcontext.cpp37
-rw-r--r--messagebus/src/tests/serviceaddress/serviceaddress.cpp1
-rw-r--r--messagebus/src/tests/shutdown/shutdown.cpp1
-rw-r--r--messagebus/src/vespa/messagebus/testlib/custompolicy.cpp7
-rw-r--r--messagebus/src/vespa/messagebus/testlib/custompolicy.h1
8 files changed, 31 insertions, 46 deletions
diff --git a/messagebus/src/tests/advancedrouting/advancedrouting.cpp b/messagebus/src/tests/advancedrouting/advancedrouting.cpp
index eed792ebf7c..e847fdf3222 100644
--- a/messagebus/src/tests/advancedrouting/advancedrouting.cpp
+++ b/messagebus/src/tests/advancedrouting/advancedrouting.cpp
@@ -11,7 +11,7 @@
#include <vespa/messagebus/testlib/slobrok.h>
#include <vespa/messagebus/testlib/testserver.h>
#include <vespa/vespalib/testkit/testapp.h>
-#include <vespa/vespalib/util/vstringfmt.h>
+#include <vespa/vespalib/util/stringfmt.h>
using namespace mbus;
@@ -126,7 +126,7 @@ Test::testAdvanced(TestData &data)
.addHop(HopSpec("bar", "dst/bar"))
.addHop(HopSpec("baz", "dst/baz"))
.addRoute(RouteSpec("baz").addHop("baz"))));
- string route = vespalib::make_vespa_string("[Custom:%s,bar,route:baz,dst/cox,?dst/unknown]",
+ string route = vespalib::make_string("[Custom:%s,bar,route:baz,dst/cox,?dst/unknown]",
data._fooSession->getConnectionSpec().c_str());
EXPECT_TRUE(data._srcSession->send(createMessage("msg"), Route::parse(route)).isAccepted());
diff --git a/messagebus/src/tests/messagebus/messagebus.cpp b/messagebus/src/tests/messagebus/messagebus.cpp
index bcd5d662cea..7434941a900 100644
--- a/messagebus/src/tests/messagebus/messagebus.cpp
+++ b/messagebus/src/tests/messagebus/messagebus.cpp
@@ -2,25 +2,17 @@
#include <vespa/messagebus/destinationsession.h>
#include <vespa/messagebus/emptyreply.h>
-#include <vespa/messagebus/error.h>
#include <vespa/messagebus/errorcode.h>
#include <vespa/messagebus/intermediatesession.h>
#include <vespa/messagebus/messagebus.h>
#include <vespa/messagebus/routablequeue.h>
-#include <vespa/messagebus/routing/route.h>
#include <vespa/messagebus/routing/routingcontext.h>
-#include <vespa/messagebus/routing/routingnodeiterator.h>
-#include <vespa/messagebus/routing/routingspec.h>
-#include <vespa/messagebus/sourcesession.h>
-#include <vespa/messagebus/sourcesessionparams.h>
-#include <vespa/messagebus/testlib/receptor.h>
#include <vespa/messagebus/testlib/simplemessage.h>
#include <vespa/messagebus/testlib/simpleprotocol.h>
-#include <vespa/messagebus/testlib/simplereply.h>
#include <vespa/messagebus/testlib/slobrok.h>
#include <vespa/messagebus/testlib/testserver.h>
#include <vespa/vespalib/testkit/testapp.h>
-#include <vespa/vespalib/util/vstringfmt.h>
+#include <vespa/vespalib/util/stringfmt.h>
using namespace mbus;
@@ -377,7 +369,7 @@ Test::testDirectHop()
// Send using name.
ASSERT_TRUE(client->session->send(
Message::UP(new SimpleMessage("empty")),
- Route().addHop(vespalib::make_vespa_string("search/r.%d/c.%d/session", row, col)))
+ Route().addHop(vespalib::make_string("search/r.%d/c.%d/session", row, col)))
.isAccepted());
assertDst(*dst);
assertSrc(*client);
diff --git a/messagebus/src/tests/messageordering/messageordering.cpp b/messagebus/src/tests/messageordering/messageordering.cpp
index 9df36b349a1..7ea31701127 100644
--- a/messagebus/src/tests/messageordering/messageordering.cpp
+++ b/messagebus/src/tests/messageordering/messageordering.cpp
@@ -1,19 +1,13 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/messagebus/messagebus.h>
-#include <vespa/messagebus/sourcesession.h>
-#include <vespa/messagebus/destinationsession.h>
#include <vespa/messagebus/testlib/slobrok.h>
#include <vespa/messagebus/testlib/testserver.h>
-#include <vespa/messagebus/routing/routingspec.h>
#include <vespa/messagebus/testlib/receptor.h>
-#include <vespa/messagebus/sourcesessionparams.h>
#include <vespa/messagebus/testlib/simplemessage.h>
#include <vespa/messagebus/testlib/simplereply.h>
-#include <vespa/messagebus/testlib/simpleprotocol.h>
#include <vespa/messagebus/errorcode.h>
-#include <vespa/vespalib/util/vstringfmt.h>
-#include <stdexcept>
+#include <vespa/vespalib/util/stringfmt.h>
#include <vespa/log/log.h>
LOG_SETUP("messageordering_test");
@@ -54,7 +48,7 @@ public:
vespalib::MonitorGuard lock(_mon);
- vespalib::string expected(vespalib::make_vespa_string("%d", _messageCounter));
+ vespalib::string expected(vespalib::make_string("%d", _messageCounter));
LOG(debug, "Got message %p with %s, expecting %s",
msg.get(),
simpleMsg.getValue().c_str(),
@@ -117,7 +111,7 @@ VerifyReplyReceptor::handleReply(Reply::UP reply)
}
LOG(warning, "%s", ss.str().c_str());
} else {
- vespalib::string expected(vespalib::make_vespa_string("%d", _replyCount));
+ vespalib::string expected(vespalib::make_string("%d", _replyCount));
SimpleReply& simpleReply(static_cast<SimpleReply&>(*reply));
if (simpleReply.getValue() != expected) {
std::stringstream ss;
@@ -171,7 +165,7 @@ Test::Main()
// send messages on client
const int messageCount = 10000;
for (int i = 0; i < messageCount; ++i) {
- vespalib::string str(vespalib::make_vespa_string("%d", i));
+ vespalib::string str(vespalib::make_string("%d", i));
//FastOS_Thread::Sleep(1);
SimpleMessage::UP msg(new SimpleMessage(str, true, commonMessageId));
msg->getTrace().setLevel(9);
diff --git a/messagebus/src/tests/routingcontext/routingcontext.cpp b/messagebus/src/tests/routingcontext/routingcontext.cpp
index 3cf8be32f04..12ed456b5a6 100644
--- a/messagebus/src/tests/routingcontext/routingcontext.cpp
+++ b/messagebus/src/tests/routingcontext/routingcontext.cpp
@@ -10,7 +10,8 @@
#include <vespa/messagebus/testlib/slobrok.h>
#include <vespa/messagebus/testlib/testserver.h>
#include <vespa/vespalib/testkit/testapp.h>
-#include <vespa/vespalib/util/vstringfmt.h>
+#include <vespa/vespalib/util/stringfmt.h>
+
using namespace mbus;
@@ -20,7 +21,7 @@ using namespace mbus;
//
////////////////////////////////////////////////////////////////////////////////
-using vespalib::make_vespa_string;
+using vespalib::make_string;
static const double TIMEOUT = 120;
@@ -74,32 +75,32 @@ CustomPolicy::select(RoutingContext &ctx)
const std::vector<Route> &all = ctx.getAllRecipients();
if (_factory._expectedAll.size() == all.size()) {
- ctx.trace(1, make_vespa_string("Got %d expected recipients.", (uint32_t)all.size()));
+ ctx.trace(1, make_string("Got %d expected recipients.", (uint32_t)all.size()));
for (std::vector<Route>::const_iterator it = all.begin();
it != all.end(); ++it)
{
if (find(_factory._expectedAll.begin(), _factory._expectedAll.end(), it->toString()) != _factory._expectedAll.end()) {
- ctx.trace(1, make_vespa_string("Got expected recipient '%s'.", it->toString().c_str()));
+ ctx.trace(1, make_string("Got expected recipient '%s'.", it->toString().c_str()));
} else {
reply->addError(Error(ErrorCode::APP_FATAL_ERROR,
- make_vespa_string("Matched recipient '%s' not expected.",
- it->toString().c_str())));
+ make_string("Matched recipient '%s' not expected.",
+ it->toString().c_str())));
}
}
} else {
reply->addError(Error(ErrorCode::APP_FATAL_ERROR,
- make_vespa_string("Expected %d recipients, got %d.",
- (uint32_t)_factory._expectedAll.size(),
- (uint32_t)all.size())));
+ make_string("Expected %d recipients, got %d.",
+ (uint32_t)_factory._expectedAll.size(),
+ (uint32_t)all.size())));
}
if (ctx.getNumRecipients() == all.size()) {
for (uint32_t i = 0; i < all.size(); ++i) {
if (all[i].toString() == ctx.getRecipient(i).toString()) {
- ctx.trace(1, make_vespa_string("getRecipient(%d) matches getAllRecipients()[%d]", i, i));
+ ctx.trace(1, make_string("getRecipient(%d) matches getAllRecipients()[%d]", i, i));
} else {
reply->addError(Error(ErrorCode::APP_FATAL_ERROR,
- make_vespa_string("getRecipient(%d) differs from getAllRecipients()[%d]", i, i)));
+ make_string("getRecipient(%d) differs from getAllRecipients()[%d]", i, i)));
}
}
} else {
@@ -110,23 +111,23 @@ CustomPolicy::select(RoutingContext &ctx)
std::vector<Route> matched;
ctx.getMatchedRecipients(matched);
if (_factory._expectedMatched.size() == matched.size()) {
- ctx.trace(1, make_vespa_string("Got %d expected recipients.", (uint32_t)matched.size()));
+ ctx.trace(1, make_string("Got %d expected recipients.", (uint32_t)matched.size()));
for (std::vector<Route>::iterator it = matched.begin();
it != matched.end(); ++it)
{
if (find(_factory._expectedMatched.begin(), _factory._expectedMatched.end(), it->toString()) != _factory._expectedMatched.end()) {
- ctx.trace(1, make_vespa_string("Got matched recipient '%s'.", it->toString().c_str()));
+ ctx.trace(1, make_string("Got matched recipient '%s'.", it->toString().c_str()));
} else {
reply->addError(Error(ErrorCode::APP_FATAL_ERROR,
- make_vespa_string("Matched recipient '%s' not expected.",
- it->toString().c_str())));
+ make_string("Matched recipient '%s' not expected.",
+ it->toString().c_str())));
}
}
} else {
reply->addError(Error(ErrorCode::APP_FATAL_ERROR,
- make_vespa_string("Expected %d matched recipients, got %d.",
- (uint32_t)_factory._expectedMatched.size(),
- (uint32_t)matched.size())));
+ make_string("Expected %d matched recipients, got %d.",
+ (uint32_t)_factory._expectedMatched.size(),
+ (uint32_t)matched.size())));
}
if (!reply->hasErrors() && _factory._forward) {
diff --git a/messagebus/src/tests/serviceaddress/serviceaddress.cpp b/messagebus/src/tests/serviceaddress/serviceaddress.cpp
index f2f5f5eca76..15a2e9fdac8 100644
--- a/messagebus/src/tests/serviceaddress/serviceaddress.cpp
+++ b/messagebus/src/tests/serviceaddress/serviceaddress.cpp
@@ -17,7 +17,6 @@
#include <vespa/messagebus/routing/routingspec.h>
#include <vespa/messagebus/network/rpcservice.h>
#include <vespa/messagebus/sourcesessionparams.h>
-#include <vespa/vespalib/util/vstringfmt.h>
using namespace mbus;
diff --git a/messagebus/src/tests/shutdown/shutdown.cpp b/messagebus/src/tests/shutdown/shutdown.cpp
index 7bb636cc87e..b5e6cac970e 100644
--- a/messagebus/src/tests/shutdown/shutdown.cpp
+++ b/messagebus/src/tests/shutdown/shutdown.cpp
@@ -12,7 +12,6 @@
#include <vespa/messagebus/testlib/testserver.h>
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/vespalib/util/exceptions.h>
-#include <vespa/vespalib/util/vstringfmt.h>
using namespace mbus;
diff --git a/messagebus/src/vespa/messagebus/testlib/custompolicy.cpp b/messagebus/src/vespa/messagebus/testlib/custompolicy.cpp
index 866183769cd..c65e4147389 100644
--- a/messagebus/src/vespa/messagebus/testlib/custompolicy.cpp
+++ b/messagebus/src/vespa/messagebus/testlib/custompolicy.cpp
@@ -1,11 +1,10 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <boost/tokenizer.hpp>
+#include "custompolicy.h"
+#include "simpleprotocol.h"
#include <vespa/messagebus/emptyreply.h>
#include <vespa/messagebus/errorcode.h>
#include <vespa/messagebus/routing/routingcontext.h>
-#include <vespa/vespalib/util/vstringfmt.h>
-#include "custompolicy.h"
-#include "simpleprotocol.h"
+#include <boost/tokenizer.hpp>
#include <vespa/log/log.h>
LOG_SETUP(".custompolicy");
diff --git a/messagebus/src/vespa/messagebus/testlib/custompolicy.h b/messagebus/src/vespa/messagebus/testlib/custompolicy.h
index 827c17f1d23..78c851d175c 100644
--- a/messagebus/src/vespa/messagebus/testlib/custompolicy.h
+++ b/messagebus/src/vespa/messagebus/testlib/custompolicy.h
@@ -3,6 +3,7 @@
#include "simpleprotocol.h"
#include <vespa/messagebus/routing/iroutingpolicy.h>
+#include <vespa/messagebus/routing/route.h>
namespace mbus {