Package org.apache.tools.ant.taskdefs.condition

Examples of org.apache.tools.ant.taskdefs.condition.Condition.eval()


        AssertTask task = new AssertTask();
        task.setProject(project);
       
        MockControl conCtrl = MockClassControl.createControl(Condition.class);
        Condition condition = (Condition)conCtrl.getMock();
        condition.eval();
        conCtrl.setReturnValue(false);

        prCtrl.replay();
        conCtrl.replay();
        task.add(condition);
View Full Code Here


        AssertTask task = new AssertTask();
        task.setProject(project);
       
        MockControl conCtrl = MockClassControl.createControl(Condition.class);
        Condition condition = (Condition)conCtrl.getMock();
        condition.eval();
        conCtrl.setReturnValue(false);

        prCtrl.replay();
        conCtrl.replay();
        task.add(condition);
View Full Code Here

    public void testExecuteDoSkip() throws Exception {
        SkipTask skip = new SkipTask();
       
        MockControl ctrl = MockClassControl.createControl(Condition.class);
        Condition condition = (Condition)ctrl.getMock();
        condition.eval();
        ctrl.setReturnValue(true);

        ctrl.replay();
        skip.add(condition);
        try {
View Full Code Here

    public void testExecuteNoSkip() throws Exception {
        SkipTask skip = new SkipTask();
       
        MockControl ctrl = MockClassControl.createControl(Condition.class);
        Condition condition = (Condition)ctrl.getMock();
        condition.eval();
        ctrl.setReturnValue(false);

        ctrl.replay();
        skip.add(condition);
        skip.execute();
View Full Code Here

        }
        if (countConditions() < 1) {
            throw new BuildException("You must nest a condition into <skip>");
        }
        Condition c = (Condition)getConditions().nextElement();
        if (c.eval()) {
            throw new TestSkippedException(description, false);
        }
    }
}
View Full Code Here

            long checkEveryMillis = calculateCheckEveryMillis();
            long start = System.currentTimeMillis();
            long end = start + maxWaitMillis;

            while (System.currentTimeMillis() < end) {
                if (c.eval()) {
                    processSuccess();
                    return;
                }
                Thread.sleep(checkEveryMillis);
            }
View Full Code Here

        }
        if (countConditions() < 1) {
            throw new BuildException("You must nest a condition into <condition>");
        }
        Condition c = (Condition) getConditions().nextElement();
        if (c.eval()) {
            getProject().setProperty(property, value);
        }
    }
}
View Full Code Here

      throw new BuildException("There must be exactly one condition specified.");
    }
   
    Sequential sequential = (Sequential) getProject().createTask("sequential");
    Condition c = (Condition) getConditions().nextElement();
    if (! c.eval()) {
      if (failOnError) {
        Exit fail = (Exit) getProject().createTask("fail");
        fail.setMessage(message);
        sequential.addTask(fail);
      }
View Full Code Here

            long checkEveryMillis = calculateCheckEveryMillis();
            long start = System.currentTimeMillis();
            long end = start + maxWaitMillis;

            while (System.currentTimeMillis() < end) {
                if (c.eval()) {
                    processSuccess();
                    return;
                }
                Thread.sleep(checkEveryMillis);
            }
View Full Code Here

        if (property == null) {
            throw new BuildException("The property attribute is required.");
        }

        Condition c = (Condition) getConditions().nextElement();
        if (c.eval()) {
            log("Condition true; setting " + property + " to " + value,
                Project.MSG_DEBUG);
            getProject().setNewProperty(property, value);
        } else {
            log("Condition false; not setting " + property,
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.