Search in sources :

Example 1 with Marker

use of com.intellij.execution.testframework.sm.Marker in project intellij-community by JetBrains.

the class GeneralToSMTRunnerEventsConvertorTest method testOnFinishedTesting_twice.

public void testOnFinishedTesting_twice() {
    myEventsProcessor.onFinishTesting();
    final Marker finishedMarker = new Marker();
    myEventsProcessor.addEventsListener(new SMTRunnerEventsAdapter() {

        @Override
        public void onTestingFinished(@NotNull SMTestProxy.SMRootTestProxy testsRoot) {
            finishedMarker.set();
        }
    });
    myEventsProcessor.onFinishTesting();
    assertFalse(finishedMarker.isSet());
}
Also used : Marker(com.intellij.execution.testframework.sm.Marker)

Example 2 with Marker

use of com.intellij.execution.testframework.sm.Marker in project intellij-community by JetBrains.

the class SMTestRunnerResultsFormTest method testChangeSelectionAction.

public void testChangeSelectionAction() {
    final Marker onSelectedHappend = new Marker();
    final Ref<SMTestProxy> proxyRef = new Ref<>();
    final Ref<Boolean> focusRequestedRef = new Ref<>();
    myResultsViewer.setShowStatisticForProxyHandler(new PropagateSelectionHandler() {

        @Override
        public void handlePropagateSelectionRequest(@Nullable final SMTestProxy selectedTestProxy, @NotNull final Object sender, final boolean requestFocus) {
            onSelectedHappend.set();
            proxyRef.set(selectedTestProxy);
            focusRequestedRef.set(requestFocus);
        }
    });
    final SMTestProxy suite = createSuiteProxy("suite", myTestsRootNode);
    final SMTestProxy test = createTestProxy("test", myTestsRootNode);
    myResultsViewer.onSuiteStarted(suite);
    myResultsViewer.onTestStarted(test);
    //On test
    myResultsViewer.selectAndNotify(test);
    myResultsViewer.showStatisticsForSelectedProxy();
    assertTrue(onSelectedHappend.isSet());
    assertEquals(test, proxyRef.get());
    assertTrue(focusRequestedRef.get());
    //on suite
    //reset markers
    onSelectedHappend.reset();
    proxyRef.set(null);
    focusRequestedRef.set(null);
    myResultsViewer.selectAndNotify(suite);
    myResultsViewer.showStatisticsForSelectedProxy();
    assertTrue(onSelectedHappend.isSet());
    assertEquals(suite, proxyRef.get());
    assertTrue(focusRequestedRef.get());
}
Also used : SMTestProxy(com.intellij.execution.testframework.sm.runner.SMTestProxy) Ref(com.intellij.openapi.util.Ref) Marker(com.intellij.execution.testframework.sm.Marker)

Aggregations

Marker (com.intellij.execution.testframework.sm.Marker)2 SMTestProxy (com.intellij.execution.testframework.sm.runner.SMTestProxy)1 Ref (com.intellij.openapi.util.Ref)1