Class JunitCustomStrategy
-
- All Implemented Interfaces:
-
org.junit.platform.engine.support.hierarchical.ParallelExecutionConfiguration,org.junit.platform.engine.support.hierarchical.ParallelExecutionConfigurationStrategy
public final class JunitCustomStrategy implements ParallelExecutionConfiguration, ParallelExecutionConfigurationStrategyПользовательская стратегия (custom strategy) для реализации параллелизации запуска автотестов.
Количество автотестов, запускаемых одновременно, равно количеству логических ядер процессора.
В настройках проекта следует указать следующие свойства:
junit.jupiter.execution.parallel.enabled=true junit.jupiter.execution.parallel.config.strategy=custom junit.jupiter.execution.parallel.config.custom.class=io.bitbucket.dsmoons.framework.odk.JunitCustomStrategyУ тестового класса указать аннотацию
@Execution(ExecutionMode.CONCURRENT)
-
-
Field Summary
Fields Modifier and Type Field Description private final IntegermaxPoolSizeprivate final IntegerkeepAliveSecondsprivate final Predicate<in ForkJoinPool>saturatePredicateprivate final IntegerminimumRunnableprivate final Integerparallelismprivate final IntegercorePoolSize
-
Constructor Summary
Constructors Constructor Description JunitCustomStrategy()Конструктор
-
Method Summary
Modifier and Type Method Description IntegergetParallelism()IntegergetMinimumRunnable()IntegergetMaxPoolSize()IntegergetCorePoolSize()IntegergetKeepAliveSeconds()ParallelExecutionConfigurationcreateConfiguration(ConfigurationParameters parameters)-
Methods inherited from class io.bitbucket.dsmoons.framework.odk.JunitCustomStrategy
getCorePoolSize, getKeepAliveSeconds, getMaxPoolSize, getMinimumRunnable, getParallelism -
Methods inherited from class org.junit.platform.engine.support.hierarchical.ParallelExecutionConfiguration
getSaturatePredicate -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getParallelism
Integer getParallelism()
-
getMinimumRunnable
Integer getMinimumRunnable()
-
getMaxPoolSize
Integer getMaxPoolSize()
-
getCorePoolSize
Integer getCorePoolSize()
-
getKeepAliveSeconds
Integer getKeepAliveSeconds()
-
createConfiguration
ParallelExecutionConfiguration createConfiguration(ConfigurationParameters parameters)
-
-
-
-