Class EventLoopGroupExtension

java.lang.Object
com.linecorp.armeria.testing.junit5.common.AbstractAllOrEachExtension
com.linecorp.armeria.testing.junit5.common.EventLoopGroupExtension
All Implemented Interfaces:
AfterAllCallback, AfterEachCallback, BeforeAllCallback, BeforeEachCallback, Extension

public class EventLoopGroupExtension
extends AbstractAllOrEachExtension
An Extension that provides an EventLoopGroup. For example:

 > public class MyTest {
 >     @RegisterExtension
 >     public static final EventLoopGroupExtension eventLoopGroup = new EventLoopGroupExtension(4);
 >
 >     @Test
 >     public void test() {
 >         ClientFactory f = ClientFactory.builder()
 >                                        .workerGroup(eventLoopGroup.get())
 >                                        .build();
 >         ...
 >     }
 > }
 
See Also:
EventLoopExtension
  • Constructor Details

    • EventLoopGroupExtension

      public EventLoopGroupExtension​(int numThreads)
      Creates a new Extension that provides an EventLoopGroup.
      Parameters:
      numThreads - the number of event loop threads
    • EventLoopGroupExtension

      public EventLoopGroupExtension​(int numThreads, boolean useDaemonThreads)
      Creates a new Extension that provides an EventLoopGroup.
      Parameters:
      numThreads - the number of event loop threads
      useDaemonThreads - whether to create daemon threads or not
    • EventLoopGroupExtension

      public EventLoopGroupExtension​(int numThreads, String threadNamePrefix)
      Creates a new Extension that provides an EventLoopGroup.
      Parameters:
      numThreads - the number of event loop threads
      threadNamePrefix - the prefix of thread names
    • EventLoopGroupExtension

      public EventLoopGroupExtension​(int numThreads, String threadNamePrefix, boolean useDaemonThreads)
      Creates a new Extension that provides an EventLoopGroup.
      Parameters:
      numThreads - the number of event loop threads
      threadNamePrefix - the prefix of thread names
      useDaemonThreads - whether to create daemon threads or not
  • Method Details