@Before public void setUp() { mongoEditionPanel = GuiActionRunner.execute(new GuiQuery<MongoEditionPanel>() { protected MongoEditionPanel executeInEDT() { return new MongoEditionPanel(mockMongoOperations, mockActionCallback) { @Override void buildPopupMenu() { } }; } }); }
@Override protected void executeInEDT() throws Throwable { task.run(); } });
@Nonnull private static FailOnThreadViolationRepaintManager installNew() { FailOnThreadViolationRepaintManager m = new FailOnThreadViolationRepaintManager(); previousRepaintManager = currentRepaintManager(); setCurrentManager(m); return m; }
/** * Executes {@link #loadDescription()} in the event dispatch thread (EDT). * * @return the text loaded in the event dispatch thread (EDT). */ @Override public final @Nonnull String value() { String result = execute(() -> loadDescription()); return checkNotNull(result); }
@Nullable private static <T> T resultOf(@Nonnull GuiQuery<T> query) { T result = query.result(); query.clearResult(); rethrowCaughtExceptionIn(query); return result; }
/** * Installs a <code>{@link FailOnThreadViolationRepaintManager}</code> to catch violations of Swing threading rules. */ @BeforeClass(alwaysRun = true) public final void setUpOnce() { FailOnThreadViolationRepaintManager.install(); }
/** * Removes the <code>{@link FailOnThreadViolationRepaintManager}</code> again to allow EDT violating and EDT safe * tests in the same suite. */ @AfterClass(alwaysRun = true) public static final void tearDownOnce() { FailOnThreadViolationRepaintManager.uninstall(); }
final void notifyExecutionCompleted() { executedInEDT(); if (executionNotification == null) { return; } executionNotification.countDown(); executionNotification = null; }
@Override public void addDirtyRegion(JComponent component, int x, int y, int w, int h) { checkThreadViolations(checkNotNull(component)); super.addDirtyRegion(component, x, y, w, h); }
@Before public void setUp() { MockitoAnnotations.initMocks(MongoResultPanelTest.class); mongoResultPanel = GuiActionRunner.execute(new GuiQuery<MongoResultPanel>() { protected MongoResultPanel executeInEDT() { return new MongoResultPanel(DummyProject.getInstance(), mongoDocumentOperations, notifierMock); } }); frameFixture = Containers.showInFrame(mongoResultPanel); }
/** * Installs a <code>{@link FailOnThreadViolationRepaintManager}</code> to catch violations of Swing threading rules. */ @BeforeClass public static final void setUpOnce() { FailOnThreadViolationRepaintManager.install(); }
/** * Removes the <code>{@link FailOnThreadViolationRepaintManager}</code> again to allow EDT violating and EDT safe * tests in the same suite. */ @AfterClass public static final void tearDownOnce() { FailOnThreadViolationRepaintManager.uninstall(); }
@Before public void setUp() { mongoManager = Mockito.spy(new MongoManager()); configurationPanel = GuiActionRunner.execute(new GuiQuery<ServerConfigurationPanel>() { protected ServerConfigurationPanel executeInEDT() { return new ServerConfigurationPanel(DummyProject.getInstance(), mongoManager); } }); frameFixture = Containers.showInFrame(configurationPanel); }
/** * Installs a <code>{@link FailOnThreadViolationRepaintManager}</code> to catch violations of Swing threading rules. */ @BeforeClass public static final void setUpOnce() { FailOnThreadViolationRepaintManager.install(); }
/** * Removes the <code>{@link FailOnThreadViolationRepaintManager}</code> again to allow EDT violating and EDT safe * tests in the same suite. */ @AfterClass public static final void tearDownOnce() { FailOnThreadViolationRepaintManager.uninstall(); }
public void fillForm(String url) { GuiActionRunner.execute(() -> component.form.urlField.setText(url)); }
void set(TriStateBoolean value) { execute(() -> { component.set(value); }); }
void enable(boolean savePasswordsConsent) { GuiActionRunner.execute(() -> component.setEnabled(true, savePasswordsConsent)); }
void disable(boolean savePasswordsConsent) { GuiActionRunner.execute(() -> component.setEnabled(false, savePasswordsConsent)); }
@RunsInEDT private static void doDisposeFrames() { execute(() -> { for (Frame f : Frame.getFrames()) { f.dispose(); } }); } }