Search in sources :

Example 6 with SdkInstaller

use of com.google.cloud.tools.managedcloudsdk.install.SdkInstaller in project google-cloud-intellij by GoogleCloudPlatform.

the class ManagedCloudSdkServiceTest method failed_install_showsErrorNotification.

@Test
public void failed_install_showsErrorNotification() throws Exception {
    emulateMockSdkInstallationProcess(MOCK_SDK_PATH);
    SdkInstaller mockInstaller = mockManagedCloudSdk.newInstaller();
    IOException ioException = new IOException("IO Error");
    when(mockInstaller.install(any(), any())).thenThrow(ioException);
    sdkService.install();
    verify(mockUiPresenter).notifyManagedSdkJobFailure(ManagedSdkJobType.INSTALL, ioException.toString());
}
Also used : SdkInstaller(com.google.cloud.tools.managedcloudsdk.install.SdkInstaller) IOException(java.io.IOException) Test(org.junit.Test)

Example 7 with SdkInstaller

use of com.google.cloud.tools.managedcloudsdk.install.SdkInstaller in project google-cloud-intellij by GoogleCloudPlatform.

the class ManagedCloudSdkServiceTest method failed_install_removesProgressIndicator.

@Test
public void failed_install_removesProgressIndicator() throws Exception {
    emulateMockSdkInstallationProcess(MOCK_SDK_PATH);
    SdkInstaller mockInstaller = mockManagedCloudSdk.newInstaller();
    IOException ioException = new IOException("IO Error");
    when(mockInstaller.install(any(), any())).thenThrow(ioException);
    sdkService.install();
    verify(mockProgressListener, atLeastOnce()).done();
}
Also used : SdkInstaller(com.google.cloud.tools.managedcloudsdk.install.SdkInstaller) IOException(java.io.IOException) Test(org.junit.Test)

Aggregations

SdkInstaller (com.google.cloud.tools.managedcloudsdk.install.SdkInstaller)7 Test (org.junit.Test)6 IOException (java.io.IOException)4 CancellationException (java.util.concurrent.CancellationException)2 SdkStatus (com.google.cloud.tools.intellij.appengine.sdk.CloudSdkService.SdkStatus)1 ManagedSdkVerificationException (com.google.cloud.tools.managedcloudsdk.ManagedSdkVerificationException)1 UnsupportedOsException (com.google.cloud.tools.managedcloudsdk.UnsupportedOsException)1 CommandExecutionException (com.google.cloud.tools.managedcloudsdk.command.CommandExecutionException)1 CommandExitException (com.google.cloud.tools.managedcloudsdk.command.CommandExitException)1 SdkComponentInstaller (com.google.cloud.tools.managedcloudsdk.components.SdkComponentInstaller)1