Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[incubator-kie-drools-6136] Migrate drools tests to JUnit5 - Reenable turtle tests #6207

Merged
merged 4 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion drools-compiler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

<properties>
<java.module.name>org.drools.compiler</java.module.name>
<excludedGroups>org.kie.test.testcategory.TurtleTestCategory</excludedGroups>
<surefire.forkCount>2</surefire.forkCount>
<drools.exclude.checkstyle>JavaParser.java|JavaLexer.java</drools.exclude.checkstyle>
</properties>
Expand Down
1 change: 0 additions & 1 deletion drools-mvel/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
<properties>
<java.module.name>org.drools.mvel</java.module.name>
<surefire.forkCount>2</surefire.forkCount>
<excludedGroups>org.kie.test.testcategory.TurtleTestCategory</excludedGroups>
</properties>

<dependencies>
Expand Down
21 changes: 17 additions & 4 deletions drools-test-coverage/test-compiler-integration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@

<properties>
<java.module.name>org.drools.compiler.integrationtests</java.module.name>
<excludedGroups>org.kie.test.testcategory.TurtleTestCategory</excludedGroups>
<surefire.forkCount>2</surefire.forkCount>
</properties>

Expand Down Expand Up @@ -185,9 +184,23 @@
<name>runTurtleTests</name>
</property>
</activation>
<properties>
<excludedGroups/>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemProperties>
<property>
<name>runTurtleTests</name>
<value>true</value>
</property>
</systemProperties>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>

<!-- test-compiler-integration requires test jars built by drools-test-coverage-jars -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,16 @@

import org.drools.testcoverage.common.model.A;
import org.drools.testcoverage.common.util.KieBaseTestConfiguration;
import org.junit.experimental.categories.Category;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
import org.kie.api.KieBase;
import org.kie.api.KieBaseConfiguration;
import org.kie.api.io.ResourceType;
import org.kie.api.runtime.KieSession;
import org.kie.internal.conf.ParallelExecutionOption;
import org.kie.internal.utils.KieHelper;
import org.kie.test.testcategory.TurtleTestCategory;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
Expand All @@ -39,7 +38,7 @@

import static org.assertj.core.api.Assertions.fail;

@Category(TurtleTestCategory.class)
@EnabledIfSystemProperty(named = "runTurtleTests", matches = "true")
public class CompositeAgendaTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,16 @@
import org.drools.testcoverage.common.util.KieBaseTestConfiguration;
import org.drools.testcoverage.common.util.KieBaseUtil;
import org.drools.testcoverage.common.util.TestParametersUtil2;
import org.junit.experimental.categories.Category;
import org.junit.jupiter.api.Timeout;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import org.kie.api.KieBase;
import org.kie.api.runtime.KieSession;
import org.kie.test.testcategory.TurtleTestCategory;

import static org.assertj.core.api.Assertions.assertThat;

