Search in sources :

Example 11 with CreateFileFromTemplateDialogFixture

use of com.android.tools.idea.tests.gui.framework.fixture.CreateFileFromTemplateDialogFixture in project android by JetBrains.

the class CreateNewClassDialogGuiTest method createClassWithSuperclass.

@Test
public void createClassWithSuperclass() throws IOException {
    CreateFileFromTemplateDialogFixture dialog = invokeNewFileDialog();
    dialog.setName(THING_NAME);
    dialog.selectKind(Kind.CLASS);
    dialog.setSuperclass(SUPERCLASS_0);
    dialog.setPackage(PACKAGE_NAME_0);
    dialog.setVisibility(Visibility.PUBLIC);
    dialog.clickOk();
    assertPackageName(THING_FILE_PATH_0, PACKAGE_NAME_0);
    assertDeclaration(THING_FILE_PATH_0, SUPERCLASS_DECLARATION, Kind.CLASS);
}
Also used : CreateFileFromTemplateDialogFixture(com.android.tools.idea.tests.gui.framework.fixture.CreateFileFromTemplateDialogFixture) Test(org.junit.Test)

Example 12 with CreateFileFromTemplateDialogFixture

use of com.android.tools.idea.tests.gui.framework.fixture.CreateFileFromTemplateDialogFixture in project android by JetBrains.

the class CreateNewClassDialogGuiTest method invalidInterfaceName.

@Test
public void invalidInterfaceName() throws IOException, InterruptedException {
    CreateFileFromTemplateDialogFixture dialog = invokeNewFileDialog();
    dialog.setName(THING_NAME);
    dialog.selectKind(Kind.CLASS);
    dialog.setInterface(INVALID_INTERFACE);
    dialog.setPackage(PACKAGE_NAME_0);
    dialog.setVisibility(Visibility.PUBLIC);
    dialog.clickOk();
    dialog.waitForErrorMessageToAppear(CreateNewClassDialogValidatorExImpl.INVALID_QUALIFIED_NAME);
    dialog.clickCancel();
}
Also used : CreateFileFromTemplateDialogFixture(com.android.tools.idea.tests.gui.framework.fixture.CreateFileFromTemplateDialogFixture) Test(org.junit.Test)

Example 13 with CreateFileFromTemplateDialogFixture

use of com.android.tools.idea.tests.gui.framework.fixture.CreateFileFromTemplateDialogFixture in project android by JetBrains.

the class CreateNewClassDialogGuiTest method hidingComponents.

// (Un)hiding fields tests.
@Test
public void hidingComponents() throws IOException {
    CreateFileFromTemplateDialogFixture dialog = invokeNewFileDialog();
    dialog.selectKind(Kind.CLASS);
    assertTrue(ComponentVisibleQuery.isVisible(dialog.find("none_radio_button", JRadioButton.class, ComponentVisibility.VISIBLE)));
    assertTrue(ComponentVisibleQuery.isVisible(dialog.find("abstract_radio_button", JRadioButton.class, ComponentVisibility.VISIBLE)));
    assertTrue(ComponentVisibleQuery.isVisible(dialog.find("final_radio_button", JRadioButton.class, ComponentVisibility.VISIBLE)));
    assertTrue(ComponentVisibleQuery.isVisible(dialog.find("modifiers_label", JLabel.class, ComponentVisibility.VISIBLE)));
    assertTrue(ComponentVisibleQuery.isVisible(dialog.find("overrides_separator", JSeparator.class, ComponentVisibility.VISIBLE)));
    assertTrue(ComponentVisibleQuery.isVisible(dialog.find("overrides_check_box", JCheckBox.class, ComponentVisibility.VISIBLE)));
    dialog.selectKind(Kind.INTERFACE);
    assertFalse(ComponentVisibleQuery.isVisible(dialog.find("none_radio_button", JRadioButton.class, ComponentVisibility.NOT_VISIBLE)));
    assertFalse(ComponentVisibleQuery.isVisible(dialog.find("abstract_radio_button", JRadioButton.class, ComponentVisibility.NOT_VISIBLE)));
    assertFalse(ComponentVisibleQuery.isVisible(dialog.find("final_radio_button", JRadioButton.class, ComponentVisibility.NOT_VISIBLE)));
    assertFalse(ComponentVisibleQuery.isVisible(dialog.find("modifiers_label", JLabel.class, ComponentVisibility.NOT_VISIBLE)));
    assertFalse(ComponentVisibleQuery.isVisible(dialog.find("overrides_separator", JSeparator.class, ComponentVisibility.NOT_VISIBLE)));
    assertFalse(ComponentVisibleQuery.isVisible(dialog.find("overrides_check_box", JCheckBox.class, ComponentVisibility.NOT_VISIBLE)));
    dialog.selectKind(Kind.CLASS);
    assertTrue(ComponentVisibleQuery.isVisible(dialog.find("none_radio_button", JRadioButton.class, ComponentVisibility.VISIBLE)));
    assertTrue(ComponentVisibleQuery.isVisible(dialog.find("abstract_radio_button", JRadioButton.class, ComponentVisibility.VISIBLE)));
    assertTrue(ComponentVisibleQuery.isVisible(dialog.find("final_radio_button", JRadioButton.class, ComponentVisibility.VISIBLE)));
    assertTrue(ComponentVisibleQuery.isVisible(dialog.find("modifiers_label", JLabel.class, ComponentVisibility.VISIBLE)));
    assertTrue(ComponentVisibleQuery.isVisible(dialog.find("overrides_separator", JSeparator.class, ComponentVisibility.VISIBLE)));
    assertTrue(ComponentVisibleQuery.isVisible(dialog.find("overrides_check_box", JCheckBox.class, ComponentVisibility.VISIBLE)));
    dialog.clickCancel();
}
Also used : CreateFileFromTemplateDialogFixture(com.android.tools.idea.tests.gui.framework.fixture.CreateFileFromTemplateDialogFixture) Test(org.junit.Test)

