use of com.intellij.execution.testframework.sm.runner.SMTestProxy in project intellij-community by JetBrains.
the class SMTRunnerFiltersTest method testShowIgnoredHidePassed.
public void testShowIgnoredHidePassed() {
TestConsoleProperties.HIDE_PASSED_TESTS.set(myProperties, true);
final SMTRunnerTreeStructure treeStructure = myResultsForm.getTreeBuilder().getSMRunnerTreeStructure();
final Object[] suites = treeStructure.getChildElements(mySuite);
assertTrue(suites.length == 1);
final Object[] tests = treeStructure.getChildElements(suites[0]);
assertTrue(tests.length == 1);
assertTrue(tests[0] instanceof SMTestProxy && "testIgnored1".equals(((SMTestProxy) tests[0]).getName()));
}
use of com.intellij.execution.testframework.sm.runner.SMTestProxy in project intellij-community by JetBrains.
the class SMTRunnerUIActionsHandlerTest method testSelectFirstDeffect_Error.
public void testSelectFirstDeffect_Error() {
TestConsoleProperties.SELECT_FIRST_DEFECT.set(myProperties, true);
mySuite.setStarted();
final SMTestProxy testsSuite = createSuiteProxy("my suite", mySuite);
testsSuite.setStarted();
// passed test
final SMTestProxy testPassed1 = createTestProxy("testPassed1", testsSuite);
testPassed1.setStarted();
//failed test
final SMTestProxy testError = createTestProxy("testError", testsSuite);
testError.setStarted();
myUIActionsHandler.onTestNodeAdded(myResultsViewer, testError);
assertNull(mySelectedTestProxy);
testError.setTestFailed("", "", true);
//myUIActionsHandler.onTestFinished(testFailed1);
assertNull(mySelectedTestProxy);
// passed test numer 2
mySelectedTestProxy = null;
final SMTestProxy testPassed2 = createTestProxy("testPassed2", testsSuite);
testPassed2.setStarted();
myUIActionsHandler.onTestNodeAdded(myResultsViewer, testPassed2);
assertNull(mySelectedTestProxy);
testPassed2.setFinished();
//myUIActionsHandler.onTestFinished(testPassed2);
assertNull(mySelectedTestProxy);
//failed test
final SMTestProxy testFailed2 = createTestProxy("testFailed1", testsSuite);
testFailed2.setStarted();
myUIActionsHandler.onTestNodeAdded(myResultsViewer, testFailed2);
assertNull(mySelectedTestProxy);
testFailed2.setTestFailed("", "", false);
//myUIActionsHandler.onTestFinished(testFailed2);
assertNull(mySelectedTestProxy);
// finish suite
testsSuite.setFinished();
assertNull(mySelectedTestProxy);
//testing finished
mySuite.setFinished();
assertNull(mySelectedTestProxy);
myUIActionsHandler.onTestingFinished(myResultsViewer);
assertEquals(testError, mySelectedTestProxy);
}
use of com.intellij.execution.testframework.sm.runner.SMTestProxy in project intellij-community by JetBrains.
the class SMTRunnerUIActionsHandlerTest method testSelectFirstDefect_Priority_Pending.
public void testSelectFirstDefect_Priority_Pending() {
// Priority: error -> failure
TestConsoleProperties.SELECT_FIRST_DEFECT.set(myProperties, true);
mySuite.setStarted();
final SMTestProxy testsSuite = createSuiteProxy("my suite", mySuite);
testsSuite.setStarted();
// pending test
final SMTestProxy testPending = createTestProxy("testPending", testsSuite);
testPending.setStarted();
myUIActionsHandler.onTestNodeAdded(myResultsViewer, testPending);
testPending.setTestIgnored("", "");
// finish suite
testsSuite.setFinished();
assertNull(mySelectedTestProxy);
//testing finished
mySuite.setFinished();
assertNull(mySelectedTestProxy);
myUIActionsHandler.onTestingFinished(myResultsViewer);
// pending tests shouldn't be considered as errors/failures
assertNull(mySelectedTestProxy);
}
use of com.intellij.execution.testframework.sm.runner.SMTestProxy in project intellij-community by JetBrains.
the class SMTRunnerUIActionsHandlerTest method testSelectFirstDefect_Priority_Failure.
public void testSelectFirstDefect_Priority_Failure() {
// Priority: error -> failure
TestConsoleProperties.SELECT_FIRST_DEFECT.set(myProperties, true);
mySuite.setStarted();
final SMTestProxy testsSuite = createSuiteProxy("my suite", mySuite);
testsSuite.setStarted();
// pending test
final SMTestProxy testPending = createTestProxy("testPending", testsSuite);
testPending.setStarted();
myUIActionsHandler.onTestNodeAdded(myResultsViewer, testPending);
testPending.setTestIgnored("", "");
//failed test
final SMTestProxy testFailed = createTestProxy("testFailed", testsSuite);
testFailed.setStarted();
myUIActionsHandler.onTestNodeAdded(myResultsViewer, testFailed);
testFailed.setTestFailed("", "", false);
// Second failed test just to check that first failed will be selected
final SMTestProxy testFailed2 = createTestProxy("testFailed2", testsSuite);
testFailed2.setStarted();
myUIActionsHandler.onTestNodeAdded(myResultsViewer, testFailed2);
testFailed2.setTestFailed("", "", false);
// finish suite
testsSuite.setFinished();
assertNull(mySelectedTestProxy);
//testing finished
mySuite.setFinished();
assertNull(mySelectedTestProxy);
myUIActionsHandler.onTestingFinished(myResultsViewer);
assertEquals(testFailed, mySelectedTestProxy);
}
use of com.intellij.execution.testframework.sm.runner.SMTestProxy in project intellij-community by JetBrains.
the class SMTestRunnerResultsFormTest method testCustomProgress_Failure.
public void testCustomProgress_Failure() {
myResultsViewer.onCustomProgressTestsCategory("foo", 4);
final SMTestProxy test1 = createTestProxy("some_test1", myTestsRootNode);
myResultsViewer.onTestStarted(test1);
myResultsViewer.onCustomProgressTestStarted();
myResultsViewer.onTestFailed(test1);
assertEquals(0, myResultsViewer.getFailedTestCount());
myResultsViewer.onCustomProgressTestFailed();
assertEquals(1, myResultsViewer.getFailedTestCount());
assertEquals(ColorProgressBar.RED, myResultsViewer.getTestsStatusColor());
}
Aggregations