use of com.facebook.buck.intellij.ideabuck.test.util.MockTreeModelListener in project buck by facebook.
the class BuckEventsConsumerTest method hasUIWorkBeenDoneOnNonAwtThreadInConsumeBuildEndThenFail.
@Test
public void hasUIWorkBeenDoneOnNonAwtThreadInConsumeBuildEndThenFail() {
DefaultTreeModel treeModel = new DefaultTreeModel(null);
BuckEventsConsumer buckEventsConsumer = initialiseEventsConsumer();
MockTreeModelListener listener = addListeners(treeModel);
buckEventsConsumer.attach(null, treeModel);
assertFalse(listener.calledOnWrongThread);
assertTrue(buckEventsConsumer.isAttached());
buckEventsConsumer.consumeBuildEnd(0);
assertFalse(listener.calledOnWrongThread);
}
use of com.facebook.buck.intellij.ideabuck.test.util.MockTreeModelListener in project buck by facebook.
the class BuckEventsConsumerTest method hasUIWorkBeenDoneOnNonAwtThreadInConsumeParseRuleEndThenFail.
@Test
public void hasUIWorkBeenDoneOnNonAwtThreadInConsumeParseRuleEndThenFail() {
DefaultTreeModel treeModel = new DefaultTreeModel(null);
BuckEventsConsumer buckEventsConsumer = initialiseEventsConsumer();
MockTreeModelListener listener = addListeners(treeModel);
buckEventsConsumer.attach(null, treeModel);
assertFalse(listener.calledOnWrongThread);
assertTrue(buckEventsConsumer.isAttached());
buckEventsConsumer.consumeParseRuleEnd(0);
assertFalse(listener.calledOnWrongThread);
}
use of com.facebook.buck.intellij.ideabuck.test.util.MockTreeModelListener in project buck by facebook.
the class BuckEventsConsumerTest method hasUIWorkBeenDoneOnNonAwtThreadInConsumeParseRuleStartThenFail.
@Test
public void hasUIWorkBeenDoneOnNonAwtThreadInConsumeParseRuleStartThenFail() {
DefaultTreeModel treeModel = new DefaultTreeModel(null);
BuckEventsConsumer buckEventsConsumer = initialiseEventsConsumer();
MockTreeModelListener listener = addListeners(treeModel);
buckEventsConsumer.attach(null, treeModel);
assertFalse(listener.calledOnWrongThread);
assertTrue(buckEventsConsumer.isAttached());
buckEventsConsumer.consumeParseRuleStart(0);
assertFalse(listener.calledOnWrongThread);
}
use of com.facebook.buck.intellij.ideabuck.test.util.MockTreeModelListener in project buck by facebook.
the class BuckEventsConsumerTest method hasUIWorkBeenDoneOnNonAwtThreadInConsumeCompilerErrorThenFail.
@Test
public void hasUIWorkBeenDoneOnNonAwtThreadInConsumeCompilerErrorThenFail() {
DefaultTreeModel treeModel = new DefaultTreeModel(null);
BuckEventsConsumer buckEventsConsumer = initialiseEventsConsumer();
MockTreeModelListener listener = addListeners(treeModel);
buckEventsConsumer.attach(null, treeModel);
assertFalse(listener.calledOnWrongThread);
assertTrue(buckEventsConsumer.isAttached());
buckEventsConsumer.consumeCompilerError("", 0, "", ImmutableSet.<String>of());
assertFalse(listener.calledOnWrongThread);
}
use of com.facebook.buck.intellij.ideabuck.test.util.MockTreeModelListener in project buck by facebook.
the class BuckEventsConsumerTest method addListeners.
public MockTreeModelListener addListeners(DefaultTreeModel treeModel) {
final MockTreeModelListener listener = new MockTreeModelListener();
// We need at least 2 listeners
treeModel.addTreeModelListener(listener);
treeModel.addTreeModelListener(new MockTreeModelListener());
treeModel.addTreeModelListener(new MockTreeModelListener());
return listener;
}
Aggregations