Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (C) 2008 Ovea <> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
package org.testatoo.core.matcher;
This class is a matcher (written based on hamcrest possibilites) to test the text of the button.

public final class Text extends TypeSafeMatcher<Button> {
    private String text;

Uses the matcher SelectedValue to compare the text on a button to the expected text of the matcher, using the syntax "text("xxx")"

button the button
True if the text on the button is equal to the text of the matcher Text
    public boolean matchesSafely(Button button) {
        return button.text().equals();

To append the description of the text on the button to the given description

description the description may be part of a a description of a larger object
    public void describeTo(Description description) {
        description.appendText("text:" + );

Constructor with given value

text text we want to know if it's the text on the button
    public Text(String text) {
        this. = text;

Using the syntax "text("xxx")", the test creates a Text matcher

text the text to compare to the text on the button
a new Text matcher
    public static Matcher<Buttontext(String text) {
        return new Text(text);
New to GrepCode? Check out our FAQ X