Package com.google.cloud.testing
Class BaseEmulatorHelper.GcloudEmulatorRunner
java.lang.Object
com.google.cloud.testing.BaseEmulatorHelper.GcloudEmulatorRunner
- All Implemented Interfaces:
BaseEmulatorHelper.EmulatorRunner
- Enclosing class:
- BaseEmulatorHelper<T extends ServiceOptions>
protected static class BaseEmulatorHelper.GcloudEmulatorRunner
extends Object
implements BaseEmulatorHelper.EmulatorRunner
Utility class to start and run an emulator from the Google Cloud SDK.
-
Constructor Summary
ConstructorsConstructorDescriptionGcloudEmulatorRunner(List<String> commandText, String versionPrefix, String minVersion) -
Method Summary
Modifier and TypeMethodDescriptionReturns the process associated to the emulator, if any.booleanReturnstrueif the emulator associated to this runner is available and can be started.voidstart()Starts the emulator associated to this runner.intwaitFor(org.threeten.bp.Duration timeout) This method is obsolete.intwaitForDuration(Duration timeout) Wait for the emulator associated to this runner to terminate, returning the exit status.
-
Constructor Details
-
GcloudEmulatorRunner
-
-
Method Details
-
isAvailable
public boolean isAvailable()Description copied from interface:BaseEmulatorHelper.EmulatorRunnerReturnstrueif the emulator associated to this runner is available and can be started.- Specified by:
isAvailablein interfaceBaseEmulatorHelper.EmulatorRunner
-
start
Description copied from interface:BaseEmulatorHelper.EmulatorRunnerStarts the emulator associated to this runner.- Specified by:
startin interfaceBaseEmulatorHelper.EmulatorRunner- Throws:
IOException
-
waitFor
@ObsoleteApi("Use waitForDuration() instead") public int waitFor(org.threeten.bp.Duration timeout) throws InterruptedException, TimeoutException This method is obsolete. UsewaitForDuration(java.time.Duration)instead- Specified by:
waitForin interfaceBaseEmulatorHelper.EmulatorRunner- Throws:
InterruptedExceptionTimeoutException
-
waitForDuration
Description copied from interface:BaseEmulatorHelper.EmulatorRunnerWait for the emulator associated to this runner to terminate, returning the exit status.- Specified by:
waitForDurationin interfaceBaseEmulatorHelper.EmulatorRunner- Throws:
InterruptedExceptionTimeoutException
-
getProcess
Description copied from interface:BaseEmulatorHelper.EmulatorRunnerReturns the process associated to the emulator, if any.- Specified by:
getProcessin interfaceBaseEmulatorHelper.EmulatorRunner
-