本文整理汇总了Java中com.intellij.openapi.vcs.impl.CancellableRunnable类的典型用法代码示例。如果您正苦于以下问题:Java CancellableRunnable类的具体用法?Java CancellableRunnable怎么用?Java CancellableRunnable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CancellableRunnable类属于com.intellij.openapi.vcs.impl包,在下文中一共展示了CancellableRunnable类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testCreateDeployRunnerInvalidSdk
import com.intellij.openapi.vcs.impl.CancellableRunnable; //导入依赖的package包/类
@Test
public void testCreateDeployRunnerInvalidSdk() {
when(sdkService.validateCloudSdk())
.thenReturn(ImmutableSet.of(CloudSdkValidationResult.CLOUD_SDK_NOT_FOUND));
Path path = Paths.get(("/this/path"));
when(sdkService.getSdkHomePath()).thenReturn(path);
Optional<CancellableRunnable> runner =
helper.createDeployRunner(
loggingHandler,
createMockDeployableDeploymentSource(),
deploymentConfiguration,
callback);
assertFalse(runner.isPresent());
verify(callback, times(1))
.errorOccurred("No Cloud SDK was found in the specified directory. " + path.toString());
}
示例2: testCreateFlexDeployRunner_noPersistedModule
import com.intellij.openapi.vcs.impl.CancellableRunnable; //导入依赖的package包/类
@Test
public void testCreateFlexDeployRunner_noPersistedModule() {
when(deploymentConfiguration.getModuleName()).thenReturn(null);
DeploymentSource flexSource = createMockDeployableDeploymentSource();
when(((AppEngineDeployable) flexSource).getEnvironment())
.thenReturn(AppEngineEnvironment.APP_ENGINE_FLEX);
File mockSourceFile = mock(File.class);
when(mockSourceFile.exists()).thenReturn(true);
when(flexSource.getFile()).thenReturn(mockSourceFile);
Optional<CancellableRunnable> runner =
helper.createDeployRunner(loggingHandler, flexSource, deploymentConfiguration, callback);
assertFalse(runner.isPresent());
verify(callback, times(1)).errorOccurred("No app.yaml specified for flexible deployment.");
}
示例3: disconnect
import com.intellij.openapi.vcs.impl.CancellableRunnable; //导入依赖的package包/类
@Override
public void disconnect() {
synchronized (createdDeployments) {
// Kills any executing deployment actions.
createdDeployments.values().forEach(CancellableRunnable::cancel);
createdDeployments
.keys()
.forEach(
project ->
ProjectManager.getInstance()
.removeProjectManagerListener(project, projectClosingListener));
createdDeployments.clear();
}
}
示例4: testCreateDeployRunnerInvalidDeploymentSourceType_returnsNull
import com.intellij.openapi.vcs.impl.CancellableRunnable; //导入依赖的package包/类
@Test
public void testCreateDeployRunnerInvalidDeploymentSourceType_returnsNull() {
Optional<CancellableRunnable> runner =
helper.createDeployRunner(
loggingHandler, undeployableDeploymentSource, deploymentConfiguration, callback);
assertFalse(runner.isPresent());
verify(callback, times(1)).errorOccurred("Invalid deployment source.");
}
示例5: testCreateDeployRunnerInvalidDeploymentSourceFile_returnsNull
import com.intellij.openapi.vcs.impl.CancellableRunnable; //导入依赖的package包/类
@Test
public void testCreateDeployRunnerInvalidDeploymentSourceFile_returnsNull() {
when(sdkService.validateCloudSdk()).thenReturn(ImmutableSet.of());
Optional<CancellableRunnable> runner =
helper.createDeployRunner(
loggingHandler,
createMockDeployableDeploymentSource(),
deploymentConfiguration,
callback);
assertFalse(runner.isPresent());
verify(callback, times(1)).errorOccurred("Deployment source not found: null.");
}
示例6: createDeployRunner
import com.intellij.openapi.vcs.impl.CancellableRunnable; //导入依赖的package包/类
/**
* Creates a {@link Runnable} that will execute the tasks necessary for deployment to an App
* Engine environment.
*
* @param loggingHandler logging messages will be output to this
* @param source the deployment source to be deployed
* @param deploymentConfiguration the configuration specifying the deployment
* @param callback a callback for handling completions of the operation
* @return an {@link Optional} containing the runnable that will perform the deployment operation
*/
Optional<CancellableRunnable> createDeployRunner(
LoggingHandler loggingHandler,
DeploymentSource source,
AppEngineDeploymentConfiguration deploymentConfiguration,
DeploymentOperationCallback callback);