Turn off debug by default, you can say -d for the testapp script anyway and like...
t0m [Sun, 17 May 2009 16:26:46 +0000 (17:26 +0100)]
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..

Makefile.PL
t/Catalyst-Engine-Stomp.t
testapp/lib/StompTestApp.pm

index e0e1bad..0d9a065 100644 (file)
@@ -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';
 
index 58c1e77..9c4f148 100644 (file)
@@ -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";
index 83f06a8..7ed0f1b 100644 (file)
@@ -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;