Search in sources :

Example 6 with CreateFileFromTemplateDialogFixture

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

the class CreateNewClassDialogGuiTest method createWithTwoInterfaces.

private void createWithTwoInterfaces(Kind kind) throws IOException {
    CreateFileFromTemplateDialogFixture dialog = invokeNewFileDialog();
    dialog.setName(THING_NAME);
    dialog.selectKind(kind);
    dialog.setInterface(INTERFACE_0 + "," + INTERFACE_1);
    dialog.setPackage(PACKAGE_NAME_0);
    dialog.setVisibility(Visibility.PUBLIC);
    dialog.clickOk();
    assertPackageName(THING_FILE_PATH_0, PACKAGE_NAME_0);
    String declaration = kind.equals(Kind.INTERFACE) || kind.equals(Kind.ANNOTATION) ? INTERFACE_EXTENDING_TWO_INTERFACES_DECLARATION : CLASS_IMPLEMENTING_TWO_INTERFACES_DECLARATION;
    assertDeclaration(THING_FILE_PATH_0, declaration, kind);
}
Also used : CreateFileFromTemplateDialogFixture(com.android.tools.idea.tests.gui.framework.fixture.CreateFileFromTemplateDialogFixture)

Example 7 with CreateFileFromTemplateDialogFixture

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

the class CreateNewClassDialogGuiTest method createClassInNewParallelPackage.

@Test
public void createClassInNewParallelPackage() throws IOException {
    CreateFileFromTemplateDialogFixture dialog1 = invokeNewFileDialog();
    dialog1.setName(THING_NAME);
    dialog1.selectKind(Kind.CLASS);
    dialog1.setPackage(PACKAGE_NAME_1);
    dialog1.setVisibility(Visibility.PUBLIC);
    dialog1.clickOk();
    CreateFileFromTemplateDialogFixture dialog2 = invokeNewFileDialog();
    dialog2.setName(THING_NAME);
    dialog2.selectKind(Kind.CLASS);
    dialog2.setPackage(PACKAGE_NAME_2);
    dialog2.setVisibility(Visibility.PUBLIC);
    dialog2.clickOk();
    assertPackageName(THING_FILE_PATH_2, PACKAGE_NAME_2);
    assertDeclaration(THING_FILE_PATH_2, PUBLIC_DECLARATION, Kind.CLASS);
}
Also used : CreateFileFromTemplateDialogFixture(com.android.tools.idea.tests.gui.framework.fixture.CreateFileFromTemplateDialogFixture) Test(org.junit.Test)

Example 8 with CreateFileFromTemplateDialogFixture

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

the class CreateNewClassDialogGuiTest method createAbstract.

@Test
public void createAbstract() throws IOException {
    CreateFileFromTemplateDialogFixture dialog = invokeNewFileDialog();
    dialog.setName(THING_NAME);
    dialog.selectKind(Kind.CLASS);
    dialog.setModifier(Modifier.ABSTRACT);
    dialog.clickOk();
    assertPackageName(THING_FILE_PATH_0, PACKAGE_NAME_0);
    assertDeclaration(THING_FILE_PATH_0, ABSTRACT_DECLARATION, Kind.CLASS);
}
Also used : CreateFileFromTemplateDialogFixture(com.android.tools.idea.tests.gui.framework.fixture.CreateFileFromTemplateDialogFixture) Test(org.junit.Test)

Example 9 with CreateFileFromTemplateDialogFixture

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

the class CreateNewClassDialogGuiTest method invalidName.

// Invalid field entries tests. These tests ensure the UI reacts appropriately to invalid input. They do not test
// that all forms of invalid input produce errors. NewClassDialogOptionsValidatorTest does that.
@Test
public void invalidName() throws IOException, InterruptedException {
    CreateFileFromTemplateDialogFixture dialog = invokeNewFileDialog();
    dialog.setName(INVALID_NAME);
    dialog.selectKind(Kind.CLASS);
    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 10 with CreateFileFromTemplateDialogFixture

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

the class CreateNewClassDialogGuiTest method createFinal.

@Test
public void createFinal() throws IOException {
    CreateFileFromTemplateDialogFixture dialog = invokeNewFileDialog();
    dialog.setName(THING_NAME);
    dialog.selectKind(Kind.CLASS);
    dialog.setModifier(Modifier.FINAL);
    dialog.clickOk();
    assertPackageName(THING_FILE_PATH_0, PACKAGE_NAME_0);
    assertDeclaration(THING_FILE_PATH_0, FINAL_DECLARATION, Kind.CLASS);
}
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