Commit | Line | Data |
bf8937b7 |
1 | use Alien::ActiveMQ; |
2 | my $ACTIVEMQ_VERSION = '5.2.0'; |
3 | |
4 | eval { |
5 | $stomp = Net::Stomp->new( { hostname => 'localhost', port => 61613 } ); |
6 | }; |
7 | if ($@) { |
8 | |
9 | unless (Alien::ActiveMQ->is_version_installed($ACTIVEMQ_VERSION)) { |
10 | plan 'skip_all' => 'No ActiveMQ server installed by Alien::ActiveMQ, try running the "install-activemq" command'; |
11 | exit; |
12 | } |
13 | |
14 | $mq = Alien::ActiveMQ->run_server($ACTIVEMQ_VERSION); |
15 | |
16 | eval { |
17 | $stomp = Net::Stomp->new( { hostname => 'localhost', port => 61613 } ); |
18 | }; |
19 | if ($@) { |
20 | plan 'skip_all' => 'No ActiveMQ server listening on 61613: ' . $@; |
21 | exit; |
22 | } |
23 | } |
24 | |
25 | # First fire off the server |
26 | $SIG{CHLD} = 'IGNORE'; |
27 | unless (fork()) { |
28 | system("$^X -Ilib -Itestapp/lib testapp/script/stomptestapp_stomp.pl --oneshot"); |
29 | exit 0; |
30 | } |
31 | print STDERR "server started, waiting for spinup..."; |
32 | sleep 2; |
33 | |