Class AsadminResultMatcher

java.lang.Object
org.hamcrest.BaseMatcher<AsadminResult>
org.hamcrest.TypeSafeMatcher<AsadminResult>
org.hamcrest.CustomTypeSafeMatcher<AsadminResult>
org.glassfish.main.itest.tools.asadmin.AsadminResultMatcher
All Implemented Interfaces:
org.hamcrest.Matcher<AsadminResult>, org.hamcrest.SelfDescribing

public class AsadminResultMatcher extends org.hamcrest.CustomTypeSafeMatcher<AsadminResult>
Matcher checking that Asadmin command succeeded. Prints its output otherwise.
Author:
David Matejcek
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.hamcrest.CustomTypeSafeMatcher<AsadminResult>
    asadminError(String expectedErrorMessage)
    Returns true if the command failed and contains the specified message in stderr
    static org.hamcrest.CustomTypeSafeMatcher<AsadminResult>
     
    protected boolean
     

    Methods inherited from class org.hamcrest.CustomTypeSafeMatcher

    describeTo

    Methods inherited from class org.hamcrest.TypeSafeMatcher

    describeMismatch, describeMismatchSafely, matches

    Methods inherited from class org.hamcrest.BaseMatcher

    _dont_implement_Matcher___instead_extend_BaseMatcher_, isNotNull, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Method Details

    • matchesSafely

      protected boolean matchesSafely(AsadminResult item)
      Specified by:
      matchesSafely in class org.hamcrest.TypeSafeMatcher<AsadminResult>
    • asadminOK

      public static org.hamcrest.CustomTypeSafeMatcher<AsadminResult> asadminOK()
      Returns:
      matcher checking that Asadmin command succeeded. Prints it's output otherwise.
    • asadminError

      public static org.hamcrest.CustomTypeSafeMatcher<AsadminResult> asadminError(String expectedErrorMessage)
      Returns true if the command failed and contains the specified message in stderr
      Parameters:
      expectedErrorMessage - A message that should appear in the stderr to match this error
      Returns:
      matcher checking that Asadmin command failed.