Search in sources :

Example 16 with CreateFileFromTemplateDialogFixture

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

the class CreateNewClassDialogGuiTest method invalidPackage.

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

Example 17 with CreateFileFromTemplateDialogFixture

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

the class CreateNewClassDialogGuiTest method createWithAnImport.

private void createWithAnImport(Kind kind) throws IOException {
    CreateFileFromTemplateDialogFixture dialog = invokeNewFileDialog();
    dialog.setName(THING_NAME);
    dialog.selectKind(kind);
    dialog.setInterface(FULLY_QUALIFIED_INTERFACE);
    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_INTERFACE_THAT_NEEDS_IMPORT_DECLARATION : CLASS_IMPLEMENTING_INTERFACE_THAT_NEEDS_IMPORT_DECLARATION;
    assertImport(THING_FILE_PATH_0, INTERFACE_IMPORT);
    assertDeclaration(THING_FILE_PATH_0, declaration, kind);
}
Also used : CreateFileFromTemplateDialogFixture(com.android.tools.idea.tests.gui.framework.fixture.CreateFileFromTemplateDialogFixture)

Example 18 with CreateFileFromTemplateDialogFixture

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

the class CreateNewClassDialogGuiTest method implementAClass.

// Interfaces vs. classes.
@Test
public void implementAClass() throws IOException {
    CreateFileFromTemplateDialogFixture dialog = invokeNewFileDialog();
    dialog.setName(THING_NAME);
    dialog.selectKind(Kind.CLASS);
    dialog.setInterface("java.lang.Object");
    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 19 with CreateFileFromTemplateDialogFixture

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

the class CreateNewClassDialogGuiTest method extendAnInterface.

@Test
public void extendAnInterface() throws IOException {
    CreateFileFromTemplateDialogFixture dialog = invokeNewFileDialog();
    dialog.setName(THING_NAME);
    dialog.selectKind(Kind.CLASS);
    dialog.setSuperclass("java.lang.Runnable");
    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 20 with CreateFileFromTemplateDialogFixture

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

the class CreateNewClassDialogGuiTest method createPackagePrivate.

private void createPackagePrivate(Kind kind) throws IOException {
    CreateFileFromTemplateDialogFixture dialog = invokeNewFileDialog();
    dialog.setName(THING_NAME);
    dialog.selectKind(kind);
    dialog.setPackage(PACKAGE_NAME_0);
    dialog.setVisibility(Visibility.PACKAGE_PRIVATE);
    dialog.clickOk();
    assertPackageName(THING_FILE_PATH_0, PACKAGE_NAME_0);
    assertDeclaration(THING_FILE_PATH_0, PACKAGE_PRIVATE_DECLARATION, kind);
}
Also used : CreateFileFromTemplateDialogFixture(com.android.tools.idea.tests.gui.framework.fixture.CreateFileFromTemplateDialogFixture)

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