public class DemuxOutputTask extends org.apache.tools.ant.Task
A simple task that prints to System.out and System.err and then catches
the output which it then checks. If the output does not match, an
exception is thrown
since
1.5
created
21 February 2002
Fields Summary
private String
randomOutValue
private String
randomErrValue
private boolean
outputReceived
private boolean
errorReceived
Constructors Summary
Methods Summary
public void
execute()
Random generator = new Random();
randomOutValue = "Output Value is " + generator.nextInt();
randomErrValue = "Error Value is " + generator.nextInt();
System.out.println(randomOutValue);
System.err.println(randomErrValue);
if (!outputReceived) {
throw new BuildException("Did not receive output");
}
if (!errorReceived) {
throw new BuildException("Did not receive error");
}