Class 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 given Executor ; such tests should be annotated with the RunWithCustomExecutor 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()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.annotation.Annotation

        equals, hashCode, toString
    • Constructor Detail

      • RunWithCustomExecutorRule

        public RunWithCustomExecutorRule​(java.util.concurrent.ExecutorService executor)
        Note : the lifecycle of the the executor should be managed outside this class.
        Parameters:
        executor - The executor to use to run tests in.
    • 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 interface org.junit.rules.TestRule
      • annotationType

        public java.lang.Class<? extends java.lang.annotation.Annotation> annotationType()
        Specified by:
        annotationType in interface java.lang.annotation.Annotation
      • order

        public int order()