本文整理汇总了Java中com.intellij.openapi.ui.TestDialog类的典型用法代码示例。如果您正苦于以下问题:Java TestDialog类的具体用法?Java TestDialog怎么用?Java TestDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TestDialog类属于com.intellij.openapi.ui包,在下文中一共展示了TestDialog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: tearDown
import com.intellij.openapi.ui.TestDialog; //导入依赖的package包/类
@Override
public void tearDown() throws Exception {
if (myJdkHome == null) {
//super.setUp() wasn't called
return;
}
try {
new WriteAction() {
@Override
protected void run(@NotNull Result result) throws Throwable {
Sdk old = ProjectJdkTable.getInstance().findJdk(GRADLE_JDK_NAME);
if (old != null) {
SdkConfigurationUtil.removeSdk(old);
}
}
}.execute();
Messages.setTestDialog(TestDialog.DEFAULT);
FileUtil.delete(BuildManager.getInstance().getBuildSystemDirectory());
}
finally {
super.tearDown();
}
}
示例2: testGithubAlreadyExists
import com.intellij.openapi.ui.TestDialog; //导入依赖的package包/类
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);
}
}
示例3: done
import com.intellij.openapi.ui.TestDialog; //导入依赖的package包/类
@After
public void done() throws Throwable {
testApplication.waitForBackgroundActivityToFinish();
if(handler != null) {
handler.finish();
}
Assert.assertTrue("Unhandled messages: " + testMessages.asString(), testMessages.isEmpty());
Messages.setTestDialog(TestDialog.DEFAULT);
List<Exception> ex = errorService._shiftErrors();
Assert.assertTrue("Unhandled exceptions: " + ex.toString(), ex.isEmpty());
for(EntityListener listener: entityListeners) {
entityService.removeEntityListener(listener);
}
getComponent(DetailUtil.class)._restore();
if(isIsolated()) {
handler.getServer().stop();
}
}
示例4: configConfirmationForYesAnswer
import com.intellij.openapi.ui.TestDialog; //导入依赖的package包/类
protected static AtomicInteger configConfirmationForYesAnswer() {
final AtomicInteger counter = new AtomicInteger();
Messages.setTestDialog(new TestDialog() {
@Override
public int show(String message) {
counter.set(counter.get() + 1);
return 0;
}
});
return counter;
}
示例5: configConfirmationForNoAnswer
import com.intellij.openapi.ui.TestDialog; //导入依赖的package包/类
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;
}
示例6: tearDown
import com.intellij.openapi.ui.TestDialog; //导入依赖的package包/类
@Override
protected void tearDown() throws Exception {
try {
if (myGlobalSettingsFile != null) {
VfsRootAccess.disallowRootAccess(myGlobalSettingsFile.getAbsolutePath());
}
VfsRootAccess.disallowRootAccess(PathManager.getConfigPath());
Messages.setTestDialog(TestDialog.DEFAULT);
removeFromLocalRepository("test");
FileUtil.delete(BuildManager.getInstance().getBuildSystemDirectory());
}
finally {
super.tearDown();
}
}
示例7: undo
import com.intellij.openapi.ui.TestDialog; //导入依赖的package包/类
protected void undo() {
UIUtil.invokeAndWaitIfNeeded(new Runnable() {
@Override
public void run() {
final TestDialog oldTestDialog = Messages.setTestDialog(TestDialog.OK);
try {
UndoManager.getInstance(myProject).undo(null);
}
finally {
Messages.setTestDialog(oldTestDialog);
}
}
});
}
示例8: tearDown
import com.intellij.openapi.ui.TestDialog; //导入依赖的package包/类
@Override
public void tearDown() throws Exception {
// TODO thread leak either a IJ bug https://youtrack.jetbrains.com/issue/IDEA-155496
// or a pants plugin bug https://github.com/pantsbuild/intellij-pants-plugin/issues/130
// Temporarily ignore the following 'leaking' threads to pass CI.
ThreadTracker.longRunningThreadCreated(
ApplicationManager.getApplication(),
"BaseDataReader",
"ProcessWaitFor",
"Timer"
);
try {
if (myCompilerTester != null) {
myCompilerTester.tearDown();
}
// Kill nailgun after usage as memory on travis is limited, at a cost of slower later builds.
killNailgun();
cleanProjectRoot();
Messages.setTestDialog(TestDialog.DEFAULT);
// TODO(cosmicexplorer): after updating from 172.4343.14 to 173.3531.6,
// intellij's provided test class sometimes yells about a leaky jdk
// table. i don't think this indicates any problems, so for now if tests
// fail with leaky sdk errors, broaden this to include the leaked sdks.
removeJdks(jdk -> jdk.getName().contains("pants"));
super.tearDown();
}
catch (Throwable throwable) {
// Discard error containing "Already disposed".
if (!throwable.getMessage().contains("Already disposed")) {
throw throwable;
}
}
}
示例9: tearDown
import com.intellij.openapi.ui.TestDialog; //导入依赖的package包/类
@Override
protected void tearDown() throws Exception {
Messages.setTestDialog(TestDialog.DEFAULT);
myProjectsManager.projectClosed();
removeFromLocalRepository("test");
if (useJps()) {
FileUtil.delete(BuildManager.getInstance().getBuildSystemDirectory());
}
super.tearDown();
}
示例10: doOverrideTest
import com.intellij.openapi.ui.TestDialog; //导入依赖的package包/类
public void doOverrideTest(String testFile, TestDialog answer) throws Throwable {
Messages.setTestDialog(answer);
myFixture.configureByFiles(testFile, "com/bar/TestSearchOverrides.hx");
myFixture.copyFileToProject(getResultsPath());
compareExpectedUsages(findUsages());
}
示例11: testLogSimple
import com.intellij.openapi.ui.TestDialog; //导入依赖的package包/类
public void testLogSimple() throws Exception {
Messages.setTestDialog(TestDialog.DEFAULT);
doTest();
}
示例12: testLogRename
import com.intellij.openapi.ui.TestDialog; //导入依赖的package包/类
public void testLogRename() throws Exception {
Messages.setTestDialog(TestDialog.OK);
doTest();
}
示例13: testLogPublic
import com.intellij.openapi.ui.TestDialog; //导入依赖的package包/类
public void testLogPublic() throws Exception {
Messages.setTestDialog(TestDialog.OK);
doTest();
}
示例14: testLogNonStatic
import com.intellij.openapi.ui.TestDialog; //导入依赖的package包/类
public void testLogNonStatic() throws Exception {
Messages.setTestDialog(TestDialog.OK);
doTest();
}
示例15: testLogNonFinal
import com.intellij.openapi.ui.TestDialog; //导入依赖的package包/类
public void testLogNonFinal() throws Exception {
Messages.setTestDialog(TestDialog.OK);
doTest();
}