List of usage examples for com.intellij.openapi.ui TestInputDialog TestInputDialog
TestInputDialog
From source file:org.intellij.xquery.runner.ui.run.main.variables.ContextItemPanelGuiTest.java
License:Apache License
@Test public void shouldShowDialogAfterEditorContextButtonClickedAndSetValue() { final String myValue = "my Content"; final boolean[] dialogShown = { false }; initPanel(true, null, null, true, null); TestInputDialog oldDialog = Messages.setTestInputDialog(new TestInputDialog() { @Override//www . jav a2s .c o m public String show(String message) { dialogShown[0] = true; return myValue; } }); window.button(SHOW_EDITOR_BUTTON).click(); assertThat(dialogShown[0], is(true)); assertThat(panel.getContextItemEditorContent(), is(myValue)); Messages.setTestInputDialog(oldDialog); }