Search in sources :

Example 6 with GradleSyncListener

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

the class GradleProjectImporterTest method testImportProjectWithNullProject.

public void testImportProjectWithNullProject() throws Exception {
    GradleProjectImporter.Request importSettings = new GradleProjectImporter.Request();
    importSettings.setProject(null).setLanguageLevel(JDK_1_8);
    Project newProject = getProject();
    when(myProjectSetup.createProject(myProjectName, myProjectFolderPath.getPath())).thenReturn(newProject);
    GradleSyncListener syncListener = mock(GradleSyncListener.class);
    myProjectImporter.importProject(myProjectName, myProjectFolderPath, importSettings, syncListener);
    // Verify project setup before syncing.
    verifyProjectFilesCreation();
    verifyProjectCreation(times(1));
    verifyProjectPreparation(JDK_1_8);
    verifyGradleVmOptionsCleanup(times(1));
    // Verify sync.
    verifyGradleSyncInvocation(importSettings, syncListener);
}
Also used : Project(com.intellij.openapi.project.Project) GradleSyncListener(com.android.tools.idea.gradle.project.sync.GradleSyncListener)

Aggregations

GradleSyncListener (com.android.tools.idea.gradle.project.sync.GradleSyncListener)6 Project (com.intellij.openapi.project.Project)4 GradleProjectImporter (com.android.tools.idea.gradle.project.importing.GradleProjectImporter)2 ConfigurationException (com.intellij.openapi.options.ConfigurationException)2 IOException (java.io.IOException)2 GradleSyncInvoker (com.android.tools.idea.gradle.project.sync.GradleSyncInvoker)1 Projects.isLegacyIdeaAndroidProject (com.android.tools.idea.gradle.util.Projects.isLegacyIdeaAndroidProject)1 Sdk (com.intellij.openapi.projectRoots.Sdk)1 Library (com.intellij.openapi.roots.libraries.Library)1 LibraryTable (com.intellij.openapi.roots.libraries.LibraryTable)1 Ref (com.intellij.openapi.util.Ref)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 LanguageLevel (com.intellij.pom.java.LanguageLevel)1 File (java.io.File)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 NotNull (org.jetbrains.annotations.NotNull)1