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

Examples of org.apache.tools.ant.taskdefs.condition.Condition


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

        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

        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

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

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

            throw new BuildException("You must not nest more than one condition into <skip>");
        }
        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

        }
        if (countConditions() < 1) {
            throw new BuildException("You must nest a condition into "
                                     + getTaskName());
        }
        Condition c = (Condition) getConditions().nextElement();
        try {
            long maxWaitMillis = calculateMaxWaitMillis();
            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

            throw new BuildException("You must not nest more than one condition into <condition>");
        }
        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

    else if (countConditions() > 1) {
      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

TOP

Related Classes of org.apache.tools.ant.taskdefs.condition.Condition

Copyright © 2018 www.massapicom. 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.