use of com.intellij.execution.testframework.sm.runner.SMTestProxy 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());
}
use of com.intellij.execution.testframework.sm.runner.SMTestProxy in project intellij-community by JetBrains.
the class SMTestRunnerResultsFormTest method testCustomProgress_Terminated.
public void testCustomProgress_Terminated() {
myResultsViewer.onTestingStarted(myTestsRootNode);
final SMTestProxy test1 = createTestProxy("some_test1", myTestsRootNode);
myResultsViewer.onTestStarted(test1);
myResultsViewer.onTestingFinished(myTestsRootNode);
assertEquals(ColorProgressBar.GREEN, myResultsViewer.getTestsStatusColor());
}
use of com.intellij.execution.testframework.sm.runner.SMTestProxy in project intellij-community by JetBrains.
the class SMTestRunnerResultsFormTest method testOnTestFailure.
public void testOnTestFailure() {
final SMTestProxy test = createTestProxy(myTestsRootNode);
myResultsViewer.onTestStarted(test);
myResultsViewer.onTestFailed(test);
assertEquals(1, myResultsViewer.getFailedTestCount());
assertEquals(1, myResultsViewer.getFailedTestCount());
}
use of com.intellij.execution.testframework.sm.runner.SMTestProxy in project intellij-community by JetBrains.
the class SMTestRunnerResultsFormTest method testCustomProgress_EmptySuite.
public void testCustomProgress_EmptySuite() {
myResultsViewer.onCustomProgressTestsCategory("foo", 0);
final SMTestProxy suite = createSuiteProxy("some_suite", myTestsRootNode);
myTestsRootNode.setStarted();
myResultsViewer.onSuiteStarted(suite);
suite.setStarted();
suite.setFinished();
myResultsViewer.onSuiteFinished(suite);
myTestsRootNode.setFinished();
myResultsViewer.onSuiteFinished(myTestsRootNode);
myResultsViewer.onTestingFinished(myTestsRootNode);
assertEquals(0, myResultsViewer.getTotalTestCount());
assertEquals(Color.LIGHT_GRAY, myResultsViewer.getTestsStatusColor());
}
use of com.intellij.execution.testframework.sm.runner.SMTestProxy in project intellij-community by JetBrains.
the class SMTestRunnerResultsFormTest method testCustomProgress_Terminated_SmthFailed.
public void testCustomProgress_Terminated_SmthFailed() {
myResultsViewer.onTestingStarted(myTestsRootNode);
final SMTestProxy test1 = createTestProxy("some_test1", myTestsRootNode);
myResultsViewer.onTestStarted(test1);
myResultsViewer.onTestFailed(test1);
myResultsViewer.onTestStarted(createTestProxy("some_test2", myTestsRootNode));
myResultsViewer.onTestingFinished(myTestsRootNode);
assertEquals(ColorProgressBar.RED, myResultsViewer.getTestsStatusColor());
}
Aggregations