Package net.sourceforge.cruisecontrol.util

Examples of net.sourceforge.cruisecontrol.util.XMLLogHelper


        LOG.info("Getting project from file: " + f.getName());
        try {
            Document doc = readDocFromFile(f);
            LOG.info("Loaded xml document for BuildStatus");
            Element root = doc.getRootElement();
            XMLLogHelper log = new XMLLogHelper(root);
        return log.getProjectName();
        } catch (JDOMException ex) {
            LOG.info("Failed to load BuildStatus xml document" + ex);
        } catch (IOException ex) {
            LOG.info("Failed to load BuildStatus xml document" + ex);
        } catch (CruiseControlException ex) {
View Full Code Here


    /**
     *  Implementing the <code>Publisher</code> interface.
     */
    public void publish(Element cruisecontrolLog) {
        XMLLogHelper helper = new XMLLogHelper(cruisecontrolLog);
        boolean important = !helper.isBuildSuccessful() && failAsImportant;
        try {
            if (shouldSend(helper)) {
                sendMail(
                    createUserList(helper),
                    createSubject(helper),
View Full Code Here

   
    public void publish(Element cruisecontrolLog)
        throws CruiseControlException {

        // put the log files
        XMLLogHelper helper = new XMLLogHelper(cruisecontrolLog);
        String uniqueDir = helper.getBuildTimestamp();
       
        File logDir = new File(srcdir + File.separator + uniqueDir);
       
        Vector knownDirs = new Vector();
        FTPClient ftp = null;
View Full Code Here

   /**
    * Perform the log transform and publish the results.
    */
   public void publish(Element cruisecontrolLog) throws CruiseControlException {
      XMLLogHelper helper = new XMLLogHelper(cruisecontrolLog);
      Boolean buildSuccess = null;
      try {
         buildSuccess = new Boolean(helper.isBuildSuccessful());
      } catch (NullPointerException ne) {
         //Do Nothing - leave buildSuccess = null
      }

      //if the cruisecontrollog element or the buildSuccess attribute
      //turn out to be null, then there is nothing to do, so just return
      if (cruisecontrolLog == null || buildSuccess == null) {
         return;
      }

      //if the build failed and we are not supposed to publish on fail the return immediately
      if (!buildSuccess.booleanValue() && !publishOnFail) {
         LOG.info("Build failed and publishOnFail is false: Not publishing log.");
         return;
      }

      //If the outFileName attribute is null then construct the outFileName based
      //upon the build label that was created
      if (outFileName == null) {
         String label = helper.getCruiseControlInfoProperty("label");
         if (label == null || label.trim().length() == 0) {
            throw new CruiseControlException("The Label property is not set in the log file..."
                    + "unable to publish the log.");
         }
         LOG.debug(
View Full Code Here

         //Prepare the transformer
         TransformerFactory tFactory = TransformerFactory.newInstance();
         Transformer transformer = tFactory.newTransformer(new StreamSource(xslFileStream));

         //cruisecontrolLog.get
         XMLLogHelper helper = new XMLLogHelper(cruisecontrolLog);
         String logFileName = helper.getLogFileName();
         LOG.info("Transforming the log file: " + logFileName + " to: " + path + " using the xslt: " + this.xsltFile);

         //Create the temporary log file - since we do not have access to the actual log file location
         xmlFile = writeTempLogFile(cruisecontrolLog);
         if (xmlFile == null || !xmlFile.exists() || !xmlFile.canRead()) {
View Full Code Here

    public void publish(Element cruisecontrolLog)
        throws CruiseControlException {

        if (file == null) {
            XMLLogHelper helper = new XMLLogHelper(cruisecontrolLog);
            file = helper.getLogFileName().substring(1);
        }

        Commandline command = createCommandline(file);
        LOG.info("executing command: " + command);
        try {
View Full Code Here

    }

    protected XMLLogHelper createLogHelper(boolean success, boolean lastBuildSuccess) {
        Element cruisecontrolElement = Util.createElement(success, lastBuildSuccess);

        return new XMLLogHelper(cruisecontrolElement);
    }
View Full Code Here

        targetFile = file;
    }

    public void publish(Element cruisecontrolLog)
        throws CruiseControlException {
        XMLLogHelper helper = new XMLLogHelper(cruisecontrolLog);
        Project project = new Project();
        String timestamp = helper.getBuildTimestamp();
        File destinationDirectory = getDestinationDirectory(timestamp);

        if (targetDirectory != null) {
            publishDirectory(project, destinationDirectory);
        }
View Full Code Here

            //  call getContent() wouldn't be appropriate here.
            nextLogger.log(buildLog);
        }

        //Figure out what the log filename will be.
        XMLLogHelper helper = new XMLLogHelper(buildLog);

        String logFilename = null;
        if (helper.isBuildSuccessful()) {
            logFilename = formatLogFileName(now, helper.getLabel());
        } else {
            logFilename = formatLogFileName(now);
        }

        Element logFileElement = new Element("property");
View Full Code Here

    public Element getContent() {
        return (Element) buildLog.clone();
    }

    public boolean wasBuildSuccessful() {
        return new XMLLogHelper(buildLog).isBuildSuccessful();
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.cruisecontrol.util.XMLLogHelper

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.