congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
CloudSdkServiceManager.runWhenSdkReady
Code IndexAdd Tabnine to your IDE (free)

How to use
runWhenSdkReady
method
in
com.google.cloud.tools.intellij.appengine.java.sdk.CloudSdkServiceManager

Best Java code snippets using com.google.cloud.tools.intellij.appengine.java.sdk.CloudSdkServiceManager.runWhenSdkReady (Showing top 7 results out of 315)

origin: GoogleCloudPlatform/google-cloud-intellij

@Test
public void installingSdk_then_readySdk_correctly_runs() {
 mockSdkStatusChange(SdkStatus.INSTALLING, SdkStatus.READY);
 cloudSdkServiceManager.runWhenSdkReady(mockProject, mockRunnable, "", mockStatusHandler);
 ApplicationManager.getApplication().invokeAndWait(() -> verify(mockRunnable).run());
}
origin: GoogleCloudPlatform/google-cloud-intellij

@Test
public void installingSdk_then_stillInstalling_doesNotRun() {
 mockSdkStatusChange(SdkStatus.INSTALLING, SdkStatus.INSTALLING);
 // mock cancel operation for incomplete install.
 doReturn(true).when(cloudSdkServiceManager).checkIfCancelled();
 cloudSdkServiceManager.runWhenSdkReady(mockProject, mockRunnable, "", mockStatusHandler);
 ApplicationManager.getApplication().invokeAndWait(() -> verifyNoMoreInteractions(mockRunnable));
}
origin: GoogleCloudPlatform/google-cloud-intellij

@Test
public void installingSdk_then_userCancel_doesNotShowWarningNotification() {
 mockSdkStatusChange(SdkStatus.INSTALLING, SdkStatus.INSTALLING);
 // mock cancel operation for incomplete install.
 doReturn(true).when(cloudSdkServiceManager).checkIfCancelled();
 cloudSdkServiceManager.runWhenSdkReady(mockProject, mockRunnable, "", mockStatusHandler);
 ApplicationManager.getApplication()
   .invokeAndWait(
     () ->
       // explicit parameters are not relevant but need to be passed for spy to work.
       verify(cloudSdkServiceManager, never())
         .showCloudSdkNotification("", NotificationType.WARNING));
}
origin: GoogleCloudPlatform/google-cloud-intellij

@Test
public void installingSdk_then_invalidSdk_showsErrorNotification() {
 mockSdkStatusChange(SdkStatus.INSTALLING, SdkStatus.INVALID);
 String errorMessage = "Deployment failed: Google Cloud SDK is not ready.";
 when(mockStatusHandler.getErrorMessage(SdkStatus.INVALID)).thenReturn(errorMessage);
 cloudSdkServiceManager.runWhenSdkReady(mockProject, mockRunnable, "", mockStatusHandler);
 ApplicationManager.getApplication()
   .invokeAndWait(
     () ->
       verify(cloudSdkServiceManager)
         .showCloudSdkNotification(errorMessage, NotificationType.WARNING));
}
origin: GoogleCloudPlatform/google-cloud-intellij

@Test
public void installingSdk_then_invalidSdk_doesNotRun() {
 mockSdkStatusChange(SdkStatus.INSTALLING, SdkStatus.INVALID);
 cloudSdkServiceManager.runWhenSdkReady(mockProject, mockRunnable, "", mockStatusHandler);
 ApplicationManager.getApplication().invokeAndWait(() -> verifyNoMoreInteractions(mockRunnable));
}
origin: GoogleCloudPlatform/google-cloud-intellij

@Test
public void installingSdk_then_notAvailableSdk_doesNotRun() {
 mockSdkStatusChange(SdkStatus.INSTALLING, SdkStatus.NOT_AVAILABLE);
 cloudSdkServiceManager.runWhenSdkReady(mockProject, mockRunnable, "", mockStatusHandler);
 ApplicationManager.getApplication().invokeAndWait(() -> verifyNoMoreInteractions(mockRunnable));
}
origin: GoogleCloudPlatform/google-cloud-intellij

.runWhenSdkReady(
  task.getProject(),
  deployRunner,
com.google.cloud.tools.intellij.appengine.java.sdkCloudSdkServiceManagerrunWhenSdkReady

Javadoc

Waits in background for Cloud SDK to be ready for all operations and then runs the given runnable. If process results in error or user cancel, shows notification and does not run. This method does not block and must be called from application UI thread.

Popular methods of CloudSdkServiceManager

  • getCloudSdkService
  • getInstance
  • checkIfCancelled
  • getSdkReadLock
    Lock to be acquired on all SDK read (i.e. execute gcloud) operations. Can be held by multiple operat
  • onNewCloudSdkServiceTypeSelected
    Callback when a user selected and applied a new cloud sdk type.
  • showCloudSdkNotification
  • blockUntilSdkReady
    Blocks current thread until Cloud SDK is ready for all operations. If process results in error or us
  • doWait
    Performs generic wait in a separate thread for SDK to become ready, returns immediately. Must be cal
  • getSdkWriteLock
    Lock to be acquired on all SDK write (i.e. delete, replace, update SDK files) operations. Exclusive,
  • isInstallInProgress
    Checks if current SDK service is currently installing and not ready for operations.

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (Timer)
  • getExternalFilesDir (Context)
  • findViewById (Activity)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Collectors (java.util.stream)
  • Runner (org.openjdk.jmh.runner)
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now