summaryrefslogtreecommitdiffstats
path: root/messagebus_test
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2016-09-14 00:13:11 +0200
committerGitHub <noreply@github.com>2016-09-14 00:13:11 +0200
commit0836f0bf337ee23c5e66f420cfa54d49e4a2104e (patch)
tree403c361cd30043cc3de04483489cfa8e25fe0ff3 /messagebus_test
parent4537f2d1e36f41e74f348258aecf448b77ef1799 (diff)
Revert "Aressem/move messagebus test tests to separate module"
Diffstat (limited to 'messagebus_test')
-rw-r--r--messagebus_test/CMakeLists.txt17
-rw-r--r--messagebus_test/OWNERS3
-rw-r--r--messagebus_test/README1
-rw-r--r--messagebus_test/src/.gitignore8
-rw-r--r--messagebus_test/src/binref/.gitignore5
-rw-r--r--messagebus_test/src/binref/CMakeLists.txt5
-rwxr-xr-xmessagebus_test/src/binref/compilejava.in11
-rw-r--r--messagebus_test/src/binref/env.sh.in2
l---------messagebus_test/src/binref/progctl.sh1
-rwxr-xr-xmessagebus_test/src/binref/runjava.in13
-rw-r--r--messagebus_test/src/tests/compile-cpp/.gitignore4
-rw-r--r--messagebus_test/src/tests/compile-cpp/CMakeLists.txt8
-rw-r--r--messagebus_test/src/tests/compile-cpp/DESC2
-rw-r--r--messagebus_test/src/tests/compile-cpp/FILES1
-rw-r--r--messagebus_test/src/tests/compile-cpp/compile-cpp.cpp16
-rw-r--r--messagebus_test/src/tests/compile-java/.gitignore4
-rw-r--r--messagebus_test/src/tests/compile-java/CMakeLists.txt2
-rw-r--r--messagebus_test/src/tests/compile-java/DESC2
-rw-r--r--messagebus_test/src/tests/compile-java/FILES1
-rw-r--r--messagebus_test/src/tests/compile-java/TestCompile.java9
-rwxr-xr-xmessagebus_test/src/tests/compile-java/compile-java_test.sh12
-rw-r--r--messagebus_test/src/tests/error/.gitignore15
-rw-r--r--messagebus_test/src/tests/error/CMakeLists.txt21
-rw-r--r--messagebus_test/src/tests/error/DESC2
-rw-r--r--messagebus_test/src/tests/error/FILES8
-rw-r--r--messagebus_test/src/tests/error/JavaClient.java65
-rw-r--r--messagebus_test/src/tests/error/JavaServer.java47
-rw-r--r--messagebus_test/src/tests/error/cpp-client.cpp75
-rw-r--r--messagebus_test/src/tests/error/cpp-server.cpp73
-rwxr-xr-xmessagebus_test/src/tests/error/ctl.sh10
-rw-r--r--messagebus_test/src/tests/error/error.cpp49
-rwxr-xr-xmessagebus_test/src/tests/error/error_test.sh12
-rw-r--r--messagebus_test/src/tests/error/progdefs.sh3
-rw-r--r--messagebus_test/src/tests/error/routing-template.cfg11
-rw-r--r--messagebus_test/src/tests/errorcodes/.gitignore7
-rw-r--r--messagebus_test/src/tests/errorcodes/CMakeLists.txt9
-rw-r--r--messagebus_test/src/tests/errorcodes/DESC2
-rw-r--r--messagebus_test/src/tests/errorcodes/DumpCodes.java51
-rw-r--r--messagebus_test/src/tests/errorcodes/FILES5
-rw-r--r--messagebus_test/src/tests/errorcodes/dumpcodes.cpp70
-rwxr-xr-xmessagebus_test/src/tests/errorcodes/errorcodes_test.sh15
-rw-r--r--messagebus_test/src/tests/errorcodes/ref-dump.txt34
-rw-r--r--messagebus_test/src/tests/speed/.gitignore15
-rw-r--r--messagebus_test/src/tests/speed/CMakeLists.txt21
-rw-r--r--messagebus_test/src/tests/speed/DESC4
-rw-r--r--messagebus_test/src/tests/speed/FILES8
-rw-r--r--messagebus_test/src/tests/speed/JavaClient.java137
-rw-r--r--messagebus_test/src/tests/speed/JavaServer.java54
-rw-r--r--messagebus_test/src/tests/speed/cpp-client.cpp146
-rw-r--r--messagebus_test/src/tests/speed/cpp-server.cpp77
-rwxr-xr-xmessagebus_test/src/tests/speed/ctl.sh10
-rw-r--r--messagebus_test/src/tests/speed/progdefs.sh3
-rw-r--r--messagebus_test/src/tests/speed/routing-template.cfg11
-rw-r--r--messagebus_test/src/tests/speed/speed.cpp56
-rwxr-xr-xmessagebus_test/src/tests/speed/speed_test.sh13
-rw-r--r--messagebus_test/src/tests/trace/.gitignore12
-rw-r--r--messagebus_test/src/tests/trace/CMakeLists.txt15
-rw-r--r--messagebus_test/src/tests/trace/DESC1
-rw-r--r--messagebus_test/src/tests/trace/FILES19
-rw-r--r--messagebus_test/src/tests/trace/JavaServer.java97
-rw-r--r--messagebus_test/src/tests/trace/cpp-server.cpp90
-rwxr-xr-xmessagebus_test/src/tests/trace/ctl.sh10
-rw-r--r--messagebus_test/src/tests/trace/progdefs.sh15
-rw-r--r--messagebus_test/src/tests/trace/routing-template.cfg32
-rw-r--r--messagebus_test/src/tests/trace/trace.cpp121
-rwxr-xr-xmessagebus_test/src/tests/trace/trace_test.sh12
66 files changed, 0 insertions, 1690 deletions
diff --git a/messagebus_test/CMakeLists.txt b/messagebus_test/CMakeLists.txt
deleted file mode 100644
index 96dc39327ac..00000000000
--- a/messagebus_test/CMakeLists.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-vespa_define_module(
- DEPENDS
- slobrok_slobrokserver
- messagebus
-
- APPS
- src/binref
-
- TESTS
- src/tests/compile-cpp
- src/tests/compile-java
- src/tests/error
- src/tests/errorcodes
- src/tests/speed
- src/tests/trace
-)
-
diff --git a/messagebus_test/OWNERS b/messagebus_test/OWNERS
deleted file mode 100644
index 7379f3287ad..00000000000
--- a/messagebus_test/OWNERS
+++ /dev/null
@@ -1,3 +0,0 @@
-dybis
-baldersheim
-
diff --git a/messagebus_test/README b/messagebus_test/README
deleted file mode 100644
index 7c63f8b1a48..00000000000
--- a/messagebus_test/README
+++ /dev/null
@@ -1 +0,0 @@
-This is the generic Vespa message bus infrastructure tests that combine C++ and Java.
diff --git a/messagebus_test/src/.gitignore b/messagebus_test/src/.gitignore
deleted file mode 100644
index 8689bfd3624..00000000000
--- a/messagebus_test/src/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-Makefile.inc
-Makefile.ini
-config.cfg
-config_command.sh
-configure
-project.dsw
-versiontag.mak
-/messagebus_test.mak
diff --git a/messagebus_test/src/binref/.gitignore b/messagebus_test/src/binref/.gitignore
deleted file mode 100644
index c1b83610972..00000000000
--- a/messagebus_test/src/binref/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-.depend
-Makefile
-compilejava
-env.sh
-runjava
diff --git a/messagebus_test/src/binref/CMakeLists.txt b/messagebus_test/src/binref/CMakeLists.txt
deleted file mode 100644
index 20594f98d02..00000000000
--- a/messagebus_test/src/binref/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-configure_file(compilejava.in compilejava @ONLY)
-configure_file(runjava.in runjava @ONLY)
-configure_file(env.sh.in env.sh @ONLY)
diff --git a/messagebus_test/src/binref/compilejava.in b/messagebus_test/src/binref/compilejava.in
deleted file mode 100755
index 3dca3c2f3db..00000000000
--- a/messagebus_test/src/binref/compilejava.in
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-unset VESPA_LOG_TARGET
-CLASSPATH=@PROJECT_SOURCE_DIR@/messagebus/target/messagebus-jar-with-dependencies.jar
-CLASSPATH=$CLASSPATH:@PROJECT_SOURCE_DIR@/component/target/component.jar
-CLASSPATH=$CLASSPATH:.
-
-if [ $# -lt 1 ]; then
- echo "usage: compilejava file ..."
- exit 1
-fi
-exec javac -d . -classpath $CLASSPATH "$@"
diff --git a/messagebus_test/src/binref/env.sh.in b/messagebus_test/src/binref/env.sh.in
deleted file mode 100644
index d485eb9dfea..00000000000
--- a/messagebus_test/src/binref/env.sh.in
+++ /dev/null
@@ -1,2 +0,0 @@
-BINREF=@CMAKE_CURRENT_BINARY_DIR@
-export BINREF
diff --git a/messagebus_test/src/binref/progctl.sh b/messagebus_test/src/binref/progctl.sh
deleted file mode 120000
index 2c1fb1d47ce..00000000000
--- a/messagebus_test/src/binref/progctl.sh
+++ /dev/null
@@ -1 +0,0 @@
-../../../vespalib/src/vespa/vespalib/testkit/progctl.sh \ No newline at end of file
diff --git a/messagebus_test/src/binref/runjava.in b/messagebus_test/src/binref/runjava.in
deleted file mode 100755
index f6427a1f7cc..00000000000
--- a/messagebus_test/src/binref/runjava.in
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-unset VESPA_LOG_TARGET
-unset LD_PRELOAD
-CLASSPATH=@PROJECT_SOURCE_DIR@/messagebus/target/messagebus-jar-with-dependencies.jar
-CLASSPATH=$CLASSPATH:@PROJECT_SOURCE_DIR@/component/target/component.jar
-CLASSPATH=$CLASSPATH:.
-if [ $# -lt 1 ]; then
- echo "usage: runjava <class> [args]"
- exit 1
-fi
-CLASS=$1
-shift
-exec java -cp $CLASSPATH $CLASS "$@"
diff --git a/messagebus_test/src/tests/compile-cpp/.gitignore b/messagebus_test/src/tests/compile-cpp/.gitignore
deleted file mode 100644
index 14e4fb37c45..00000000000
--- a/messagebus_test/src/tests/compile-cpp/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.depend
-Makefile
-compile-cpp_test
-messagebus_test_compile-cpp_test_app
diff --git a/messagebus_test/src/tests/compile-cpp/CMakeLists.txt b/messagebus_test/src/tests/compile-cpp/CMakeLists.txt
deleted file mode 100644
index 86e3d7388ab..00000000000
--- a/messagebus_test/src/tests/compile-cpp/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-vespa_add_executable(messagebus_test_compile-cpp_test_app TEST
- SOURCES
- compile-cpp.cpp
- DEPENDS
- messagebus
-)
-vespa_add_test(NAME messagebus_test_compile-cpp_test_app NO_VALGRIND COMMAND messagebus_test_compile-cpp_test_app)
diff --git a/messagebus_test/src/tests/compile-cpp/DESC b/messagebus_test/src/tests/compile-cpp/DESC
deleted file mode 100644
index 465d625ca9e..00000000000
--- a/messagebus_test/src/tests/compile-cpp/DESC
+++ /dev/null
@@ -1,2 +0,0 @@
-simple compilation test to check dependencies.
-
diff --git a/messagebus_test/src/tests/compile-cpp/FILES b/messagebus_test/src/tests/compile-cpp/FILES
deleted file mode 100644
index 956ce16a56e..00000000000
--- a/messagebus_test/src/tests/compile-cpp/FILES
+++ /dev/null
@@ -1 +0,0 @@
-compile-cpp.cpp
diff --git a/messagebus_test/src/tests/compile-cpp/compile-cpp.cpp b/messagebus_test/src/tests/compile-cpp/compile-cpp.cpp
deleted file mode 100644
index e15b57859b7..00000000000
--- a/messagebus_test/src/tests/compile-cpp/compile-cpp.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP("compile-cpp_test");
-#include <vespa/vespalib/testkit/testapp.h>
-#include <vespa/messagebus/routing/route.h>
-
-TEST_SETUP(Test);
-
-int
-Test::Main()
-{
- TEST_INIT("compile-cpp_test");
- mbus::Route r;
- TEST_DONE();
-}
diff --git a/messagebus_test/src/tests/compile-java/.gitignore b/messagebus_test/src/tests/compile-java/.gitignore
deleted file mode 100644
index d615ebbafe7..00000000000
--- a/messagebus_test/src/tests/compile-java/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-*.class
-.depend
-Makefile
-compile-java_test
diff --git a/messagebus_test/src/tests/compile-java/CMakeLists.txt b/messagebus_test/src/tests/compile-java/CMakeLists.txt
deleted file mode 100644
index f13175939f6..00000000000
--- a/messagebus_test/src/tests/compile-java/CMakeLists.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-vespa_add_test(NAME messagebus_test_compile-java_test NO_VALGRIND COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/compile-java_test.sh)
diff --git a/messagebus_test/src/tests/compile-java/DESC b/messagebus_test/src/tests/compile-java/DESC
deleted file mode 100644
index 465d625ca9e..00000000000
--- a/messagebus_test/src/tests/compile-java/DESC
+++ /dev/null
@@ -1,2 +0,0 @@
-simple compilation test to check dependencies.
-
diff --git a/messagebus_test/src/tests/compile-java/FILES b/messagebus_test/src/tests/compile-java/FILES
deleted file mode 100644
index 5b154bb1605..00000000000
--- a/messagebus_test/src/tests/compile-java/FILES
+++ /dev/null
@@ -1 +0,0 @@
-TestCompile.java
diff --git a/messagebus_test/src/tests/compile-java/TestCompile.java b/messagebus_test/src/tests/compile-java/TestCompile.java
deleted file mode 100644
index 443ae093794..00000000000
--- a/messagebus_test/src/tests/compile-java/TestCompile.java
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-import com.yahoo.messagebus.EmptyReply;
-
-public class TestCompile {
- public static void main(String[] args) {
- EmptyReply er = new EmptyReply();
- }
-}
diff --git a/messagebus_test/src/tests/compile-java/compile-java_test.sh b/messagebus_test/src/tests/compile-java/compile-java_test.sh
deleted file mode 100755
index d99e3e841e5..00000000000
--- a/messagebus_test/src/tests/compile-java/compile-java_test.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-set -e
-
-if [ -z "$SOURCE_DIRECTORY" ]; then
- SOURCE_DIRECTORY="."
-fi
-
-. ../../binref/env.sh
-
-$BINREF/compilejava $SOURCE_DIRECTORY/TestCompile.java
-$BINREF/runjava TestCompile
-
diff --git a/messagebus_test/src/tests/error/.gitignore b/messagebus_test/src/tests/error/.gitignore
deleted file mode 100644
index 20cb631e9e8..00000000000
--- a/messagebus_test/src/tests/error/.gitignore
+++ /dev/null
@@ -1,15 +0,0 @@
-*.class
-.depend
-Makefile
-cpp-client
-cpp-server
-error_test
-out.*
-pid.*
-routing.cfg
-slobrok.cfg
-/cpp-client-error
-/cpp-server-error
-messagebus_test_error_test_app
-messagebus_test_cpp-client-error_app
-messagebus_test_cpp-server-error_app
diff --git a/messagebus_test/src/tests/error/CMakeLists.txt b/messagebus_test/src/tests/error/CMakeLists.txt
deleted file mode 100644
index 926047f31cd..00000000000
--- a/messagebus_test/src/tests/error/CMakeLists.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-vespa_add_executable(messagebus_test_error_test_app TEST
- SOURCES
- error.cpp
- DEPENDS
- messagebus_messagebus-test
-)
-vespa_add_executable(messagebus_test_cpp-server-error_app
- SOURCES
- cpp-server.cpp
- DEPENDS
- messagebus_messagebus-test
-)
-vespa_add_executable(messagebus_test_cpp-client-error_app
- SOURCES
- cpp-client.cpp
- DEPENDS
- messagebus_messagebus-test
-)
-vespa_add_test(NAME messagebus_test_error_test_app NO_VALGRIND COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/error_test.sh
- DEPENDS messagebus_test_error_test_app messagebus_test_cpp-server-error_app messagebus_test_cpp-client-error_app)
diff --git a/messagebus_test/src/tests/error/DESC b/messagebus_test/src/tests/error/DESC
deleted file mode 100644
index 171966761ee..00000000000
--- a/messagebus_test/src/tests/error/DESC
+++ /dev/null
@@ -1,2 +0,0 @@
-Check that java and cpp messagebus components are able to pass errors
-to each other and preserve meaning.
diff --git a/messagebus_test/src/tests/error/FILES b/messagebus_test/src/tests/error/FILES
deleted file mode 100644
index 571002a917f..00000000000
--- a/messagebus_test/src/tests/error/FILES
+++ /dev/null
@@ -1,8 +0,0 @@
-error.cpp
-out.server.cpp
-out.server.java
-cpp-client.cpp
-cpp-server.cpp
-JavaClient.java
-JavaServer.java
-routing-template.cfg
diff --git a/messagebus_test/src/tests/error/JavaClient.java b/messagebus_test/src/tests/error/JavaClient.java
deleted file mode 100644
index e263b3597da..00000000000
--- a/messagebus_test/src/tests/error/JavaClient.java
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-import com.yahoo.messagebus.*;
-import com.yahoo.messagebus.test.*;
-import com.yahoo.config.*;
-import com.yahoo.messagebus.routing.*;
-import com.yahoo.messagebus.network.*;
-import com.yahoo.messagebus.network.rpc.*;
-import com.yahoo.messagebus.network.rpc.test.*;
-import java.util.Arrays;
-import java.util.logging.*;
-
-public class JavaClient {
-
- private static Logger log = Logger.getLogger(JavaClient.class.getName());
-
- public static void main(String[] args) {
- try {
- RPCMessageBus mb = new RPCMessageBus(
- Arrays.asList((Protocol)new SimpleProtocol()),
- new RPCNetworkParams()
- .setIdentity(new Identity("server/java"))
- .setSlobrokConfigId("file:slobrok.cfg"),
- "file:routing.cfg");
-
- Receptor src = new Receptor();
- Message msg = null;
- Reply reply = null;
-
- SourceSession session = mb.getMessageBus().createSourceSession(src, new SourceSessionParams().setTimeout(300));
- for (int i = 0; i < 10; i++) {
- msg = new SimpleMessage("test");
- msg.getTrace().setLevel(9);
- session.send(msg, "test");
- reply = src.getReply(60);
- if (reply == null) {
- System.err.println("JAVA-CLIENT: no reply");
- } else {
- System.err.println("JAVA-CLIENT:\n" + reply.getTrace());
- if (reply.getNumErrors() == 2) {
- break;
- }
- }
- Thread.sleep(1000);
- }
- if (reply == null) {
- System.err.println("JAVA-CLIENT: no reply");
- System.exit(1);
- }
- if (reply.getNumErrors() != 2 ||
- reply.getError(0).getCode() != ErrorCode.APP_FATAL_ERROR + 1 ||
- reply.getError(1).getCode() != ErrorCode.APP_FATAL_ERROR + 2 ||
- !reply.getError(0).getMessage().equals("ERR 1") ||
- !reply.getError(1).getMessage().equals("ERR 2"))
- {
- System.err.printf("JAVA-CLIENT: wrong errors\n");
- System.exit(1);
- }
- session.destroy();
- mb.destroy();
- } catch (Exception e) {
- log.log(Level.SEVERE, "JAVA-CLIENT: Failed", e);
- System.exit(1);
- }
- }
-}
diff --git a/messagebus_test/src/tests/error/JavaServer.java b/messagebus_test/src/tests/error/JavaServer.java
deleted file mode 100644
index b5321f41fc3..00000000000
--- a/messagebus_test/src/tests/error/JavaServer.java
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-import com.yahoo.messagebus.*;
-import com.yahoo.messagebus.test.*;
-import com.yahoo.config.*;
-import com.yahoo.messagebus.routing.*;
-import com.yahoo.messagebus.network.*;
-import com.yahoo.messagebus.network.rpc.*;
-import java.util.Arrays;
-import java.util.logging.*;
-
-public class JavaServer implements MessageHandler {
-
- private static Logger log = Logger.getLogger(JavaServer.class.getName());
-
- private DestinationSession session;
-
- public JavaServer(RPCMessageBus mb) {
- session = mb.getMessageBus().createDestinationSession("session", true, this);
- }
-
- public void handleMessage(Message msg) {
- Reply reply = new EmptyReply();
- msg.swapState(reply);
- reply.addError(new com.yahoo.messagebus.Error(ErrorCode.APP_FATAL_ERROR + 1, "ERR 1"));
- reply.addError(new com.yahoo.messagebus.Error(ErrorCode.APP_FATAL_ERROR + 2, "ERR 2"));
- session.reply(reply);
- }
-
- public static void main(String[] args) {
- try {
- RPCMessageBus mb = new RPCMessageBus(
- Arrays.asList((Protocol)new SimpleProtocol()),
- new RPCNetworkParams()
- .setIdentity(new Identity("server/java"))
- .setSlobrokConfigId("file:slobrok.cfg"),
- "file:routing.cfg");
- JavaServer server = new JavaServer(mb);
- System.out.println("java server started");
- while (true) {
- Thread.sleep(1000);
- }
- } catch (Exception e) {
- log.log(Level.SEVERE, "JAVA-SERVER: Failed", e);
- System.exit(1);
- }
- }
-}
diff --git a/messagebus_test/src/tests/error/cpp-client.cpp b/messagebus_test/src/tests/error/cpp-client.cpp
deleted file mode 100644
index 4f94a13977c..00000000000
--- a/messagebus_test/src/tests/error/cpp-client.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP("cpp-client");
-#include <vespa/messagebus/messagebus.h>
-#include <vespa/messagebus/sourcesession.h>
-#include <vespa/messagebus/testlib/simplemessage.h>
-#include <vespa/messagebus/testlib/simplereply.h>
-#include <vespa/messagebus/testlib/simpleprotocol.h>
-#include <vespa/messagebus/rpcmessagebus.h>
-#include <vespa/messagebus/errorcode.h>
-#include <vespa/messagebus/iprotocol.h>
-#include <vespa/messagebus/protocolset.h>
-#include <vespa/messagebus/sourcesessionparams.h>
-#include <vespa/messagebus/testlib/receptor.h>
-#include <vespa/vespalib/util/sync.h>
-
-using namespace mbus;
-
-class App : public FastOS_Application
-{
-public:
- int Main();
-};
-
-int
-App::Main()
-{
- RPCMessageBus mb(ProtocolSet().add(IProtocol::SP(new SimpleProtocol())),
- RPCNetworkParams()
- .setIdentity(Identity("server/cpp"))
- .setSlobrokConfig("file:slobrok.cfg"),
- "file:routing.cfg");
-
- Receptor src;
- Message::UP msg;
- Reply::UP reply;
-
- SourceSession::UP ss = mb.getMessageBus().createSourceSession(src, SourceSessionParams().setTimeout(300));
- for (int i = 0; i < 10; ++i) {
- msg.reset(new SimpleMessage("test"));
- msg->getTrace().setLevel(9);
- ss->send(std::move(msg), "test");
- reply = src.getReply(600); // 10 minutes timeout
- if (reply.get() == 0) {
- fprintf(stderr, "CPP-CLIENT: no reply\n");
- } else {
- fprintf(stderr, "CPP-CLIENT:\n%s\n",
- reply->getTrace().toString().c_str());
- if (reply->getNumErrors() == 2) {
- break;
- }
- }
- FastOS_Thread::Sleep(1000);
- }
- if (reply.get() == 0) {
- fprintf(stderr, "CPP-CLIENT: no reply\n");
- return 1;
- }
- if (reply->getNumErrors() != 2 ||
- reply->getError(0).getCode() != (ErrorCode::APP_FATAL_ERROR + 1) ||
- reply->getError(1).getCode() != (ErrorCode::APP_FATAL_ERROR + 2) ||
- reply->getError(0).getMessage() != "ERR 1" ||
- reply->getError(1).getMessage() != "ERR 2")
- {
- fprintf(stderr, "CPP-CLIENT: wrong errors\n");
- return 1;
- }
- return 0;
-}
-
-int main(int argc, char **argv) {
- App app;
- return app.Entry(argc, argv);
-}
diff --git a/messagebus_test/src/tests/error/cpp-server.cpp b/messagebus_test/src/tests/error/cpp-server.cpp
deleted file mode 100644
index 2eb929f6ca9..00000000000
--- a/messagebus_test/src/tests/error/cpp-server.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP("cpp-server");
-#include <vespa/messagebus/messagebus.h>
-#include <vespa/messagebus/destinationsession.h>
-#include <vespa/messagebus/testlib/simplemessage.h>
-#include <vespa/messagebus/testlib/simplereply.h>
-#include <vespa/messagebus/testlib/simpleprotocol.h>
-#include <vespa/messagebus/rpcmessagebus.h>
-#include <vespa/messagebus/iprotocol.h>
-#include <vespa/messagebus/protocolset.h>
-#include <vespa/messagebus/emptyreply.h>
-#include <vespa/messagebus/error.h>
-#include <vespa/messagebus/errorcode.h>
-
-using namespace mbus;
-
-class Server : public IMessageHandler
-{
-private:
- DestinationSession::UP _session;
-public:
- Server(MessageBus &bus);
- ~Server();
- void handleMessage(Message::UP msg);
-};
-
-Server::Server(MessageBus &bus)
- : _session(bus.createDestinationSession("session", true, *this))
-{
- fprintf(stderr, "cpp server started\n");
-}
-
-Server::~Server()
-{
- _session.reset();
-}
-
-void
-Server::handleMessage(Message::UP msg) {
- Reply::UP reply(new EmptyReply());
- msg->swapState(*reply);
- reply->addError(Error(ErrorCode::APP_FATAL_ERROR + 1, "ERR 1"));
- reply->addError(Error(ErrorCode::APP_FATAL_ERROR + 2, "ERR 2"));
- _session->reply(std::move(reply));
-}
-
-class App : public FastOS_Application
-{
-public:
- int Main();
-};
-
-int
-App::Main()
-{
- RPCMessageBus mb(ProtocolSet().add(IProtocol::SP(new SimpleProtocol())),
- RPCNetworkParams()
- .setIdentity(Identity("server/cpp"))
- .setSlobrokConfig("file:slobrok.cfg"),
- "file:routing.cfg");
- Server server(mb.getMessageBus());
- while (true) {
- FastOS_Thread::Sleep(1000);
- }
- return 0;
-}
-
-int main(int argc, char **argv) {
- App app;
- return app.Entry(argc, argv);
-}
diff --git a/messagebus_test/src/tests/error/ctl.sh b/messagebus_test/src/tests/error/ctl.sh
deleted file mode 100755
index ca4fc7701e6..00000000000
--- a/messagebus_test/src/tests/error/ctl.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-if [ -z "$SOURCE_DIRECTORY" ]; then
- SOURCE_DIRECTORY="."
-fi
-
-. ../../binref/env.sh
-
-exec $SOURCE_DIRECTORY/../../binref/progctl.sh $SOURCE_DIRECTORY/progdefs.sh "$@"
diff --git a/messagebus_test/src/tests/error/error.cpp b/messagebus_test/src/tests/error/error.cpp
deleted file mode 100644
index 749874a5ef2..00000000000
--- a/messagebus_test/src/tests/error/error.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP("error_test");
-#include <vespa/vespalib/testkit/testapp.h>
-#include <vespa/vespalib/testkit/test_kit.h>
-#include <vespa/messagebus/testlib/slobrok.h>
-#include <vespa/vespalib/util/stringfmt.h>
-
-using namespace mbus;
-using vespalib::make_string;
-
-TEST_SETUP(Test);
-
-int
-Test::Main()
-{
- TEST_INIT("error_test");
- Slobrok slobrok;
- const std::string routing_template = TEST_PATH("routing-template.cfg");
- const std::string ctl_script = TEST_PATH("ctl.sh");
-
- { // Make slobrok config
- EXPECT_TRUE(system("echo slobrok[1] > slobrok.cfg") == 0);
- EXPECT_TRUE(system(make_string("echo 'slobrok[0].connectionspec tcp/localhost:%d' "
- ">> slobrok.cfg", slobrok.port()).c_str()) == 0);
- }
- { // CPP SERVER
- { // Make routing config
- EXPECT_TRUE(system(("cat " + routing_template + " | sed 's#session#cpp/session#' > routing.cfg").c_str()) == 0);
- }
- fprintf(stderr, "STARTING CPP-SERVER\n");
- EXPECT_TRUE(system((ctl_script + " start server cpp").c_str()) == 0);
- EXPECT_TRUE(system("./messagebus_test_cpp-client-error_app") == 0);
- EXPECT_TRUE(system("../../binref/runjava JavaClient") == 0);
- EXPECT_TRUE(system((ctl_script + " stop server cpp").c_str()) == 0);
- }
- { // JAVA SERVER
- { // Make routing config
- EXPECT_TRUE(system(("cat " + routing_template + " | sed 's#session#java/session#' > routing.cfg").c_str()) == 0);
- }
- fprintf(stderr, "STARTING JAVA-SERVER\n");
- EXPECT_TRUE(system((ctl_script + " start server java").c_str()) == 0);
- EXPECT_TRUE(system("./messagebus_test_cpp-client-error_app") == 0);
- EXPECT_TRUE(system("../../binref/runjava JavaClient") == 0);
- EXPECT_TRUE(system((ctl_script + " stop server java").c_str()) == 0);
- }
- TEST_DONE();
-}
diff --git a/messagebus_test/src/tests/error/error_test.sh b/messagebus_test/src/tests/error/error_test.sh
deleted file mode 100755
index 0c39f3d1ad3..00000000000
--- a/messagebus_test/src/tests/error/error_test.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-set -e
-
-if [ -z "$SOURCE_DIRECTORY" ]; then
- SOURCE_DIRECTORY="."
-fi
-
-. ../../binref/env.sh
-
-$BINREF/compilejava $SOURCE_DIRECTORY/JavaServer.java
-$BINREF/compilejava $SOURCE_DIRECTORY/JavaClient.java
-VESPA_LOG_LEVEL='all -spam' ./messagebus_test_error_test_app
diff --git a/messagebus_test/src/tests/error/progdefs.sh b/messagebus_test/src/tests/error/progdefs.sh
deleted file mode 100644
index 47d02d95b93..00000000000
--- a/messagebus_test/src/tests/error/progdefs.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-prog server cpp "" "./messagebus_test_cpp-server-error_app"
-prog server java "" "$BINREF/runjava JavaServer"
diff --git a/messagebus_test/src/tests/error/routing-template.cfg b/messagebus_test/src/tests/error/routing-template.cfg
deleted file mode 100644
index 4b938c9cc82..00000000000
--- a/messagebus_test/src/tests/error/routing-template.cfg
+++ /dev/null
@@ -1,11 +0,0 @@
-routingtable[1]
-routingtable[0].protocol "Simple"
-routingtable[0].hop[1]
-routingtable[0].hop[0].name "server"
-routingtable[0].hop[0].selector "server/session"
-routingtable[0].hop[0].recipient[1]
-routingtable[0].hop[0].recipient[0] "server/session"
-routingtable[0].route[1]
-routingtable[0].route[0].name "test"
-routingtable[0].route[0].hop[1]
-routingtable[0].route[0].hop[0] "server"
diff --git a/messagebus_test/src/tests/errorcodes/.gitignore b/messagebus_test/src/tests/errorcodes/.gitignore
deleted file mode 100644
index 13957172a38..00000000000
--- a/messagebus_test/src/tests/errorcodes/.gitignore
+++ /dev/null
@@ -1,7 +0,0 @@
-.depend
-DumpCodes.class
-Makefile
-cpp-dump.txt
-dumpcodes
-java-dump.txt
-messagebus_test_dumpcodes_app
diff --git a/messagebus_test/src/tests/errorcodes/CMakeLists.txt b/messagebus_test/src/tests/errorcodes/CMakeLists.txt
deleted file mode 100644
index b996c58464c..00000000000
--- a/messagebus_test/src/tests/errorcodes/CMakeLists.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-vespa_add_executable(messagebus_test_dumpcodes_app TEST
- SOURCES
- dumpcodes.cpp
- DEPENDS
- messagebus
-)
-vespa_add_test(NAME messagebus_test_dumpcodes_app NO_VALGRIND COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/errorcodes_test.sh
- DEPENDS messagebus_test_dumpcodes_app)
diff --git a/messagebus_test/src/tests/errorcodes/DESC b/messagebus_test/src/tests/errorcodes/DESC
deleted file mode 100644
index 103ebb4698f..00000000000
--- a/messagebus_test/src/tests/errorcodes/DESC
+++ /dev/null
@@ -1,2 +0,0 @@
-A small test to check that error codes are equal in the Java and C++
-implementations.
diff --git a/messagebus_test/src/tests/errorcodes/DumpCodes.java b/messagebus_test/src/tests/errorcodes/DumpCodes.java
deleted file mode 100644
index 8eb97813404..00000000000
--- a/messagebus_test/src/tests/errorcodes/DumpCodes.java
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-import com.yahoo.messagebus.ErrorCode;
-
-public class DumpCodes {
-
- private static void dump(String desc, int value) {
- String name = ErrorCode.getName(value);
- System.out.printf("%s => %d => \"%s\"\n", desc, value,
- name != null ? name : "");
- }
-
- public static void main(String[] args) {
- dump("NONE", ErrorCode.NONE);
-
- dump("SEND_QUEUE_FULL", ErrorCode.SEND_QUEUE_FULL);
- dump("NO_ADDRESS_FOR_SERVICE", ErrorCode.NO_ADDRESS_FOR_SERVICE);
- dump("CONNECTION_ERROR", ErrorCode.CONNECTION_ERROR);
- dump("UNKNOWN_SESSION", ErrorCode.UNKNOWN_SESSION);
- dump("SESSION_BUSY", ErrorCode.SESSION_BUSY);
- dump("SEND_ABORTED", ErrorCode.SEND_ABORTED);
- dump("HANDSHAKE_FAILED", ErrorCode.HANDSHAKE_FAILED);
- dump("first unused TRANSIENT_ERROR", ErrorCode.TRANSIENT_ERROR + 8);
-
- dump("SEND_QUEUE_CLOSED", ErrorCode.SEND_QUEUE_CLOSED);
- dump("ILLEGAL_ROUTE", ErrorCode.ILLEGAL_ROUTE);
- dump("NO_SERVICES_FOR_ROUTE", ErrorCode.NO_SERVICES_FOR_ROUTE);
- dump("SERVICE_OOS", ErrorCode.SERVICE_OOS);
- dump("ENCODE_ERROR", ErrorCode.ENCODE_ERROR);
- dump("NETWORK_ERROR", ErrorCode.NETWORK_ERROR);
- dump("UNKNOWN_PROTOCOL", ErrorCode.UNKNOWN_PROTOCOL);
- dump("DECODE_ERROR", ErrorCode.DECODE_ERROR);
- dump("TIMEOUT", ErrorCode.TIMEOUT);
- dump("INCOMPATIBLE_VERSION", ErrorCode.INCOMPATIBLE_VERSION);
- dump("UNKNOWN_POLICY", ErrorCode.UNKNOWN_POLICY);
- dump("NETWORK_SHUTDOWN", ErrorCode.NETWORK_SHUTDOWN);
- dump("POLICY_ERROR", ErrorCode.POLICY_ERROR);
- dump("SEQUENCE_ERROR", ErrorCode.SEQUENCE_ERROR);
- dump("first unused FATAL_ERROR", ErrorCode.FATAL_ERROR + 15);
-
- dump("max UNKNOWN below", ErrorCode.TRANSIENT_ERROR - 1);
- dump("min TRANSIENT_ERROR", ErrorCode.TRANSIENT_ERROR);
- dump("max TRANSIENT_ERROR", ErrorCode.TRANSIENT_ERROR + 49999);
- dump("min APP_TRANSIENT_ERROR", ErrorCode.APP_TRANSIENT_ERROR);
- dump("max APP_TRANSIENT_ERROR", ErrorCode.APP_TRANSIENT_ERROR + 49999);
- dump("min FATAL_ERROR", ErrorCode.FATAL_ERROR);
- dump("max FATAL_ERROR", ErrorCode.FATAL_ERROR + 49999);
- dump("min APP_FATAL_ERROR", ErrorCode.APP_FATAL_ERROR);
- dump("max APP_FATAL_ERROR", ErrorCode.APP_FATAL_ERROR + 49999);
- dump("min UNKNOWN above", ErrorCode.ERROR_LIMIT);
- }
-}
diff --git a/messagebus_test/src/tests/errorcodes/FILES b/messagebus_test/src/tests/errorcodes/FILES
deleted file mode 100644
index 766402133fb..00000000000
--- a/messagebus_test/src/tests/errorcodes/FILES
+++ /dev/null
@@ -1,5 +0,0 @@
-dumpcodes.cpp
-DumpCodes.java
-ref-dump.txt
-cpp-dump.txt
-java-dump.txt
diff --git a/messagebus_test/src/tests/errorcodes/dumpcodes.cpp b/messagebus_test/src/tests/errorcodes/dumpcodes.cpp
deleted file mode 100644
index 121d8585726..00000000000
--- a/messagebus_test/src/tests/errorcodes/dumpcodes.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP("dumpcodes");
-#include <vespa/messagebus/errorcode.h>
-#include <string>
-
-using namespace mbus;
-
-class App : public FastOS_Application
-{
-public:
- void dump(const std::string &desc, uint32_t value);
- int Main();
-};
-
-void
-App::dump(const std::string &desc, uint32_t value)
-{
- fprintf(stdout, "%s => %u => \"%s\"\n", desc.c_str(), value,
- ErrorCode::getName(value).c_str());
-}
-
-int
-App::Main()
-{
- dump("NONE", ErrorCode::NONE);
-
- dump("SEND_QUEUE_FULL", ErrorCode::SEND_QUEUE_FULL);
- dump("NO_ADDRESS_FOR_SERVICE", ErrorCode::NO_ADDRESS_FOR_SERVICE);
- dump("CONNECTION_ERROR", ErrorCode::CONNECTION_ERROR);
- dump("UNKNOWN_SESSION", ErrorCode::UNKNOWN_SESSION);
- dump("SESSION_BUSY", ErrorCode::SESSION_BUSY);
- dump("SEND_ABORTED", ErrorCode::SEND_ABORTED);
- dump("HANDSHAKE_FAILED", ErrorCode::HANDSHAKE_FAILED);
- dump("first unused TRANSIENT_ERROR", ErrorCode::TRANSIENT_ERROR + 8);
-
- dump("SEND_QUEUE_CLOSED", ErrorCode::SEND_QUEUE_CLOSED);
- dump("ILLEGAL_ROUTE", ErrorCode::ILLEGAL_ROUTE);
- dump("NO_SERVICES_FOR_ROUTE", ErrorCode::NO_SERVICES_FOR_ROUTE);
- dump("SERVICE_OOS", ErrorCode::SERVICE_OOS);
- dump("ENCODE_ERROR", ErrorCode::ENCODE_ERROR);
- dump("NETWORK_ERROR", ErrorCode::NETWORK_ERROR);
- dump("UNKNOWN_PROTOCOL", ErrorCode::UNKNOWN_PROTOCOL);
- dump("DECODE_ERROR", ErrorCode::DECODE_ERROR);
- dump("TIMEOUT", ErrorCode::TIMEOUT);
- dump("INCOMPATIBLE_VERSION", ErrorCode::INCOMPATIBLE_VERSION);
- dump("UNKNOWN_POLICY", ErrorCode::UNKNOWN_POLICY);
- dump("NETWORK_SHUTDOWN", ErrorCode::NETWORK_SHUTDOWN);
- dump("POLICY_ERROR", ErrorCode::POLICY_ERROR);
- dump("SEQUENCE_ERROR", ErrorCode::SEQUENCE_ERROR);
- dump("first unused FATAL_ERROR", ErrorCode::FATAL_ERROR + 15);
-
- dump("max UNKNOWN below", ErrorCode::TRANSIENT_ERROR - 1);
- dump("min TRANSIENT_ERROR", ErrorCode::TRANSIENT_ERROR);
- dump("max TRANSIENT_ERROR", ErrorCode::TRANSIENT_ERROR + 49999);
- dump("min APP_TRANSIENT_ERROR", ErrorCode::APP_TRANSIENT_ERROR);
- dump("max APP_TRANSIENT_ERROR", ErrorCode::APP_TRANSIENT_ERROR + 49999);
- dump("min FATAL_ERROR", ErrorCode::FATAL_ERROR);
- dump("max FATAL_ERROR", ErrorCode::FATAL_ERROR + 49999);
- dump("min APP_FATAL_ERROR", ErrorCode::APP_FATAL_ERROR);
- dump("max APP_FATAL_ERROR", ErrorCode::APP_FATAL_ERROR + 49999);
- dump("min UNKNOWN above", ErrorCode::ERROR_LIMIT);
- return 0;
-}
-
-int main(int argc, char **argv) {
- App app;
- return app.Entry(argc, argv);
-}
diff --git a/messagebus_test/src/tests/errorcodes/errorcodes_test.sh b/messagebus_test/src/tests/errorcodes/errorcodes_test.sh
deleted file mode 100755
index e6ecc033ef3..00000000000
--- a/messagebus_test/src/tests/errorcodes/errorcodes_test.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/bash
-set -e
-
-if [ -z "$SOURCE_DIRECTORY" ]; then
- SOURCE_DIRECTORY="."
-fi
-
-. ../../binref/env.sh
-
-$BINREF/compilejava $SOURCE_DIRECTORY/DumpCodes.java
-
-./messagebus_test_dumpcodes_app > cpp-dump.txt
-$BINREF/runjava DumpCodes > java-dump.txt
-diff -u $SOURCE_DIRECTORY/ref-dump.txt cpp-dump.txt
-diff -u $SOURCE_DIRECTORY/ref-dump.txt java-dump.txt
diff --git a/messagebus_test/src/tests/errorcodes/ref-dump.txt b/messagebus_test/src/tests/errorcodes/ref-dump.txt
deleted file mode 100644
index b8038816897..00000000000
--- a/messagebus_test/src/tests/errorcodes/ref-dump.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-NONE => 0 => "NONE"
-SEND_QUEUE_FULL => 100001 => "SEND_QUEUE_FULL"
-NO_ADDRESS_FOR_SERVICE => 100002 => "NO_ADDRESS_FOR_SERVICE"
-CONNECTION_ERROR => 100003 => "CONNECTION_ERROR"
-UNKNOWN_SESSION => 100004 => "UNKNOWN_SESSION"
-SESSION_BUSY => 100005 => "SESSION_BUSY"
-SEND_ABORTED => 100006 => "SEND_ABORTED"
-HANDSHAKE_FAILED => 100007 => "HANDSHAKE_FAILED"
-first unused TRANSIENT_ERROR => 100008 => "UNKNOWN(100008)"
-SEND_QUEUE_CLOSED => 200001 => "SEND_QUEUE_CLOSED"
-ILLEGAL_ROUTE => 200002 => "ILLEGAL_ROUTE"
-NO_SERVICES_FOR_ROUTE => 200003 => "NO_SERVICES_FOR_ROUTE"
-SERVICE_OOS => 200004 => "SERVICE_OOS"
-ENCODE_ERROR => 200005 => "ENCODE_ERROR"
-NETWORK_ERROR => 200006 => "NETWORK_ERROR"
-UNKNOWN_PROTOCOL => 200007 => "UNKNOWN_PROTOCOL"
-DECODE_ERROR => 200008 => "DECODE_ERROR"
-TIMEOUT => 200009 => "TIMEOUT"
-INCOMPATIBLE_VERSION => 200010 => "INCOMPATIBLE_VERSION"
-UNKNOWN_POLICY => 200011 => "UNKNOWN_POLICY"
-NETWORK_SHUTDOWN => 200012 => "NETWORK_SHUTDOWN"
-POLICY_ERROR => 200013 => "POLICY_ERROR"
-SEQUENCE_ERROR => 200014 => "SEQUENCE_ERROR"
-first unused FATAL_ERROR => 200015 => "UNKNOWN(200015)"
-max UNKNOWN below => 99999 => "UNKNOWN(99999)"
-min TRANSIENT_ERROR => 100000 => "TRANSIENT_ERROR"
-max TRANSIENT_ERROR => 149999 => "UNKNOWN(149999)"
-min APP_TRANSIENT_ERROR => 150000 => "APP_TRANSIENT_ERROR"
-max APP_TRANSIENT_ERROR => 199999 => "UNKNOWN(199999)"
-min FATAL_ERROR => 200000 => "FATAL_ERROR"
-max FATAL_ERROR => 249999 => "UNKNOWN(249999)"
-min APP_FATAL_ERROR => 250000 => "APP_FATAL_ERROR"
-max APP_FATAL_ERROR => 299999 => "UNKNOWN(299999)"
-min UNKNOWN above => 300000 => "UNKNOWN(300000)"
diff --git a/messagebus_test/src/tests/speed/.gitignore b/messagebus_test/src/tests/speed/.gitignore
deleted file mode 100644
index 326da75ebb6..00000000000
--- a/messagebus_test/src/tests/speed/.gitignore
+++ /dev/null
@@ -1,15 +0,0 @@
-*.class
-.depend
-Makefile
-cpp-client
-cpp-server
-out.*
-pid.*
-routing.cfg
-slobrok.cfg
-speed_test
-cpp-client-speed
-cpp-server-speed
-messagebus_test_speed_test_app
-messagebus_test_cpp-client-speed_app
-messagebus_test_cpp-server-speed_app
diff --git a/messagebus_test/src/tests/speed/CMakeLists.txt b/messagebus_test/src/tests/speed/CMakeLists.txt
deleted file mode 100644
index 5a5f9615c42..00000000000
--- a/messagebus_test/src/tests/speed/CMakeLists.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-vespa_add_executable(messagebus_test_speed_test_app
- SOURCES
- speed.cpp
- DEPENDS
- messagebus_messagebus-test
-)
-vespa_add_executable(messagebus_test_cpp-server-speed_app
- SOURCES
- cpp-server.cpp
- DEPENDS
- messagebus_messagebus-test
-)
-vespa_add_executable(messagebus_test_cpp-client-speed_app
- SOURCES
- cpp-client.cpp
- DEPENDS
- messagebus_messagebus-test
-)
-vespa_add_test(NAME messagebus_test_speed_test_app COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/speed_test.sh BENCHMARK
- DEPENDS messagebus_test_speed_test_app messagebus_test_cpp-server-speed_app messagebus_test_cpp-client-speed_app )
diff --git a/messagebus_test/src/tests/speed/DESC b/messagebus_test/src/tests/speed/DESC
deleted file mode 100644
index 10734957438..00000000000
--- a/messagebus_test/src/tests/speed/DESC
+++ /dev/null
@@ -1,4 +0,0 @@
-This is a simple test that gives a rough idea of the inherent overhead
-in messagebus. It sends simple messages back and forth with the
-simplest routing setup possible. This test also tests that messagebus
-works across Java and C++.
diff --git a/messagebus_test/src/tests/speed/FILES b/messagebus_test/src/tests/speed/FILES
deleted file mode 100644
index 09f0a5ec1d3..00000000000
--- a/messagebus_test/src/tests/speed/FILES
+++ /dev/null
@@ -1,8 +0,0 @@
-speed.cpp
-out.server.cpp
-out.server.java
-cpp-client.cpp
-cpp-server.cpp
-JavaClient.java
-JavaServer.java
-routing-template.cfg
diff --git a/messagebus_test/src/tests/speed/JavaClient.java b/messagebus_test/src/tests/speed/JavaClient.java
deleted file mode 100644
index b905ab07e91..00000000000
--- a/messagebus_test/src/tests/speed/JavaClient.java
+++ /dev/null
@@ -1,137 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-import com.yahoo.messagebus.*;
-import com.yahoo.messagebus.test.*;
-import com.yahoo.config.*;
-import com.yahoo.messagebus.routing.*;
-import com.yahoo.messagebus.network.*;
-import com.yahoo.messagebus.network.rpc.*;
-import java.util.Arrays;
-import java.util.logging.*;
-
-public class JavaClient implements ReplyHandler {
-
- private static Logger log = Logger.getLogger(JavaClient.class.getName());
-
- private static class Counts {
- public int okCnt = 0;
- public int failCnt = 0;
- Counts() {}
- Counts(int okCnt, int failCnt) {
- this.okCnt = okCnt;
- this.failCnt = failCnt;
- }
- }
-
- private SourceSession session;
- private Counts counts = new Counts();
- private static long mySeq = 100000;
-
- public JavaClient(RPCMessageBus mb) {
- session = mb.getMessageBus().createSourceSession(this, new SourceSessionParams().setTimeout(30));
- }
-
- public synchronized Counts sample() {
- return new Counts(counts.okCnt, counts.failCnt);
- }
-
- public void send() {
- send(++mySeq);
- }
-
- public void send(long seq) {
- session.send(new MyMessage(seq), "test");
- }
-
- public void handleReply(Reply reply) {
- if ((reply.getProtocol() == SimpleProtocol.NAME)
- && (reply.getType() == SimpleProtocol.REPLY)
- && (((SimpleReply)reply).getValue().equals("OK")))
- {
- synchronized (this) {
- counts.okCnt++;
- }
- } else {
- synchronized (this) {
- counts.failCnt++;
- }
- }
- try {
- send();
- } catch (IllegalStateException ignore) {} // handle paranoia for shutdown source sessions
- }
-
- public void shutdown() {
- session.destroy();
- }
-
- public static void main(String[] args) {
- try {
- RPCMessageBus mb = new RPCMessageBus(
- new MessageBusParams()
- .setRetryPolicy(new RetryTransientErrorsPolicy().setBaseDelay(0.1))
- .addProtocol(new SimpleProtocol()),
- new RPCNetworkParams()
- .setIdentity(new Identity("server/java"))
- .setSlobrokConfigId("file:slobrok.cfg"),
- "file:routing.cfg");
- JavaClient client = new JavaClient(mb);
-
- // let the system 'warm up'
- Thread.sleep(5000);
-
- // inject messages into the feedback loop
- for (int i = 0; i < 1024; ++i) {
- client.send(i);
- }
-
- // let the system 'warm up'
- Thread.sleep(5000);
-
- long start;
- long stop;
- Counts before;
- Counts after;
-
- start = System.currentTimeMillis();
- before = client.sample();
- Thread.sleep(10000); // Benchmark time
- stop = System.currentTimeMillis();
- after = client.sample();
- stop -= start;
- double time = (double)stop;
- double msgCnt = (double)(after.okCnt - before.okCnt);
- double throughput = (msgCnt / time) * 1000.0;
- System.out.printf("JAVA-CLIENT: %g msg/s\n", throughput);
- client.shutdown();
- mb.destroy();
- if (after.failCnt > before.failCnt) {
- System.err.printf("JAVA-CLIENT: FAILED (%d -> %d)\n",
- before.failCnt, after.failCnt);
- System.exit(1);
- }
- } catch (Exception e) {
- log.log(Level.SEVERE, "JAVA-CLIENT: Failed", e);
- System.exit(1);
- }
- }
-
- private static class MyMessage extends SimpleMessage {
-
- final long seqId;
-
- MyMessage(long seqId) {
- super("message");
- this.seqId = seqId;
- }
-
- @Override
- public boolean hasSequenceId() {
- return true;
- }
-
- @Override
- public long getSequenceId() {
- return seqId;
- }
- }
-}
diff --git a/messagebus_test/src/tests/speed/JavaServer.java b/messagebus_test/src/tests/speed/JavaServer.java
deleted file mode 100644
index afec6dcdba2..00000000000
--- a/messagebus_test/src/tests/speed/JavaServer.java
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-import com.yahoo.messagebus.*;
-import com.yahoo.messagebus.test.*;
-import com.yahoo.config.*;
-import com.yahoo.messagebus.routing.*;
-import com.yahoo.messagebus.network.*;
-import com.yahoo.messagebus.network.rpc.*;
-import java.util.Arrays;
-import java.util.logging.*;
-
-public class JavaServer implements MessageHandler {
-
- private static Logger log = Logger.getLogger(JavaServer.class.getName());
-
- private DestinationSession session;
-
- public JavaServer(RPCMessageBus mb) {
- session = mb.getMessageBus().createDestinationSession("session", true, this);
- }
-
- public void handleMessage(Message msg) {
- if ((msg.getProtocol() == SimpleProtocol.NAME)
- && (msg.getType() == SimpleProtocol.MESSAGE)
- && (((SimpleMessage)msg).getValue().equals("message")))
- {
- Reply reply = new SimpleReply("OK");
- msg.swapState(reply);
- session.reply(reply);
- } else {
- Reply reply = new SimpleReply("FAIL");
- msg.swapState(reply);
- session.reply(reply);
- }
- }
-
- public static void main(String[] args) {
- try {
- RPCMessageBus mb = new RPCMessageBus(
- Arrays.asList((Protocol)new SimpleProtocol()),
- new RPCNetworkParams()
- .setIdentity(new Identity("server/java"))
- .setSlobrokConfigId("file:slobrok.cfg"),
- "file:routing.cfg");
- JavaServer server = new JavaServer(mb);
- System.out.println("java server started");
- while (true) {
- Thread.sleep(1000);
- }
- } catch (Exception e) {
- log.log(Level.SEVERE, "JAVA-SERVER: Failed", e);
- System.exit(1);
- }
- }
-}
diff --git a/messagebus_test/src/tests/speed/cpp-client.cpp b/messagebus_test/src/tests/speed/cpp-client.cpp
deleted file mode 100644
index c0c9d621a20..00000000000
--- a/messagebus_test/src/tests/speed/cpp-client.cpp
+++ /dev/null
@@ -1,146 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP("cpp-client");
-#include <vespa/messagebus/messagebus.h>
-#include <vespa/messagebus/routing/retrytransienterrorspolicy.h>
-#include <vespa/messagebus/rpcmessagebus.h>
-#include <vespa/messagebus/sourcesession.h>
-#include <vespa/messagebus/sourcesessionparams.h>
-#include <vespa/messagebus/testlib/simplemessage.h>
-#include <vespa/messagebus/testlib/simpleprotocol.h>
-#include <vespa/messagebus/testlib/simplereply.h>
-#include <vespa/vespalib/util/sync.h>
-
-using namespace mbus;
-
-class Client : public IReplyHandler
-{
-private:
- vespalib::Lock _lock;
- uint32_t _okCnt;
- uint32_t _failCnt;
- SourceSession::UP _session;
- static uint64_t _seq;
-public:
- Client(MessageBus &bus, const SourceSessionParams &params);
- ~Client();
- void send();
- void send(uint64_t seq);
- void sample(uint32_t &okCnt, uint32_t &failCnt);
- void handleReply(Reply::UP reply);
-};
-uint64_t Client::_seq = 100000;
-
-Client::Client(MessageBus &bus, const SourceSessionParams &params)
- : _lock(),
- _okCnt(0),
- _failCnt(0),
- _session(bus.createSourceSession(*this, params))
-{
-}
-
-Client::~Client()
-{
- _session->close();
-}
-
-void
-Client::send() {
- send(++_seq);
-}
-
-void
-Client::send(uint64_t seq) {
- Message::UP msg(new SimpleMessage("message", true, seq));
- _session->send(std::move(msg), "test");
-}
-
-void
-Client::sample(uint32_t &okCnt, uint32_t &failCnt) {
- vespalib::LockGuard guard(_lock);
- okCnt = _okCnt;
- failCnt = _failCnt;
-}
-
-void
-Client::handleReply(Reply::UP reply) {
- if ((reply->getProtocol() == SimpleProtocol::NAME)
- && (reply->getType() == SimpleProtocol::REPLY)
- && (static_cast<SimpleReply&>(*reply).getValue() == "OK"))
- {
- vespalib::LockGuard guard(_lock);
- ++_okCnt;
- } else {
- fprintf(stderr, "BAD REPLY\n");
- for (uint32_t i = 0; i < reply->getNumErrors(); ++i) {
- fprintf(stderr, "ERR[%d]: code=%d, msg=%s\n", i,
- reply->getError(i).getCode(),
- reply->getError(i).getMessage().c_str());
- }
- vespalib::LockGuard guard(_lock);
- ++_failCnt;
- }
- send();
-}
-
-class App : public FastOS_Application
-{
-public:
- int Main();
-};
-
-int
-App::Main()
-{
- RetryTransientErrorsPolicy::SP retryPolicy(new RetryTransientErrorsPolicy());
- retryPolicy->setBaseDelay(0.1);
- RPCMessageBus mb(MessageBusParams().setRetryPolicy(retryPolicy).addProtocol(IProtocol::SP(new SimpleProtocol())),
- RPCNetworkParams().setIdentity(Identity("server/cpp")).setSlobrokConfig("file:slobrok.cfg"),
- "file:routing.cfg");
- Client client(mb.getMessageBus(), SourceSessionParams().setTimeout(30));
-
- // let the system 'warm up'
- FastOS_Thread::Sleep(5000);
-
- // inject messages into the feedback loop
- for (uint32_t i = 0; i < 1024; ++i) {
- client.send(i);
- }
-
- // let the system 'warm up'
- FastOS_Thread::Sleep(5000);
-
- FastOS_Time start;
- FastOS_Time stop;
- uint32_t okBefore = 0;
- uint32_t okAfter = 0;
- uint32_t failBefore = 0;
- uint32_t failAfter = 0;
-
- start.SetNow();
- client.sample(okBefore, failBefore);
- FastOS_Thread::Sleep(10000); // Benchmark time
- stop.SetNow();
- client.sample(okAfter, failAfter);
- stop -= start;
- double time = stop.MilliSecs();
- double msgCnt = (double)(okAfter - okBefore);
- double throughput = (msgCnt / time) * 1000.0;
- fprintf(stdout, "CPP-CLIENT: %g msg/s\n", throughput);
- if (failAfter > failBefore) {
- fprintf(stderr, "CPP-CLIENT: FAILED (%d -> %d)\n", failBefore, failAfter);
- return 1;
- }
- return 0;
-}
-
-int main(int argc, char **argv) {
- fprintf(stderr, "started '%s'\n", argv[0]);
- fflush(stderr);
- App app;
- int r = app.Entry(argc, argv);
- fprintf(stderr, "stopping '%s'\n", argv[0]);
- fflush(stderr);
- return r;
-}
diff --git a/messagebus_test/src/tests/speed/cpp-server.cpp b/messagebus_test/src/tests/speed/cpp-server.cpp
deleted file mode 100644
index c2cd9bf262a..00000000000
--- a/messagebus_test/src/tests/speed/cpp-server.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP("cpp-server");
-#include <vespa/messagebus/messagebus.h>
-#include <vespa/messagebus/destinationsession.h>
-#include <vespa/messagebus/testlib/simplemessage.h>
-#include <vespa/messagebus/testlib/simplereply.h>
-#include <vespa/messagebus/testlib/simpleprotocol.h>
-#include <vespa/messagebus/rpcmessagebus.h>
-#include <vespa/messagebus/iprotocol.h>
-#include <vespa/messagebus/protocolset.h>
-
-using namespace mbus;
-
-class Server : public IMessageHandler
-{
-private:
- DestinationSession::UP _session;
-public:
- Server(MessageBus &bus);
- ~Server();
- void handleMessage(Message::UP msg);
-};
-
-Server::Server(MessageBus &bus)
- : _session(bus.createDestinationSession("session", true, *this))
-{
- fprintf(stderr, "cpp server started\n");
-}
-
-Server::~Server()
-{
- _session.reset();
-}
-
-void
-Server::handleMessage(Message::UP msg) {
- if ((msg->getProtocol() == SimpleProtocol::NAME)
- && (msg->getType() == SimpleProtocol::MESSAGE)
- && (static_cast<SimpleMessage&>(*msg).getValue() == "message"))
- {
- Reply::UP reply(new SimpleReply("OK"));
- msg->swapState(*reply);
- _session->reply(std::move(reply));
- } else {
- Reply::UP reply(new SimpleReply("FAIL"));
- msg->swapState(*reply);
- _session->reply(std::move(reply));
- }
-}
-
-class App : public FastOS_Application
-{
-public:
- int Main();
-};
-
-int
-App::Main()
-{
- RPCMessageBus mb(ProtocolSet().add(IProtocol::SP(new SimpleProtocol())),
- RPCNetworkParams()
- .setIdentity(Identity("server/cpp"))
- .setSlobrokConfig("file:slobrok.cfg"),
- "file:routing.cfg");
- Server server(mb.getMessageBus());
- while (true) {
- FastOS_Thread::Sleep(1000);
- }
- return 0;
-}
-
-int main(int argc, char **argv) {
- App app;
- return app.Entry(argc, argv);
-}
diff --git a/messagebus_test/src/tests/speed/ctl.sh b/messagebus_test/src/tests/speed/ctl.sh
deleted file mode 100755
index ca4fc7701e6..00000000000
--- a/messagebus_test/src/tests/speed/ctl.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-if [ -z "$SOURCE_DIRECTORY" ]; then
- SOURCE_DIRECTORY="."
-fi
-
-. ../../binref/env.sh
-
-exec $SOURCE_DIRECTORY/../../binref/progctl.sh $SOURCE_DIRECTORY/progdefs.sh "$@"
diff --git a/messagebus_test/src/tests/speed/progdefs.sh b/messagebus_test/src/tests/speed/progdefs.sh
deleted file mode 100644
index 0b2bd600db0..00000000000
--- a/messagebus_test/src/tests/speed/progdefs.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-prog server cpp "" "./messagebus_test_cpp-server-speed_app"
-prog server java "" "$BINREF/runjava JavaServer"
diff --git a/messagebus_test/src/tests/speed/routing-template.cfg b/messagebus_test/src/tests/speed/routing-template.cfg
deleted file mode 100644
index 4b938c9cc82..00000000000
--- a/messagebus_test/src/tests/speed/routing-template.cfg
+++ /dev/null
@@ -1,11 +0,0 @@
-routingtable[1]
-routingtable[0].protocol "Simple"
-routingtable[0].hop[1]
-routingtable[0].hop[0].name "server"
-routingtable[0].hop[0].selector "server/session"
-routingtable[0].hop[0].recipient[1]
-routingtable[0].hop[0].recipient[0] "server/session"
-routingtable[0].route[1]
-routingtable[0].route[0].name "test"
-routingtable[0].route[0].hop[1]
-routingtable[0].route[0].hop[0] "server"
diff --git a/messagebus_test/src/tests/speed/speed.cpp b/messagebus_test/src/tests/speed/speed.cpp
deleted file mode 100644
index 1cfe1ff5704..00000000000
--- a/messagebus_test/src/tests/speed/speed.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP("speed_test");
-#include <vespa/vespalib/testkit/testapp.h>
-#include <vespa/vespalib/testkit/test_kit.h>
-#include <vespa/messagebus/testlib/slobrok.h>
-#include <vespa/vespalib/util/stringfmt.h>
-
-using namespace mbus;
-using vespalib::make_string;
-
-TEST_SETUP(Test);
-
-int
-Test::Main()
-{
- TEST_INIT("speed_test");
- Slobrok slobrok;
-
- const std::string routing_template = TEST_PATH("routing-template.cfg");
- const std::string ctl_script = TEST_PATH("ctl.sh");
-
- { // Make slobrok config
- EXPECT_EQUAL(system("echo slobrok[1] > slobrok.cfg"), 0);
- EXPECT_EQUAL(system(make_string("echo 'slobrok[0].connectionspec tcp/localhost:%d' "
- ">> slobrok.cfg", slobrok.port()).c_str()), 0);
- }
- { // CPP SERVER
- { // Make routing config
- EXPECT_EQUAL(system(("cat " + routing_template + " | sed 's#session#cpp/session#' > routing.cfg").c_str()), 0);
- }
- fprintf(stderr, "STARTING CPP-SERVER\n");
- EXPECT_EQUAL(system((ctl_script + " start server cpp").c_str()), 0);
- fprintf(stderr, "STARTING CPP-CLIENT\n");
- EXPECT_EQUAL(system("./messagebus_test_cpp-client-speed_app"), 0);
- fprintf(stderr, "STARTING JAVA-CLIENT\n");
- EXPECT_EQUAL(system("../../binref/runjava JavaClient"), 0);
- fprintf(stderr, "STOPPING\n");
- EXPECT_EQUAL(system((ctl_script + " stop server cpp").c_str()), 0);
- }
- { // JAVA SERVER
- { // Make routing config
- EXPECT_EQUAL(system(("cat " + routing_template + " | sed 's#session#java/session#' > routing.cfg").c_str()), 0);
- }
- fprintf(stderr, "STARTING JAVA-SERVER\n");
- EXPECT_EQUAL(system((ctl_script + " start server java").c_str()), 0);
- fprintf(stderr, "STARTING CPP-CLIENT\n");
- EXPECT_EQUAL(system("./messagebus_test_cpp-client-speed_app"), 0);
- fprintf(stderr, "STARTING JAVA-CLIENT\n");
- EXPECT_EQUAL(system("../../binref/runjava JavaClient"), 0);
- fprintf(stderr, "STOPPING\n");
- EXPECT_EQUAL(system((ctl_script + " stop server java").c_str()), 0);
- }
- TEST_DONE();
-}
diff --git a/messagebus_test/src/tests/speed/speed_test.sh b/messagebus_test/src/tests/speed/speed_test.sh
deleted file mode 100755
index 1d9ba27f84e..00000000000
--- a/messagebus_test/src/tests/speed/speed_test.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-set -e
-
-if [ -z "$SOURCE_DIRECTORY" ]; then
- SOURCE_DIRECTORY="."
-fi
-
-. ../../binref/env.sh
-
-$BINREF/compilejava $SOURCE_DIRECTORY/JavaServer.java
-$BINREF/compilejava $SOURCE_DIRECTORY/JavaClient.java
-
-(ulimit -c; ulimit -H -c; ulimit -c unlimited; $VALGRIND ./messagebus_test_speed_test_app)
diff --git a/messagebus_test/src/tests/trace/.gitignore b/messagebus_test/src/tests/trace/.gitignore
deleted file mode 100644
index 1be907ec2f8..00000000000
--- a/messagebus_test/src/tests/trace/.gitignore
+++ /dev/null
@@ -1,12 +0,0 @@
-*.class
-.depend
-Makefile
-cpp-server
-out.*
-pid.*
-routing.cfg
-slobrok.cfg
-trace_test
-/cpp-server-trace
-messagebus_test_trace_test_app
-messagebus_test_cpp-server-trace_app
diff --git a/messagebus_test/src/tests/trace/CMakeLists.txt b/messagebus_test/src/tests/trace/CMakeLists.txt
deleted file mode 100644
index f43d66d9122..00000000000
--- a/messagebus_test/src/tests/trace/CMakeLists.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-vespa_add_executable(messagebus_test_trace_test_app TEST
- SOURCES
- trace.cpp
- DEPENDS
- messagebus_messagebus-test
-)
-vespa_add_executable(messagebus_test_cpp-server-trace_app
- SOURCES
- cpp-server.cpp
- DEPENDS
- messagebus_messagebus-test
-)
-vespa_add_test(NAME messagebus_test_trace_test_app NO_VALGRIND COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/trace_test.sh
- DEPENDS messagebus_test_trace_test_app messagebus_test_cpp-server-trace_app)
diff --git a/messagebus_test/src/tests/trace/DESC b/messagebus_test/src/tests/trace/DESC
deleted file mode 100644
index 452e75aefea..00000000000
--- a/messagebus_test/src/tests/trace/DESC
+++ /dev/null
@@ -1 +0,0 @@
-trace test. Take a look at trace.cpp for details.
diff --git a/messagebus_test/src/tests/trace/FILES b/messagebus_test/src/tests/trace/FILES
deleted file mode 100644
index 891e4df6273..00000000000
--- a/messagebus_test/src/tests/trace/FILES
+++ /dev/null
@@ -1,19 +0,0 @@
-trace.cpp
-cpp-server.cpp
-JavaServer.java
-routing.cfg
-out.server.cpp1
-out.server.cpp2
-out.server.cpp3
-out.server.cpp4
-out.server.cpp5
-out.server.cpp6
-out.server.cpp7
-out.server.java1
-out.server.java2
-out.server.java3
-out.server.java4
-out.server.java5
-out.server.java6
-out.server.java7
-progdefs.sh
diff --git a/messagebus_test/src/tests/trace/JavaServer.java b/messagebus_test/src/tests/trace/JavaServer.java
deleted file mode 100644
index 5dfe15e3d0b..00000000000
--- a/messagebus_test/src/tests/trace/JavaServer.java
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-import com.yahoo.messagebus.*;
-import com.yahoo.messagebus.test.*;
-import com.yahoo.config.*;
-import com.yahoo.messagebus.routing.*;
-import com.yahoo.messagebus.network.*;
-import com.yahoo.messagebus.network.rpc.*;
-import java.util.Arrays;
-import java.util.logging.*;
-
-public class JavaServer implements MessageHandler, ReplyHandler {
-
- private static Logger log = Logger.getLogger(JavaServer.class.getName());
-
- private IntermediateSession session;
- private String name;
-
- public JavaServer(RPCMessageBus mb, String name) {
- session = mb.getMessageBus().createIntermediateSession("session", true, this, this);
- this.name = name;
- }
-
- public void handleMessage(Message msg) {
- msg.getTrace().trace(1, name + " (message)", false);
- if (msg.getRoute() == null || !msg.getRoute().hasHops()) {
- System.out.println("**** Server '" + name + "' replying.");
- Reply reply = new EmptyReply();
- msg.swapState(reply);
- handleReply(reply);
- } else {
- System.out.println("**** Server '" + name + "' forwarding message.");
- session.forward(msg);
- }
- }
-
- public void handleReply(Reply reply) {
- reply.getTrace().trace(1, name + " (reply)", false);
- session.forward(reply);
- }
-
- public static void main(String[] args) {
- if (args.length != 1) {
- System.err.println("usage: JavaServer <service prefix>");
- System.exit(1);
- }
- String name = args[0];
- SimpleProtocol protocol = new SimpleProtocol();
- protocol.addPolicyFactory("All", new SimpleProtocol.PolicyFactory() {
- @Override
- public RoutingPolicy create(String param) {
- return new AllPolicy();
- }
- });
- try {
- RPCMessageBus mb = new RPCMessageBus(
- Arrays.<Protocol>asList(protocol),
- new RPCNetworkParams()
- .setIdentity(new Identity(name))
- .setSlobrokConfigId("file:slobrok.cfg"),
- "file:routing.cfg");
- JavaServer server = new JavaServer(mb, name);
- System.out.printf("java server started name=%s\n", name);
- while (true) {
- Thread.sleep(1000);
- }
- } catch (Exception e) {
- log.log(Level.SEVERE, "JAVA-SERVER: Failed", e);
- System.exit(1);
- }
- }
-
- private static class AllPolicy implements RoutingPolicy {
-
- @Override
- public void select(RoutingContext ctx) {
- ctx.addChildren(ctx.getMatchedRecipients());
- }
-
- @Override
- public void merge(RoutingContext ctx) {
- EmptyReply ret = new EmptyReply();
- for (RoutingNodeIterator it = ctx.getChildIterator();
- it.isValid(); it.next()) {
- Reply reply = it.getReplyRef();
- for (int i = 0; i < reply.getNumErrors(); ++i) {
- ret.addError(reply.getError(i));
- }
- }
- ctx.setReply(ret);
- }
-
- @Override
- public void destroy() {
-
- }
- }
-}
diff --git a/messagebus_test/src/tests/trace/cpp-server.cpp b/messagebus_test/src/tests/trace/cpp-server.cpp
deleted file mode 100644
index 76e20bc3cfd..00000000000
--- a/messagebus_test/src/tests/trace/cpp-server.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP("cpp-server");
-#include <vespa/messagebus/messagebus.h>
-#include <vespa/messagebus/destinationsession.h>
-#include <vespa/messagebus/testlib/simplemessage.h>
-#include <vespa/messagebus/testlib/simplereply.h>
-#include <vespa/messagebus/testlib/simpleprotocol.h>
-#include <vespa/messagebus/rpcmessagebus.h>
-#include <vespa/messagebus/iprotocol.h>
-#include <vespa/messagebus/protocolset.h>
-#include <vespa/messagebus/emptyreply.h>
-
-using namespace mbus;
-
-class Server : public IMessageHandler,
- public IReplyHandler
-{
-private:
- IntermediateSession::UP _session;
- std::string _name;
-public:
- Server(MessageBus &bus, const std::string &name);
- ~Server();
- void handleMessage(Message::UP msg);
- void handleReply(Reply::UP reply);
-};
-
-Server::Server(MessageBus &bus, const std::string &name)
- : _session(bus.createIntermediateSession("session", true, *this, *this)),
- _name(name)
-{
- fprintf(stderr, "cpp server started: %s\n", _name.c_str());
-}
-
-Server::~Server()
-{
- _session.reset();
-}
-
-void
-Server::handleMessage(Message::UP msg) {
- msg->getTrace().trace(1, _name + " (message)", false);
- if (!msg->getRoute().hasHops()) {
- fprintf(stderr, "**** Server '%s' replying.\n", _name.c_str());
- Reply::UP reply(new EmptyReply());
- msg->swapState(*reply);
- handleReply(std::move(reply));
- } else {
- fprintf(stderr, "**** Server '%s' forwarding message.\n", _name.c_str());
- _session->forward(std::move(msg));
- }
-}
-
-void
-Server::handleReply(Reply::UP reply) {
- reply->getTrace().trace(1, _name + " (reply)", false);
- _session->forward(std::move(reply));
-}
-
-class App : public FastOS_Application
-{
-public:
- int Main();
-};
-
-int
-App::Main()
-{
- if (_argc != 2) {
- fprintf(stderr, "usage: %s <service-prefix>\n", _argv[0]);
- return 1;
- }
- RPCMessageBus mb(ProtocolSet().add(IProtocol::SP(new SimpleProtocol())),
- RPCNetworkParams()
- .setIdentity(Identity(_argv[1]))
- .setSlobrokConfig("file:slobrok.cfg"),
- "file:routing.cfg");
- Server server(mb.getMessageBus(), _argv[1]);
- while (true) {
- FastOS_Thread::Sleep(1000);
- }
- return 0;
-}
-
-int main(int argc, char **argv) {
- App app;
- return app.Entry(argc, argv);
-}
diff --git a/messagebus_test/src/tests/trace/ctl.sh b/messagebus_test/src/tests/trace/ctl.sh
deleted file mode 100755
index ca4fc7701e6..00000000000
--- a/messagebus_test/src/tests/trace/ctl.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-if [ -z "$SOURCE_DIRECTORY" ]; then
- SOURCE_DIRECTORY="."
-fi
-
-. ../../binref/env.sh
-
-exec $SOURCE_DIRECTORY/../../binref/progctl.sh $SOURCE_DIRECTORY/progdefs.sh "$@"
diff --git a/messagebus_test/src/tests/trace/progdefs.sh b/messagebus_test/src/tests/trace/progdefs.sh
deleted file mode 100644
index 4071da4beb5..00000000000
--- a/messagebus_test/src/tests/trace/progdefs.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-prog server cpp1 "" "./messagebus_test_cpp-server-trace_app server/cpp/1/A"
-prog server cpp2 "" "./messagebus_test_cpp-server-trace_app server/cpp/2/A"
-prog server cpp3 "" "./messagebus_test_cpp-server-trace_app server/cpp/2/B"
-prog server cpp4 "" "./messagebus_test_cpp-server-trace_app server/cpp/3/A"
-prog server cpp5 "" "./messagebus_test_cpp-server-trace_app server/cpp/3/B"
-prog server cpp6 "" "./messagebus_test_cpp-server-trace_app server/cpp/3/C"
-prog server cpp7 "" "./messagebus_test_cpp-server-trace_app server/cpp/3/D"
-prog server java1 "" "$BINREF/runjava JavaServer server/java/1/A"
-prog server java2 "" "$BINREF/runjava JavaServer server/java/2/A"
-prog server java3 "" "$BINREF/runjava JavaServer server/java/2/B"
-prog server java4 "" "$BINREF/runjava JavaServer server/java/3/A"
-prog server java5 "" "$BINREF/runjava JavaServer server/java/3/B"
-prog server java6 "" "$BINREF/runjava JavaServer server/java/3/C"
-prog server java7 "" "$BINREF/runjava JavaServer server/java/3/D"
diff --git a/messagebus_test/src/tests/trace/routing-template.cfg b/messagebus_test/src/tests/trace/routing-template.cfg
deleted file mode 100644
index 72318131b99..00000000000
--- a/messagebus_test/src/tests/trace/routing-template.cfg
+++ /dev/null
@@ -1,32 +0,0 @@
-routingtable[1]
-routingtable[0].protocol "Simple"
-routingtable[0].hop[3]
-routingtable[0].hop[0].name "hop1"
-routingtable[0].hop[0].selector "server/[All]/1/[All]/session"
-routingtable[0].hop[0].recipient[2]
-routingtable[0].hop[0].recipient[0] "server/cpp/1/A/session"
-routingtable[0].hop[0].recipient[1] "server/java/1/A/session"
-routingtable[0].hop[1].name "hop2"
-routingtable[0].hop[1].selector "server/[All]/2/[All]/session"
-routingtable[0].hop[1].recipient[4]
-routingtable[0].hop[1].recipient[0] "server/cpp/2/A/session"
-routingtable[0].hop[1].recipient[1] "server/cpp/2/B/session"
-routingtable[0].hop[1].recipient[2] "server/java/2/A/session"
-routingtable[0].hop[1].recipient[3] "server/java/2/B/session"
-routingtable[0].hop[2].name "hop3"
-routingtable[0].hop[2].selector "server/[All]/3/[All]/session"
-routingtable[0].hop[2].recipient[8]
-routingtable[0].hop[2].recipient[0] "server/cpp/3/A/session"
-routingtable[0].hop[2].recipient[1] "server/cpp/3/B/session"
-routingtable[0].hop[2].recipient[2] "server/cpp/3/C/session"
-routingtable[0].hop[2].recipient[3] "server/cpp/3/D/session"
-routingtable[0].hop[2].recipient[4] "server/java/3/A/session"
-routingtable[0].hop[2].recipient[5] "server/java/3/B/session"
-routingtable[0].hop[2].recipient[6] "server/java/3/C/session"
-routingtable[0].hop[2].recipient[7] "server/java/3/D/session"
-routingtable[0].route[1]
-routingtable[0].route[0].name "test"
-routingtable[0].route[0].hop[3]
-routingtable[0].route[0].hop[0] "hop1"
-routingtable[0].route[0].hop[1] "hop2"
-routingtable[0].route[0].hop[2] "hop3"
diff --git a/messagebus_test/src/tests/trace/trace.cpp b/messagebus_test/src/tests/trace/trace.cpp
deleted file mode 100644
index f25c776ca74..00000000000
--- a/messagebus_test/src/tests/trace/trace.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP("trace_test");
-#include <vespa/vespalib/testkit/testapp.h>
-#include <vespa/vespalib/testkit/test_kit.h>
-#include <vespa/messagebus/testlib/slobrok.h>
-#include <vespa/vespalib/util/stringfmt.h>
-#include <vespa/messagebus/emptyreply.h>
-#include <vespa/messagebus/messagebus.h>
-#include <vespa/messagebus/sourcesession.h>
-#include <vespa/messagebus/rpcmessagebus.h>
-#include <vespa/messagebus/intermediatesession.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 <iostream>
-
-using namespace mbus;
-using vespalib::make_string;
-
-TEST_SETUP(Test);
-
-bool
-waitSlobrok(RPCMessageBus &mbus, const std::string &pattern)
-{
- for (int i = 0; i < 30000; i++) {
- slobrok::api::MirrorAPI::SpecList res = mbus.getRPCNetwork().getMirror().lookup(pattern);
- if (res.size() > 0) {
- return true;
- }
- FastOS_Thread::Sleep(10);
- }
- return false;
-}
-
-int
-Test::Main()
-{
- TEST_INIT("trace_test");
- Slobrok slobrok;
- const std::string routing_template = TEST_PATH("routing-template.cfg");
- const std::string ctl_script = TEST_PATH("ctl.sh");
-
- { // Make slobrok config
- EXPECT_TRUE(system("echo slobrok[1] > slobrok.cfg") == 0);
- EXPECT_TRUE(system(make_string("echo 'slobrok[0].connectionspec tcp/localhost:%d' "
- ">> slobrok.cfg", slobrok.port()).c_str()) == 0);
- }
- { // Make routing config
- EXPECT_TRUE(system(("cat " + routing_template + " > routing.cfg").c_str()) == 0);
- }
-
- EXPECT_TRUE(system((ctl_script + " start all").c_str()) == 0);
- RPCMessageBus mb(ProtocolSet().add(IProtocol::SP(new SimpleProtocol())),
- RPCNetworkParams().setSlobrokConfig("file:slobrok.cfg"),
- "file:routing.cfg");
- EXPECT_TRUE(waitSlobrok(mb, "server/cpp/1/A/session"));
- EXPECT_TRUE(waitSlobrok(mb, "server/cpp/2/A/session"));
- EXPECT_TRUE(waitSlobrok(mb, "server/cpp/2/B/session"));
- EXPECT_TRUE(waitSlobrok(mb, "server/cpp/3/A/session"));
- EXPECT_TRUE(waitSlobrok(mb, "server/cpp/3/B/session"));
- EXPECT_TRUE(waitSlobrok(mb, "server/cpp/3/C/session"));
- EXPECT_TRUE(waitSlobrok(mb, "server/cpp/3/D/session"));
- EXPECT_TRUE(waitSlobrok(mb, "server/java/1/A/session"));
- EXPECT_TRUE(waitSlobrok(mb, "server/java/2/A/session"));
- EXPECT_TRUE(waitSlobrok(mb, "server/java/2/B/session"));
- EXPECT_TRUE(waitSlobrok(mb, "server/java/3/A/session"));
- EXPECT_TRUE(waitSlobrok(mb, "server/java/3/B/session"));
- EXPECT_TRUE(waitSlobrok(mb, "server/java/3/C/session"));
- EXPECT_TRUE(waitSlobrok(mb, "server/java/3/D/session"));
-
- TraceNode e3 = TraceNode()
- .addChild(TraceNode().addChild("server/cpp/3/A (message)").addChild("server/cpp/3/A (reply)"))
- .addChild(TraceNode().addChild("server/cpp/3/B (message)").addChild("server/cpp/3/B (reply)"))
- .addChild(TraceNode().addChild("server/cpp/3/C (message)").addChild("server/cpp/3/C (reply)"))
- .addChild(TraceNode().addChild("server/cpp/3/D (message)").addChild("server/cpp/3/D (reply)"))
- .addChild(TraceNode().addChild("server/java/3/A (message)").addChild("server/java/3/A (reply)"))
- .addChild(TraceNode().addChild("server/java/3/B (message)").addChild("server/java/3/B (reply)"))
- .addChild(TraceNode().addChild("server/java/3/C (message)").addChild("server/java/3/C (reply)"))
- .addChild(TraceNode().addChild("server/java/3/D (message)").addChild("server/java/3/D (reply)")).setStrict(false);
- TraceNode e2 = TraceNode()
- .addChild(TraceNode().addChild("server/cpp/2/A (message)").addChild(e3).addChild("server/cpp/2/A (reply)"))
- .addChild(TraceNode().addChild("server/cpp/2/B (message)").addChild(e3).addChild("server/cpp/2/B (reply)"))
- .addChild(TraceNode().addChild("server/java/2/A (message)").addChild(e3).addChild("server/java/2/A (reply)"))
- .addChild(TraceNode().addChild("server/java/2/B (message)").addChild(e3).addChild("server/java/2/B (reply)")).setStrict(false);
- TraceNode expect = TraceNode()
- .addChild(TraceNode().addChild("server/cpp/1/A (message)").addChild(e2).addChild("server/cpp/1/A (reply)"))
- .addChild(TraceNode().addChild("server/java/1/A (message)").addChild(e2).addChild("server/java/1/A (reply)")).setStrict(false);
- expect.normalize();
-
- Receptor src;
- Reply::UP reply;
- SourceSession::UP ss = mb.getMessageBus().createSourceSession(src, SourceSessionParams());
- for (int i = 0; i < 50; ++i) {
- Message::UP msg(new SimpleMessage("test"));
- msg->getTrace().setLevel(1);
- ss->send(std::move(msg), "test");
- reply = src.getReply(10);
- if (reply.get() != NULL) {
- reply->getTrace().getRoot().normalize();
- // resending breaks the trace, so retry until it has expected form
- if (!reply->hasErrors() && reply->getTrace().getRoot().encode() == expect.encode()) {
- break;
- }
- }
- std::cout << "Attempt " << i << " got errors, retrying in 1 second.." << std::endl;
- FastOS_Thread::Sleep(1000);
- }
-
- EXPECT_TRUE(!reply->hasErrors());
- EXPECT_EQUAL(reply->getTrace().getRoot().encode(), expect.encode());
- EXPECT_TRUE(system((ctl_script + " stop all").c_str()) == 0);
- TEST_DONE();
-}
diff --git a/messagebus_test/src/tests/trace/trace_test.sh b/messagebus_test/src/tests/trace/trace_test.sh
deleted file mode 100755
index 7bd344a8618..00000000000
--- a/messagebus_test/src/tests/trace/trace_test.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-set -e
-
-if [ -z "$SOURCE_DIRECTORY" ]; then
- SOURCE_DIRECTORY="."
-fi
-
-. ../../binref/env.sh
-
-$BINREF/compilejava $SOURCE_DIRECTORY/JavaServer.java
-
-$VALGRIND ./messagebus_test_trace_test_app