List of usage examples for com.intellij.openapi.ui Messages setTestInputDialog
@TestOnly public static TestInputDialog setTestInputDialog(TestInputDialog newValue)
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//from w w w . jav a 2 s .c om 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); }