Package limn.testing

Class AccessibleTrees

java.lang.Object
limn.testing.AccessibleTrees

public final class AccessibleTrees extends Object
Reading a published tree in a test: one node by name, every node in a state, and the whole tree as text for the message of an assertion that failed. The two accessibility test bases each had these three; the tests under them each had a fourth for a node by identifier.
  • Method Details

    • named

      public static @Nullable AccessibleNode named(AccessibleTree tree, String name)
      Parameters:
      tree - the tree
      name - a node's name, exactly
      Returns:
      the first node with that name, or null
    • withRole

      public static @Nullable AccessibleNode withRole(AccessibleTree tree, Accessible.Role role)
      Parameters:
      tree - the tree
      role - a role
      Returns:
      the first node with that role, or null
    • withState

      public static List<AccessibleNode> withState(AccessibleTree tree, Accessible.State state)
      Parameters:
      tree - the tree
      state - a state
      Returns:
      every node carrying it, in tree order
    • describe

      public static String describe(AccessibleTree tree)
      The tree as one line per node, for the message of a failed assertion: index, role, name, states, box and parent.
      Parameters:
      tree - the tree
      Returns:
      the text, beginning with a newline so it reads under the assertion's own message