|
From: Steven B. <ste...@gm...> - 2009-05-06 14:11:31
|
On Wed, May 6, 2009 at 5:11 AM, Francesco Spegni
<fra...@gm...> 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.
|