use of com.android.tools.idea.tests.gui.framework.fixture.CreateFileFromTemplateDialogFixture in project android by JetBrains.
the class CreateNewClassDialogGuiTest method createClassInNewSubPackage.
@Test
public void createClassInNewSubPackage() throws IOException {
CreateFileFromTemplateDialogFixture dialog = invokeNewFileDialog();
dialog.setName(THING_NAME);
dialog.selectKind(Kind.CLASS);
dialog.setPackage(PACKAGE_NAME_1);
dialog.setVisibility(Visibility.PUBLIC);
dialog.clickOk();
assertPackageName(THING_FILE_PATH_1, PACKAGE_NAME_1);
assertDeclaration(THING_FILE_PATH_1, PUBLIC_DECLARATION, Kind.CLASS);
}
use of com.android.tools.idea.tests.gui.framework.fixture.CreateFileFromTemplateDialogFixture in project android by JetBrains.
the class CreateNewClassDialogGuiTest method createClassWithNestedInterfaceImport.
@Test
public void createClassWithNestedInterfaceImport() throws IOException {
CreateFileFromTemplateDialogFixture dialog = invokeNewFileDialog();
dialog.setName(THING_NAME);
dialog.selectKind(Kind.CLASS);
dialog.setInterface(JAVA_UTIL_MAP_ENTRY);
dialog.setPackage(PACKAGE_NAME_0);
dialog.setVisibility(Visibility.PUBLIC);
dialog.clickOk();
assertPackageName(THING_FILE_PATH_0, PACKAGE_NAME_0);
assertImport(THING_FILE_PATH_0, JAVA_UTIL_MAP_IMPORT);
assertDeclaration(THING_FILE_PATH_0, JAVA_UTIL_MAP_ENTRY_DECLARATION, Kind.CLASS);
}
use of com.android.tools.idea.tests.gui.framework.fixture.CreateFileFromTemplateDialogFixture in project android by JetBrains.
the class CreateNewClassDialogGuiTest method createClassInCurrentPackage.
// Create in package tests.
@Test
public void createClassInCurrentPackage() throws IOException {
CreateFileFromTemplateDialogFixture dialog = invokeNewFileDialog();
dialog.setName(THING_NAME);
dialog.selectKind(Kind.CLASS);
dialog.setVisibility(Visibility.PUBLIC);
dialog.clickOk();
assertPackageName(THING_FILE_PATH_0, PACKAGE_NAME_0);
assertDeclaration(THING_FILE_PATH_0, PUBLIC_DECLARATION, Kind.CLASS);
assertThat(myEditor.getCurrentFileContents()).doesNotContain("import ");
}
use of com.android.tools.idea.tests.gui.framework.fixture.CreateFileFromTemplateDialogFixture in project android by JetBrains.
the class CreateNewClassDialogGuiTest method createClassWithSuperclassAndInterface.
@Test
public void createClassWithSuperclassAndInterface() throws IOException {
CreateFileFromTemplateDialogFixture dialog = invokeNewFileDialog();
dialog.setName(THING_NAME);
dialog.selectKind(Kind.CLASS);
dialog.setSuperclass(SUPERCLASS_0);
dialog.setInterface(INTERFACE_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_AND_INTERFACE_DECLARATION, Kind.CLASS);
}
use of com.android.tools.idea.tests.gui.framework.fixture.CreateFileFromTemplateDialogFixture in project android by JetBrains.
the class CreateNewClassDialogGuiTest method createWithOneInterface.
private void createWithOneInterface(Kind kind) throws IOException {
CreateFileFromTemplateDialogFixture dialog = invokeNewFileDialog();
dialog.setName(THING_NAME);
dialog.selectKind(kind);
dialog.setInterface(INTERFACE_0);
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_ONE_INTERFACE_DECLARATION : CLASS_IMPLEMENTING_ONE_INTERFACE_DECLARATION;
assertDeclaration(THING_FILE_PATH_0, declaration, kind);
}
Aggregations