Class LogContent

  • All Implemented Interfaces:
    java.lang.Cloneable, java.lang.Comparable<org.apache.tools.ant.types.Resource>, java.lang.Iterable<org.apache.tools.ant.types.Resource>, org.apache.tools.ant.types.ResourceCollection

    public class LogContent
    extends org.apache.tools.ant.types.Resource
    Exposes AntUnit log content as a (read-only) Resource.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.apache.tools.ant.types.LogLevel level  
      private boolean mergeLines  
      • Fields inherited from class org.apache.tools.ant.types.Resource

        MAGIC, UNKNOWN_DATETIME, UNKNOWN_SIZE
      • Fields inherited from class org.apache.tools.ant.types.DataType

        checked, ref
      • Fields inherited from class org.apache.tools.ant.ProjectComponent

        description, location, project
    • Constructor Summary

      Constructors 
      Constructor Description
      LogContent()
      Create a new LogContent resource.
      LogContent​(org.apache.tools.ant.Project p, org.apache.tools.ant.types.LogLevel level)
      Create a new LogContent resource, specifying Project and log level.
      LogContent​(org.apache.tools.ant.Project p, org.apache.tools.ant.types.LogLevel level, boolean mergeLines)
      Create a new LogContent resource, specifying Project and log level.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      java.io.InputStream getInputStream()  
      private LogCapturer getLogCapturer()  
      private java.io.InputStream getLogStream​(LogCapturer lc)  
      boolean isExists()  
      void setLevel​(org.apache.tools.ant.types.LogLevel level)
      Set the desired log level.
      void setMergeLines​(boolean b)
      Whether to merge messages into a single line or split them into multiple lines.
      • Methods inherited from class org.apache.tools.ant.types.Resource

        as, asOptional, clone, compareTo, getLastModified, getMagicNumber, getName, getOutputStream, getRef, getSize, hashCode, isDirectory, isFilesystemOnly, iterator, setDirectory, setExists, setLastModified, setName, setRefid, setSize, size, toLongString, toString
      • Methods inherited from class org.apache.tools.ant.types.DataType

        checkAttributesAllowed, checkChildrenAllowed, circularReference, dieOnCircularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, tooManyAttributes
      • Methods inherited from class org.apache.tools.ant.ProjectComponent

        getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
      • Methods inherited from interface org.apache.tools.ant.types.ResourceCollection

        isEmpty, stream
    • Field Detail

      • level

        private org.apache.tools.ant.types.LogLevel level
      • mergeLines

        private boolean mergeLines
    • Constructor Detail

      • LogContent

        public LogContent()
        Create a new LogContent resource.
      • LogContent

        public LogContent​(org.apache.tools.ant.Project p,
                          org.apache.tools.ant.types.LogLevel level)
        Create a new LogContent resource, specifying Project and log level.

        This constructor is provided primarily for convenience during programmatic usage.

        Parameters:
        p - the test project
        level - the LogLevel.
      • LogContent

        public LogContent​(org.apache.tools.ant.Project p,
                          org.apache.tools.ant.types.LogLevel level,
                          boolean mergeLines)
        Create a new LogContent resource, specifying Project and log level.

        This constructor is provided primarily for convenience during programmatic usage.

        Parameters:
        p - the test project
        level - the LogLevel.
        mergeLines - whether to merge messages into a single line or split them into multiple lines
        Since:
        AntUnit 1.3
    • Method Detail

      • setLevel

        public final void setLevel​(org.apache.tools.ant.types.LogLevel level)
        Set the desired log level.
        Parameters:
        level - a LogLevel enumerated attribute.
      • setMergeLines

        public final void setMergeLines​(boolean b)
        Whether to merge messages into a single line or split them into multiple lines.
        Parameters:
        b - whether to merge messages into a single line
        Since:
        AntUnit 1.3
      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.io.IOException
        Overrides:
        getInputStream in class org.apache.tools.ant.types.Resource
        Throws:
        java.io.IOException
      • isExists

        public boolean isExists()
        Overrides:
        isExists in class org.apache.tools.ant.types.Resource
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class org.apache.tools.ant.types.Resource
      • getLogCapturer

        private LogCapturer getLogCapturer()
      • getLogStream

        private java.io.InputStream getLogStream​(LogCapturer lc)