3 use namespace::autoclean;
5 after 'disconnect' => sub {
6 delete shift->{___activemq};
14 use Exporter qw/import/;
17 our $ACTIVEMQ_VERSION = '5.2.0';
19 our @EXPORT = qw/ start_server /;
24 $stomp = Net::Stomp->new( { hostname => 'localhost', port => 61613 } );
28 unless (Alien::ActiveMQ->is_version_installed($ACTIVEMQ_VERSION)) {
29 plan 'skip_all' => 'No ActiveMQ server installed by Alien::ActiveMQ, try running the "install-activemq" command';
33 $mq = Alien::ActiveMQ->run_server($ACTIVEMQ_VERSION);
36 $stomp = Net::Stomp->new( { hostname => 'localhost', port => 61613 } );
39 plan 'skip_all' => 'No ActiveMQ server listening on 61613: ' . $@;
44 $SIG{CHLD} = 'IGNORE';
46 my $libs = join(' ', map { "-I$_" } @INC);
47 system("$^X $libs $FindBin::Bin/script/stomptestapp_stomp.pl --oneshot");
50 print STDERR "server started, waiting for spinup...";
53 $stomp->{___activemq} = $mq if $mq;
54 StompRole->meta->apply($stomp);