Permalink
Browse files

Added script like example, added live running test (sadly not working…

…), tuned Makefile.PL, tuned MANIFEST.SKIP
  • Loading branch information...
1 parent f67fdd8 commit 061ea8b09427e714a90f8b1fd8dd86010e1abfa6 Torsten Raudssus committed Jul 18, 2010
Showing with 71 additions and 8 deletions.
  1. +5 −3 MANIFEST.SKIP
  2. +16 −1 Makefile.PL
  3. +3 −2 ex/start_dist_aped.pl
  4. +6 −0 script/alien_ape_server_dist
  5. +2 −2 t/{01-daemon.t → 01-binary.t}
  6. +39 −0 t/02-running.t
View
8 MANIFEST.SKIP 100644 → 100755
@@ -1,4 +1,6 @@
-^.git
-^.gitignore$
+^\.git
+^\.gitignore$
^Makefile$
-
+^README.md$
+^MANIFEST.SKIP$
+^Makefile\.old$
View
@@ -5,13 +5,28 @@ name 'Alien-APE-Server';
perl_version '5.008';
license 'gpl2';
all_from 'lib/Alien/APE/Server.pm';
+
requires 'File::ShareDir';
+
test_requires 'Test::More' => '0.42';
test_requires 'FindBin';
+test_requires 'Proc::Background';
+test_requires 'LWP::UserAgent';
+test_requires 'HTTP::Request';
+
+author_requires 'Module::Install::AuthorRequires';
+author_requires 'Module::Install::AutoLicense';
+author_requires 'Module::Install::AutoManifest';
+
+no_index directory => 'ape-server';
+
+install_script 'alien_ape_server_dist';
-no_index directory => 'ape-server';
+# get_file 'http://github.com/APE-Project/APE_Server/tarball/a5d079cece721c38f48177589ef3a9bd8b7137c2';
+auto_license;
auto_install;
+auto_manifest;
my $S = ($^O eq 'MSWin32') ? "\\" : "\/";
my $root = "\$(INST_LIB)${S}auto${S}share${S}dist${S}\$(DISTNAME)";
@@ -1,5 +1,6 @@
#!/usr/bin/perl
+use strict;
+use warnings;
use Alien::APE::Server;
-
-Alien::APE::Server->start_dist_aped;
+Alien::APE::Server->start_dist_aped;
@@ -0,0 +1,6 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use Alien::APE::Server;
+Alien::APE::Server->start_dist_aped;
@@ -7,7 +7,7 @@ use FindBin;
BEGIN {
my $help = `$FindBin::Bin/../ape-server/bin/aped --help`;
- ok($help =~ m/AJAX Push Engine Server 1\.01dev/ && $help =~ m/Show version number/, 'testing ape-server help');
+ ok($help =~ m/AJAX Push Engine Server 1\.01dev/ && $help =~ m/Show version number/, 'ape-server help');
my $unknown = `$FindBin::Bin/../ape-server/bin/aped --unknowncommand`;
- ok($unknown =~ m/AJAX Push Engine Server 1\.01dev/ && $unknown =~ m/Unknown parameters/, 'testing ape-server unknown parameters');
+ ok($unknown =~ m/AJAX Push Engine Server 1\.01dev/ && $unknown =~ m/Unknown parameters/, 'ape-server unknown parameters');
}
View
@@ -0,0 +1,39 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use Test::More tests => 2;
+use FindBin;
+use LWP::UserAgent;
+use HTTP::Request;
+use Proc::Background;
+
+BEGIN {
+
+ diag('starting ape...');
+ my $aped = Proc::Background->new("( cd $FindBin::Bin/../ape-server/bin && ./aped )");
+ diag('waiting a second...');
+ sleep 1;
+
+ ok($aped->alive, 'startup check');
+
+ my $http_client = LWP::UserAgent->new();
+ $http_client->timeout(2);
+
+ diag('starting request...');
+ my $http_response = $http_client->request(HTTP::Request->new(
+ GET => 'http://localhost:6969/'
+ ));
+
+ my $reply = $http_response->content;
+
+ ok($reply =~ m/No command given./ && $reply =~ m!http://www\.ape-project\.org/!, 'ape server reply');
+
+ while( $aped->alive ) {
+ diag('killing ape...');
+ $aped->die;
+ sleep 1;
+ $aped->wait;
+ }
+
+}

0 comments on commit 061ea8b

Please sign in to comment.