X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2FCatalyst-Engine-Stomp.t;h=ea2e699860d2e1d5b01147425f00727658a55e29;hb=a431050d77f65a0cdb3683c9620b2135ca4ca1dc;hp=58c1e778906ff241824ced8da6751e4fccfb8d42;hpb=68e73c9f66beb49890b4609af4d85222c3076aca;p=catagits%2FCatalyst-Engine-STOMP.git diff --git a/t/Catalyst-Engine-Stomp.t b/t/Catalyst-Engine-Stomp.t index 58c1e77..ea2e699 100644 --- a/t/Catalyst-Engine-Stomp.t +++ b/t/Catalyst-Engine-Stomp.t @@ -8,26 +8,41 @@ use Net::Stomp; use YAML::XS qw/ Dump Load /; use Data::Dumper; -my $stomp; +use Alien::ActiveMQ; +my $ACTIVEMQ_VERSION = '5.2.0'; + +my ($stomp, $mq); eval { $stomp = Net::Stomp->new( { hostname => 'localhost', port => 61613 } ); }; if ($@) { - plan 'skip_all' => 'No ActiveMQ server listening on 61613: ' . $@; - exit; -} -else { - plan tests => 12; + + 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; + } + + $mq = Alien::ActiveMQ->run_server($ACTIVEMQ_VERSION); + + eval { + $stomp = Net::Stomp->new( { hostname => 'localhost', port => 61613 } ); + }; + if ($@) { + plan 'skip_all' => 'No ActiveMQ server listening on 61613: ' . $@; + exit; + } } +plan tests => 12; + # 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";