You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Ja...@rzf.fin-nrw.de on 2005/02/09 09:03:33 UTC
AW: cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/option
al Rpm.java
> Modified:
> src/main/org/apache/tools/ant/taskdefs/optional Rpm.java
> Log:
> return code checking on rpm. How do we test this?
Using a mock object for rpm? Could return the value of a system parameter or
file content or env variable ...
<rpm rpmBuildCommand="rpm-mock"/>
Because rpm runs only on *nix, the test doesnt have to be platform
independant.
Jan
> /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java,v
> exe.setCommandline(toExecute.getCommandline());
> try {
> + int returncode = exe.execute();
> + if (returncode != 0) {
> + throw new BuildException("'" +
> + toExecute.getExecutable() +
> + "' failed with exit code "+returncode);
> + }
> }
Re: AW: cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/option al Rpm.java
Posted by julian simpson <si...@gmail.com>.
Hello,
On Wed, 9 Feb 2005 09:03:33 +0100, Jan.Materne@rzf.fin-nrw.de
<Ja...@rzf.fin-nrw.de> wrote:
> > Modified:
> > src/main/org/apache/tools/ant/taskdefs/optional Rpm.java
> > Log:
> > return code checking on rpm. How do we test this?
>
> Using a mock object for rpm? Could return the value of a system parameter or
> file content or env variable ...
>
> <rpm rpmBuildCommand="rpm-mock"/>
>
I mocked out/overrode the Executor object for the unit test I
submitted; I don't want to know that rpmbuild actually runs, I just
want to ensure that we can execute it and deal with all the reponses.
I thought it was excessive to submit Jmock with the patch, but there
could be milage in using a mock Executor so you can make tests with
mock objects for all the tasks that use the Executor.
> Because rpm runs only on *nix, the test doesnt have to be platform
> independant.
I'd like to be able to make RPM's from cygwin; does that count as a
*nix in that case?
Best,
Julian.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: AW: cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/option
al Rpm.java
Posted by Steve Loughran <st...@apache.org>.
Jan.Materne@rzf.fin-nrw.de wrote:
>> Modified:
>>src/main/org/apache/tools/ant/taskdefs/optional Rpm.java
>> Log:
>> return code checking on rpm. How do we test this?
>
>
>
> Using a mock object for rpm? Could return the value of a system parameter or
> file content or env variable ...
>
> <rpm rpmBuildCommand="rpm-mock"/>
>
> Because rpm runs only on *nix, the test doesnt have to be platform
> independant.
>
>
Or we really could rpm something up, then <exec> something to look at it
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org