blob: fba1d78eab5e0178e7d8ce3dce3d559a1f37b19b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/messagebus/emptyreply.h>
#include <vespa/messagebus/routablequeue.h>
#include <vespa/messagebus/testlib/simplemessage.h>
#include <vespa/messagebus/testlib/simplereply.h>
#include <vespa/vespalib/testkit/testapp.h>
using namespace mbus;
TEST_SETUP(Test);
int
Test::Main()
{
TEST_INIT("auto-reply_test");
RoutableQueue q;
{
Message::UP msg(new SimpleMessage("test"));
}
EXPECT_TRUE(q.size() == 0);
{
Message::UP msg(new SimpleMessage("test"));
msg->pushHandler(q);
}
EXPECT_TRUE(q.size() == 1);
{
Reply::UP reply(new SimpleReply("test"));
}
EXPECT_TRUE(q.size() == 1);
{
Reply::UP reply(new SimpleReply("test"));
reply->pushHandler(q);
}
EXPECT_TRUE(q.size() == 2);
TEST_DONE();
}
|