Search in sources :

Example 16 with ModuleToImport

use of com.android.tools.idea.gradle.project.ModuleToImport in project android by JetBrains.

the class ModulesListModelTest method testNameCollision.

public void testNameCollision() {
    ModuleToImport anotherModule = new ModuleToImport("m1", myModule2.location, NO_DEPS);
    setModules(myModule1, anotherModule);
    myModel.setModuleName(myModule1, anotherModule.name);
    assertEquals(DUPLICATE_MODULE_NAME, myModel.getModuleState(anotherModule));
    assertEquals(DUPLICATE_MODULE_NAME, myModel.getModuleState(myModule1));
    myModel.setSelected(anotherModule, false);
    assertEquals(OK, myModel.getModuleState(anotherModule));
    assertEquals(OK, myModel.getModuleState(myModule1));
    myModel.setSelected(anotherModule, true);
    assertEquals(DUPLICATE_MODULE_NAME, myModel.getModuleState(anotherModule));
    assertEquals(DUPLICATE_MODULE_NAME, myModel.getModuleState(myModule1));
    myModel.setSelected(myModule1, false);
    assertEquals(OK, myModel.getModuleState(anotherModule));
    assertEquals(OK, myModel.getModuleState(myModule1));
}
Also used : ModuleToImport(com.android.tools.idea.gradle.project.ModuleToImport)

Example 17 with ModuleToImport

use of com.android.tools.idea.gradle.project.ModuleToImport in project android by JetBrains.

the class ModulesListModelTest method testModuleExistsSeverity.

public void testModuleExistsSeverity() {
    ModuleToImport existing = new ModuleToImport(EXISTING_MODULE, myModule2.location, NO_DEPS);
    setModules(existing, myModule1);
    assertEquals(MessageType.WARNING, myModel.getStatusSeverity(existing));
    myModel.setSelected(existing, true);
    assertEquals(MessageType.ERROR, myModel.getStatusSeverity(existing));
}
Also used : ModuleToImport(com.android.tools.idea.gradle.project.ModuleToImport)

Aggregations

ModuleToImport (com.android.tools.idea.gradle.project.ModuleToImport)17 VirtualFile (com.intellij.openapi.vfs.VirtualFile)4 IOException (java.io.IOException)3 VisibleForTesting (com.android.annotations.VisibleForTesting)1 ModuleImporter (com.android.tools.idea.gradle.project.ModuleImporter)1 ModuleListModel (com.android.tools.idea.npw.importing.ModuleListModel)1 Function (com.google.common.base.Function)1 Project (com.intellij.openapi.project.Project)1 File (java.io.File)1 Collection (java.util.Collection)1 NotNull (org.jetbrains.annotations.NotNull)1 Nullable (org.jetbrains.annotations.Nullable)1