Perl Run Script


MichaelNestler reports ...

I wrote my first FIT fixture and a Perl CGI RunScript for Windows using wget. I am running it on Apache 2 and it is attached to this email. Please feel free to put it on the Wiki if it helps. GNU wget appears (at least to me) to be more accessible and widespread on the Win32 platform compared to lynx (that's why I used wget).

I think FIT is a very good idea and I am going to use it for a new (commercial) Web application. My first fixture tests the correctness of a DB import (using straight JDBC).


 #!c:/Perl/bin/Perl.exe

$workdir = 'C:\Program Files\Apache Group\Apache2\htdocs'; $wget = '"C:\Program Files\wget-1.9\wget.exe" -O tmp.html'; $classpath = 'YOUR CLASSPATH HERE'; $java = "java -cp $classpath fit.FileRunner tmp.html out.html";

print "Content-type: text/html\n\n";

chdir($workdir); `$wget $ENV{HTTP_REFERER}`; `$java`;

open(HTML, '<out.html') or die "Unable to open out.html: $!"; $/ = undef; $html = <HTML>; print $html; close HTML; unlink 'tmp.html', 'out.html';


 

Last edited December 14, 2003
Return to WelcomeVisitors