X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2FCatalyst-Engine-Stomp.t;h=0145e28191cb33333e684ffc2388c76436b211f9;hb=fa1e564eedaeaa045d243f573b86db4437ba14a6;hp=e96c0285db9188546ad1c598b73a51a2c282ebe9;hpb=0a66358961c58c5fff96a363853ee93b00f55119;p=catagits%2FCatalyst-Engine-STOMP.git diff --git a/t/Catalyst-Engine-Stomp.t b/t/Catalyst-Engine-Stomp.t index e96c028..0145e28 100644 --- a/t/Catalyst-Engine-Stomp.t +++ b/t/Catalyst-Engine-Stomp.t @@ -1,5 +1,4 @@ -use Test::More tests => 14; -use Test::Fork; +use Test::More; # Tests which expect a STOMP server like ActiveMQ to exist on # localhost:61613, which is what you get if you just get the ActiveMQ @@ -9,15 +8,28 @@ use Net::Stomp; use YAML::XS qw/ Dump Load /; use Data::Dumper; +my $stomp; +eval { + $stomp = Net::Stomp->new( { hostname => 'localhost', port => 61613 } ); +}; +if ($@) { + plan 'skip_all' => 'No ActiveMQ server listening on 61613: ' . $@; + exit; +} +else { + plan tests => 12; +} + # First fire off the server -my $child_pid = fork_ok(1, sub { - ok(system("$^X -Ilib -Itestapp/lib testapp/script/testapp_stomp.pl --oneshot")); - #sleep 3; -}); +$SIG{CHLD} = 'IGNORE'; +unless (fork()) { + system("$^X -Ilib -Itestapp/lib testapp/script/testapp_stomp.pl --oneshot"); + exit 0; +} +sleep 30; # Now be a client to that server -my $stomp = Net::Stomp->new( { hostname => 'localhost', port => 61613 } ); ok($stomp, 'Net::Stomp object'); my $frame = $stomp->connect();