You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2008/11/11 00:41:03 UTC
svn commit: r712874 - in /activemq/activemq-cpp/trunk/src/test:
decaf/util/concurrent/ThreadPoolTest.cpp main.cpp
Author: tabish
Date: Mon Nov 10 15:41:02 2008
New Revision: 712874
URL: http://svn.apache.org/viewvc?rev=712874&view=rev
Log:
Update test driver to allow for multiple runs of the tests in a single launch.
Modified:
activemq/activemq-cpp/trunk/src/test/decaf/util/concurrent/ThreadPoolTest.cpp
activemq/activemq-cpp/trunk/src/test/main.cpp
Modified: activemq/activemq-cpp/trunk/src/test/decaf/util/concurrent/ThreadPoolTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/decaf/util/concurrent/ThreadPoolTest.cpp?rev=712874&r1=712873&r2=712874&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/decaf/util/concurrent/ThreadPoolTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/decaf/util/concurrent/ThreadPoolTest.cpp Mon Nov 10 15:41:02 2008
@@ -38,6 +38,9 @@
ThreadPool* pool = ThreadPool::getInstance();
+ pool->setMaxThreads( ThreadPool::DEFAULT_MAX_POOL_SIZE );
+ pool->setBlockSize( ThreadPool::DEFAULT_MAX_BLOCK_SIZE );
+
pool->queueTask( ThreadPool::Task( &task1, this ) );
pool->queueTask( ThreadPool::Task( &task2, this ) );
pool->queueTask( ThreadPool::Task( &task3, this ) );
Modified: activemq/activemq-cpp/trunk/src/test/main.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/main.cpp?rev=712874&r1=712873&r2=712874&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/main.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/main.cpp Mon Nov 10 15:41:02 2008
@@ -21,15 +21,25 @@
#include <cppunit/TestResult.h>
#include <activemq/util/Config.h>
#include <decaf/lang/Runtime.h>
+#include <decaf/lang/Integer.h>
#include <iostream>
-int main( int argc AMQCPP_UNUSED, char **argv AMQCPP_UNUSED)
-{
+int main( int argc, char **argv ) {
+
// ensure that we start the runtime.
decaf::lang::Runtime::getRuntime();
bool wasSuccessful = false;
+ int iterations = 1;
+
+ if( argc > 1 ) {
+ try {
+ iterations = decaf::lang::Integer::parseInt( argv[1] );
+ } catch( decaf::lang::exceptions::NumberFormatException& ex ) {
+ iterations = 1;
+ }
+ }
- for( int i = 0; i < 1; ++i ) {
+ for( int i = 0; i < iterations; ++i ) {
CppUnit::TextUi::TestRunner runner;
CppUnit::TestFactoryRegistry ®istry = CppUnit::TestFactoryRegistry::getRegistry();
runner.addTest( registry.makeTest() );