Search in sources :

Example 11 with SdkStatus

use of com.google.cloud.tools.intellij.appengine.sdk.CloudSdkService.SdkStatus in project google-cloud-intellij by GoogleCloudPlatform.

the class ManagedCloudSdkServiceTest method failed_update_validSdk_sdkStatus_available.

@Test
public void failed_update_validSdk_sdkStatus_available() throws Exception {
    makeMockSdkInstalled(MOCK_SDK_PATH);
    emulateMockSdkUpdateProcess();
    SdkUpdater mockUpdater = mockManagedCloudSdk.newUpdater();
    doThrow(new CommandExitException(-1, "")).when(mockUpdater).update(any(), any());
    sdkService.addStatusUpdateListener(mockStatusUpdateListener);
    sdkService.update();
    ArgumentCaptor<SdkStatus> statusCaptor = ArgumentCaptor.forClass(SdkStatus.class);
    verify(mockStatusUpdateListener, times(2)).onSdkStatusChange(any(), statusCaptor.capture());
    assertThat(statusCaptor.getAllValues()).isEqualTo(Arrays.asList(SdkStatus.INSTALLING, SdkStatus.READY));
}
Also used : SdkUpdater(com.google.cloud.tools.managedcloudsdk.components.SdkUpdater) CommandExitException(com.google.cloud.tools.managedcloudsdk.command.CommandExitException) SdkStatus(com.google.cloud.tools.intellij.appengine.sdk.CloudSdkService.SdkStatus) Test(org.junit.Test)

Aggregations

SdkStatus (com.google.cloud.tools.intellij.appengine.sdk.CloudSdkService.SdkStatus)11 Test (org.junit.Test)6 SdkUpdater (com.google.cloud.tools.managedcloudsdk.components.SdkUpdater)4 CloudSdkService (com.google.cloud.tools.intellij.appengine.sdk.CloudSdkService)2 CloudSdkStatusHandler (com.google.cloud.tools.intellij.appengine.sdk.CloudSdkServiceManager.CloudSdkStatusHandler)2 CommandExitException (com.google.cloud.tools.managedcloudsdk.command.CommandExitException)2 RuntimeConfigurationError (com.intellij.execution.configurations.RuntimeConfigurationError)2 AppEngineExecutor (com.google.cloud.tools.intellij.appengine.cloud.executor.AppEngineExecutor)1 AppEngineStandardRunTask (com.google.cloud.tools.intellij.appengine.cloud.executor.AppEngineStandardRunTask)1 UserSpecifiedPathDeploymentSource (com.google.cloud.tools.intellij.appengine.cloud.flexible.UserSpecifiedPathDeploymentSource)1 CloudSdkValidationResult (com.google.cloud.tools.intellij.appengine.sdk.CloudSdkValidationResult)1 AppEngineServerModel (com.google.cloud.tools.intellij.appengine.server.instance.AppEngineServerModel)1 CommandExecutionException (com.google.cloud.tools.managedcloudsdk.command.CommandExecutionException)1 SdkComponentInstaller (com.google.cloud.tools.managedcloudsdk.components.SdkComponentInstaller)1 SdkInstaller (com.google.cloud.tools.managedcloudsdk.install.SdkInstaller)1 ExecutionException (com.intellij.execution.ExecutionException)1 OSProcessHandler (com.intellij.execution.process.OSProcessHandler)1 CommonModel (com.intellij.javaee.run.configuration.CommonModel)1 ExecutableObject (com.intellij.javaee.run.localRun.ExecutableObject)1 ScriptHelper (com.intellij.javaee.run.localRun.ScriptHelper)1