Search in sources :

Example 1 with SdkSync

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

the class GradleProjectImporterTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    myProjectName = "testProject";
    SdkSync sdkSync = mock(SdkSync.class);
    mySyncInvoker = mock(GradleSyncInvoker.class);
    myProjectSetup = mock(NewProjectSetup.class);
    myProjectFolder = mock(ProjectFolder.class);
    Project project = getProject();
    String projectFolderPathText = project.getBasePath();
    assertNotNull(projectFolderPathText);
    myProjectFolderPath = new File(projectFolderPathText);
    ProjectFolder.Factory projectFolderFactory = mock(ProjectFolder.Factory.class);
    when(projectFolderFactory.create(myProjectFolderPath)).thenReturn(myProjectFolder);
    // Replace GradleSettings service with a mock.
    myGradleSettings = mock(GradleSettings.class);
    IdeComponents.replaceService(project, GradleSettings.class, myGradleSettings);
    assertSame(GradleSettings.getInstance(project), myGradleSettings);
    myProjectImporter = new GradleProjectImporter(sdkSync, mySyncInvoker, myProjectSetup, projectFolderFactory);
}
Also used : SdkSync(com.android.tools.idea.gradle.project.sync.SdkSync) Project(com.intellij.openapi.project.Project) GradleSyncInvoker(com.android.tools.idea.gradle.project.sync.GradleSyncInvoker) GradleSettings(org.jetbrains.plugins.gradle.settings.GradleSettings) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File)

Example 2 with SdkSync

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

the class IdeComponentsTest method testReplaceApplicationService.

public void testReplaceApplicationService() {
    SdkSync mockSdkSync = mock(SdkSync.class);
    IdeComponents.replaceService(SdkSync.class, mockSdkSync);
    assertSame(mockSdkSync, SdkSync.getInstance());
}
Also used : SdkSync(com.android.tools.idea.gradle.project.sync.SdkSync)

Aggregations

SdkSync (com.android.tools.idea.gradle.project.sync.SdkSync)2 GradleSyncInvoker (com.android.tools.idea.gradle.project.sync.GradleSyncInvoker)1 Project (com.intellij.openapi.project.Project)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 File (java.io.File)1 GradleSettings (org.jetbrains.plugins.gradle.settings.GradleSettings)1