Class AbstractTextFlowAssert<SELF extends AbstractTextFlowAssert<SELF>>

java.lang.Object
org.assertj.core.api.AbstractAssert<SELF,javafx.css.Styleable>
All Implemented Interfaces:
org.assertj.core.api.Assert<SELF,javafx.css.Styleable>, org.assertj.core.api.Descriptable<SELF>, org.assertj.core.api.ExtensionPoints<SELF,javafx.css.Styleable>
Direct Known Subclasses:
TextFlowAssert

public class AbstractTextFlowAssert<SELF extends AbstractTextFlowAssert<SELF>> extends AbstractParentAssert<SELF>
Base class for all TextFlow assertions.
  • Field Summary

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

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

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractTextFlowAssert(javafx.scene.text.TextFlow actual, Class<?> selfType)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    doesNotHaveColoredText(String coloredTextMarkup)
    Verifies that the actual TextFlow does not have the given coloredTextMarkup.
    Verifies that the actual TextFlow does not have exactly the given coloredTextMarkup.
    Verifies that the actual TextFlow does not have exactly the given text (the result of combining all of its text-based children's text together).
    hasColoredText(String coloredTextMarkup)
    Verifies that the actual TextFlow has the given coloredTextMarkup.
    hasExactlyColoredText(String coloredTextMarkup)
    Verifies that the actual TextFlow has exactly the given coloredTextMarkup.
    Verifies that the actual TextFlow has exactly the given text (the result of combining all of its text-based children's text together).

    Methods inherited from class org.testfx.assertions.api.AbstractParentAssert

    doesNotHaveExactlyNumChildren, hasAnyChild, hasExactlyNumChildren, hasNoChildren

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

    areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, 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

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

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

    as, as, as, describedAs, describedAs
  • Constructor Details

    • AbstractTextFlowAssert

      protected AbstractTextFlowAssert(javafx.scene.text.TextFlow actual, Class<?> selfType)
  • Method Details

    • hasText

      public SELF hasText(String text)
      Verifies that the actual TextFlow has exactly the given text (the result of combining all of its text-based children's text together).
      Parameters:
      text - the given text to compare the actual text to
      Returns:
      this assertion object
    • doesNotHaveText

      public SELF doesNotHaveText(String text)
      Verifies that the actual TextFlow does not have exactly the given text (the result of combining all of its text-based children's text together).
      Parameters:
      text - the given text to compare the actual text to
      Returns:
      this assertion object
    • hasColoredText

      public SELF hasColoredText(String coloredTextMarkup)
      Verifies that the actual TextFlow has the given coloredTextMarkup. The color is matched by using the closest named color, as described below.

      Colors are specified using the following markup:

      <COLOR>text</COLOR>

      Where COLOR is one of JavaFX's named colors.

      Here is an example for verifying that a TextFlow contains the text "hello" and that the named color that has the closest value to the color of the text is Colors.RED:

      
         Text text = new Text("hello");
         text.setFill(Colors.RED);
         TextFlow textFlow = new TextFlow(text);
         assertThat(textFlow).hasColoredText("<RED>hello</RED>");
       
      Parameters:
      coloredTextMarkup - the given colored text markup to compare the actual colored text to
      Returns:
      this assertion object
      See Also:
    • doesNotHaveColoredText

      public SELF doesNotHaveColoredText(String coloredTextMarkup)
      Verifies that the actual TextFlow does not have the given coloredTextMarkup. The color is matched by using the closest named color, as described below.

      Colors are specified using the following markup:

      <COLOR>text</COLOR>

      Where COLOR is one of JavaFX's named colors.

      Here is an example for verifying that a TextFlow does not contain the text "hello" with any color that has the closest named color Colors.RED:

      
         Text text = new Text("hello");
         text.setFill(Colors.BLUE);
         TextFlow textFlow = new TextFlow(text);
         assertThat(textFlow).doesNotHaveColoredText("<RED>hello</RED>");
       
      Parameters:
      coloredTextMarkup - the given colored text markup to compare the actual colored text to
      Returns:
      this assertion object
      See Also:
    • hasExactlyColoredText

      public SELF hasExactlyColoredText(String coloredTextMarkup)
      Verifies that the actual TextFlow has exactly the given coloredTextMarkup. The color is matched in an exact way, as described below.

      Colors are specified using the following markup:

      <COLOR>text</COLOR>

      Where COLOR is one of JavaFX's named colors.

      Here is an example for verifying that a TextFlow contains the text "hello" and that the color of the text is exactly Colors.BLUE (that is, it has an RGB value of (0, 0, 255)).

      
         Text text = new Text("hello");
         text.setFill(Colors.BLUE); // or: text.setFill(Colors.rgb(0, 0, 255));
         TextFlow textFlow = new TextFlow(text);
         assertThat(textFlow).hasExactlyColoredText("hello");
       
      Parameters:
      coloredTextMarkup - the given colored text markup to compare the actual colored text to
      Returns:
      this assertion object
      See Also:
    • doesNotHaveExactlyColoredText

      public SELF doesNotHaveExactlyColoredText(String coloredTextMarkup)
      Verifies that the actual TextFlow does not have exactly the given coloredTextMarkup. The color is matched in an exact way, as described below.

      Colors are specified using the following markup:

      <COLOR>text</COLOR>

      Where COLOR is one of JavaFX's named colors.

      Here is an example for verifying that a TextFlow does not contain the text "hello" and that the color of the text is not exactly Colors.BLUE (that is, it does not have an RGB value of (0, 0, 255)).

      
         Text text = new Text("hello");
         text.setFill(Colors.rgb(0, 0, 254));
         TextFlow textFlow = new TextFlow(text);
         assertThat(textFlow).doesNotHaveExactlyColoredText("hello");
       
      Parameters:
      coloredTextMarkup - the given colored text markup to compare the actual colored text to
      Returns:
      this assertion object
      See Also: