commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: [Exec] Change needed to Executor interface
Date Thu, 17 Apr 2008 21:57:55 GMT
On 17/04/2008, Matt Benson <gudnabrsam@yahoo.com> wrote:
>
>  --- Siegfried Goeschl <sgoeschl@gmx.at> wrote:
>
>  > Hi sebb,
>  >
>  > thanks for your input and I'm sorry for my late
>  > response - I will look
>  > at the stuff during the weekend
>  >
>  > Siegfried Goeschl
>  >
>  > sebb wrote:
>  > > VMS testing has revealed that the
>  > DefaultExecutorTest class assumes
>  > > that 0 = success, and 1 = failure.
>  > >
>  > > This is not the case for all OSes - VMS regards
>  > odd numbers as
>  > > successful and even ones as failures.
>  > >
>  > > So I think the test needs to use a more versatile
>  > means of checking statuses.
>  > >
>  > > There is a method in DefaultExecutor
>  > >    public static boolean isFailure(final int
>  > exitValue)
>  > > However, it is static, so cannot be added to the
>  > Executor interface.
>  > >
>  > > Any objections if I make it non-static and add it
>  > to the interface?
>  > > This will allow the test suite to correctly check
>  > for success/failure.
>  > >
>  > > I suspect the private boolean isSuccess(final int
>  > exitValue) method
>  > > may need updating for VMS. And I don't understand
>  > why it returns true
>  > > if there is no exitValues array - perhaps it
>  > should return !
>  > > isFailure(exitValue) ? Or throw an error of some
>  > kind?
>
>
> If the test case exists simply to test
>  DefaultExecutor, why not explicitly refer to
>  DefaultExecutor.isFailure()?

Yes, that's also possible.

>  Or move the static
>  method into an abstract BaseExecutor superclass that
>  hypothetical other Executor implementations could use
>  for the same purpose, and refer to the method there?

Likewise.

However, I think any Executor implementation is going to need to
provide an isFailure() - or perhaps better an isSuccess() - method for
callers to be able to check if the execute has succeeded or not.

>  -Matt
>
>
>  > >
>  > >
>  >
>  ---------------------------------------------------------------------
>  > > To unsubscribe, e-mail:
>  > dev-unsubscribe@commons.apache.org
>  > > For additional commands, e-mail:
>  > dev-help@commons.apache.org
>  > >
>  > >
>  > >
>  > >
>  >
>  >
>  ---------------------------------------------------------------------
>  > To unsubscribe, e-mail:
>  > dev-unsubscribe@commons.apache.org
>  > For additional commands, e-mail:
>  > dev-help@commons.apache.org
>  >
>  >
>
>
>
>
>       ____________________________________________________________________________________
>  Be a better friend, newshound, and
>  know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>  For additional commands, e-mail: dev-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message