=================================================================== RCS file: /cvs/HOPE/Net-OpenAMD/t/local_server.t,v retrieving revision 1.3 retrieving revision 1.9 diff -u -r1.3 -r1.9 --- HOPE/Net-OpenAMD/t/local_server.t 2010/06/26 15:14:36 1.3 +++ HOPE/Net-OpenAMD/t/local_server.t 2010/06/28 21:40:38 1.9 @@ -1,43 +1,38 @@ #!perl -# $AFresh1: local_server.t,v 1.2 2010/06/26 14:02:31 andrew Exp $ -use Test::More;# tests => 75; +# $AFresh1: local_server.t,v 1.8 2010/06/28 20:34:14 andrew Exp $ +use Test::More; use strict; use warnings; -#use File::Temp qw/ tempdir /; -#use File::Copy qw/ cp /; -#use File::Spec; +use Net::OpenAMD; -my $have_test_json = 1; - BEGIN { use FindBin; - use lib "$FindBin::Bin/../../../mojo/lib"; + use lib "$FindBin::Bin"; + use lib "$FindBin::Bin/../../mojo/lib"; eval "use Test::Mojo::Server"; - plan skip_all => "Test::Mojo::Server required for testing local server" if $@; + if ($@) { + plan skip_all => "Test::Mojo::Server required for testing local server"; + } + else { + plan tests => 15; + } + require 'network_tests.t'; } my $server = Test::Mojo::Server->new(); $server->executable('test_server.pl'); -#$server = $server->command('perl t/test_server.pl'); my $path = $server->find_executable_ok('executable found'); -#print "PATH: $path\n"; -#my $port = $server->generate_port_ok('port test'); - my $port = $server->start_daemon_ok('daemon test'); -print "Port: $port\n"; - $server->server_ok('server running'); -my $pid = $server->pid; -print "PID: $pid\n"; +my $amd = Net::OpenAMD->new( + { base_uri => 'http://127.0.0.1:' . $port . '/api/', } ); +NetworkTests::run_tests($amd); -$server->stop_server_ok('server stopped'); +$server->stop_server_ok('server stopped'); - - -done_testing(); -exit; +#done_testing();