use of com.intellij.openapi.ui.TestDialog in project intellij-community by JetBrains.
the class MavenImportingTestCase method configConfirmationForNoAnswer.
protected static AtomicInteger configConfirmationForNoAnswer() {
final AtomicInteger counter = new AtomicInteger();
Messages.setTestDialog(new TestDialog() {
@Override
public int show(String message) {
counter.set(counter.get() + 1);
return 1;
}
});
return counter;
}
use of com.intellij.openapi.ui.TestDialog in project kotlin by JetBrains.
the class MavenImportingTestCase method configConfirmationForNoAnswer.
protected static AtomicInteger configConfirmationForNoAnswer() {
final AtomicInteger counter = new AtomicInteger();
Messages.setTestDialog(new TestDialog() {
@Override
public int show(String message) {
counter.set(counter.get() + 1);
return 1;
}
});
return counter;
}
use of com.intellij.openapi.ui.TestDialog in project intellij-community by JetBrains.
the class ExternalSystemImportingTestCase method configConfirmationForNoAnswer.
protected static AtomicInteger configConfirmationForNoAnswer() {
final AtomicInteger counter = new AtomicInteger();
Messages.setTestDialog(new TestDialog() {
@Override
public int show(String message) {
counter.set(counter.get() + 1);
return 1;
}
});
return counter;
}
use of com.intellij.openapi.ui.TestDialog in project intellij-community by JetBrains.
the class GithubShareProjectTest method testGithubAlreadyExists.
public void testGithubAlreadyExists() throws Throwable {
final boolean[] dialogShown = new boolean[1];
TestDialog oldTestDialog = Messages.setTestDialog(new TestDialog() {
@Override
public int show(String message) {
dialogShown[0] = message.contains("Successfully connected to") && message.contains("Do you want to proceed anyway?");
return 1;
}
});
try {
registerDefaultShareDialogHandler();
registerDefaultUntrackedFilesDialogHandler();
createProjectFiles();
GithubShareAction.shareProjectOnGithub(myProject, myProjectRoot);
assertFalse(dialogShown[0]);
GithubShareAction.shareProjectOnGithub(myProject, myProjectRoot);
assertTrue(dialogShown[0]);
} finally {
Messages.setTestDialog(oldTestDialog);
}
}
use of com.intellij.openapi.ui.TestDialog in project android by JetBrains.
the class ForcedPluginPreviewVersionUpgradeDialog method setTestDialog.
@TestOnly
public static TestDialog setTestDialog(@NotNull TestDialog newValue) {
Application application = ApplicationManager.getApplication();
if (application != null) {
getLog().assertTrue(application.isUnitTestMode(), "This method is available for tests only");
}
TestDialog oldValue = ourTestImplementation;
ourTestImplementation = newValue;
return oldValue;
}
Aggregations