Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Steven Balthazor <stevenbalthazor-Re5JQEeQqe8AvxtiuMwx3w <at> public.gmane.org>
Subject: Re: reading the SimpleTest Eclipse plugin code...
Newsgroups: gmane.comp.php.simpletest.general
Date: Wednesday 6th May 2009 14:11:15 UTC (over 8 years ago)
On Wed, May 6, 2009 at 5:11 AM, Francesco Spegni
 wrote:
> Reading the Simpletest plugin code, then, i found something unclear.
There
> is this piece of code:
>
>            SimpletestPlugin.logMessage("Running: ");
>            SimpletestPlugin.logMessage(xml);
>            SimpletestPlugin.logMessage("*************");
>            System.out.println(exec);
>            StringBuffer err=new StringBuffer();
>            StringBuffer out=new StringBuffer();
>
> (1)        StreamReaderThread outThread=new
> StreamReaderThread(phpProcess.getInputStream(),out);
>            StreamReaderThread errThread=new
> StreamReaderThread(phpProcess.getErrorStream(),err);
>            outThread.start();
>            errThread.start();
>
> The line that I've marked with (1) launch a thread which generates an
> IOException with message (Bad file descriptor). I'm wondering why are we
> reading from the phpProcess input. Shouldn't you _write_ in the STDIN of
the
> process? Am I missing something?

You are misinterpreting the code.  That line is opening an inputstream
in java to read from the php STDOUT.  Php STDOUT is coming out of php
and into java.

Hope that helps.

On a side note, you might try just running PHPUnit tests directly from
Eclipse using the "Run As PHP Script" functionality which is embedded
with the Eclipse PDT (although I am not sure how to make that happen
for PHPUnit).  This is how I run my Simpletests now; I have stopped
using the Simpletest plugin and simply put a
require_once('autorun.php'); at the top of the test file and then I
can right click on the file and select "Run As PHP Script" and the
output from the testing shows up in the eclipse console -- easier to
configure and it runs faster than the plugin.  The other benefit of
running this way is that if you want to debug your test, when you
right click the test file you can click "Debug As PHP Script" instead
of "Run As".

Regards,
Steven Balthazor.

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK
i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
 
CD: 2ms