Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat) Service: Implement NodeQuery. #174

Merged
merged 8 commits into from Feb 19, 2015

Conversation

hastebrot
Copy link
Member

This PR will enhance the nested methods API for Node retrieval with a chained methods API. Nested methods will be used for common tasks, chained methods for tasks that need more flexibility or are cumbersome with nested methods.

Node retrieval is an integral part of TestFX and used in FxRobot and FxAssert.


Added NodeQuery interface:

public interface NodeQuery {
    NodeQuery from(Node... parentNodes);
    NodeQuery from(Set<Node> parentNodes);

    NodeQuery lookup(String query);
    NodeQuery lookup(Predicate<Node> predicate);
    NodeQuery lookup(Matcher<Object> matcher);
    NodeQuery lookup(Function<Node, Set<Node>> function);

    NodeQuery select(Predicate<Node> predicate);
    NodeQuery select(Matcher<Object> matcher);
    NodeQuery selectAt(int index);

    @Nullable Node queryFirst();
    Optional<Node> tryQueryFirst();
    Set<Node> queryAll();
}

Updated NodeFinder interface:

public interface NodeFinder {
    NodeQuery nodes();
    NodeQuery nodes(String query);
    NodeQuery nodes(Predicate<Node> predicate);
    NodeQuery nodes(Matcher<Object> matcher);

    NodeQuery nodesFrom(Node... parentNodes);
    NodeQuery nodesFrom(Set<Node> parentNodes);

    Node rootNode(Window window);
    Node rootNode(Scene scene);
    Node rootNode(Node node);

    Node rootNode(Predicate<Window> predicate);
    Node rootNode(int windowIndex);
    Node rootNode(Pattern stageTitlePattern);
    Node rootNode(String stageTitle);
}

@hastebrot
Copy link
Member Author

cc: #167

@hastebrot hastebrot mentioned this pull request Feb 10, 2015
hastebrot added a commit that referenced this pull request Feb 19, 2015
feat(Service): Implement NodeQuery.
@hastebrot hastebrot merged commit 6c9bc03 into TestFX:master Feb 19, 2015
@hastebrot hastebrot changed the title feat(Service): Implement NodeQuery. (feat) Service: Implement NodeQuery. Feb 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant