Search in sources :

Example 1 with TestFactoryTestDescriptor

use of org.junit.jupiter.engine.descriptor.TestFactoryTestDescriptor in project intellij-community by JetBrains.

the class JUnit5EventsTest method containerFailure.

@Test
void containerFailure() throws Exception {
    ClassTestDescriptor classTestDescriptor = new ClassTestDescriptor(UniqueId.forEngine("engine"), TestClass.class);
    TestDescriptor testDescriptor = new TestFactoryTestDescriptor(UniqueId.forEngine("engine1"), TestClass.class, TestClass.class.getDeclaredMethod("brokenStream"));
    TestIdentifier identifier = TestIdentifier.from(testDescriptor);
    final TestPlan testPlan = TestPlan.from(Collections.singleton(classTestDescriptor));
    myExecutionListener.sendTree(testPlan, "");
    myExecutionListener.executionStarted(identifier);
    myExecutionListener.executionFinished(identifier, TestExecutionResult.failed(new IllegalStateException()));
    Assertions.assertEquals("##teamcity[enteredTheMatrix]\n" + "##teamcity[treeEnded]\n" + "##teamcity[testSuiteStarted id='|[engine:engine1|]' name='brokenStream()']\n" + "\n" + "##teamcity[testStarted name='Class Configuration' locationHint='java:suite://com.intellij.junit5.JUnit5EventsTest$TestClass.brokenStream']\n" + "\n" + "##teamcity[testFailed name='Class Configuration' id='Class Configuration' details='TRACE' error='true' message='']\n" + "\n" + "##teamcity[testFinished name='Class Configuration']\n" + "##teamcity[testSuiteFinished  id='|[engine:engine1|]' name='brokenStream()']\n", StringUtil.convertLineSeparators(myBuf.toString()));
}
Also used : TestFactoryTestDescriptor(org.junit.jupiter.engine.descriptor.TestFactoryTestDescriptor) TestPlan(org.junit.platform.launcher.TestPlan) TestIdentifier(org.junit.platform.launcher.TestIdentifier) ClassTestDescriptor(org.junit.jupiter.engine.descriptor.ClassTestDescriptor) MethodTestDescriptor(org.junit.jupiter.engine.descriptor.MethodTestDescriptor) TestFactoryTestDescriptor(org.junit.jupiter.engine.descriptor.TestFactoryTestDescriptor) ClassTestDescriptor(org.junit.jupiter.engine.descriptor.ClassTestDescriptor) TestDescriptor(org.junit.platform.engine.TestDescriptor)

Aggregations

ClassTestDescriptor (org.junit.jupiter.engine.descriptor.ClassTestDescriptor)1 MethodTestDescriptor (org.junit.jupiter.engine.descriptor.MethodTestDescriptor)1 TestFactoryTestDescriptor (org.junit.jupiter.engine.descriptor.TestFactoryTestDescriptor)1 TestDescriptor (org.junit.platform.engine.TestDescriptor)1 TestIdentifier (org.junit.platform.launcher.TestIdentifier)1 TestPlan (org.junit.platform.launcher.TestPlan)1