Example 14 with CreateFileFromTemplateDialogFixture

use of com.android.tools.idea.tests.gui.framework.fixture.CreateFileFromTemplateDialogFixture in project android by JetBrains.

the class CreateNewClassDialogGuiTest method showOverridesDialog.

// Overrides dialog tests.
@Ignore("Causes next test method to fail with error: File already exists.")
@Test
public void showOverridesDialog() throws IOException {
    CreateFileFromTemplateDialogFixture newFileDialog = invokeNewFileDialog();
    newFileDialog.setName(THING_NAME);
    JCheckBoxFixture overridesCheckBox = newFileDialog.findCheckBox("overrides_check_box");
    overridesCheckBox.setSelected(true);
    newFileDialog.clickOk();
    JavaOverrideImplementMemberChooserFixture.find(guiTest.robot()).clickCancel();
}
Also used : CreateFileFromTemplateDialogFixture(com.android.tools.idea.tests.gui.framework.fixture.CreateFileFromTemplateDialogFixture) JCheckBoxFixture(org.fest.swing.fixture.JCheckBoxFixture) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 15 with CreateFileFromTemplateDialogFixture

use of com.android.tools.idea.tests.gui.framework.fixture.CreateFileFromTemplateDialogFixture in project android by JetBrains.

the class CreateNewClassDialogGuiTest method invalidSuperclass.

@Test
public void invalidSuperclass() throws IOException, InterruptedException {
    CreateFileFromTemplateDialogFixture dialog = invokeNewFileDialog();
    dialog.setName(THING_NAME);
    dialog.selectKind(Kind.CLASS);
    dialog.setSuperclass(INVALID_NAME);
    dialog.setPackage(PACKAGE_NAME_0);
    dialog.setVisibility(Visibility.PUBLIC);
    dialog.clickOk();
    dialog.waitForErrorMessageToAppear(CreateNewClassDialogValidatorExImpl.INVALID_QUALIFIED_NAME);
    dialog.clickCancel();
}
Also used : CreateFileFromTemplateDialogFixture(com.android.tools.idea.tests.gui.framework.fixture.CreateFileFromTemplateDialogFixture) Test(org.junit.Test)

Aggregations

CreateFileFromTemplateDialogFixture (com.android.tools.idea.tests.gui.framework.fixture.CreateFileFromTemplateDialogFixture)21 Test (org.junit.Test)17 JCheckBoxFixture (org.fest.swing.fixture.JCheckBoxFixture)1 Ignore (org.junit.Ignore)1