summaryrefslogtreecommitdiff
path: root/qpid/extras/dispatch/tests
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2013-06-11 14:13:11 +0000
committerTed Ross <tross@apache.org>2013-06-11 14:13:11 +0000
commita155aa356400c8b73be5cb079e39091194672df7 (patch)
tree02581cc384805207fba5028d755e38f87070053e /qpid/extras/dispatch/tests
parent1dc04d1335a76abd84bbaabd04af518a3d2e3c71 (diff)
downloadqpid-python-a155aa356400c8b73be5cb079e39091194672df7.tar.gz
QPID_4913 - Work in progress
- Added configuration handling of listeners (basic, still needs ssl, sasl, etc.) - Updated the server tests to use the configuration file rather than hard-coded settings. - Fixed a bug in the CMake file regarding the use of the PYTHON include path. - Made changes to accomodate older compilers. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1491805 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/extras/dispatch/tests')
-rw-r--r--qpid/extras/dispatch/tests/CMakeLists.txt2
-rw-r--r--qpid/extras/dispatch/tests/run_unit_tests.c8
-rw-r--r--qpid/extras/dispatch/tests/server_test.c11
-rw-r--r--qpid/extras/dispatch/tests/threads4.conf26
4 files changed, 41 insertions, 6 deletions
diff --git a/qpid/extras/dispatch/tests/CMakeLists.txt b/qpid/extras/dispatch/tests/CMakeLists.txt
index 688e1de2f6..3d90f163b3 100644
--- a/qpid/extras/dispatch/tests/CMakeLists.txt
+++ b/qpid/extras/dispatch/tests/CMakeLists.txt
@@ -48,4 +48,4 @@ add_test(unit_tests_size_5 unit_tests_size 5)
add_test(unit_tests_size_3 unit_tests_size 3)
add_test(unit_tests_size_2 unit_tests_size 2)
add_test(unit_tests_size_1 unit_tests_size 1)
-add_test(unit_tests unit_tests)
+add_test(unit_tests unit_tests ${CMAKE_CURRENT_SOURCE_DIR}/threads4.conf)
diff --git a/qpid/extras/dispatch/tests/run_unit_tests.c b/qpid/extras/dispatch/tests/run_unit_tests.c
index 9b0b5b100e..4b83d84b40 100644
--- a/qpid/extras/dispatch/tests/run_unit_tests.c
+++ b/qpid/extras/dispatch/tests/run_unit_tests.c
@@ -18,6 +18,7 @@
*/
#include <qpid/dispatch/buffer.h>
+#include <stdio.h>
int tool_tests();
int timer_tests();
@@ -26,11 +27,16 @@ int server_tests();
int main(int argc, char** argv)
{
+ if (argc != 2) {
+ fprintf(stderr, "usage: %s <config-file>\n", argv[0]);
+ exit(1);
+ }
+
int result = 0;
result += tool_tests();
result += timer_tests();
result += alloc_tests();
- result += server_tests();
+ result += server_tests(argv[1]);
return result;
}
diff --git a/qpid/extras/dispatch/tests/server_test.c b/qpid/extras/dispatch/tests/server_test.c
index deb3ae78eb..525d8b6a9f 100644
--- a/qpid/extras/dispatch/tests/server_test.c
+++ b/qpid/extras/dispatch/tests/server_test.c
@@ -29,6 +29,7 @@
#define THREAD_COUNT 4
#define OCTET_COUNT 100
+static const char *config_file;
static dx_dispatch_t *dx;
static sys_mutex_t *test_lock;
@@ -116,7 +117,7 @@ static char* test_start_handler(void *context)
{
int i;
- dx = dx_dispatch(THREAD_COUNT, 0, 0, 0);
+ dx = dx_dispatch(config_file);
expected_context = (void*) 0x00112233;
stored_error[0] = 0x0;
@@ -139,7 +140,7 @@ static char* test_start_handler(void *context)
static char *test_server_start(void *context)
{
- dx = dx_dispatch(THREAD_COUNT, 0, 0, 0);
+ dx = dx_dispatch(config_file);
dx_server_start(dx);
dx_server_stop(dx);
dx_dispatch_free(dx);
@@ -153,7 +154,7 @@ static char* test_user_fd(void *context)
int res;
dx_timer_t *timer;
- dx = dx_dispatch(THREAD_COUNT, 0, 0, 0);
+ dx = dx_dispatch(config_file);
dx_server_set_user_fd_handler(dx, ufd_handler);
timer = dx_timer(dx, fd_test_start, 0);
dx_timer_schedule(timer, 0);
@@ -190,12 +191,14 @@ static char* test_user_fd(void *context)
}
-int server_tests(void)
+int server_tests(const char *_config_file)
{
int result = 0;
test_lock = sys_mutex();
dx_log_set_mask(LOG_NONE);
+ config_file = _config_file;
+
TEST_CASE(test_server_start, 0);
TEST_CASE(test_start_handler, 0);
TEST_CASE(test_user_fd, 0);
diff --git a/qpid/extras/dispatch/tests/threads4.conf b/qpid/extras/dispatch/tests/threads4.conf
new file mode 100644
index 0000000000..1466e11cca
--- /dev/null
+++ b/qpid/extras/dispatch/tests/threads4.conf
@@ -0,0 +1,26 @@
+##
+## Licensed to the Apache Software Foundation (ASF) under one
+## or more contributor license agreements. See the NOTICE file
+## distributed with this work for additional information
+## regarding copyright ownership. The ASF licenses this file
+## to you under the Apache License, Version 2.0 (the
+## "License"); you may not use this file except in compliance
+## with the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing,
+## software distributed under the License is distributed on an
+## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+## KIND, either express or implied. See the License for the
+## specific language governing permissions and limitations
+## under the License
+##
+
+
+##
+## Container section - Configures the general operation of the AMQP container.
+##
+container {
+ worker-threads: 4
+}