This is an automated email from the ASF dual-hosted git repository.
tkobayas pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-drools.git
The following commit(s) were added to refs/heads/main by this push:
new 20232671b63 [incubator-kie-drools-6848] Restructure
drools-test-coverage-jars (#6855)
20232671b63 is described below
commit 20232671b631716b42ff2d137a8ab3448890c5a2
Author: Toshiya Kobayashi <[email protected]>
AuthorDate: Mon Aug 3 16:49:25 2026 +0900
[incubator-kie-drools-6848] Restructure drools-test-coverage-jars (#6855)
* [incubator-kie-drools-6848] Restructure drools-test-coverage-jars
- Isolate tests which require pre-built jars to test-integration-prebuilt
* adjust ci scope test
---
drools-test-coverage/pom.xml | 2 +-
.../test-compiler-integration/pom.xml | 43 -----
.../mvel/integrationtests/DynamicRulesTest.java | 116 ------------
.../drools/mvel/integrationtests/JBRULESTest.java | 68 -------
.../integrationtests/MBeansMonitoringTest.java | 42 -----
.../drools/mvel/integrationtests/Misc2Test.java | 41 -----
.../README.md | 6 +-
.../pom.xml | 14 +-
.../kjar-with-invoker}/pom.xml | 18 +-
.../src/it/kie-project-simple/pom.xml | 4 +-
.../src/main/resources/META-INF/kmodule.xml | 0
.../src/main/resources/defaultkiesession/test.drl | 0
.../src/it/kjar-module-after/pom.xml | 4 +-
.../src/main/resources/KBase-test/kjar/rule1.drl | 0
.../src/main/resources/KBase-test/kjar/rule2.drl | 0
.../src/main/resources/META-INF/kmodule.xml | 0
.../src/it/kjar-module-before/pom.xml | 4 +-
.../src/main/resources/KBase-test/kjar/rule1.drl | 0
.../src/main/resources/META-INF/kmodule.xml | 0
.../it/only-jar-pojo-not-kjar-no-kmodule/pom.xml | 3 +-
.../only_jar_pojo_not_kjar_no_kmodule/MyPojo.java | 0
.../test-integration-prebuilt-jars}/pom.xml | 8 +-
.../setter-overload/pom.xml | 9 +-
.../setter/overload/SetterOverload.java | 0
.../test-integration-prebuilt-jars}/surf/pom.xml | 4 +-
.../surf/src/main/java/org/example/surf/Board.java | 0
.../src/main/java/org/example/surf/Person.java | 0
.../testEnum/pom.xml | 4 +-
.../src/main/java/org/drools/Primitives.java | 0
.../src/main/java/org/drools/TestEnum.java | 0
.../test-integration-prebuilt-tests/pom.xml | 170 ++++++++++++++++++
.../prebuilt/DynamicRulesWithPrebuiltJarTest.java | 198 +++++++++++++++++++++
.../prebuilt/KieBuilderWithPrebuiltJarTest.java | 90 ++++++++++
.../prebuilt/KieContainerWithPrebuiltJarTest.java | 89 +++++++++
.../KieRepositoryWithPrebuiltJarTest.java} | 46 ++---
.../MBeansMonitoringWithPrebuiltJarTest.java | 111 ++++++++++++
.../prebuilt/MarshallingWithPrebuiltJarTest.java} | 25 +--
.../SetterOverloadWithPrebuiltJarTest.java | 110 ++++++++++++
.../src/test/resources/kjar/pom-kjar.xml} | 14 +-
.../src/test/resources/logback-test.xml} | 22 ++-
.../prebuilt/test_EnumSerialization.drl} | 21 +--
drools-test-coverage/test-suite/pom.xml | 76 --------
.../testcoverage/functional/KieContainerTest.java | 52 ------
.../02-hub-module-source/expected-affected.txt | 3 +-
.../02-hub-module-source/expected-upstream.txt | 3 +-
.../03-root-pom/expected-affected.txt | 6 +-
.../expected-affected.txt | 3 +-
.../expected-upstream.txt | 3 +-
.../06-aggregator-pom/expected-affected.txt | 3 +-
.../06-aggregator-pom/expected-upstream.txt | 3 +-
.../07-removed-module/expected-affected.txt | 3 +-
.../07-removed-module/expected-upstream.txt | 3 +-
.../expected-affected.txt | 3 +-
.../expected-upstream.txt | 3 +-
.../09-nested-pom-under-src/expected-affected.txt | 7 +-
.../09-nested-pom-under-src/expected-upstream.txt | 4 +-
.../10-plugin-dep-as-dependency/README.md | 6 +-
.../10-plugin-dep-as-dependency/changed-files.txt | 4 +-
.../expected-affected.txt | 5 +-
.../expected-changed.txt | 2 +-
.../expected-upstream.txt | 3 +-
.../11-fully-removed-subtree/expected-affected.txt | 6 +-
62 files changed, 916 insertions(+), 571 deletions(-)
diff --git a/drools-test-coverage/pom.xml b/drools-test-coverage/pom.xml
index 06597478025..90fe18bc730 100644
--- a/drools-test-coverage/pom.xml
+++ b/drools-test-coverage/pom.xml
@@ -39,13 +39,13 @@
<modules>
<module>standalone</module>
- <module>drools-test-coverage-jars</module>
<module>test-suite</module>
<module>test-compiler-integration</module>
<module>test-integration-nomvel</module>
<module>test-integration-notms</module>
<module>test-integration-noxml</module>
<module>test-integration-ruleunits</module>
+ <module>test-integration-prebuilt</module>
</modules>
</project>
diff --git a/drools-test-coverage/test-compiler-integration/pom.xml
b/drools-test-coverage/test-compiler-integration/pom.xml
index 6bc76d1d365..851c320205e 100644
--- a/drools-test-coverage/test-compiler-integration/pom.xml
+++ b/drools-test-coverage/test-compiler-integration/pom.xml
@@ -96,13 +96,6 @@
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.drools.testcoverage</groupId>
- <artifactId>drools-test-coverage-jars</artifactId>
- <type>pom</type>
- <scope>test</scope>
- </dependency>
-
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
@@ -193,42 +186,6 @@
</build>
</profile>
- <!-- test-compiler-integration requires test jars built by
drools-test-coverage-jars -->
- <!-- This profile makes sure that drools-test-coverage-jars is executed if
not-->
- <!-- See: https://github.com/apache/incubator-kie-drools/pull/6144 -->
- <profile>
- <id>missing-test-jar-file</id>
- <activation>
- <file>
- <missing>src/test/resources/surf.jar</missing>
- </file>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-invoker-plugin</artifactId>
- <executions>
- <execution>
- <id>build-drools-test-coverage-jars</id>
- <goals>
- <goal>run</goal>
- </goals>
- <phase>generate-test-resources</phase>
- <configuration>
-
<projectsDirectory>${basedir}/../drools-test-coverage-jars</projectsDirectory>
- <logDirectory>${path.to.buildlog.directory}</logDirectory>
- <goals>
- <goal>clean</goal>
- <goal>install</goal>
- </goals>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
</profiles>
</project>
diff --git
a/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/DynamicRulesTest.java
b/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/DynamicRulesTest.java
index 486f9b27499..29097958a99 100644
---
a/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/DynamicRulesTest.java
+++
b/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/DynamicRulesTest.java
@@ -929,122 +929,6 @@ public class DynamicRulesTest {
}
- @ParameterizedTest(name = "KieBase type={0}")
- @MethodSource("parameters")
- @Timeout(10000)
- public void
testIsolatedClassLoaderWithEnumsPkgBuilder(KieBaseTestConfiguration
kieBaseTestConfiguration) throws Exception {
- try {
- // Creates first class loader and use it to load fact classes
- ClassLoader loader1 = new SubvertedClassLoader( new
URL[]{getClass().getResource( "/testEnum.jar" )},
-
this.getClass().getClassLoader() );
- loader1.loadClass( "org.drools.Primitives" );
- loader1.loadClass( "org.drools.TestEnum" );
-
- // create a builder with the given classloader
- Collection<KiePackage> kpkgs =
KieBaseUtil.getKieBaseFromClasspathResourcesWithClassLoaderForKieBuilder("test",
getClass(), loader1, kieBaseTestConfiguration,
"test_EnumSerialization.drl").getKiePackages();
-
- // adding original packages to a kbase just to make sure they are
fine
- KieBaseConfiguration kbaseConf =
RuleBaseFactory.newKnowledgeBaseConfiguration( null, loader1 );
- final KieModule kieModule =
KieUtil.getKieModuleFromResourcesWithClassLoaderForKieBuilder("test", loader1,
kieBaseTestConfiguration);
- InternalKnowledgeBase kbase = (InternalKnowledgeBase)
KieBaseUtil.newKieBaseFromReleaseId(kieModule.getReleaseId(), kbaseConf);
-
- kbase.addPackages( kpkgs );
- KieSession ksession = kbase.newKieSession();
- List list = new ArrayList();
- ksession.setGlobal( "list", list);
- assertThat(ksession.fireAllRules()).isEqualTo(1);
- assertThat(list.size()).isEqualTo(1);
-
- // now, create another classloader and make sure it has access to
the classes
- ClassLoader loader2 = new SubvertedClassLoader( new
URL[]{getClass().getResource( "/testEnum.jar" )},
-
this.getClass().getClassLoader() );
- loader2.loadClass( "org.drools.Primitives" );
- loader2.loadClass( "org.drools.TestEnum" );
-
- // create another kbase
- KieBaseConfiguration kbaseConf2 =
RuleBaseFactory.newKnowledgeBaseConfiguration( null,
-
loader2 );
- final KieModule kieModule2 =
KieUtil.getKieModuleFromResourcesWithClassLoaderForKieBuilder("test2", loader2,
kieBaseTestConfiguration);
- InternalKnowledgeBase kbase2 = (InternalKnowledgeBase)
KieBaseUtil.newKieBaseFromReleaseId(kieModule2.getReleaseId(), kbaseConf2);
-
- kbase2.addPackages( kpkgs );
- ksession = kbase2.newKieSession();
- list = new ArrayList();
- ksession.setGlobal( "list", list);
- assertThat(ksession.fireAllRules()).isEqualTo(1);
- assertThat(list.size()).isEqualTo(1);
-
- } catch ( ClassCastException cce ) {
- cce.printStackTrace();
- fail( "No ClassCastException should be raised." );
- }
- }
-
- @ParameterizedTest(name = "KieBase type={0}")
- @MethodSource("parameters")
- @Timeout(10000)
- public void
testIsolatedClassLoaderWithEnumsContextClassloader(KieBaseTestConfiguration
kieBaseTestConfiguration) throws Exception {
- try {
- // Creates first class loader and use it to load fact classes
- ClassLoader loader1 = new SubvertedClassLoader( new
URL[]{getClass().getResource( "/testEnum.jar" )},
-
this.getClass().getClassLoader() );
- loader1.loadClass( "org.drools.Primitives" );
- loader1.loadClass( "org.drools.TestEnum" );
-
- // Build it using the current context
- ClassLoader ccl = Thread.currentThread().getContextClassLoader();
- Collection<KiePackage> kpkgs;
- try {
- Thread.currentThread().setContextClassLoader( loader1 );
- // create a builder with the given classloader
- kpkgs = KieBaseUtil.getKieBaseFromClasspathResources("tmp",
getClass(), kieBaseTestConfiguration,
"test_EnumSerialization.drl").getKiePackages();
-
- // adding original packages to a kbase just to make sure they
are fine
- InternalKnowledgeBase kbase = (InternalKnowledgeBase)
KieBaseUtil.getKieBaseFromKieModuleFromDrl("test", kieBaseTestConfiguration);
- kbase.addPackages( kpkgs );
-
- KieSession ksession = kbase.newKieSession();
- List list = new ArrayList();
- ksession.setGlobal( "list", list);
- assertThat(ksession.fireAllRules()).isEqualTo(1);
- assertThat(list.size()).isEqualTo(1);
- } finally {
- Thread.currentThread().setContextClassLoader( ccl );
- }
-
- // now, create another classloader and make sure it has access to
the classes
- ClassLoader loader2 = new SubvertedClassLoader( new
URL[]{getClass().getResource( "/testEnum.jar" )},
-
this.getClass().getClassLoader() );
- loader2.loadClass( "org.drools.Primitives" );
- loader2.loadClass( "org.drools.TestEnum" );
-
- // set context classloader and use it
- ccl = Thread.currentThread().getContextClassLoader();
- try {
- Thread.currentThread().setContextClassLoader( loader2 );
-
- // Note: This test originally serialize/deserialize kpkgs with
different context classloaders.
- // Now exec-model doesn't support package serialization so we
may remove this test.
-
- // create another kbase
- InternalKnowledgeBase kbase2 = (InternalKnowledgeBase)
KieBaseUtil.getKieBaseFromKieModuleFromDrl("test2", kieBaseTestConfiguration);
- kbase2.addPackages( kpkgs );
-
- KieSession ksession = kbase2.newKieSession();
- List list = new ArrayList();
- ksession.setGlobal( "list", list);
- assertThat(ksession.fireAllRules()).isEqualTo(1);
- assertThat(list.size()).isEqualTo(1);
- } finally {
- Thread.currentThread().setContextClassLoader( ccl );
- }
-
- } catch ( ClassCastException cce ) {
- cce.printStackTrace();
- fail( "No ClassCastException should be raised." );
- }
- }
-
@ParameterizedTest(name = "KieBase type={0}")
@MethodSource("parameters")
@Timeout(10000)
diff --git
a/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/JBRULESTest.java
b/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/JBRULESTest.java
index f00c41bdaf7..ac31eda26fd 100644
---
a/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/JBRULESTest.java
+++
b/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/JBRULESTest.java
@@ -18,16 +18,11 @@
*/
package org.drools.mvel.integrationtests;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import java.util.jar.JarEntry;
-import java.util.jar.JarInputStream;
import java.util.stream.Stream;
-import org.drools.base.rule.MapBackedClassLoader;
import org.drools.mvel.compiler.Bar;
import org.drools.mvel.compiler.Cheese;
import org.drools.mvel.compiler.FactA;
@@ -47,13 +42,8 @@ import org.kie.api.KieBase;
import org.kie.api.builder.KieBuilder;
import org.kie.api.builder.Message.Level;
import org.kie.api.event.rule.AfterMatchFiredEvent;
-import org.kie.api.io.ResourceType;
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.rule.FactHandle;
-import org.kie.internal.builder.KnowledgeBuilder;
-import org.kie.internal.builder.KnowledgeBuilderConfiguration;
-import org.kie.internal.builder.KnowledgeBuilderFactory;
-import org.kie.internal.io.ResourceFactory;
import org.mockito.ArgumentCaptor;
import org.mvel2.MVEL;
@@ -315,62 +305,4 @@ public class JBRULESTest {
ksession.dispose();
}
- @ParameterizedTest(name = "KieBase type={0}")
- @MethodSource("parameters")
- public void testGUVNOR578_2(KieBaseTestConfiguration
kieBaseTestConfiguration) throws Exception {
- // An internal specific test case so not enhanced for executable-model
- final MapBackedClassLoader loader = new MapBackedClassLoader(
this.getClass().getClassLoader() );
-
- InputStream is =
this.getClass().getResourceAsStream("/setter-overload.jar");
- assertThat(is).as("Make sure to build drools-test-coverage-jars first")
- .isNotNull();
- final JarInputStream jis = new JarInputStream(is);
-
- JarEntry entry;
- final byte[] buf = new byte[1024];
- int len;
- while ( (entry = jis.getNextJarEntry()) != null ) {
- if ( !entry.isDirectory() ) {
- final ByteArrayOutputStream out = new ByteArrayOutputStream();
- while ( (len = jis.read( buf )) >= 0 ) {
- out.write( buf,
- 0,
- len );
- }
- loader.addResource( entry.getName(),
- out.toByteArray() );
- }
- }
-
- final List<JarInputStream> jarInputStreams = new
ArrayList<JarInputStream>();
- jarInputStreams.add(jis);
-
- final KnowledgeBuilderConfiguration conf =
KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(null, loader);
- final KnowledgeBuilder kbuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder(conf);
-
- final String header = "import
org.drools.compiler.integrationtests.setter.overload.SetterOverload\n";
-
- kbuilder.add(ResourceFactory.newByteArrayResource(header.getBytes()),
ResourceType.DRL);
- assertThat(kbuilder.hasErrors()).isFalse();
-
- final String passingRule = "rule \"rule1\"\n"
- + "dialect \"mvel\"\n"
- + "when\n"
- + "SetterOverload( echelle == \"abc\" )"
- + "then\n"
- + "end\n";
-
- final String failingRule = "rule \"rule2\"\n"
- + "dialect \"mvel\"\n"
- + "when\n"
- + "SetterOverload( quotiteRemuneration == 123 , echelle ==
\"abc\" )"
- + "then\n"
- + "end\n";
-
-
kbuilder.add(ResourceFactory.newByteArrayResource(passingRule.getBytes()),
ResourceType.DRL);
- assertThat(kbuilder.hasErrors()).isFalse();
-
-
kbuilder.add(ResourceFactory.newByteArrayResource(failingRule.getBytes()),
ResourceType.DRL);
- assertThat(kbuilder.hasErrors()).isFalse();
- }
}
diff --git
a/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/MBeansMonitoringTest.java
b/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/MBeansMonitoringTest.java
index 66ff1516a30..050366cea34 100644
---
a/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/MBeansMonitoringTest.java
+++
b/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/MBeansMonitoringTest.java
@@ -20,8 +20,6 @@ package org.drools.mvel.integrationtests;
import java.io.StringReader;
import java.lang.management.ManagementFactory;
-import java.net.URL;
-import java.net.URLClassLoader;
import java.util.stream.Stream;
import javax.management.JMX;
@@ -519,44 +517,4 @@ public class MBeansMonitoringTest {
assertThat(mb.getTotalMatchesFired()).isEqualTo(mFired);
}
- /**
- * Copied from KieRepositoryTest to test JMX monitoring
- */
- @ParameterizedTest(name = "KieBase type={0}")
- @MethodSource("parameters")
- public void testLoadKjarFromClasspath(KieBaseTestConfiguration
kieBaseTestConfiguration) {
- // DROOLS-1335
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
-
- URL simpleKjar =
this.getClass().getResource("/kie-project-simple-1.0.0.jar");
- assertThat(simpleKjar).as("Make sure to build
drools-test-coverage-jars first")
- .isNotNull();
- URLClassLoader urlClassLoader = new URLClassLoader( new
URL[]{simpleKjar} );
- Thread.currentThread().setContextClassLoader( urlClassLoader );
-
- MBeanServer mbserver = ManagementFactory.getPlatformMBeanServer();
-
- try {
- KieServices ks = KieServices.Factory.get();
- KieRepository kieRepository = ks.getRepository();
- ReleaseId releaseId = ks.newReleaseId( "org.drools.testcoverage",
"kie-project-simple", "1.0.0" );
- KieModule kieModule = kieRepository.getKieModule( releaseId );
- assertThat(kieModule).isNotNull();
- assertThat(kieModule.getReleaseId()).isEqualTo(releaseId);
-
- KieContainer kc = ks.newKieContainer("myID", releaseId);
-
- KieContainerMonitorMXBean c1Monitor = JMX.newMXBeanProxy(
- mbserver,
- DroolsManagementAgent.createObjectNameBy("myID"),
- KieContainerMonitorMXBean.class);
-
-
assertThat(c1Monitor.getConfiguredReleaseId().sameGAVof(releaseId)).isTrue();
-
assertThat(c1Monitor.getResolvedReleaseId().sameGAVof(releaseId)).isTrue();
-
- kc.dispose();
- } finally {
- Thread.currentThread().setContextClassLoader( cl );
- }
- }
}
diff --git
a/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/Misc2Test.java
b/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/Misc2Test.java
index edd9434a99b..c3443479732 100644
---
a/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/Misc2Test.java
+++
b/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/Misc2Test.java
@@ -7062,47 +7062,6 @@ public class Misc2Test {
assertThat(ksession.fireAllRules()).isEqualTo(1);
}
- @ParameterizedTest(name = "KieBase type={0}")
- @MethodSource("parameters")
- public void testKieBuilderWithClassLoader(KieBaseTestConfiguration
kieBaseTestConfiguration) {
- // DROOLS-763
- String drl =
- "import org.example.surf.Person\n" +
- "\n" +
- "global java.util.List list\n" +
- "\n" +
- "rule R1 when\n" +
- " $i : Integer()\n" +
- "then\n" +
- " Person p = new Person();\n" +
- " p.setAge($i);\n" +
- " insert(p);\n" +
- "end\n" +
- "\n" +
- "rule R2 when\n" +
- " $p : Person()\n" +
- "then\n" +
- " list.add($p.getAge());\n" +
- "end\n";
-
- URL simplejar = this.getClass().getResource("/surf.jar");
- assertThat(simplejar).as("Make sure to build drools-test-coverage-jars
first")
- .isNotNull();
- URLClassLoader urlClassLoader = new URLClassLoader( new
URL[]{simplejar} );
-
- InternalKnowledgeBase kbase =
(InternalKnowledgeBase)KieBaseUtil.getKieBaseFromDrlWithClassLoaderForKieBuilder("test",
urlClassLoader, kieBaseTestConfiguration, drl);
- KieSession ksession = kbase.newKieSession();
-
- List<Integer> list = new ArrayList<>();
- ksession.setGlobal( "list", list );
-
- ksession.insert( 18 );
- ksession.fireAllRules();
-
- assertThat(list.size()).isEqualTo(1);
- assertThat((int) list.get(0)).isEqualTo(18);
- }
-
@ParameterizedTest(name = "KieBase type={0}")
@MethodSource("parameters")
public void testInsertAndDelete(KieBaseTestConfiguration
kieBaseTestConfiguration) {
diff --git a/drools-test-coverage/drools-test-coverage-jars/README.md
b/drools-test-coverage/test-integration-prebuilt/README.md
similarity index 65%
rename from drools-test-coverage/drools-test-coverage-jars/README.md
rename to drools-test-coverage/test-integration-prebuilt/README.md
index 4ee66cda9ff..06506e5fefa 100644
--- a/drools-test-coverage/drools-test-coverage-jars/README.md
+++ b/drools-test-coverage/test-integration-prebuilt/README.md
@@ -17,12 +17,12 @@
under the License.
-->
-## drools-test-coverage-jars
-This project is to build jars that are used in `drools-test-coverage` project.
So we can avoid having jar binaries in the codebase.
+## test-integration-prebuilt
+Use this project for tests which require jar or kjar as binaries. ASF doesn't
allow jar/kjar binaries in the codebase, so `test-integration-prebuilt-jars`
builds required jar/kjar and copy them to `test-integration-prebuilt-tests`.
### How to add a jar project
If the jar is not a kjar and doesn't care about the artifact version, you can
simply add the jar project under this project. `surf` project is an example.
When copying the jar file, you should not include its artifact version in its
destination file name in order to avoid a test failure when upgrading drools
version.
-If the jar has a fixed version while requires the current version for
dependency or plugin (e.g. jar version is `1.0.0`, but requires `999-SNAPSHOT`
kie-maven-plugin to build the kjar), use
`drools-test-coverage-jars-with-invoker` to build the jar with
maven-invoker-plugin. Place the jar project under `src/it`. `kie-poject-simple`
is an example. Even if the jar is not a kjar, you would need to use
`drools-test-coverage-jars-with-invoker` to build the jar to have a fixed
version (e.g. `on [...]
+If the jar has a fixed version while requires the current version for
dependency or plugin (e.g. jar version is `1.0.0`, but requires `999-SNAPSHOT`
kie-maven-plugin to build the kjar), use
`test-integration-prebuilt-jars/kjar-with-invoker` to build the jar with
maven-invoker-plugin. Place the jar project under `src/it`. `kie-poject-simple`
is an example. Even if the jar is not a kjar, you would need to use
`kjar-with-invoker` to build the jar to have a fixed version (e.g.
`only-jar-pojo [...]
In both cases, you would need to copy the jar file to the target test project
using `copy-rename-maven-plugin`.
\ No newline at end of file
diff --git a/drools-test-coverage/drools-test-coverage-jars/pom.xml
b/drools-test-coverage/test-integration-prebuilt/pom.xml
similarity index 78%
copy from drools-test-coverage/drools-test-coverage-jars/pom.xml
copy to drools-test-coverage/test-integration-prebuilt/pom.xml
index c32590b1465..67468eacda7 100644
--- a/drools-test-coverage/drools-test-coverage-jars/pom.xml
+++ b/drools-test-coverage/test-integration-prebuilt/pom.xml
@@ -30,18 +30,12 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>drools-test-coverage-jars</artifactId>
+ <artifactId>test-integration-prebuilt</artifactId>
<packaging>pom</packaging>
- <name>Drools :: Test Coverage :: Jars for tests</name>
-
- <properties>
- <parent.project.version>${project.version}</parent.project.version>
- </properties>
+ <name>Drools :: Test Coverage :: Integration tests with prebuilt JARs
Parent</name>
<modules>
- <module>surf</module>
- <module>testEnum</module>
- <module>setter-overload</module>
- <module>drools-test-coverage-jars-with-invoker</module>
+ <module>test-integration-prebuilt-jars</module>
+ <module>test-integration-prebuilt-tests</module>
</modules>
</project>
diff --git
a/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/pom.xml
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/pom.xml
similarity index 76%
rename from
drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/pom.xml
rename to
drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/pom.xml
index 3a0131db04f..150bfa2cf4d 100644
---
a/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/pom.xml
+++
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/pom.xml
@@ -22,21 +22,25 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
- <artifactId>drools-test-coverage-jars</artifactId>
+ <artifactId>test-integration-prebuilt-jars</artifactId>
<groupId>org.drools.testcoverage</groupId>
<version>999-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>drools-test-coverage-jars-with-invoker</artifactId>
+ <artifactId>kjar-with-invoker</artifactId>
- <name>Drools :: Test Coverage :: Jars for tests built by invoker</name>
+ <name>Drools :: Test Coverage :: Integration tests with prebuilt JARs -
KJARs built by invoker</name>
<properties>
-
<java.module.name>org.drools.compiler.integrationtests.jars.with.invoker</java.module.name>
+
<java.module.name>org.drools.compiler.integrationtests.kjar.with.invoker</java.module.name>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<org.kie.version>${project.version}</org.kie.version>
-
<path.to.buildlog.directory>${project.parent.parent.basedir}/../${buildlogs.dir}</path.to.buildlog.directory>
+
<path.to.buildlog.directory>${project.parent.parent.parent.basedir}/../${buildlogs.dir}</path.to.buildlog.directory>
+
+ <!-- Skip build by default. Execute only when triggered by
test-integration-prebuilt-tests
+ So we can minimize the build time in CI while local development
ensures fresh build -->
+ <skipInvokerITs>true</skipInvokerITs>
</properties>
<dependencies>
@@ -64,8 +68,8 @@
<streamLogs>true</streamLogs>
<goal>clean</goal>
<goal>package</goal>
- <skipInstallation>${skipITs}</skipInstallation>
- <skipInvocation>${skipITs}</skipInvocation>
+ <skipInstallation>${skipInvokerITs}</skipInstallation>
+ <skipInvocation>${skipInvokerITs}</skipInvocation>
</configuration>
<executions>
<execution>
diff --git
a/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kie-project-simple/pom.xml
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/src/it/kie-project-simple/pom.xml
similarity index 92%
rename from
drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kie-project-simple/pom.xml
rename to
drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/src/it/kie-project-simple/pom.xml
index 94e58d6b810..1a0ca337826 100644
---
a/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kie-project-simple/pom.xml
+++
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/src/it/kie-project-simple/pom.xml
@@ -68,8 +68,8 @@
</goals>
<configuration>
<sourceFile>${project.build.directory}/${project.build.finalName}.jar</sourceFile>
- <!-- copy to test-compiler-integration/src/test/resources -->
-
<destinationFile>${project.build.directory}/../../../../../../test-compiler-integration/src/test/resources/${project.artifactId}-${project.version}.jar</destinationFile>
+ <!-- copy to test-integration-prebuilt-tests/src/test/resources
-->
+
<destinationFile>${project.build.directory}/../../../../../../test-integration-prebuilt-tests/src/test/resources/${project.artifactId}-${project.version}.jar</destinationFile>
</configuration>
</execution>
</executions>
diff --git
a/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kie-project-simple/src/main/resources/META-INF/kmodule.xml
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/src/it/kie-project-simple/src/main/resources/META-INF/kmodule.xml
similarity index 100%
copy from
drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kie-project-simple/src/main/resources/META-INF/kmodule.xml
copy to
drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/src/it/kie-project-simple/src/main/resources/META-INF/kmodule.xml
diff --git
a/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kie-project-simple/src/main/resources/defaultkiesession/test.drl
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/src/it/kie-project-simple/src/main/resources/defaultkiesession/test.drl
similarity index 100%
rename from
drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kie-project-simple/src/main/resources/defaultkiesession/test.drl
rename to
drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/src/it/kie-project-simple/src/main/resources/defaultkiesession/test.drl
diff --git
a/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kjar-module-after/pom.xml
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/src/it/kjar-module-after/pom.xml
similarity index 93%
rename from
drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kjar-module-after/pom.xml
rename to
drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/src/it/kjar-module-after/pom.xml
index 32f3dd522be..eeae820a0f7 100644
---
a/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kjar-module-after/pom.xml
+++
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/src/it/kjar-module-after/pom.xml
@@ -65,8 +65,8 @@
</goals>
<configuration>
<sourceFile>${project.build.directory}/${project.build.finalName}.jar</sourceFile>
- <!-- copy to test-suite/src/test/resources -->
-
<destinationFile>${project.build.directory}/../../../../../../test-suite/src/test/resources/kjar/kjar-module-after.jar</destinationFile>
+ <!-- copy to
test-integration-prebuilt-tests/src/test/resources/kjar -->
+
<destinationFile>${project.build.directory}/../../../../../../test-integration-prebuilt-tests/src/test/resources/kjar/kjar-module-after.jar</destinationFile>
</configuration>
</execution>
</executions>
diff --git
a/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kjar-module-after/src/main/resources/KBase-test/kjar/rule1.drl
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/src/it/kjar-module-after/src/main/resources/KBase-test/kjar/rule1.drl
similarity index 100%
rename from
drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kjar-module-after/src/main/resources/KBase-test/kjar/rule1.drl
rename to
drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/src/it/kjar-module-after/src/main/resources/KBase-test/kjar/rule1.drl
diff --git
a/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kjar-module-after/src/main/resources/KBase-test/kjar/rule2.drl
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/src/it/kjar-module-after/src/main/resources/KBase-test/kjar/rule2.drl
similarity index 100%
copy from
drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kjar-module-after/src/main/resources/KBase-test/kjar/rule2.drl
copy to
drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/src/it/kjar-module-after/src/main/resources/KBase-test/kjar/rule2.drl
diff --git
a/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kjar-module-after/src/main/resources/META-INF/kmodule.xml
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/src/it/kjar-module-after/src/main/resources/META-INF/kmodule.xml
similarity index 100%
rename from
drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kjar-module-after/src/main/resources/META-INF/kmodule.xml
rename to
drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/src/it/kjar-module-after/src/main/resources/META-INF/kmodule.xml
diff --git
a/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kjar-module-before/pom.xml
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/src/it/kjar-module-before/pom.xml
similarity index 93%
rename from
drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kjar-module-before/pom.xml
rename to
drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/src/it/kjar-module-before/pom.xml
index 748882bb031..6a58e183816 100644
---
a/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kjar-module-before/pom.xml
+++
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/src/it/kjar-module-before/pom.xml
@@ -65,8 +65,8 @@
</goals>
<configuration>
<sourceFile>${project.build.directory}/${project.build.finalName}.jar</sourceFile>
- <!-- copy to test-suite/src/test/resources -->
-
<destinationFile>${project.build.directory}/../../../../../../test-suite/src/test/resources/kjar/kjar-module-before.jar</destinationFile>
+ <!-- copy to
test-integration-prebuilt-tests/src/test/resources/kjar -->
+
<destinationFile>${project.build.directory}/../../../../../../test-integration-prebuilt-tests/src/test/resources/kjar/kjar-module-before.jar</destinationFile>
</configuration>
</execution>
</executions>
diff --git
a/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kjar-module-before/src/main/resources/KBase-test/kjar/rule1.drl
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/src/it/kjar-module-before/src/main/resources/KBase-test/kjar/rule1.drl
similarity index 100%
rename from
drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kjar-module-before/src/main/resources/KBase-test/kjar/rule1.drl
rename to
drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/src/it/kjar-module-before/src/main/resources/KBase-test/kjar/rule1.drl
diff --git
a/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kjar-module-before/src/main/resources/META-INF/kmodule.xml
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/src/it/kjar-module-before/src/main/resources/META-INF/kmodule.xml
similarity index 100%
rename from
drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kjar-module-before/src/main/resources/META-INF/kmodule.xml
rename to
drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/src/it/kjar-module-before/src/main/resources/META-INF/kmodule.xml
diff --git
a/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/only-jar-pojo-not-kjar-no-kmodule/pom.xml
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/src/it/only-jar-pojo-not-kjar-no-kmodule/pom.xml
similarity index 92%
rename from
drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/only-jar-pojo-not-kjar-no-kmodule/pom.xml
rename to
drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/src/it/only-jar-pojo-not-kjar-no-kmodule/pom.xml
index 0edbc852bf1..c263c262dbb 100644
---
a/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/only-jar-pojo-not-kjar-no-kmodule/pom.xml
+++
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/src/it/only-jar-pojo-not-kjar-no-kmodule/pom.xml
@@ -62,7 +62,8 @@
</goals>
<configuration>
<sourceFile>${project.build.directory}/${project.build.finalName}.jar</sourceFile>
-
<destinationFile>${project.build.directory}/../../../../../../test-compiler-integration/src/test/resources/${project.artifactId}-${project.version}.jar</destinationFile>
+ <!-- copy to test-integration-prebuilt-tests/src/test/resources
-->
+
<destinationFile>${project.build.directory}/../../../../../../test-integration-prebuilt-tests/src/test/resources/${project.artifactId}-${project.version}.jar</destinationFile>
</configuration>
</execution>
</executions>
diff --git
a/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/only-jar-pojo-not-kjar-no-kmodule/src/main/java/org/drools/compiler/integrationtests/only_jar_pojo_not_kjar_no_kmodule/MyPojo.java
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/src/it/only-jar-pojo-not-kjar-no-kmodule/src/main/java/org/drools/compiler/integrationtests/only_jar_pojo_not_kjar_no_kmodule/MyPojo.java
similarity index 100%
rename from
drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/only-jar-pojo-not-kjar-no-kmodule/src/main/java/org/drools/compiler/integrationtests/only_jar_pojo_not_kjar_no_kmodule/MyPojo.java
rename to
drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/kjar-with-invoker/src/it/only-jar-pojo-not-kjar-no-kmodule/src/main/java/org/drools/compiler/integrationtests/only_jar_pojo_not_kjar_no_kmodule/MyPojo.java
diff --git a/drools-test-coverage/drools-test-coverage-jars/pom.xml
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/pom.xml
similarity index 86%
rename from drools-test-coverage/drools-test-coverage-jars/pom.xml
rename to
drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/pom.xml
index c32590b1465..8ee798f91cc 100644
--- a/drools-test-coverage/drools-test-coverage-jars/pom.xml
+++
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/pom.xml
@@ -24,15 +24,15 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
- <artifactId>drools-test-coverage-parent</artifactId>
+ <artifactId>test-integration-prebuilt</artifactId>
<groupId>org.drools.testcoverage</groupId>
<version>999-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>drools-test-coverage-jars</artifactId>
+ <artifactId>test-integration-prebuilt-jars</artifactId>
<packaging>pom</packaging>
- <name>Drools :: Test Coverage :: Jars for tests</name>
+ <name>Drools :: Test Coverage :: Integration tests with prebuilt JARs -
JARs</name>
<properties>
<parent.project.version>${project.version}</parent.project.version>
@@ -42,6 +42,6 @@
<module>surf</module>
<module>testEnum</module>
<module>setter-overload</module>
- <module>drools-test-coverage-jars-with-invoker</module>
+ <module>kjar-with-invoker</module>
</modules>
</project>
diff --git
a/drools-test-coverage/drools-test-coverage-jars/setter-overload/pom.xml
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/setter-overload/pom.xml
similarity index 88%
rename from
drools-test-coverage/drools-test-coverage-jars/setter-overload/pom.xml
rename to
drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/setter-overload/pom.xml
index 7e8d47c2797..6b2e10580f0 100644
--- a/drools-test-coverage/drools-test-coverage-jars/setter-overload/pom.xml
+++
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/setter-overload/pom.xml
@@ -24,23 +24,20 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
- <artifactId>drools-test-coverage-jars</artifactId>
+ <artifactId>test-integration-prebuilt-jars</artifactId>
<groupId>org.drools.testcoverage</groupId>
<version>999-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>setter-overload</artifactId>
- <name>Drools :: Test Coverage :: Jar with setter overload for Compiler
integration tests</name>
+ <name>Drools :: Test Coverage :: Integration tests with prebuilt JARs - Jar
with setter overload</name>
<properties>
<java.module.name>org.drools.compiler.integrationtests.setter.overload</java.module.name>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>
- <dependencies>
- </dependencies>
-
<build>
<plugins>
<plugin>
@@ -55,7 +52,7 @@
</goals>
<configuration>
<sourceFile>${project.build.directory}/${project.build.finalName}.jar</sourceFile>
-
<destinationFile>${project.build.directory}/../../../test-compiler-integration/src/test/resources/${project.artifactId}.jar</destinationFile>
+
<destinationFile>${project.build.directory}/../../../test-integration-prebuilt-tests/src/test/resources/${project.artifactId}.jar</destinationFile>
</configuration>
</execution>
</executions>
diff --git
a/drools-test-coverage/drools-test-coverage-jars/setter-overload/src/main/java/org/drools/compiler/integrationtests/setter/overload/SetterOverload.java
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/setter-overload/src/main/java/org/drools/compiler/integrationtests/setter/overload/SetterOverload.java
similarity index 100%
rename from
drools-test-coverage/drools-test-coverage-jars/setter-overload/src/main/java/org/drools/compiler/integrationtests/setter/overload/SetterOverload.java
rename to
drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/setter-overload/src/main/java/org/drools/compiler/integrationtests/setter/overload/SetterOverload.java
diff --git a/drools-test-coverage/drools-test-coverage-jars/surf/pom.xml
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/surf/pom.xml
similarity index 92%
rename from drools-test-coverage/drools-test-coverage-jars/surf/pom.xml
rename to
drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/surf/pom.xml
index 4d64756f856..857f6701211 100644
--- a/drools-test-coverage/drools-test-coverage-jars/surf/pom.xml
+++
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/surf/pom.xml
@@ -28,7 +28,7 @@
<version>1.0.0</version>
<packaging>jar</packaging>
- <name>Drools :: Test Coverage :: Jar with simple pojo</name>
+ <name>Drools :: Test Coverage :: Integration tests with prebuilt JARs - Jar
with simple pojo</name>
<properties>
<java.module.name>org.drools.compiler.integrationtests.surf</java.module.name>
@@ -64,7 +64,7 @@
</goals>
<configuration>
<sourceFile>${project.build.directory}/${project.build.finalName}.jar</sourceFile>
-
<destinationFile>${project.build.directory}/../../../test-compiler-integration/src/test/resources/${project.artifactId}.jar</destinationFile>
+
<destinationFile>${project.build.directory}/../../../test-integration-prebuilt-tests/src/test/resources/${project.artifactId}.jar</destinationFile>
</configuration>
</execution>
</executions>
diff --git
a/drools-test-coverage/drools-test-coverage-jars/surf/src/main/java/org/example/surf/Board.java
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/surf/src/main/java/org/example/surf/Board.java
similarity index 100%
rename from
drools-test-coverage/drools-test-coverage-jars/surf/src/main/java/org/example/surf/Board.java
rename to
drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/surf/src/main/java/org/example/surf/Board.java
diff --git
a/drools-test-coverage/drools-test-coverage-jars/surf/src/main/java/org/example/surf/Person.java
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/surf/src/main/java/org/example/surf/Person.java
similarity index 100%
rename from
drools-test-coverage/drools-test-coverage-jars/surf/src/main/java/org/example/surf/Person.java
rename to
drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/surf/src/main/java/org/example/surf/Person.java
diff --git a/drools-test-coverage/drools-test-coverage-jars/testEnum/pom.xml
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/testEnum/pom.xml
similarity index 93%
rename from drools-test-coverage/drools-test-coverage-jars/testEnum/pom.xml
rename to
drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/testEnum/pom.xml
index 3ad43595713..794f14757e8 100644
--- a/drools-test-coverage/drools-test-coverage-jars/testEnum/pom.xml
+++
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/testEnum/pom.xml
@@ -28,7 +28,7 @@
<version>1.0.0</version>
<packaging>jar</packaging>
- <name>Drools :: Test Coverage :: Jar with enum</name>
+ <name>Drools :: Test Coverage :: Integration tests with prebuilt JARs - Jar
with enum</name>
<properties>
<java.module.name>org.drools.compiler.integrationtests.testEnum</java.module.name>
@@ -64,7 +64,7 @@
</goals>
<configuration>
<sourceFile>${project.build.directory}/${project.build.finalName}.jar</sourceFile>
-
<destinationFile>${project.build.directory}/../../../test-compiler-integration/src/test/resources/${project.artifactId}.jar</destinationFile>
+
<destinationFile>${project.build.directory}/../../../test-integration-prebuilt-tests/src/test/resources/${project.artifactId}.jar</destinationFile>
</configuration>
</execution>
</executions>
diff --git
a/drools-test-coverage/drools-test-coverage-jars/testEnum/src/main/java/org/drools/Primitives.java
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/testEnum/src/main/java/org/drools/Primitives.java
similarity index 100%
rename from
drools-test-coverage/drools-test-coverage-jars/testEnum/src/main/java/org/drools/Primitives.java
rename to
drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/testEnum/src/main/java/org/drools/Primitives.java
diff --git
a/drools-test-coverage/drools-test-coverage-jars/testEnum/src/main/java/org/drools/TestEnum.java
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/testEnum/src/main/java/org/drools/TestEnum.java
similarity index 100%
rename from
drools-test-coverage/drools-test-coverage-jars/testEnum/src/main/java/org/drools/TestEnum.java
rename to
drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-jars/testEnum/src/main/java/org/drools/TestEnum.java
diff --git
a/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/pom.xml
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/pom.xml
new file mode 100644
index 00000000000..4eee7a6c645
--- /dev/null
+++
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/pom.xml
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>test-integration-prebuilt</artifactId>
+ <groupId>org.drools.testcoverage</groupId>
+ <version>999-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>test-integration-prebuilt-tests</artifactId>
+ <name>Drools :: Test Coverage :: Integration tests with prebuilt JARs -
Tests</name>
+
+ <properties>
+
<java.module.name>org.drools.compiler.integrationtests.prebuilt.tests</java.module.name>
+ <surefire.forkCount>1</surefire.forkCount>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-engine</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-engine-classic</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-core</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-compiler</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.kie</groupId>
+ <artifactId>kie-ci</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.kie</groupId>
+ <artifactId>kie-test-util</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.drools.testcoverage</groupId>
+ <artifactId>drools-test-suite</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- External dependencies -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.assertj</groupId>
+ <artifactId>assertj-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <!-- Ensures kie-maven-plugin is built before this module in the Maven
reactor -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.kie</groupId>
+ <artifactId>kie-maven-plugin</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+
+ <!-- The tests in this module use generated JARs/KJARs stored under
src/test/resources.
+ They are produced by test-integration-prebuilt-jars and must be
removed by clean
+ to avoid reusing stale artifacts between builds. -->
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>src/test/resources</directory>
+ <includes>
+ <include>*.jar</include>
+ </includes>
+ </fileset>
+ <fileset>
+ <directory>src/test/resources/kjar</directory>
+ <includes>
+ <include>*.jar</include>
+ </includes>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ <!-- The tests in this module use generated JARs/KJARs stored under
src/test/resources.
+ Make sure to build and copy these JARs/KJARs -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-invoker-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>build-test-kjar</id>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <phase>generate-test-resources</phase>
+ <configuration>
+ <pom>${basedir}/../test-integration-prebuilt-jars/pom.xml</pom>
+ <goals>
+ <goal>install</goal>
+ </goals>
+ <properties>
+ <skipInvokerITs>false</skipInvokerITs>
+ </properties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git
a/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/java/org/drools/testcoverage/integrationtests/prebuilt/DynamicRulesWithPrebuiltJarTest.java
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/java/org/drools/testcoverage/integrationtests/prebuilt/DynamicRulesWithPrebuiltJarTest.java
new file mode 100644
index 00000000000..4ab4e006957
--- /dev/null
+++
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/java/org/drools/testcoverage/integrationtests/prebuilt/DynamicRulesWithPrebuiltJarTest.java
@@ -0,0 +1,198 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.drools.testcoverage.integrationtests.prebuilt;
+
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.stream.Stream;
+
+import org.drools.kiesession.rulebase.InternalKnowledgeBase;
+import org.drools.core.impl.RuleBaseFactory;
+import org.drools.testcoverage.common.util.KieBaseTestConfiguration;
+import org.drools.testcoverage.common.util.KieBaseUtil;
+import org.drools.testcoverage.common.util.KieUtil;
+import org.drools.testcoverage.common.util.TestParametersUtil2;
+import org.junit.jupiter.api.Timeout;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
+import org.kie.api.KieBaseConfiguration;
+import org.kie.api.builder.KieModule;
+import org.kie.api.definition.KiePackage;
+import org.kie.api.runtime.KieSession;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.fail;
+
+/**
+ * Tests that verify isolated class loading of enum types from an external JAR.
+ * Extracted from DynamicRulesTest in test-compiler-integration.
+ */
+public class DynamicRulesWithPrebuiltJarTest {
+
+ public static Stream<KieBaseTestConfiguration> parameters() {
+ return
TestParametersUtil2.getKieBaseCloudConfigurations(false).stream();
+ }
+
+ /**
+ * Extracted from
DynamicRulesTest#testIsolatedClassLoaderWithEnumsPkgBuilder.
+ */
+ @ParameterizedTest(name = "KieBase type={0}")
+ @MethodSource("parameters")
+ @Timeout(10000)
+ public void
testIsolatedClassLoaderWithEnumsPkgBuilder(KieBaseTestConfiguration
kieBaseTestConfiguration) throws Exception {
+ try {
+ // Creates first class loader and use it to load fact classes
+ ClassLoader loader1 = new SubvertedClassLoader(new
URL[]{getClass().getResource("/testEnum.jar")},
+
this.getClass().getClassLoader());
+ loader1.loadClass("org.drools.Primitives");
+ loader1.loadClass("org.drools.TestEnum");
+
+ // create a builder with the given classloader
+ Collection<KiePackage> kpkgs =
KieBaseUtil.getKieBaseFromClasspathResourcesWithClassLoaderForKieBuilder(
+ "test", getClass(), loader1, kieBaseTestConfiguration,
"test_EnumSerialization.drl").getKiePackages();
+
+ // adding original packages to a kbase just to make sure they are
fine
+ KieBaseConfiguration kbaseConf =
RuleBaseFactory.newKnowledgeBaseConfiguration(null, loader1);
+ final KieModule kieModule =
KieUtil.getKieModuleFromResourcesWithClassLoaderForKieBuilder("test", loader1,
kieBaseTestConfiguration);
+ InternalKnowledgeBase kbase = (InternalKnowledgeBase)
KieBaseUtil.newKieBaseFromReleaseId(kieModule.getReleaseId(), kbaseConf);
+
+ kbase.addPackages(kpkgs);
+ KieSession ksession = kbase.newKieSession();
+ List list = new ArrayList();
+ ksession.setGlobal("list", list);
+ assertThat(ksession.fireAllRules()).isEqualTo(1);
+ assertThat(list.size()).isEqualTo(1);
+
+ // now, create another classloader and make sure it has access to
the classes
+ ClassLoader loader2 = new SubvertedClassLoader(new
URL[]{getClass().getResource("/testEnum.jar")},
+
this.getClass().getClassLoader());
+ loader2.loadClass("org.drools.Primitives");
+ loader2.loadClass("org.drools.TestEnum");
+
+ // create another kbase
+ KieBaseConfiguration kbaseConf2 =
RuleBaseFactory.newKnowledgeBaseConfiguration(null, loader2);
+ final KieModule kieModule2 =
KieUtil.getKieModuleFromResourcesWithClassLoaderForKieBuilder("test2", loader2,
kieBaseTestConfiguration);
+ InternalKnowledgeBase kbase2 = (InternalKnowledgeBase)
KieBaseUtil.newKieBaseFromReleaseId(kieModule2.getReleaseId(), kbaseConf2);
+
+ kbase2.addPackages(kpkgs);
+ ksession = kbase2.newKieSession();
+ list = new ArrayList();
+ ksession.setGlobal("list", list);
+ assertThat(ksession.fireAllRules()).isEqualTo(1);
+ assertThat(list.size()).isEqualTo(1);
+
+ } catch (ClassCastException cce) {
+ cce.printStackTrace();
+ fail("No ClassCastException should be raised.");
+ }
+ }
+
+ /**
+ * Extracted from
DynamicRulesTest#testIsolatedClassLoaderWithEnumsContextClassloader.
+ */
+ @ParameterizedTest(name = "KieBase type={0}")
+ @MethodSource("parameters")
+ @Timeout(10000)
+ public void
testIsolatedClassLoaderWithEnumsContextClassloader(KieBaseTestConfiguration
kieBaseTestConfiguration) throws Exception {
+ try {
+ // Creates first class loader and use it to load fact classes
+ ClassLoader loader1 = new SubvertedClassLoader(new
URL[]{getClass().getResource("/testEnum.jar")},
+
this.getClass().getClassLoader());
+ loader1.loadClass("org.drools.Primitives");
+ loader1.loadClass("org.drools.TestEnum");
+
+ // Build it using the current context
+ ClassLoader ccl = Thread.currentThread().getContextClassLoader();
+ Collection<KiePackage> kpkgs;
+ try {
+ Thread.currentThread().setContextClassLoader(loader1);
+ // create a builder with the given classloader
+ kpkgs = KieBaseUtil.getKieBaseFromClasspathResources("tmp",
getClass(), kieBaseTestConfiguration,
"test_EnumSerialization.drl").getKiePackages();
+
+ // adding original packages to a kbase just to make sure they
are fine
+ InternalKnowledgeBase kbase = (InternalKnowledgeBase)
KieBaseUtil.getKieBaseFromKieModuleFromDrl("test", kieBaseTestConfiguration);
+ kbase.addPackages(kpkgs);
+
+ KieSession ksession = kbase.newKieSession();
+ List list = new ArrayList();
+ ksession.setGlobal("list", list);
+ assertThat(ksession.fireAllRules()).isEqualTo(1);
+ assertThat(list.size()).isEqualTo(1);
+ } finally {
+ Thread.currentThread().setContextClassLoader(ccl);
+ }
+
+ // now, create another classloader and make sure it has access to
the classes
+ ClassLoader loader2 = new SubvertedClassLoader(new
URL[]{getClass().getResource("/testEnum.jar")},
+
this.getClass().getClassLoader());
+ loader2.loadClass("org.drools.Primitives");
+ loader2.loadClass("org.drools.TestEnum");
+
+ // set context classloader and use it
+ ccl = Thread.currentThread().getContextClassLoader();
+ try {
+ Thread.currentThread().setContextClassLoader(loader2);
+
+ // Note: This test originally serialize/deserialize kpkgs with
different context classloaders.
+ // Now exec-model doesn't support package serialization so we
may remove this test.
+
+ // create another kbase
+ InternalKnowledgeBase kbase2 = (InternalKnowledgeBase)
KieBaseUtil.getKieBaseFromKieModuleFromDrl("test2", kieBaseTestConfiguration);
+ kbase2.addPackages(kpkgs);
+
+ KieSession ksession = kbase2.newKieSession();
+ List list = new ArrayList();
+ ksession.setGlobal("list", list);
+ assertThat(ksession.fireAllRules()).isEqualTo(1);
+ assertThat(list.size()).isEqualTo(1);
+ } finally {
+ Thread.currentThread().setContextClassLoader(ccl);
+ }
+
+ } catch (ClassCastException cce) {
+ cce.printStackTrace();
+ fail("No ClassCastException should be raised.");
+ }
+ }
+
+ public class SubvertedClassLoader extends URLClassLoader {
+
+ private static final long serialVersionUID = 510l;
+
+ public SubvertedClassLoader(final URL[] urls, final ClassLoader
parentClassLoader) {
+ super(urls, parentClassLoader);
+ }
+
+ protected synchronized Class loadClass(String name, boolean resolve)
throws ClassNotFoundException {
+ // First, check if the class has already been loaded
+ Class c = findLoadedClass(name);
+ if (c == null) {
+ try {
+ c = findClass(name);
+ } catch (ClassNotFoundException e) {
+ c = super.loadClass(name, resolve);
+ }
+ }
+ return c;
+ }
+ }
+}
diff --git
a/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/java/org/drools/testcoverage/integrationtests/prebuilt/KieBuilderWithPrebuiltJarTest.java
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/java/org/drools/testcoverage/integrationtests/prebuilt/KieBuilderWithPrebuiltJarTest.java
new file mode 100644
index 00000000000..fac1fbf85d6
--- /dev/null
+++
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/java/org/drools/testcoverage/integrationtests/prebuilt/KieBuilderWithPrebuiltJarTest.java
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.drools.testcoverage.integrationtests.prebuilt;
+
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Stream;
+
+import org.drools.kiesession.rulebase.InternalKnowledgeBase;
+import org.drools.testcoverage.common.util.KieBaseTestConfiguration;
+import org.drools.testcoverage.common.util.KieBaseUtil;
+import org.drools.testcoverage.common.util.TestParametersUtil2;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
+import org.kie.api.runtime.KieSession;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/**
+ * Tests that a KieBuilder can use a ClassLoader backed by an external JAR
(surf).
+ * Extracted from Misc2Test#testKieBuilderWithClassLoader in
test-compiler-integration.
+ */
+public class KieBuilderWithPrebuiltJarTest {
+
+ public static Stream<KieBaseTestConfiguration> parameters() {
+ return
TestParametersUtil2.getKieBaseCloudConfigurations(false).stream();
+ }
+
+ /**
+ * Extracted from Misc2Test#testKieBuilderWithClassLoader (DROOLS-763).
+ */
+ @ParameterizedTest(name = "KieBase type={0}")
+ @MethodSource("parameters")
+ public void testKieBuilderWithClassLoader(KieBaseTestConfiguration
kieBaseTestConfiguration) {
+ // DROOLS-763
+ String drl =
+ "import org.example.surf.Person\n" +
+ "\n" +
+ "global java.util.List list\n" +
+ "\n" +
+ "rule R1 when\n" +
+ " $i : Integer()\n" +
+ "then\n" +
+ " Person p = new Person();\n" +
+ " p.setAge($i);\n" +
+ " insert(p);\n" +
+ "end\n" +
+ "\n" +
+ "rule R2 when\n" +
+ " $p : Person()\n" +
+ "then\n" +
+ " list.add($p.getAge());\n" +
+ "end\n";
+
+ URL simplejar = this.getClass().getResource("/surf.jar");
+ assertThat(simplejar).as("Make sure to build
test-integration-prebuilt-jars first")
+ .isNotNull();
+ URLClassLoader urlClassLoader = new URLClassLoader(new
URL[]{simplejar});
+
+ InternalKnowledgeBase kbase = (InternalKnowledgeBase)
KieBaseUtil.getKieBaseFromDrlWithClassLoaderForKieBuilder("test",
urlClassLoader, kieBaseTestConfiguration, drl);
+ KieSession ksession = kbase.newKieSession();
+
+ List<Integer> list = new ArrayList<>();
+ ksession.setGlobal("list", list);
+
+ ksession.insert(18);
+ ksession.fireAllRules();
+
+ assertThat(list.size()).isEqualTo(1);
+ assertThat((int) list.get(0)).isEqualTo(18);
+ }
+}
diff --git
a/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/java/org/drools/testcoverage/integrationtests/prebuilt/KieContainerWithPrebuiltJarTest.java
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/java/org/drools/testcoverage/integrationtests/prebuilt/KieContainerWithPrebuiltJarTest.java
new file mode 100644
index 00000000000..02730c70272
--- /dev/null
+++
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/java/org/drools/testcoverage/integrationtests/prebuilt/KieContainerWithPrebuiltJarTest.java
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.drools.testcoverage.integrationtests.prebuilt;
+
+import java.io.File;
+import java.util.Collection;
+
+import org.junit.jupiter.api.Test;
+import org.kie.api.KieBase;
+import org.kie.api.KieServices;
+import org.kie.api.builder.ReleaseId;
+import org.kie.api.definition.KiePackage;
+import org.kie.api.definition.rule.Rule;
+import org.kie.api.runtime.KieContainer;
+import org.kie.maven.integration.MavenRepository;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/**
+ * Tests that a KieContainer can be updated with a new KJAR version from the
Maven repository.
+ * Extracted from
KieContainerTest#testKieContainerBeforeAndAfterDeployOfSnapshot in test-suite.
+ */
+public class KieContainerWithPrebuiltJarTest {
+
+ @Test
+ public void testKieContainerBeforeAndAfterDeployOfSnapshot() throws
Exception {
+ // BZ-1007977
+ KieServices ks = KieServices.Factory.get();
+
+ String group = "org.kie.test";
+ String artifact = "test-module";
+ String version = "1.0.0-SNAPSHOT";
+
+ ReleaseId releaseId = ks.newReleaseId(group, artifact, version);
+
+ File kjar = new File("src/test/resources/kjar/kjar-module-before.jar");
+ assertThat(kjar).as("Make sure to build test-integration-prebuilt-jars
first")
+ .exists();
+ File pom = new File("src/test/resources/kjar/pom-kjar.xml");
+ MavenRepository repository = MavenRepository.getMavenRepository();
+ repository.installArtifact(releaseId, kjar, pom);
+
+ KieContainer kContainer = ks.newKieContainer(releaseId);
+ KieBase kbase = kContainer.getKieBase();
+ assertThat(kbase).isNotNull();
+ Collection<KiePackage> packages = kbase.getKiePackages();
+ assertThat(packages).isNotNull();
+ assertThat(packages.size()).isEqualTo(1);
+ Collection<Rule> rules = packages.iterator().next().getRules();
+ assertThat(rules.size()).isEqualTo(2);
+
+ ks.getRepository().removeKieModule(releaseId);
+
+ // deploy new version
+ File kjar1 = new File("src/test/resources/kjar/kjar-module-after.jar");
+ assertThat(kjar1).as("Make sure to build
test-integration-prebuilt-jars first")
+ .exists();
+ File pom1 = new File("src/test/resources/kjar/pom-kjar.xml");
+
+ repository.installArtifact(releaseId, kjar1, pom1);
+
+ KieContainer kContainer2 = ks.newKieContainer(releaseId);
+ KieBase kbase2 = kContainer2.getKieBase();
+ assertThat(kbase2).isNotNull();
+ Collection<KiePackage> packages2 = kbase2.getKiePackages();
+ assertThat(packages2).isNotNull();
+ assertThat(packages2.size()).isEqualTo(1);
+ Collection<Rule> rules2 = packages2.iterator().next().getRules();
+ assertThat(rules2.size()).isEqualTo(4);
+
+ ks.getRepository().removeKieModule(releaseId);
+ }
+}
diff --git
a/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/KieRepositoryTest.java
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/java/org/drools/testcoverage/integrationtests/prebuilt/KieRepositoryWithPrebuiltJarTest.java
similarity index 60%
rename from
drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/KieRepositoryTest.java
rename to
drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/java/org/drools/testcoverage/integrationtests/prebuilt/KieRepositoryWithPrebuiltJarTest.java
index d7843fc3caf..53191d2d6ec 100644
---
a/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/KieRepositoryTest.java
+++
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/java/org/drools/testcoverage/integrationtests/prebuilt/KieRepositoryWithPrebuiltJarTest.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.drools.mvel.integrationtests;
+package org.drools.testcoverage.integrationtests.prebuilt;
import java.net.URL;
import java.net.URLClassLoader;
@@ -29,7 +29,11 @@ import org.kie.api.builder.ReleaseId;
import static org.assertj.core.api.Assertions.assertThat;
-public class KieRepositoryTest {
+/**
+ * Tests loading KJARs from the classpath via URLClassLoader.
+ * Extracted from KieRepositoryTest in test-compiler-integration.
+ */
+public class KieRepositoryWithPrebuiltJarTest {
@Test
public void testLoadKjarFromClasspath() {
@@ -37,20 +41,20 @@ public class KieRepositoryTest {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
URL simpleKjar =
this.getClass().getResource("/kie-project-simple-1.0.0.jar");
- assertThat(simpleKjar).as("Make sure to build
drools-test-coverage-jars first")
+ assertThat(simpleKjar).as("Make sure to build
test-integration-prebuilt-jars first")
.isNotNull();
- URLClassLoader urlClassLoader = new URLClassLoader( new
URL[]{simpleKjar} );
- Thread.currentThread().setContextClassLoader( urlClassLoader );
+ URLClassLoader urlClassLoader = new URLClassLoader(new
URL[]{simpleKjar});
+ Thread.currentThread().setContextClassLoader(urlClassLoader);
try {
KieServices ks = KieServices.Factory.get();
KieRepository kieRepository = ks.getRepository();
- ReleaseId releaseId = ks.newReleaseId( "org.drools.testcoverage",
"kie-project-simple", "1.0.0" );
- KieModule kieModule = kieRepository.getKieModule( releaseId );
+ ReleaseId releaseId = ks.newReleaseId("org.drools.testcoverage",
"kie-project-simple", "1.0.0");
+ KieModule kieModule = kieRepository.getKieModule(releaseId);
assertThat(kieModule).isNotNull();
assertThat(kieModule.getReleaseId()).isEqualTo(releaseId);
} finally {
- Thread.currentThread().setContextClassLoader( cl );
+ Thread.currentThread().setContextClassLoader(cl);
}
}
@@ -60,41 +64,41 @@ public class KieRepositoryTest {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
URL simpleKjar =
this.getClass().getResource("/kie-project-simple-1.0.0.jar");
- assertThat(simpleKjar).as("Make sure to build
drools-test-coverage-jars first")
+ assertThat(simpleKjar).as("Make sure to build
test-integration-prebuilt-jars first")
.isNotNull();
- URLClassLoader urlClassLoader = new URLClassLoader( new
URL[]{simpleKjar} );
- Thread.currentThread().setContextClassLoader( urlClassLoader );
+ URLClassLoader urlClassLoader = new URLClassLoader(new
URL[]{simpleKjar});
+ Thread.currentThread().setContextClassLoader(urlClassLoader);
try {
KieServices ks = KieServices.Factory.get();
KieRepository kieRepository = ks.getRepository();
- ReleaseId releaseId = ks.newReleaseId( "org.drools.testcoverage",
"kie-project-simple", "1.0.1" );
- KieModule kieModule = kieRepository.getKieModule( releaseId );
+ ReleaseId releaseId = ks.newReleaseId("org.drools.testcoverage",
"kie-project-simple", "1.0.1");
+ KieModule kieModule = kieRepository.getKieModule(releaseId);
assertThat(kieModule).isNull();
} finally {
- Thread.currentThread().setContextClassLoader( cl );
+ Thread.currentThread().setContextClassLoader(cl);
}
}
-
+
@Test
public void testLoadingNotAKJar() {
// DROOLS-1351
ClassLoader cl = Thread.currentThread().getContextClassLoader();
URL pojoJar =
this.getClass().getResource("/only-jar-pojo-not-kjar-no-kmodule-1.0.0.jar");
- assertThat(pojoJar).as("Make sure to build drools-test-coverage-jars
first")
+ assertThat(pojoJar).as("Make sure to build
test-integration-prebuilt-jars first")
.isNotNull();
- URLClassLoader urlClassLoader = new URLClassLoader( new URL[]{pojoJar}
);
- Thread.currentThread().setContextClassLoader( urlClassLoader );
+ URLClassLoader urlClassLoader = new URLClassLoader(new URL[]{pojoJar});
+ Thread.currentThread().setContextClassLoader(urlClassLoader);
try {
KieServices ks = KieServices.Factory.get();
KieRepository kieRepository = ks.getRepository();
- ReleaseId releaseId = ks.newReleaseId( "org.drools.testcoverage",
"only-jar-pojo-not-kjar-no-kmodule", "1.0.0" );
- KieModule kieModule = kieRepository.getKieModule( releaseId );
+ ReleaseId releaseId = ks.newReleaseId("org.drools.testcoverage",
"only-jar-pojo-not-kjar-no-kmodule", "1.0.0");
+ KieModule kieModule = kieRepository.getKieModule(releaseId);
assertThat(kieModule).isNull();
} finally {
- Thread.currentThread().setContextClassLoader( cl );
+ Thread.currentThread().setContextClassLoader(cl);
}
}
}
diff --git
a/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/java/org/drools/testcoverage/integrationtests/prebuilt/MBeansMonitoringWithPrebuiltJarTest.java
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/java/org/drools/testcoverage/integrationtests/prebuilt/MBeansMonitoringWithPrebuiltJarTest.java
new file mode 100644
index 00000000000..22bae8df2b7
--- /dev/null
+++
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/java/org/drools/testcoverage/integrationtests/prebuilt/MBeansMonitoringWithPrebuiltJarTest.java
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.drools.testcoverage.integrationtests.prebuilt;
+
+import java.lang.management.ManagementFactory;
+import java.net.URL;
+import java.net.URLClassLoader;
+
+import javax.management.JMX;
+import javax.management.MBeanServer;
+
+import org.drools.compiler.kie.builder.impl.KieServicesImpl;
+import org.drools.core.management.DroolsManagementAgent;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.kie.api.KieServices;
+import org.kie.api.builder.KieModule;
+import org.kie.api.builder.KieRepository;
+import org.kie.api.builder.ReleaseId;
+import org.kie.api.conf.MBeansOption;
+import org.kie.api.management.KieContainerMonitorMXBean;
+import org.kie.api.runtime.KieContainer;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/**
+ * Tests that JMX MBeans are correctly registered when loading a KJAR from the
classpath.
+ * Extracted from MBeansMonitoringTest#testLoadKjarFromClasspath in
test-compiler-integration.
+ */
+public class MBeansMonitoringWithPrebuiltJarTest {
+
+ private String mbeansprop;
+
+ @BeforeEach
+ public void setUp() {
+ ((KieServicesImpl)
KieServices.Factory.get()).nullKieClasspathContainer();
+ ((KieServicesImpl) KieServices.Factory.get()).nullAllContainerIds();
+ mbeansprop = System.getProperty(MBeansOption.PROPERTY_NAME);
+ System.setProperty(MBeansOption.PROPERTY_NAME, "enabled");
+ }
+
+ @AfterEach
+ public void tearDown() {
+ ((KieServicesImpl)
KieServices.Factory.get()).nullKieClasspathContainer();
+ ((KieServicesImpl) KieServices.Factory.get()).nullAllContainerIds();
+ if (mbeansprop != null) {
+ System.setProperty(MBeansOption.PROPERTY_NAME, mbeansprop);
+ } else {
+ System.setProperty(MBeansOption.PROPERTY_NAME,
MBeansOption.DISABLED.toString());
+ }
+ }
+
+ /**
+ * Extracted from MBeansMonitoringTest#testLoadKjarFromClasspath
(DROOLS-1335).
+ * Verifies that KieContainerMonitorMXBean reflects the correct ReleaseId
after loading
+ * a KJAR from a URLClassLoader-backed classpath.
+ */
+ @Test
+ public void testLoadKjarFromClasspath() {
+ // DROOLS-1335
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+
+ URL simpleKjar =
this.getClass().getResource("/kie-project-simple-1.0.0.jar");
+ assertThat(simpleKjar).as("Make sure to build
test-integration-prebuilt-jars first")
+ .isNotNull();
+ URLClassLoader urlClassLoader = new URLClassLoader(new
URL[]{simpleKjar});
+ Thread.currentThread().setContextClassLoader(urlClassLoader);
+
+ MBeanServer mbserver = ManagementFactory.getPlatformMBeanServer();
+
+ try {
+ KieServices ks = KieServices.Factory.get();
+ KieRepository kieRepository = ks.getRepository();
+ ReleaseId releaseId = ks.newReleaseId("org.drools.testcoverage",
"kie-project-simple", "1.0.0");
+ KieModule kieModule = kieRepository.getKieModule(releaseId);
+ assertThat(kieModule).isNotNull();
+ assertThat(kieModule.getReleaseId()).isEqualTo(releaseId);
+
+ KieContainer kc = ks.newKieContainer("myID", releaseId);
+
+ KieContainerMonitorMXBean c1Monitor = JMX.newMXBeanProxy(
+ mbserver,
+ DroolsManagementAgent.createObjectNameBy("myID"),
+ KieContainerMonitorMXBean.class);
+
+
assertThat(c1Monitor.getConfiguredReleaseId().sameGAVof(releaseId)).isTrue();
+
assertThat(c1Monitor.getResolvedReleaseId().sameGAVof(releaseId)).isTrue();
+
+ kc.dispose();
+ } finally {
+ Thread.currentThread().setContextClassLoader(cl);
+ }
+ }
+}
diff --git
a/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/MarshallingTest.java
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/java/org/drools/testcoverage/integrationtests/prebuilt/MarshallingWithPrebuiltJarTest.java
similarity index 82%
rename from
drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/MarshallingTest.java
rename to
drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/java/org/drools/testcoverage/integrationtests/prebuilt/MarshallingWithPrebuiltJarTest.java
index d1ca1f6b11f..de64997649a 100644
---
a/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/MarshallingTest.java
+++
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/java/org/drools/testcoverage/integrationtests/prebuilt/MarshallingWithPrebuiltJarTest.java
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.drools.mvel.integrationtests;
+package org.drools.testcoverage.integrationtests.prebuilt;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
@@ -25,6 +25,7 @@ import java.util.jar.JarEntry;
import java.util.jar.JarInputStream;
import org.drools.base.rule.MapBackedClassLoader;
+import org.drools.testcoverage.common.util.SerializationHelper;
import org.junit.jupiter.api.Test;
import org.kie.api.definition.KiePackage;
import org.kie.api.io.ResourceType;
@@ -36,17 +37,22 @@ import org.kie.internal.io.ResourceFactory;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
-class MarshallingTest {
+/**
+ * Tests serialisability of rules whose fact types are loaded from an external
JAR.
+ * Extracted from MarshallingTest in test-compiler-integration.
+ */
+class MarshallingWithPrebuiltJarTest {
/**
* In this case we are dealing with facts which are not on the systems
classpath.
+ * Extracted from MarshallingTest#testSerializabilityWithJarFacts.
*/
@Test
void testSerializabilityWithJarFacts() throws Exception {
MapBackedClassLoader loader = new
MapBackedClassLoader(this.getClass().getClassLoader());
InputStream is = this.getClass().getResourceAsStream("/surf.jar");
- assertThat(is).as("Make sure to build drools-test-coverage-jars first")
+ assertThat(is).as("Make sure to build test-integration-prebuilt-jars
first")
.isNotNull();
JarInputStream jis = new JarInputStream(is);
@@ -57,12 +63,9 @@ class MarshallingTest {
if (!entry.isDirectory()) {
ByteArrayOutputStream out = new ByteArrayOutputStream();
while ((len = jis.read(buf)) >= 0) {
- out.write(buf,
- 0,
- len);
+ out.write(buf, 0, len);
}
- loader.addResource(entry.getName(),
- out.toByteArray());
+ loader.addResource(entry.getName(), out.toByteArray());
}
}
diff --git
a/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/java/org/drools/testcoverage/integrationtests/prebuilt/SetterOverloadWithPrebuiltJarTest.java
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/java/org/drools/testcoverage/integrationtests/prebuilt/SetterOverloadWithPrebuiltJarTest.java
new file mode 100644
index 00000000000..e8852fffb06
--- /dev/null
+++
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/java/org/drools/testcoverage/integrationtests/prebuilt/SetterOverloadWithPrebuiltJarTest.java
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.drools.testcoverage.integrationtests.prebuilt;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.jar.JarEntry;
+import java.util.jar.JarInputStream;
+import java.util.stream.Stream;
+
+import org.drools.base.rule.MapBackedClassLoader;
+import org.drools.testcoverage.common.util.KieBaseTestConfiguration;
+import org.drools.testcoverage.common.util.TestParametersUtil2;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
+import org.kie.api.io.ResourceType;
+import org.kie.internal.builder.KnowledgeBuilder;
+import org.kie.internal.builder.KnowledgeBuilderConfiguration;
+import org.kie.internal.builder.KnowledgeBuilderFactory;
+import org.kie.internal.io.ResourceFactory;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/**
+ * Tests that setter-overload classes loaded from an external JAR compile
without errors.
+ * Extracted from JBRULESTest#testGUVNOR578_2 in test-compiler-integration.
+ */
+public class SetterOverloadWithPrebuiltJarTest {
+
+ public static Stream<KieBaseTestConfiguration> parameters() {
+ return
TestParametersUtil2.getKieBaseCloudConfigurations(true).stream();
+ }
+
+ /**
+ * Extracted from JBRULESTest#testGUVNOR578_2.
+ */
+ @ParameterizedTest(name = "KieBase type={0}")
+ @MethodSource("parameters")
+ public void testGUVNOR578_2(KieBaseTestConfiguration
kieBaseTestConfiguration) throws Exception {
+ // An internal specific test case so not enhanced for executable-model
+ final MapBackedClassLoader loader = new
MapBackedClassLoader(this.getClass().getClassLoader());
+
+ InputStream is =
this.getClass().getResourceAsStream("/setter-overload.jar");
+ assertThat(is).as("Make sure to build test-integration-prebuilt-jars
first")
+ .isNotNull();
+ final JarInputStream jis = new JarInputStream(is);
+
+ JarEntry entry;
+ final byte[] buf = new byte[1024];
+ int len;
+ while ((entry = jis.getNextJarEntry()) != null) {
+ if (!entry.isDirectory()) {
+ final ByteArrayOutputStream out = new ByteArrayOutputStream();
+ while ((len = jis.read(buf)) >= 0) {
+ out.write(buf, 0, len);
+ }
+ loader.addResource(entry.getName(), out.toByteArray());
+ }
+ }
+
+ final List<JarInputStream> jarInputStreams = new
ArrayList<JarInputStream>();
+ jarInputStreams.add(jis);
+
+ final KnowledgeBuilderConfiguration conf =
KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(null, loader);
+ final KnowledgeBuilder kbuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder(conf);
+
+ final String header = "import
org.drools.compiler.integrationtests.setter.overload.SetterOverload\n";
+
+ kbuilder.add(ResourceFactory.newByteArrayResource(header.getBytes()),
ResourceType.DRL);
+ assertThat(kbuilder.hasErrors()).isFalse();
+
+ final String passingRule = "rule \"rule1\"\n"
+ + "dialect \"mvel\"\n"
+ + "when\n"
+ + "SetterOverload( echelle == \"abc\" )"
+ + "then\n"
+ + "end\n";
+
+ final String failingRule = "rule \"rule2\"\n"
+ + "dialect \"mvel\"\n"
+ + "when\n"
+ + "SetterOverload( quotiteRemuneration == 123 , echelle ==
\"abc\" )"
+ + "then\n"
+ + "end\n";
+
+
kbuilder.add(ResourceFactory.newByteArrayResource(passingRule.getBytes()),
ResourceType.DRL);
+ assertThat(kbuilder.hasErrors()).isFalse();
+
+
kbuilder.add(ResourceFactory.newByteArrayResource(failingRule.getBytes()),
ResourceType.DRL);
+ assertThat(kbuilder.hasErrors()).isFalse();
+ }
+}
diff --git
a/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kie-project-simple/src/main/resources/META-INF/kmodule.xml
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/resources/kjar/pom-kjar.xml
similarity index 69%
copy from
drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kie-project-simple/src/main/resources/META-INF/kmodule.xml
copy to
drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/resources/kjar/pom-kjar.xml
index 0c77ec31e8b..c4885aa7dfc 100644
---
a/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kie-project-simple/src/main/resources/META-INF/kmodule.xml
+++
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/resources/kjar/pom-kjar.xml
@@ -1,4 +1,3 @@
-<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
@@ -19,10 +18,9 @@
under the License.
-->
-<kmodule
- xmlns="http://jboss.org/kie/6.0.0/kmodule">
-
- <kbase name="simpleKBase">
- <ksession name="simpleKSession" default="true"/>
- </kbase>
-</kmodule>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.kie.test</groupId>
+ <artifactId>test-module</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+</project>
\ No newline at end of file
diff --git
a/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kie-project-simple/src/main/resources/META-INF/kmodule.xml
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/resources/logback-test.xml
similarity index 65%
rename from
drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kie-project-simple/src/main/resources/META-INF/kmodule.xml
rename to
drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/resources/logback-test.xml
index 0c77ec31e8b..d91bcf01e6f 100644
---
a/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kie-project-simple/src/main/resources/META-INF/kmodule.xml
+++
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/resources/logback-test.xml
@@ -19,10 +19,20 @@
under the License.
-->
-<kmodule
- xmlns="http://jboss.org/kie/6.0.0/kmodule">
- <kbase name="simpleKBase">
- <ksession name="simpleKSession" default="true"/>
- </kbase>
-</kmodule>
+<configuration>
+
+ <appender name="consoleAppender"
class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>%date{HH:mm:ss.SSS} [%thread] %-5level
%class{36}.%method:%line - %msg%n</pattern>
+ </encoder>
+ </appender>
+
+ <logger name="org.kie" level="warn"/>
+ <logger name="org.drools" level="warn"/>
+
+ <root level="warn">
+ <appender-ref ref="consoleAppender" />
+ </root>
+
+</configuration>
diff --git
a/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kjar-module-after/src/main/resources/KBase-test/kjar/rule2.drl
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/resources/org/drools/testcoverage/integrationtests/prebuilt/test_EnumSerialization.drl
old mode 100644
new mode 100755
similarity index 77%
rename from
drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kjar-module-after/src/main/resources/KBase-test/kjar/rule2.drl
rename to
drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/resources/org/drools/testcoverage/integrationtests/prebuilt/test_EnumSerialization.drl
index 571f9790314..343b185e4c9
---
a/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kjar-module-after/src/main/resources/KBase-test/kjar/rule2.drl
+++
b/drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/resources/org/drools/testcoverage/integrationtests/prebuilt/test_EnumSerialization.drl
@@ -17,23 +17,16 @@
* under the License.
*/
-package org.drools.test
+package org.drools.compiler.test
+import org.drools.Primitives
+import org.drools.TestEnum
-rule "Your First Rule"
+global java.util.List list;
+rule "enum serialization with isolated classloader"
when
- //conditions
+ not Primitives( enumValue == TestEnum.TWO )
then
- //actions
-
-end
-
-rule "Your Second Rule"
- //include attributes such as "salience" here...
- when
- //conditions
- then
- //actions
-
+ list.add("xxx");
end
diff --git a/drools-test-coverage/test-suite/pom.xml
b/drools-test-coverage/test-suite/pom.xml
index 78d400b8cd0..d1cb36f0096 100644
--- a/drools-test-coverage/test-suite/pom.xml
+++ b/drools-test-coverage/test-suite/pom.xml
@@ -132,13 +132,6 @@
<artifactId>kie-test-util</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.drools.testcoverage</groupId>
- <artifactId>drools-test-coverage-jars</artifactId>
- <type>pom</type>
- <scope>test</scope>
- </dependency>
-
<!-- External dependencies -->
<dependency>
<groupId>org.slf4j</groupId>
@@ -169,39 +162,6 @@
</dependency>
</dependencies>
- <build>
- <plugins>
- <!-- Ensures kie-maven-plugin is built before this module in the Maven
reactor -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>org.kie</groupId>
- <artifactId>kie-maven-plugin</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
- </plugin>
- <!-- The tests in this module use generated KJARs stored under
src/test/resources/kjar.
- They are produced by the drools-test-coverage-jars setup/profile
when missing, and
- must be removed by clean to avoid reusing stale artifacts between
builds. -->
- <plugin>
- <artifactId>maven-clean-plugin</artifactId>
- <configuration>
- <filesets>
- <fileset>
- <directory>src/test/resources/kjar</directory>
- <includes>
- <include>*.jar</include>
- </includes>
- </fileset>
- </filesets>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
<profiles>
<profile>
<id>runTurtleTests</id>
@@ -215,42 +175,6 @@
</properties>
</profile>
- <!-- drools-test-suite requires test jars built by
drools-test-coverage-jars -->
- <!-- This profile makes sure that drools-test-coverage-jars is executed if
not-->
- <!-- See: https://github.com/apache/incubator-kie-drools/pull/6144 -->
- <profile>
- <id>missing-test-jar-file</id>
- <activation>
- <file>
- <missing>src/test/resources/kjar/kjar-module-before.jar</missing>
- </file>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-invoker-plugin</artifactId>
- <executions>
- <execution>
- <id>build-drools-test-coverage-jars</id>
- <goals>
- <goal>run</goal>
- </goals>
- <phase>generate-test-resources</phase>
- <configuration>
-
<projectsDirectory>${basedir}/../drools-test-coverage-jars</projectsDirectory>
- <logDirectory>${path.to.buildlog.directory}</logDirectory>
- <goals>
- <goal>clean</goal>
- <goal>install</goal>
- </goals>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
</profiles>
</project>
diff --git
a/drools-test-coverage/test-suite/src/test/java/org/drools/testcoverage/functional/KieContainerTest.java
b/drools-test-coverage/test-suite/src/test/java/org/drools/testcoverage/functional/KieContainerTest.java
index 6965d544719..e9fd5002faf 100644
---
a/drools-test-coverage/test-suite/src/test/java/org/drools/testcoverage/functional/KieContainerTest.java
+++
b/drools-test-coverage/test-suite/src/test/java/org/drools/testcoverage/functional/KieContainerTest.java
@@ -20,7 +20,6 @@ package org.drools.testcoverage.functional;
import java.io.File;
import java.io.IOException;
-import java.util.Collection;
import org.drools.testcoverage.common.util.TestConstants;
import org.junit.jupiter.api.BeforeEach;
@@ -32,12 +31,9 @@ import org.kie.api.builder.KieBuilder;
import org.kie.api.builder.KieFileSystem;
import org.kie.api.builder.ReleaseId;
import org.kie.api.builder.model.KieModuleModel;
-import org.kie.api.definition.KiePackage;
-import org.kie.api.definition.rule.Rule;
import org.kie.api.io.KieResources;
import org.kie.api.runtime.KieContainer;
import org.kie.api.runtime.KieSession;
-import org.kie.maven.integration.MavenRepository;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
@@ -130,52 +126,4 @@ public class KieContainerTest {
kbuilder.buildAll();
}
- @Test
- public void testKieContainerBeforeAndAfterDeployOfSnapshot() throws
Exception {
- // BZ-1007977
- KieServices ks = KieServices.Factory.get();
-
- String group = "org.kie.test";
- String artifact = "test-module";
- String version = "1.0.0-SNAPSHOT";
-
- ReleaseId releaseId = ks.newReleaseId(group, artifact, version);
-
- File kjar = new File("src/test/resources/kjar/kjar-module-before.jar");
- assertThat(kjar).as("Make sure to build drools-test-coverage-jars
first")
- .exists();
- File pom = new File("src/test/resources/kjar/pom-kjar.xml");
- MavenRepository repository = MavenRepository.getMavenRepository();
- repository.installArtifact(releaseId, kjar, pom);
-
- KieContainer kContainer = ks.newKieContainer(releaseId);
- KieBase kbase = kContainer.getKieBase();
- assertThat(kbase).isNotNull();
- Collection<KiePackage> packages = kbase.getKiePackages();
- assertThat(packages).isNotNull();
- assertThat(packages.size()).isEqualTo(1);
- Collection<Rule> rules = packages.iterator().next().getRules();
- assertThat(rules.size()).isEqualTo(2);
-
- ks.getRepository().removeKieModule(releaseId);
-
- // deploy new version
- File kjar1 = new File("src/test/resources/kjar/kjar-module-after.jar");
- assertThat(kjar1).as("Make sure to build drools-test-coverage-jars
first")
- .exists();
- File pom1 = new File("src/test/resources/kjar/pom-kjar.xml");
-
- repository.installArtifact(releaseId, kjar1, pom1);
-
- KieContainer kContainer2 = ks.newKieContainer(releaseId);
- KieBase kbase2 = kContainer2.getKieBase();
- assertThat(kbase2).isNotNull();
- Collection<KiePackage> packages2 = kbase2.getKiePackages();
- assertThat(packages2).isNotNull();
- assertThat(packages2.size()).isEqualTo(1);
- Collection<Rule> rules2 = packages2.iterator().next().getRules();
- assertThat(rules2.size()).isEqualTo(4);
-
- ks.getRepository().removeKieModule(releaseId);
- }
}
diff --git
a/script/ci/tests/scenarios-compute-build-scopes/02-hub-module-source/expected-affected.txt
b/script/ci/tests/scenarios-compute-build-scopes/02-hub-module-source/expected-affected.txt
index 969d6d0a69c..8c1ac2e8bf1 100644
---
a/script/ci/tests/scenarios-compute-build-scopes/02-hub-module-source/expected-affected.txt
+++
b/script/ci/tests/scenarios-compute-build-scopes/02-hub-module-source/expected-affected.txt
@@ -1,11 +1,12 @@
org.drools.testcoverage:drools-kie-ci-with-domain-tests
org.drools.testcoverage:drools-kie-ci-without-domain-tests
-org.drools.testcoverage:drools-test-coverage-jars-with-invoker
+org.drools.testcoverage:kjar-with-invoker
org.drools.testcoverage:drools-test-suite
org.drools.testcoverage:test-compiler-integration
org.drools.testcoverage:test-integration-nomvel
org.drools.testcoverage:test-integration-notms
org.drools.testcoverage:test-integration-noxml
+org.drools.testcoverage:test-integration-prebuilt-tests
org.drools.testcoverage:test-integration-ruleunits-jar
org.drools.testcoverage:test-integration-ruleunits-tests
org.drools:default-kiesession
diff --git
a/script/ci/tests/scenarios-compute-build-scopes/02-hub-module-source/expected-upstream.txt
b/script/ci/tests/scenarios-compute-build-scopes/02-hub-module-source/expected-upstream.txt
index e7009980f4d..1a20088611f 100644
---
a/script/ci/tests/scenarios-compute-build-scopes/02-hub-module-source/expected-upstream.txt
+++
b/script/ci/tests/scenarios-compute-build-scopes/02-hub-module-source/expected-upstream.txt
@@ -2,8 +2,9 @@ org.drools.testcoverage:drools-kie-ci-with-domain-parent
org.drools.testcoverage:drools-kie-ci-with-domain-test-domain
org.drools.testcoverage:drools-kie-ci-without-domain-parent
org.drools.testcoverage:drools-standalone-parent
-org.drools.testcoverage:drools-test-coverage-jars
org.drools.testcoverage:drools-test-coverage-parent
+org.drools.testcoverage:test-integration-prebuilt
+org.drools.testcoverage:test-integration-prebuilt-jars
org.drools.testcoverage:test-integration-ruleunits
org.drools:drools-addons-quarkus-events-rules-parent
org.drools:drools-base
diff --git
a/script/ci/tests/scenarios-compute-build-scopes/03-root-pom/expected-affected.txt
b/script/ci/tests/scenarios-compute-build-scopes/03-root-pom/expected-affected.txt
index 1f114bd987e..1d00c2df45f 100644
---
a/script/ci/tests/scenarios-compute-build-scopes/03-root-pom/expected-affected.txt
+++
b/script/ci/tests/scenarios-compute-build-scopes/03-root-pom/expected-affected.txt
@@ -7,15 +7,17 @@
org.drools.testcoverage:drools-kie-ci-without-domain-test-domain
org.drools.testcoverage:drools-kie-ci-without-domain-test-kjar
org.drools.testcoverage:drools-kie-ci-without-domain-tests
org.drools.testcoverage:drools-standalone-parent
-org.drools.testcoverage:drools-test-coverage-jars
-org.drools.testcoverage:drools-test-coverage-jars-with-invoker
org.drools.testcoverage:drools-test-coverage-parent
org.drools.testcoverage:drools-test-suite
+org.drools.testcoverage:kjar-with-invoker
org.drools.testcoverage:setter-overload
org.drools.testcoverage:test-compiler-integration
org.drools.testcoverage:test-integration-nomvel
org.drools.testcoverage:test-integration-notms
org.drools.testcoverage:test-integration-noxml
+org.drools.testcoverage:test-integration-prebuilt
+org.drools.testcoverage:test-integration-prebuilt-jars
+org.drools.testcoverage:test-integration-prebuilt-tests
org.drools.testcoverage:test-integration-ruleunits
org.drools.testcoverage:test-integration-ruleunits-jar
org.drools.testcoverage:test-integration-ruleunits-tests
diff --git
a/script/ci/tests/scenarios-compute-build-scopes/05-upstream-downstream-pair/expected-affected.txt
b/script/ci/tests/scenarios-compute-build-scopes/05-upstream-downstream-pair/expected-affected.txt
index 969d6d0a69c..8c1ac2e8bf1 100644
---
a/script/ci/tests/scenarios-compute-build-scopes/05-upstream-downstream-pair/expected-affected.txt
+++
b/script/ci/tests/scenarios-compute-build-scopes/05-upstream-downstream-pair/expected-affected.txt
@@ -1,11 +1,12 @@
org.drools.testcoverage:drools-kie-ci-with-domain-tests
org.drools.testcoverage:drools-kie-ci-without-domain-tests
-org.drools.testcoverage:drools-test-coverage-jars-with-invoker
+org.drools.testcoverage:kjar-with-invoker
org.drools.testcoverage:drools-test-suite
org.drools.testcoverage:test-compiler-integration
org.drools.testcoverage:test-integration-nomvel
org.drools.testcoverage:test-integration-notms
org.drools.testcoverage:test-integration-noxml
+org.drools.testcoverage:test-integration-prebuilt-tests
org.drools.testcoverage:test-integration-ruleunits-jar
org.drools.testcoverage:test-integration-ruleunits-tests
org.drools:default-kiesession
diff --git
a/script/ci/tests/scenarios-compute-build-scopes/05-upstream-downstream-pair/expected-upstream.txt
b/script/ci/tests/scenarios-compute-build-scopes/05-upstream-downstream-pair/expected-upstream.txt
index e7009980f4d..1a20088611f 100644
---
a/script/ci/tests/scenarios-compute-build-scopes/05-upstream-downstream-pair/expected-upstream.txt
+++
b/script/ci/tests/scenarios-compute-build-scopes/05-upstream-downstream-pair/expected-upstream.txt
@@ -2,8 +2,9 @@ org.drools.testcoverage:drools-kie-ci-with-domain-parent
org.drools.testcoverage:drools-kie-ci-with-domain-test-domain
org.drools.testcoverage:drools-kie-ci-without-domain-parent
org.drools.testcoverage:drools-standalone-parent
-org.drools.testcoverage:drools-test-coverage-jars
org.drools.testcoverage:drools-test-coverage-parent
+org.drools.testcoverage:test-integration-prebuilt
+org.drools.testcoverage:test-integration-prebuilt-jars
org.drools.testcoverage:test-integration-ruleunits
org.drools:drools-addons-quarkus-events-rules-parent
org.drools:drools-base
diff --git
a/script/ci/tests/scenarios-compute-build-scopes/06-aggregator-pom/expected-affected.txt
b/script/ci/tests/scenarios-compute-build-scopes/06-aggregator-pom/expected-affected.txt
index 5c181166ef9..f7b0f4ca0e9 100644
---
a/script/ci/tests/scenarios-compute-build-scopes/06-aggregator-pom/expected-affected.txt
+++
b/script/ci/tests/scenarios-compute-build-scopes/06-aggregator-pom/expected-affected.txt
@@ -1,11 +1,12 @@
org.drools.testcoverage:drools-kie-ci-with-domain-tests
org.drools.testcoverage:drools-kie-ci-without-domain-tests
-org.drools.testcoverage:drools-test-coverage-jars-with-invoker
+org.drools.testcoverage:kjar-with-invoker
org.drools.testcoverage:drools-test-suite
org.drools.testcoverage:test-compiler-integration
org.drools.testcoverage:test-integration-nomvel
org.drools.testcoverage:test-integration-notms
org.drools.testcoverage:test-integration-noxml
+org.drools.testcoverage:test-integration-prebuilt-tests
org.drools.testcoverage:test-integration-ruleunits-jar
org.drools.testcoverage:test-integration-ruleunits-tests
org.drools:default-kiesession
diff --git
a/script/ci/tests/scenarios-compute-build-scopes/06-aggregator-pom/expected-upstream.txt
b/script/ci/tests/scenarios-compute-build-scopes/06-aggregator-pom/expected-upstream.txt
index 75f6b7fa478..96efd39dd29 100644
---
a/script/ci/tests/scenarios-compute-build-scopes/06-aggregator-pom/expected-upstream.txt
+++
b/script/ci/tests/scenarios-compute-build-scopes/06-aggregator-pom/expected-upstream.txt
@@ -2,8 +2,9 @@ org.drools.testcoverage:drools-kie-ci-with-domain-parent
org.drools.testcoverage:drools-kie-ci-with-domain-test-domain
org.drools.testcoverage:drools-kie-ci-without-domain-parent
org.drools.testcoverage:drools-standalone-parent
-org.drools.testcoverage:drools-test-coverage-jars
org.drools.testcoverage:drools-test-coverage-parent
+org.drools.testcoverage:test-integration-prebuilt
+org.drools.testcoverage:test-integration-prebuilt-jars
org.drools.testcoverage:test-integration-ruleunits
org.drools:drools-addons-quarkus-events-rules-parent
org.drools:drools-base
diff --git
a/script/ci/tests/scenarios-compute-build-scopes/07-removed-module/expected-affected.txt
b/script/ci/tests/scenarios-compute-build-scopes/07-removed-module/expected-affected.txt
index 5c181166ef9..f7b0f4ca0e9 100644
---
a/script/ci/tests/scenarios-compute-build-scopes/07-removed-module/expected-affected.txt
+++
b/script/ci/tests/scenarios-compute-build-scopes/07-removed-module/expected-affected.txt
@@ -1,11 +1,12 @@
org.drools.testcoverage:drools-kie-ci-with-domain-tests
org.drools.testcoverage:drools-kie-ci-without-domain-tests
-org.drools.testcoverage:drools-test-coverage-jars-with-invoker
+org.drools.testcoverage:kjar-with-invoker
org.drools.testcoverage:drools-test-suite
org.drools.testcoverage:test-compiler-integration
org.drools.testcoverage:test-integration-nomvel
org.drools.testcoverage:test-integration-notms
org.drools.testcoverage:test-integration-noxml
+org.drools.testcoverage:test-integration-prebuilt-tests
org.drools.testcoverage:test-integration-ruleunits-jar
org.drools.testcoverage:test-integration-ruleunits-tests
org.drools:default-kiesession
diff --git
a/script/ci/tests/scenarios-compute-build-scopes/07-removed-module/expected-upstream.txt
b/script/ci/tests/scenarios-compute-build-scopes/07-removed-module/expected-upstream.txt
index 75f6b7fa478..96efd39dd29 100644
---
a/script/ci/tests/scenarios-compute-build-scopes/07-removed-module/expected-upstream.txt
+++
b/script/ci/tests/scenarios-compute-build-scopes/07-removed-module/expected-upstream.txt
@@ -2,8 +2,9 @@ org.drools.testcoverage:drools-kie-ci-with-domain-parent
org.drools.testcoverage:drools-kie-ci-with-domain-test-domain
org.drools.testcoverage:drools-kie-ci-without-domain-parent
org.drools.testcoverage:drools-standalone-parent
-org.drools.testcoverage:drools-test-coverage-jars
org.drools.testcoverage:drools-test-coverage-parent
+org.drools.testcoverage:test-integration-prebuilt
+org.drools.testcoverage:test-integration-prebuilt-jars
org.drools.testcoverage:test-integration-ruleunits
org.drools:drools-addons-quarkus-events-rules-parent
org.drools:drools-base
diff --git
a/script/ci/tests/scenarios-compute-build-scopes/08-combined-mixed-changes/expected-affected.txt
b/script/ci/tests/scenarios-compute-build-scopes/08-combined-mixed-changes/expected-affected.txt
index 73582bbc316..576660bda95 100644
---
a/script/ci/tests/scenarios-compute-build-scopes/08-combined-mixed-changes/expected-affected.txt
+++
b/script/ci/tests/scenarios-compute-build-scopes/08-combined-mixed-changes/expected-affected.txt
@@ -1,11 +1,12 @@
org.drools.testcoverage:drools-kie-ci-with-domain-tests
org.drools.testcoverage:drools-kie-ci-without-domain-tests
-org.drools.testcoverage:drools-test-coverage-jars-with-invoker
+org.drools.testcoverage:kjar-with-invoker
org.drools.testcoverage:drools-test-suite
org.drools.testcoverage:test-compiler-integration
org.drools.testcoverage:test-integration-nomvel
org.drools.testcoverage:test-integration-notms
org.drools.testcoverage:test-integration-noxml
+org.drools.testcoverage:test-integration-prebuilt-tests
org.drools.testcoverage:test-integration-ruleunits-jar
org.drools.testcoverage:test-integration-ruleunits-tests
org.drools:default-kiesession
diff --git
a/script/ci/tests/scenarios-compute-build-scopes/08-combined-mixed-changes/expected-upstream.txt
b/script/ci/tests/scenarios-compute-build-scopes/08-combined-mixed-changes/expected-upstream.txt
index af5353bb56e..e614e2e9cae 100644
---
a/script/ci/tests/scenarios-compute-build-scopes/08-combined-mixed-changes/expected-upstream.txt
+++
b/script/ci/tests/scenarios-compute-build-scopes/08-combined-mixed-changes/expected-upstream.txt
@@ -2,8 +2,9 @@ org.drools.testcoverage:drools-kie-ci-with-domain-parent
org.drools.testcoverage:drools-kie-ci-with-domain-test-domain
org.drools.testcoverage:drools-kie-ci-without-domain-parent
org.drools.testcoverage:drools-standalone-parent
-org.drools.testcoverage:drools-test-coverage-jars
org.drools.testcoverage:drools-test-coverage-parent
+org.drools.testcoverage:test-integration-prebuilt
+org.drools.testcoverage:test-integration-prebuilt-jars
org.drools.testcoverage:test-integration-ruleunits
org.drools:drools-addons-quarkus-events-rules-parent
org.drools:drools-base
diff --git
a/script/ci/tests/scenarios-compute-build-scopes/09-nested-pom-under-src/expected-affected.txt
b/script/ci/tests/scenarios-compute-build-scopes/09-nested-pom-under-src/expected-affected.txt
index 3f1ce4b9a55..335517492c2 100644
---
a/script/ci/tests/scenarios-compute-build-scopes/09-nested-pom-under-src/expected-affected.txt
+++
b/script/ci/tests/scenarios-compute-build-scopes/09-nested-pom-under-src/expected-affected.txt
@@ -1,8 +1,5 @@
-org.drools.testcoverage:drools-test-coverage-jars-with-invoker
-org.drools.testcoverage:drools-test-suite
-org.drools.testcoverage:test-compiler-integration
-org.drools.testcoverage:test-integration-nomvel
-org.drools.testcoverage:test-integration-notms
+org.drools.testcoverage:kjar-with-invoker
+org.drools.testcoverage:test-integration-prebuilt-tests
org.kie:kie-archetypes
org.kie:kie-drools-dmn-archetype
org.kie:kie-drools-exec-model-archetype
diff --git
a/script/ci/tests/scenarios-compute-build-scopes/09-nested-pom-under-src/expected-upstream.txt
b/script/ci/tests/scenarios-compute-build-scopes/09-nested-pom-under-src/expected-upstream.txt
index fb73b643f4f..a7b13155db7 100644
---
a/script/ci/tests/scenarios-compute-build-scopes/09-nested-pom-under-src/expected-upstream.txt
+++
b/script/ci/tests/scenarios-compute-build-scopes/09-nested-pom-under-src/expected-upstream.txt
@@ -1,4 +1,6 @@
-org.drools.testcoverage:drools-test-coverage-jars
+org.drools.testcoverage:test-integration-prebuilt
+org.drools.testcoverage:test-integration-prebuilt-jars
+org.drools.testcoverage:drools-test-suite
org.drools.testcoverage:drools-test-coverage-parent
org.drools:drools-alphanetwork-compiler
org.drools:drools-base
diff --git
a/script/ci/tests/scenarios-compute-build-scopes/10-plugin-dep-as-dependency/README.md
b/script/ci/tests/scenarios-compute-build-scopes/10-plugin-dep-as-dependency/README.md
index 2a09d0b2d7b..5f3685aaaf6 100644
---
a/script/ci/tests/scenarios-compute-build-scopes/10-plugin-dep-as-dependency/README.md
+++
b/script/ci/tests/scenarios-compute-build-scopes/10-plugin-dep-as-dependency/README.md
@@ -20,7 +20,7 @@
# 10 — Plugin `<dependency>` counts as a reactor dependency
**Input:** any change inside
-`drools-test-coverage/test-suite`
(`org.drools.testcoverage:drools-test-suite`).
+`drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests`
(`org.drools.testcoverage:test-integration-prebuilt-tests`).
**What this tests:** that a `<dependency>` declared *inside a build
plugin* (`maven-surefire-plugin` → `<dependencies>` →
`org.kie:kie-maven-plugin`)
@@ -29,8 +29,8 @@ shows up in `upstream` for the consuming module exactly as a
regular
`<dependency>` would.
**Expected structure:**
-- `changed` = `{org.drools.testcoverage:drools-test-suite}`
-- `affected` = `drools-test-suite` + its reactor downstreams
+- `changed` = `{org.drools.testcoverage:test-integration-prebuilt-tests}`
+- `affected` = `test-integration-prebuilt-tests` + its reactor downstreams
- `upstream` MUST contain `org.kie:kie-maven-plugin` (and its transitive
reactor deps), proving the plugin-level dependency was followed
diff --git
a/script/ci/tests/scenarios-compute-build-scopes/10-plugin-dep-as-dependency/changed-files.txt
b/script/ci/tests/scenarios-compute-build-scopes/10-plugin-dep-as-dependency/changed-files.txt
index bfd186bc794..22639f53b55 100644
---
a/script/ci/tests/scenarios-compute-build-scopes/10-plugin-dep-as-dependency/changed-files.txt
+++
b/script/ci/tests/scenarios-compute-build-scopes/10-plugin-dep-as-dependency/changed-files.txt
@@ -1,2 +1,2 @@
-drools-test-coverage/test-suite/pom.xml
-drools-test-coverage/test-suite/src/test/java/org/drools/testcoverage/SomeTest.java
+drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/pom.xml
+drools-test-coverage/test-integration-prebuilt/test-integration-prebuilt-tests/src/test/java/org/drools/testcoverage/integrationtests/prebuilt/SomeTest.java
diff --git
a/script/ci/tests/scenarios-compute-build-scopes/10-plugin-dep-as-dependency/expected-affected.txt
b/script/ci/tests/scenarios-compute-build-scopes/10-plugin-dep-as-dependency/expected-affected.txt
index 7bec68afbb0..8065f83e6e4 100644
---
a/script/ci/tests/scenarios-compute-build-scopes/10-plugin-dep-as-dependency/expected-affected.txt
+++
b/script/ci/tests/scenarios-compute-build-scopes/10-plugin-dep-as-dependency/expected-affected.txt
@@ -1,4 +1 @@
-org.drools.testcoverage:drools-test-suite
-org.drools.testcoverage:test-compiler-integration
-org.drools.testcoverage:test-integration-nomvel
-org.drools.testcoverage:test-integration-notms
+org.drools.testcoverage:test-integration-prebuilt-tests
diff --git
a/script/ci/tests/scenarios-compute-build-scopes/10-plugin-dep-as-dependency/expected-changed.txt
b/script/ci/tests/scenarios-compute-build-scopes/10-plugin-dep-as-dependency/expected-changed.txt
index f5f2aaa5049..8065f83e6e4 100644
---
a/script/ci/tests/scenarios-compute-build-scopes/10-plugin-dep-as-dependency/expected-changed.txt
+++
b/script/ci/tests/scenarios-compute-build-scopes/10-plugin-dep-as-dependency/expected-changed.txt
@@ -1 +1 @@
-org.drools.testcoverage:drools-test-suite
+org.drools.testcoverage:test-integration-prebuilt-tests
diff --git
a/script/ci/tests/scenarios-compute-build-scopes/10-plugin-dep-as-dependency/expected-upstream.txt
b/script/ci/tests/scenarios-compute-build-scopes/10-plugin-dep-as-dependency/expected-upstream.txt
index d2bff5fd515..d8bce6f23b5 100644
---
a/script/ci/tests/scenarios-compute-build-scopes/10-plugin-dep-as-dependency/expected-upstream.txt
+++
b/script/ci/tests/scenarios-compute-build-scopes/10-plugin-dep-as-dependency/expected-upstream.txt
@@ -1,4 +1,5 @@
-org.drools.testcoverage:drools-test-coverage-jars
+org.drools.testcoverage:test-integration-prebuilt
+org.drools.testcoverage:drools-test-suite
org.drools.testcoverage:drools-test-coverage-parent
org.drools:drools-alphanetwork-compiler
org.drools:drools-base
diff --git
a/script/ci/tests/scenarios-compute-build-scopes/11-fully-removed-subtree/expected-affected.txt
b/script/ci/tests/scenarios-compute-build-scopes/11-fully-removed-subtree/expected-affected.txt
index 1f114bd987e..1d00c2df45f 100644
---
a/script/ci/tests/scenarios-compute-build-scopes/11-fully-removed-subtree/expected-affected.txt
+++
b/script/ci/tests/scenarios-compute-build-scopes/11-fully-removed-subtree/expected-affected.txt
@@ -7,15 +7,17 @@
org.drools.testcoverage:drools-kie-ci-without-domain-test-domain
org.drools.testcoverage:drools-kie-ci-without-domain-test-kjar
org.drools.testcoverage:drools-kie-ci-without-domain-tests
org.drools.testcoverage:drools-standalone-parent
-org.drools.testcoverage:drools-test-coverage-jars
-org.drools.testcoverage:drools-test-coverage-jars-with-invoker
org.drools.testcoverage:drools-test-coverage-parent
org.drools.testcoverage:drools-test-suite
+org.drools.testcoverage:kjar-with-invoker
org.drools.testcoverage:setter-overload
org.drools.testcoverage:test-compiler-integration
org.drools.testcoverage:test-integration-nomvel
org.drools.testcoverage:test-integration-notms
org.drools.testcoverage:test-integration-noxml
+org.drools.testcoverage:test-integration-prebuilt
+org.drools.testcoverage:test-integration-prebuilt-jars
+org.drools.testcoverage:test-integration-prebuilt-tests
org.drools.testcoverage:test-integration-ruleunits
org.drools.testcoverage:test-integration-ruleunits-jar
org.drools.testcoverage:test-integration-ruleunits-tests
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]