Class JunitApiExecutor
- java.lang.Object
-
- ru.vyarus.spock.jupiter.interceptor.JunitApiExecutor
-
public class JunitApiExecutor extends java.lang.ObjectExecutes registered extensions.Mostly a copy of
ClassBasedTestDescriptorandTestMethodTestDescriptorlogic.Note that in jupiter all such logic is aggregated in descriptors because they have to do all the work of methods execution. But spock do most of it already and that's why descriptors concept wasn't used at all. Essentially, this class contains all required code (plus
ExtensionUtils).Contexts are more equal to jupiter analog, but in context of spock much less context types is required (and overall amount of possible execution scenarios is less than in jupiter because there is no templates and nested tests).
ThrowableCollectorconcept is very limited comparing to jupiter: there it used for everything, because descriptors control all flow, but here, collectors used only for exceptions detection in extensions (and to make callbacks processing logic more equal to the original source). Also, that's why exception handler extensions are not supported (it is possible, but not so important).- Since:
- 28.12.2021
-
-
Constructor Summary
Constructors Constructor Description JunitApiExecutor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterAll(ClassContext context)voidafterEach(MethodContext context)voidafterTestExecution(MethodContext context)voidbeforeAll(ClassContext context)voidbeforeEach(MethodContext context)voidbeforeTestExecution(MethodContext context)voidhandleTestException(MethodContext context, java.lang.Throwable error)voidinstancePostProcessors(ClassContext context, java.lang.Object instance)voidinstancePreDestroy(MethodContext context)
-
-
-
Method Detail
-
beforeAll
public void beforeAll(ClassContext context)
-
instancePostProcessors
public void instancePostProcessors(ClassContext context, java.lang.Object instance)
-
beforeEach
public void beforeEach(MethodContext context)
-
beforeTestExecution
public void beforeTestExecution(MethodContext context)
-
afterTestExecution
public void afterTestExecution(MethodContext context)
-
afterEach
public void afterEach(MethodContext context)
-
instancePreDestroy
public void instancePreDestroy(MethodContext context)
-
afterAll
public void afterAll(ClassContext context)
-
handleTestException
public void handleTestException(MethodContext context, java.lang.Throwable error)
-
-