Package org.apache.tools.ant.taskdefs

Examples of org.apache.tools.ant.taskdefs.Sequential


      if (m_finalTasks != null)
      {
         throw new BuildException("Cannot have two nested Finally elements");
      }

      m_finalTasks = new Sequential();

      return m_finalTasks;
   }
View Full Code Here


      if (m_ifThen != null)
      {
         throw new BuildException("Cannot have two nested Then elements");
      }

      m_ifThen = new Sequential();

      return m_ifThen;
   }
View Full Code Here

      if (m_ifElse != null)
      {
         throw new BuildException("Cannot have two nested Else elements");
      }

      m_ifElse = new Sequential();

      return m_ifElse;
   }
View Full Code Here

            applicationRun.addTask(application);
        }

        //The test run consists of the block followed by the tests.
        long testRunTimeout = 0;
        Sequential testRun = new Sequential();
        bind(testRun);
        if (block != null) {
            //waitfor is not a task, it needs to be adapted
            TaskAdapter ta = new TaskAdapter(block);
            ta.bindToOwner(this);
            validateTask(ta, "block");
            testRun.addTask(ta);
            //add the block time to the total test run timeout
            testRunTimeout = block.calculateMaxWaitMillis();
        }

        //add the tests and more delay
        if (tests != null) {
            testRun.addTask(tests);
            testRunTimeout += timeoutMillis;
        }
        //add the reporting and more delay
        if (reporting != null) {
            testRun.addTask(reporting);
            testRunTimeout += timeoutMillis;
        }

        //wrap this in a parallel purely to set up timeouts for the
        //test run
View Full Code Here

        }
        return names;
    }

    private static Sequential initSequence(Project project, int port, File resultPath, Set<String> suiteNames, List<SuiteFilter> suiteFilters, int concurrentSuites, long maxTimeForSuite) {
        Sequential runnerSequence = new Sequential();
        runnerSequence.setProject(project);
        runnerSequence.setTaskName("sequential");
        runnerSequence.addTask(initSleep(project, SECONDS_TO_WAIT_FOR_WEBSERVER_TO_START));
        runnerSequence.addTask(initRunners(project, suiteNames, port, resultPath, suiteFilters, concurrentSuites, maxTimeForSuite));
        return runnerSequence;
    }
View Full Code Here

        if (value == null)
            throw new BuildException("Value is missing");
        if (cases.size() == 0 && defaultCase == null)
            throw new BuildException("No cases supplied");

        Sequential selectedCase = defaultCase;

        int sz = cases.size();
        for (int i=0;i<sz;i++)
        {
            Case c = (Case)(cases.elementAt(i));

            String cvalue = c.value;
            if (cvalue == null) {
                throw new BuildException("Value is required for case.");
            }
            String mvalue = value;

            if (caseInsensitive)
            {
                cvalue = cvalue.toUpperCase();
                mvalue = mvalue.toUpperCase();
            }

            if (cvalue.equals(mvalue) && c != defaultCase)
                selectedCase = c;
        }

        if (selectedCase == null) {
            throw new BuildException("No case matched the value " + value
                                     + " and no default has been specified.");
        }
        selectedCase.perform();
    }
View Full Code Here

            final INodeEntry node,
            final String destinationPath
    ) throws FileCopierException {

        Project project = new Project();
        final Sequential seq = new Sequential();
        seq.setProject(project);

        final String remotefile;
        if(null==destinationPath) {
            remotefile = generateRemoteFilepathForNode(node, (null != scriptfile ? scriptfile.getName()
                    : "dispatch-script"));
        }else {
            remotefile = destinationPath;
        }
        //write to a local temp file or use the input file
        final File localTempfile =
                null != scriptfile ?
                        scriptfile :
                        writeTempFile(
                                context,
                                scriptfile,
                                input,
                                script
                        );


//        logger.debug("temp file for node " + node.getNodename() + ": " + temp.getAbsolutePath() + ",
// datacontext: " + dataContext);
        final Task scp;
        final JschNodeExecutor.NodeSSHConnectionInfo nodeAuthentication = new JschNodeExecutor.NodeSSHConnectionInfo(
                node,
                framework,
                context);
        try {

            scp = SSHTaskBuilder.buildScp(node, project, remotefile, localTempfile, nodeAuthentication,
                    context.getLoglevel(),context.getExecutionListener());
        } catch (SSHTaskBuilder.BuilderException e) {
            throw new FileCopierException("Configuration error: " + e.getMessage(),
                    StepFailureReason.ConfigurationFailure, e);
        }

        /**
         * Copy the file over
         */
        seq.addTask(createEchoVerbose("copying scriptfile: '" + localTempfile.getAbsolutePath()
                + "' to: '" + node.getNodename() + ":" + remotefile + "'", project));
        seq.addTask(scp);

        String errormsg = null;
        try {
            seq.execute();
        } catch (BuildException e) {
            JschNodeExecutor.ExtractFailure failure = JschNodeExecutor.extractFailure(e,
                    node,
                    nodeAuthentication.getSSHTimeout(),
                    framework);
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.taskdefs.Sequential

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.