Search in sources :

Example 6 with MockTreeModelListener

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

the class BuckEventsConsumerTest method hasUIWorkBeenDoneOnNonAwtThreadInConsumeBuckBuildProgressUpdateThenFail.

@Test
public void hasUIWorkBeenDoneOnNonAwtThreadInConsumeBuckBuildProgressUpdateThenFail() {
    DefaultTreeModel treeModel = new DefaultTreeModel(null);
    BuckEventsConsumer buckEventsConsumer = initialiseEventsConsumer();
    MockTreeModelListener listener = addListeners(treeModel);
    buckEventsConsumer.attach(null, treeModel);
    assertFalse(listener.calledOnWrongThread);
    assertTrue(buckEventsConsumer.isAttached());
    buckEventsConsumer.consumeBuckBuildProgressUpdate(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 7 with MockTreeModelListener

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

the class BuckEventsConsumerTest method hasUIWorkBeenDoneOnNonAwtThreadInConsumeTestRunStartedThenFail.

@Test
public void hasUIWorkBeenDoneOnNonAwtThreadInConsumeTestRunStartedThenFail() {
    DefaultTreeModel treeModel = new DefaultTreeModel(null);
    BuckEventsConsumer buckEventsConsumer = initialiseEventsConsumer();
    MockTreeModelListener listener = addListeners(treeModel);
    buckEventsConsumer.attach(null, treeModel);
    assertFalse(listener.calledOnWrongThread);
    assertTrue(buckEventsConsumer.isAttached());
    buckEventsConsumer.consumeTestRunStarted(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 8 with MockTreeModelListener

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

the class BuckEventsConsumerTest method hasUIWorkBeenDoneOnNonAwtThreadInConsumeBuildStartThenFail.

@Test
public void hasUIWorkBeenDoneOnNonAwtThreadInConsumeBuildStartThenFail() {
    DefaultTreeModel treeModel = new DefaultTreeModel(null);
    BuckEventsConsumer buckEventsConsumer = initialiseEventsConsumer();
    MockTreeModelListener listener = addListeners(treeModel);
    buckEventsConsumer.attach(null, treeModel);
    assertFalse(listener.calledOnWrongThread);
    assertTrue(buckEventsConsumer.isAttached());
    buckEventsConsumer.consumeBuildStart(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 9 with MockTreeModelListener

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

the class BuckEventsConsumerTest method hasUIWorkBeenDoneOnNonAwtThreadInConsumeParseRuleProgressUpdateThenFail.

@Test
public void hasUIWorkBeenDoneOnNonAwtThreadInConsumeParseRuleProgressUpdateThenFail() {
    DefaultTreeModel treeModel = new DefaultTreeModel(null);
    BuckEventsConsumer buckEventsConsumer = initialiseEventsConsumer();
    MockTreeModelListener listener = addListeners(treeModel);
    buckEventsConsumer.attach(null, treeModel);
    assertFalse(listener.calledOnWrongThread);
    assertTrue(buckEventsConsumer.isAttached());
    buckEventsConsumer.consumeParseRuleProgressUpdate(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 10 with MockTreeModelListener

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

the class BuckEventsConsumerTest method hasUIWorkBeenDoneOnNonAwtThreadInConsumeBuckProjectGenerationFinishedThenFail.

@Test
public void hasUIWorkBeenDoneOnNonAwtThreadInConsumeBuckProjectGenerationFinishedThenFail() {
    DefaultTreeModel treeModel = new DefaultTreeModel(null);
    BuckEventsConsumer buckEventsConsumer = initialiseEventsConsumer();
    MockTreeModelListener listener = addListeners(treeModel);
    buckEventsConsumer.attach(null, treeModel);
    assertFalse(listener.calledOnWrongThread);
    assertTrue(buckEventsConsumer.isAttached());
    buckEventsConsumer.consumeBuckProjectGenerationFinished(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