@Category(TurtleTestCategory.class)
@EnabledIfSystemProperty(named = "runTurtleTests", matches = "true")
public class QueryConcurrencyTest {

private static int LOOP = 500;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

import org.drools.testcoverage.common.util.KieBaseTestConfiguration;
import org.drools.testcoverage.common.util.TestParametersUtil2;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;

@EnabledIfEnvironmentVariable(named = "runTurtleTests", matches = "*")
@EnabledIfSystemProperty(named = "runTurtleTests", matches = "true")
public class AccumulateFunctionConcurrencyTest extends BaseConcurrencyTest {

public static Stream<KieBaseTestConfiguration> parameters() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@

import org.drools.testcoverage.common.util.KieBaseTestConfiguration;
import org.drools.testcoverage.common.util.TestParametersUtil2;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
import org.kie.api.runtime.KieSession;

@EnabledIfEnvironmentVariable(named = "runTurtleTests", matches = "*")
@EnabledIfSystemProperty(named = "runTurtleTests", matches = "true")
public class ConsequenceConcurrencyTest extends BaseConcurrencyTest {

public static Stream<KieBaseTestConfiguration> parameters() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@

import org.drools.testcoverage.common.util.KieBaseTestConfiguration;
import org.drools.testcoverage.common.util.TestParametersUtil2;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
import org.kie.api.KieBase;
import org.kie.api.runtime.KieSession;

@EnabledIfEnvironmentVariable(named = "runTurtleTests", matches = "*")
@EnabledIfSystemProperty(named = "runTurtleTests", matches = "true")
public class ConsequenceWithAndOrConcurrencyTest extends BaseConcurrencyTest {

public static Stream<KieBaseTestConfiguration> parameters() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

import org.drools.testcoverage.common.util.KieBaseTestConfiguration;
import org.drools.testcoverage.common.util.TestParametersUtil2;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;

@EnabledIfEnvironmentVariable(named = "runTurtleTests", matches = "*")
@EnabledIfSystemProperty(named = "runTurtleTests", matches = "true")
public class ConstraintConcurrencyTest extends BaseConcurrencyTest {

public static Stream<KieBaseTestConfiguration> parameters() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@

import org.drools.testcoverage.common.util.KieBaseTestConfiguration;
import org.drools.testcoverage.common.util.TestParametersUtil2;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
import org.kie.api.KieBase;
import org.kie.api.runtime.KieSession;

@EnabledIfEnvironmentVariable(named = "runTurtleTests", matches = "*")
@EnabledIfSystemProperty(named = "runTurtleTests", matches = "true")
public class ConstraintWithAndOrConcurrencyTest extends BaseConcurrencyTest {

public static Stream<KieBaseTestConfiguration> parameters() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@

import org.drools.testcoverage.common.util.KieBaseTestConfiguration;
import org.drools.testcoverage.common.util.TestParametersUtil2;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
import org.kie.api.KieBase;
import org.kie.api.runtime.KieSession;

@EnabledIfEnvironmentVariable(named = "runTurtleTests", matches = "*")
@EnabledIfSystemProperty(named = "runTurtleTests", matches = "true")
public class ConstraintWithAndOrJittingConcurrencyTest extends BaseConcurrencyTest {

public static Stream<KieBaseTestConfiguration> parameters() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

import org.drools.testcoverage.common.util.KieBaseTestConfiguration;
import org.drools.testcoverage.common.util.TestParametersUtil2;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;

@EnabledIfEnvironmentVariable(named = "runTurtleTests", matches = "*")
@EnabledIfSystemProperty(named = "runTurtleTests", matches = "true")
public class EvalConcurrencyTest extends BaseConcurrencyTest {

public static Stream<KieBaseTestConfiguration> parameters() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

import org.drools.testcoverage.common.util.KieBaseTestConfiguration;
import org.drools.testcoverage.common.util.TestParametersUtil2;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;

@EnabledIfEnvironmentVariable(named = "runTurtleTests", matches = "*")
@EnabledIfSystemProperty(named = "runTurtleTests", matches = "true")
public class FromAccumulateConcurrencyTest extends BaseConcurrencyTest {

public static Stream<KieBaseTestConfiguration> parameters() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import org.drools.testcoverage.common.model.Result;
import org.drools.testcoverage.common.util.KieBaseTestConfiguration;
import org.drools.testcoverage.common.util.KieBaseUtil;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import org.kie.api.KieBase;
Expand All @@ -40,7 +40,7 @@

import static org.assertj.core.api.Assertions.assertThat;

@EnabledIfEnvironmentVariable(named = "runTurtleTests", matches = "*")
@EnabledIfSystemProperty(named = "runTurtleTests", matches = "true")
public class GlobalConcurrencyTest {

private static final Logger LOGGER = LoggerFactory.getLogger(GlobalConcurrencyTest.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@

import org.drools.testcoverage.common.util.KieBaseTestConfiguration;
import org.drools.testcoverage.common.util.TestParametersUtil2;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
import org.kie.api.runtime.KieSession;

@EnabledIfEnvironmentVariable(named = "runTurtleTests", matches = "*")
@EnabledIfSystemProperty(named = "runTurtleTests", matches = "true")
public class MVELDateClassFieldReaderConcurrencyTest extends BaseConcurrencyTest {

public static Stream<KieBaseTestConfiguration> parameters() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@

import org.drools.testcoverage.common.util.KieBaseTestConfiguration;
import org.drools.testcoverage.common.util.TestParametersUtil2;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
import org.kie.api.runtime.KieSession;

@EnabledIfEnvironmentVariable(named = "runTurtleTests", matches = "*")
@EnabledIfSystemProperty(named = "runTurtleTests", matches = "true")
public class MVELNumberClassFieldReaderConcurrencyTest extends BaseConcurrencyTest {

public static Stream<KieBaseTestConfiguration> parameters() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@

import org.drools.testcoverage.common.util.KieBaseTestConfiguration;
import org.drools.testcoverage.common.util.TestParametersUtil2;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
import org.kie.api.runtime.KieSession;

@EnabledIfEnvironmentVariable(named = "runTurtleTests", matches = "*")
@EnabledIfSystemProperty(named = "runTurtleTests", matches = "true")
public class MVELObjectClassFieldReaderConcurrencyTest extends BaseConcurrencyTest {

public static Stream<KieBaseTestConfiguration> parameters() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@
import java.util.Set;

import org.junit.jupiter.api.Timeout;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;

@EnabledIfEnvironmentVariable(named = "runTurtleTests", matches = "*")
public abstract class AbstractAddRemoveGenerated2RulesTest {

private String rule1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@

import java.util.stream.Stream;

import org.junit.jupiter.api.condition.EnabledIfSystemProperty;

@EnabledIfSystemProperty(named = "runTurtleTests", matches = "true")
public class AddRemoveGenerated2RulesEval2Test extends AbstractAddRemoveGenerated2RulesTest {


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@

import java.util.stream.Stream;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;

@EnabledIfSystemProperty(named = "runTurtleTests", matches = "true")
public class AddRemoveGenerated2RulesEvalTest extends AbstractAddRemoveGenerated2RulesTest {

public static Stream<ConstraintsPair> parameters() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@

import java.util.stream.Stream;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;

@EnabledIfSystemProperty(named = "runTurtleTests", matches = "true")
public class AddRemoveGenerated2RulesIntegerTest extends AbstractAddRemoveGenerated2RulesTest {

public static Stream<ConstraintsPair> parameters() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@

import java.util.stream.Stream;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;

@EnabledIfSystemProperty(named = "runTurtleTests", matches = "true")
public class AddRemoveGenerated2RulesMapContainsTest extends AbstractAddRemoveGenerated2RulesTest {

public static Stream<ConstraintsPair> parameters() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@

import java.util.stream.Stream;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;

@EnabledIfSystemProperty(named = "runTurtleTests", matches = "true")
public class AddRemoveGenerated2RulesNotNotTest extends AbstractAddRemoveGenerated2RulesTest {

public static Stream<ConstraintsPair> parameters() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@

import java.util.stream.Stream;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;

@EnabledIfSystemProperty(named = "runTurtleTests", matches = "true")
public class AddRemoveGenerated2RulesNotTest extends AbstractAddRemoveGenerated2RulesTest {

public static Stream<ConstraintsPair> parameters() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@

import java.util.stream.Stream;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;

@EnabledIfSystemProperty(named = "runTurtleTests", matches = "true")
public class AddRemoveGenerated2RulesStringIntegerTest extends AbstractAddRemoveGenerated2RulesTest {

public static Stream<ConstraintsPair> parameters() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@

import java.util.stream.Stream;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;

@EnabledIfSystemProperty(named = "runTurtleTests", matches = "true")
public class AddRemoveGenerated2RulesStringTest extends AbstractAddRemoveGenerated2RulesTest {

public static Stream<ConstraintsPair> parameters() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
import java.util.Set;
import java.util.stream.Stream;

import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.rule.FactHandle;

import static org.assertj.core.api.Assertions.assertThat;

@EnabledIfEnvironmentVariable(named = "runTurtleTests", matches = "*")
@EnabledIfSystemProperty(named = "runTurtleTests", matches = "true")
public class AddRemoveRulesAddDeleteFactsTest {

public static Stream<StringPermutation> parameters() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
import org.kie.api.runtime.KieSession;

import static org.assertj.core.api.Assertions.assertThat;

/**
* Tests adding and removing rules with advanced operators.
*/
@EnabledIfEnvironmentVariable(named = "runTurtleTests", matches = "*")
@EnabledIfSystemProperty(named = "runTurtleTests", matches = "true")
public class AddRemoveRulesAdvOperatorsTest {

@Test
Expand Down
Loading
Loading