public class ActualTest extends JenkowTestCase{
public void testJobResultConsumption() throws Exception{
FreeStyleProject launchy = createFreeStyleProject("launchy");
launchy.getBuildersList().add(new Shell("echo \"launchy running\"; sleep 5; exit $((BUILD_NUMBER%2!=0))"));
FreeStyleProject launcher = createFreeStyleProject("launcher");
DescribableList<Builder,Descriptor<Builder>> bl = launcher.getBuildersList();
// TODO 4: if we have a way a script task can print into the job console, we no longer need the Shell build step
bl.add(new JenkowBuilder(getWfName("workflow")));
bl.add(new Shell("echo wf.done"));
FreeStyleBuild build = launcher.scheduleBuild2(0).get();
System.out.println(build.getDisplayName()+" completed");
assertTrue("launchy's last build # is not 2",launchy.getLastBuild().getNumber() == 2);