Package fr.gouv.vitam.common.thread
Class RunWithCustomExecutorRule
- java.lang.Object
-
- fr.gouv.vitam.common.thread.RunWithCustomExecutorRule
-
- All Implemented Interfaces:
java.lang.annotation.Annotation
,org.junit.rules.TestRule
public class RunWithCustomExecutorRule extends java.lang.Object implements org.junit.rules.TestRule, org.junit.ClassRule
Junit Test rule used to run tests with a givenExecutor
; such tests should be annotated with theRunWithCustomExecutor
annotation. Mainly designed to allow tests to be run inside VitamThread Usage example :public class ExampleTest { @Rule public RunWithCustomExecutorRule runInThread = new RunWithCustomExecutorRule(VitamThreadPoolExecutor.getDefaultExecutor()); @Test @RunWithCustomExecutor public void runInVitamThreadTest() { [...] } }
- See Also:
RunWithCustomExecutor
-
-
Constructor Summary
Constructors Constructor Description RunWithCustomExecutorRule(java.util.concurrent.ExecutorService executor)
Note : the lifecycle of the the executor should be managed outside this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<? extends java.lang.annotation.Annotation>
annotationType()
org.junit.runners.model.Statement
apply(org.junit.runners.model.Statement base, org.junit.runner.Description description)
int
order()
-
-
-
Method Detail
-
apply
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description)
- Specified by:
apply
in interfaceorg.junit.rules.TestRule
-
annotationType
public java.lang.Class<? extends java.lang.annotation.Annotation> annotationType()
- Specified by:
annotationType
in interfacejava.lang.annotation.Annotation
-
order
public int order()
-
-