Search in sources :

Example 1 with MockTestResults

use of com.facebook.buck.intellij.ideabuck.test.util.MockTestResults in project buck by facebook.

the class BuckEventsConsumerTest method hasUIWorkBeenDoneOnNonAwtThreadInConsumeTestResultsAvailableThenFail.

@Test
public void hasUIWorkBeenDoneOnNonAwtThreadInConsumeTestResultsAvailableThenFail() {
    DefaultTreeModel treeModel = new DefaultTreeModel(null);
    BuckEventsConsumer buckEventsConsumer = initialiseEventsConsumer();
    MockTreeModelListener listener = addListeners(treeModel);
    buckEventsConsumer.attach(null, treeModel);
    assertFalse(listener.calledOnWrongThread);
    assertTrue(buckEventsConsumer.isAttached());
    buckEventsConsumer.consumeTestResultsAvailable(0, new MockTestResults());
    assertFalse(listener.calledOnWrongThread);
    buckEventsConsumer.consumeTestResultsAvailable(1, new MockTestResults());
    assertFalse(listener.calledOnWrongThread);
}
Also used : MockTreeModelListener(com.facebook.buck.intellij.ideabuck.test.util.MockTreeModelListener) MockTestResults(com.facebook.buck.intellij.ideabuck.test.util.MockTestResults) DefaultTreeModel(javax.swing.tree.DefaultTreeModel) Test(org.junit.Test)

Aggregations

MockTestResults (com.facebook.buck.intellij.ideabuck.test.util.MockTestResults)1 MockTreeModelListener (com.facebook.buck.intellij.ideabuck.test.util.MockTreeModelListener)1 DefaultTreeModel (javax.swing.tree.DefaultTreeModel)1 Test (org.junit.Test)1