All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.googlecode.gwt.test.assertions.GwtAssertions Maven / Gradle / Ivy

There is a newer version: 0.63
Show newest version
package com.googlecode.gwt.test.assertions;

import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.ui.*;
import com.googlecode.gwt.test.finder.GwtInstance;

/**
 * Entry point for assertion methods for different GWT types. Each method in this class is a static
 * factory for the type-specific assertion objects. The purpose of this class is to make test code
 * more readable, following assertj principles.
 *
 * @author Gael Lazzari
 */
public class GwtAssertions {

    /**
     * Creates a new instance of {@link CheckBoxAssert}.
     *
     * @param actual the checkbox to be the target of the assertions methods.
     * @return the created assertion object.
     */
    public static CheckBoxAssert assertThat(CheckBox actual) {
        return new CheckBoxAssert(actual);
    }

    /**
     * Creates a new instance of {@link DoubleBoxAssert}.
     *
     * @param actual the doubleBox to be the target of the assertions methods.
     * @return the created assertion object.
     */
    public static DoubleBoxAssert assertThat(DoubleBox actual) {
        return new DoubleBoxAssert(actual);
    }

    /**
     * Creates a new instance of {@link ElementAssert}.
     *
     * @param actual the element to be the target of the assertions methods.
     * @return the created assertion object.
     */
    public static ElementAssert assertThat(Element actual) {
        return new ElementAssert(actual);
    }

    /**
     * Creates a new instance of {@link FocusWidgetAssert}.
     *
     * @param actual the generic focus widget to be the target of the assertions methods.
     * @return the created assertion object.
     */
    public static FocusWidgetAssert assertThat(FocusWidget actual) {
        return new FocusWidgetAssert(actual);
    }

    /**
     * Creates a new instance of {@link WidgetAssert}.
     *
     * @param actual the generic widget to be the target of the assertions methods.
     * @return the created assertion object.
     */
    public static GwtInstanceAssert assertThat(GwtInstance actual) {
        return new GwtInstanceAssert(actual);
    }

    /**
     * Creates a new instance of {@link IntegerBoxAssert}.
     *
     * @param actual the integerBox to be the target of the assertions methods.
     * @return the created assertion object.
     */
    public static IntegerBoxAssert assertThat(IntegerBox actual) {
        return new IntegerBoxAssert(actual);
    }

    /**
     * Creates a new instance of {@link ListBoxAssert}.
     *
     * @param actual the listbox to be the target of the assertions methods.
     * @return the created assertion object.
     */
    public static ListBoxAssert assertThat(ListBox actual) {
        return new ListBoxAssert(actual);
    }

    /**
     * Creates a new instance of {@link LongBoxAssert}.
     *
     * @param actual the longBox to be the target of the assertions methods.
     * @return the created assertion object.
     */
    public static LongBoxAssert assertThat(LongBox actual) {
        return new LongBoxAssert(actual);
    }

    /**
     * Creates a new instance of {@link MenuItemAssert}.
     *
     * @param actual the menu item to be the target of the assertions methods.
     * @return the created assertion object.
     */
    public static MenuItemAssert assertThat(MenuItem actual) {
        return new MenuItemAssert(actual);
    }

    /**
     * Creates a new instance of {@link PanelAssert}.
     *
     * @param actual the generic panel to be the target of the assertions methods.
     * @return the created assertion object.
     */
    public static PanelAssert assertThat(Panel actual) {
        return new PanelAssert(actual);
    }

    /**
     * Creates a new instance of {@link PopupPanelAssert}.
     *
     * @param actual the popupPanel to be the target of the assertions methods.
     * @return the created assertion object.
     */
    public static PopupPanelAssert assertThat(PopupPanel actual) {
        return new PopupPanelAssert(actual);
    }

    /**
     * Creates a new instance of {@link SuggestBoxAssert}.
     *
     * @param actual the suggestBox to be the target of the assertions methods.
     * @return the created assertion object.
     */
    public static SuggestBoxAssert assertThat(SuggestBox actual) {
        return new SuggestBoxAssert(actual);
    }

    /**
     * Creates a new instance of {@link TabPanelAssert}.
     *
     * @param actual the tabPanel to be the target of the assertions methods.
     * @return the created assertion object.
     */
    public static TabPanelAssert assertThat(TabPanel actual) {
        return new TabPanelAssert(actual);
    }

    /**
     * Creates a new instance of {@link TextAreaAssert}.
     *
     * @param actual the textArea to be the target of the assertions methods.
     * @return the created assertion object.
     */
    public static TextAreaAssert assertThat(TextArea actual) {
        return new TextAreaAssert(actual);
    }

    /**
     * Creates a new instance of {@link TextBoxAssert}.
     *
     * @param actual the textBox to be the target of the assertions methods.
     * @return the created assertion object.
     */
    public static TextBoxAssert assertThat(TextBox actual) {
        return new TextBoxAssert(actual);
    }

    /**
     * Creates a new instance of {@link TreeItemAssert}.
     *
     * @param actual the tree item to be the target of the assertions methods.
     * @return the created assertion object.
     */
    public static TreeItemAssert assertThat(TreeItem actual) {
        return new TreeItemAssert(actual);
    }

    /**
     * Creates a new instance of {@link UIObjectAssert}.
     *
     * @param actual the generic UiObject to be the target of the assertions methods.
     * @return the created assertion object.
     */
    public static UIObjectAssert assertThat(UIObject actual) {
        return new UIObjectAssert(actual);
    }

    /**
     * Creates a new instance of {@link WidgetAssert}.
     *
     * @param actual the generic widget to be the target of the assertions methods.
     * @return the created assertion object.
     */
    public static WidgetAssert assertThat(Widget actual) {
        return new WidgetAssert(actual);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy