Class MavenLogAssert

java.lang.Object
org.assertj.core.api.AbstractAssert<MavenLogAssert,MavenLog>
com.soebes.itf.extension.assertj.MavenLogAssert
All Implemented Interfaces:
org.assertj.core.api.Assert<MavenLogAssert,MavenLog>, org.assertj.core.api.Descriptable<MavenLogAssert>, org.assertj.core.api.ExtensionPoints<MavenLogAssert,MavenLog>

@API(status=EXPERIMENTAL, since="0.1.0") public class MavenLogAssert extends org.assertj.core.api.AbstractAssert<MavenLogAssert,MavenLog>
Author:
Karl Heinz Marbaise
  • Field Summary Link icon

    Fields inherited from class org.assertj.core.api.AbstractAssert Link icon

    actual, info, myself, objects, throwUnsupportedExceptionOnEquals
  • Constructor Summary Link icon

    Constructors
    Constructor
    Description
    Create instance of MavenLogAssert.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    org.assertj.core.api.ListAssert<String>
    Will give you back the stdout and removes the prefix "[DEBUG] " from all lines.
    org.assertj.core.api.ListAssert<String>
    Will read the stdout and removes the prefix "[ERROR] ".
    int
    Always returns 1.
    org.assertj.core.api.ListAssert<String>
    Will give you back the stdout and removes the prefix "[INFO] " from all lines.
    org.assertj.core.api.ListAssert<String>
    Will read the stdout without any filtering etc.
    org.assertj.core.api.ListAssert<String>
    Will read the stdout and removes the prefix "[WARNING] ".

    Methods inherited from class org.assertj.core.api.AbstractAssert Link icon

    areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hasSameClassAs, hasSameHashCodeAs, hasToString, hasToString, inBinary, inHexadecimal, is, isElementOfCustomAssert, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError

    Methods inherited from class java.lang.Object Link icon

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.assertj.core.api.Descriptable Link icon

    as, as, as, describedAs, describedAs
  • Constructor Details Link icon

    • MavenLogAssert Link icon

      MavenLogAssert(MavenLog actual)
      Create instance of MavenLogAssert.
      Parameters:
      actual - The given Log.
  • Method Details Link icon

    • info Link icon

      @API(status=EXPERIMENTAL, since="0.8.0") public org.assertj.core.api.ListAssert<String> info()
      Will give you back the stdout and removes the prefix "[INFO] " from all lines.

      It can be used to check for a sequence in the log output like this:

         assertThat(result)
          .log()
          .info()
          .containsSequence("The first line matching.", "The second line matching");
       
      Returns:
      ListAssert
      Since:
      0.8.0
      See Also:
      • AbstractIterableAssert.containsSequence(Object[])
    • debug Link icon

      @API(status=EXPERIMENTAL, since="0.8.0") public org.assertj.core.api.ListAssert<String> debug()
      Will give you back the stdout and removes the prefix "[DEBUG] " from all lines. This could be used like the following:
         assertThat(result)
          .log()
          .debug()
          .contains("Text to be checked for.");
       
      The debug() will give you back all entries which have the prefix [DEBUG] . The debug() can be combined with other parts of AssertJ like:
         assertThat(result)
          .log()
          .debug()
          .hasSize(1) // Only a single DEBUG line is allowed.
          .contains("This is something.");
       
      The above example will obviously fail cause there always more than one line of debug output being produced during a Maven build.
      Returns:
      ListAssert
      See Also:
    • warn Link icon

      @API(status=EXPERIMENTAL, since="0.8.0") public org.assertj.core.api.ListAssert<String> warn()
      Will read the stdout and removes the prefix "[WARNING] ". This could be used like the following:
         assertThat(result)
          .log()
          .warn()
          .contains("Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!");
       
      The warn() will give you back all entries which have the prefix [WARNING] . The warn() can be combined with other parts of AssertJ like:
         assertThat(result)
          .log()
          .warn()
          .hasSize(1) // Only a single WARNING is allowed.
          .contains("Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!");
       
      Returns:
      ListAssert
      See Also:
    • error Link icon

      @API(status=EXPERIMENTAL, since="0.8.0") public org.assertj.core.api.ListAssert<String> error()
      Will read the stdout and removes the prefix "[ERROR] ". This could be used like the following:
         assertThat(result)
          .log()
          .error()
          .contains("Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!");
       
      The warn() will give you back all entries which have the prefix [ERROR] . The error() can be combined with other parts of AssertJ like:
         assertThat(result)
          .log()
          .error()
          .hasSize(1) // Only a single ERROR is allowed.
          .contains("Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!");
       
      Returns:
      ListAssert
      See Also:
    • plain Link icon

      public org.assertj.core.api.ListAssert<String> plain()
      Will read the stdout without any filtering etc.
      
         assertThat(result)
          .out()
          .plain()
          .contains("[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!");
       
      Returns:
      ListAssert
      See Also:
    • hashCode Link icon

      public int hashCode()
      Always returns 1.
      Overrides:
      hashCode in class org.assertj.core.api.AbstractAssert<MavenLogAssert,MavenLog>
      Returns:
      1.