From: t0m Date: Sun, 17 May 2009 16:26:46 +0000 (+0100) Subject: Turn off debug by default, you can say -d for the testapp script anyway and like... X-Git-Tag: 0.03~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Engine-STOMP.git;a=commitdiff_plain;h=6ac87378371b9d19564a03b8c2183e14fa653d97 Turn off debug by default, you can say -d for the testapp script anyway and like this we don't get all the crap by default, but you _can_ turn it on in the tests by setting the env variable.. More useful imo :) Also add dependency on Alien::ActiveMQ, so that you can actually get the smoke tests run by CPANTS (once I teach that to install ActiveMQ as part of make install, at least).. We probably need to abstract telling it where the activeMQ server is / or getting it to start one into a test library - as I just want 'make test' to do it all, but I guess Chris is more likely to already have a broker running, and want the tests to point at that instance.. --- diff --git a/Makefile.PL b/Makefile.PL index e0e1bad..0d9a065 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -15,6 +15,8 @@ requires 'Net::Stomp' => '0.34'; requires 'YAML::XS' => '0.32'; requires 'namespace::autoclean' => '0.05'; +test_requires 'Alien::ApacheMQ' => '0.00001'; + no_index package => 'StompTestApp'; no_index package => 'StompTestApp::Controller::TestController'; diff --git a/t/Catalyst-Engine-Stomp.t b/t/Catalyst-Engine-Stomp.t index 58c1e77..9c4f148 100644 --- a/t/Catalyst-Engine-Stomp.t +++ b/t/Catalyst-Engine-Stomp.t @@ -8,6 +8,15 @@ use Net::Stomp; use YAML::XS qw/ Dump Load /; use Data::Dumper; +use Alien::ActiveMQ; +my $ACTIVEMQ_VERSION = '5.2.0'; + +unless (Alien::ActiveMQ->is_version_installed($ACTIVEMQ_VERSION)) { + plan 'skip_all' => 'No ActiveMQ server installed by Alien::ActiveMQ, try running the "install-activemq" command'; + exit; +} +my $mq = Alien::ActiveMQ->run_server($ACTIVEMQ_VERSION); + my $stomp; eval { $stomp = Net::Stomp->new( { hostname => 'localhost', port => 61613 } ); @@ -23,11 +32,11 @@ else { # First fire off the server $SIG{CHLD} = 'IGNORE'; unless (fork()) { - system("CATALYST_DEBUG=0 $^X -Ilib -Itestapp/lib testapp/script/stomptestapp_stomp.pl --oneshot"); + system("$^X -Ilib -Itestapp/lib testapp/script/stomptestapp_stomp.pl --oneshot"); exit 0; } print STDERR "server started, waiting for spinup..."; -sleep 10; +sleep 20; # Now be a client to that server print STDERR "testing\n"; diff --git a/testapp/lib/StompTestApp.pm b/testapp/lib/StompTestApp.pm index 83f06a8..7ed0f1b 100644 --- a/testapp/lib/StompTestApp.pm +++ b/testapp/lib/StompTestApp.pm @@ -3,7 +3,7 @@ package # Hide from PAUSE use Moose; use Catalyst::Runtime '5.80003'; -use Catalyst qw/-Debug +use Catalyst qw/ ConfigLoader /; use namespace::autoclean;