Search in sources :

Example 11 with MockTreeModelListener

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

the class BuckEventsConsumerTest method hasUIWorkBeenDoneOnNonAwtThreadInConsumeBuckProjectGenerationProgressThenFail.

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

Example 12 with MockTreeModelListener

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

the class BuckEventsConsumerTest method hasUIWorkBeenDoneOnNonAwtThreadInAttachThenFail.

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

Example 13 with MockTreeModelListener

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

the class BuckEventsConsumerTest method hasUIWorkBeenDoneOnNonAwtThreadInConsumeConsoleEventThenFail.

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

Example 14 with MockTreeModelListener

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

the class BuckEventsConsumerTest method hasUIWorkBeenDoneOnNonAwtThreadInConsumeInstallFinishedThenFail.

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

Example 15 with MockTreeModelListener

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

the class BuckEventsConsumerTest method hasUIWorkBeenDoneOnNonAwtThreadInConsumeTestRunCompleteThenFail.

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

Aggregations

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