This is an automated email from the ASF dual-hosted git repository.
mariofusco 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 5af319c77e [incubator-kie-issues-1602] Remove binaries from test
resources on main (#6144)
5af319c77e is described below
commit 5af319c77ea21d6626166e8b4475cbac7a183618
Author: Toshiya Kobayashi <[email protected]>
AuthorDate: Fri Nov 8 17:16:48 2024 +0900
[incubator-kie-issues-1602] Remove binaries from test resources on main
(#6144)
* [incubator-kie-issues-1602] Remove binaries from test resources on main
- WIP
* deleted unused test jars
* - binaries for KieRepositoryTest.
* replace billasurf.jar with surf project
* remove unused jar
* fixed build order
* temporarily disabled downstream GHA for quick check
* replace testEnum.jar with testEnum project
* resolve BanDuplicateClasses
* replace model.jar with a project
* remove kjar-module-after.jar and kjar-module-before.jar. Created projects
for them under drools-test-coverage-jars-with-invoker to be tested in
test-suite KieContainerTest
* clean up
* assertion message if file is not found
* Adding invoker to assist local development
* typo
---
NOTICE-BINARY | 28 ++
.../src/test/resources/JarWithSourceFiles.jar | Bin 3281 -> 0 bytes
drools-compiler/src/test/resources/KAModelTest.jar | Bin 1546 -> 0 bytes
.../src/test/resources/eventing-example.jar | Bin 4441 -> 0 bytes
drools-compiler/src/test/resources/primespoc.jar | Bin 19937 -> 0 bytes
.../src/test/resources/billasurf.jar | Bin 1784 -> 0 bytes
.../serialization/protobuf/MarshallingTest.java | 42 ---
.../drools-test-coverage-jars/README.md | 9 +
.../drools-test-coverage-jars-with-invoker/pom.xml | 88 ++++++
.../src/it/kie-project-simple/pom.xml | 79 +++++
.../src/main/resources/META-INF/kmodule.xml | 31 +-
.../src/main/resources/defaultkiesession/test.drl | 25 ++
.../src/it/kjar-module-after/pom.xml | 76 +++++
.../src/main/resources/KBase-test/kjar/rule1.drl | 38 +++
.../src/main/resources/KBase-test/kjar/rule2.drl | 39 +++
.../src/main/resources/META-INF/kmodule.xml | 36 +--
.../src/it/kjar-module-before/pom.xml | 76 +++++
.../src/main/resources/KBase-test/kjar/rule1.drl | 38 +++
.../src/main/resources/META-INF/kmodule.xml | 36 +--
.../only-jar-pojo-not-kjar-no-kmodule/pom.xml | 74 +++++
.../only_jar_pojo_not_kjar_no_kmodule/MyPojo.java | 38 +++
.../{ => drools-test-coverage-jars}/pom.xml | 34 +--
.../setter-overload/pom.xml | 66 +++++
.../setter/overload/SetterOverload.java | 51 ++++
.../drools-test-coverage-jars/surf/pom.xml | 74 +++++
.../surf/src/main/java/org/example/surf/Board.java | 50 ++++
.../src/main/java/org/example/surf/Person.java | 41 +++
.../drools-test-coverage-jars/testEnum/pom.xml | 74 +++++
.../src/main/java/org/drools/Primitives.java | 321 +++++++++++++++++++++
.../src/main/java/org/drools/TestEnum.java | 26 ++
drools-test-coverage/pom.xml | 1 +
.../test-compiler-integration/.gitignore | 22 ++
.../test-compiler-integration/pom.xml | 54 ++++
.../drools/mvel/integrationtests/JBRULESTest.java | 12 +-
.../mvel/integrationtests/KieRepositoryTest.java | 21 +-
.../integrationtests/MBeansMonitoringTest.java | 9 +-
.../mvel/integrationtests/MarshallingTest.java | 90 ++++++
.../drools/mvel/integrationtests/Misc2Test.java | 7 +-
.../src/test/resources/billasurf.jar | Bin 1784 -> 0 bytes
.../test/resources/kie-project-simple-1.0.0.jar | Bin 4378 -> 0 bytes
.../only-jar-pojo-not-kjar-no-kmodule-1.0.0.jar | Bin 2576 -> 0 bytes
.../compiler/compiler/xml/changeset/changeset.jar | Bin 739 -> 0 bytes
.../src/test/resources/testEnum.jar | Bin 3988 -> 0 bytes
drools-test-coverage/test-suite/.gitignore | 19 ++
drools-test-coverage/test-suite/pom.xml | 54 ++++
.../testcoverage/functional/KieContainerTest.java | 53 ++++
.../src/test/resources/kjar/pom-kjar.xml | 31 +-
drools-verifier/drools-verifier-drl/.gitignore | 18 ++
drools-verifier/drools-verifier-drl/pom.xml | 49 ++++
.../java/org/drools/verifier/VerifierTest.java | 12 +-
.../jarloader/PackageHeaderLoaderTest.java | 6 +-
.../VerifierMapBackedClassLoaderTest.java | 6 +-
.../test/resources/org/drools/verifier/model.jar | Bin 2417 -> 0 bytes
drools-verifier/drools-verifier-test-jar/pom.xml | 74 +++++
.../src/main/java/org/test/Person.java | 65 +++++
.../src/main/java/org/test/Pet.java | 46 +++
.../src/main/java/org/test/Rambo.java | 31 ++
drools-verifier/pom.xml | 1 +
.../java/org/kie/scanner/KieModuleMavenTest.java | 54 +---
.../src/test/resources/kjar/kjar-module-after.jar | Bin 4421 -> 0 bytes
.../src/test/resources/kjar/kjar-module-before.jar | Bin 3869 -> 0 bytes
kie-maven-plugin/pom.xml | 6 +-
62 files changed, 1995 insertions(+), 236 deletions(-)
diff --git a/NOTICE-BINARY b/NOTICE-BINARY
new file mode 100644
index 0000000000..958dc62a49
--- /dev/null
+++ b/NOTICE-BINARY
@@ -0,0 +1,28 @@
+<!--
+ 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.
+ -->
+
+## Disclaimer for (Test) Binaries
+
+The following binaries are included in this project for testing purposes only:
+
+efesto/efesto-core/efesto-common-api/src/test/resources/TestJar.jar : a
compressed JSON file for test
+efesto/efesto-core/efesto-common-core/src/test/resources/TestJar.jar : a
compressed JSON file for test
+efesto/efesto-core/efesto-runtime-manager/efesto-runtime-manager-core/src/test/resources/TestJar.jar
: a compressed JSON file for test
+
+These files are used to validate the functionality and reliability of Apache
KIE. They are not intended for production use or distribution beyond the scope
of testing within this project.
\ No newline at end of file
diff --git a/drools-compiler/src/test/resources/JarWithSourceFiles.jar
b/drools-compiler/src/test/resources/JarWithSourceFiles.jar
deleted file mode 100644
index e865470f27..0000000000
Binary files a/drools-compiler/src/test/resources/JarWithSourceFiles.jar and
/dev/null differ
diff --git a/drools-compiler/src/test/resources/KAModelTest.jar
b/drools-compiler/src/test/resources/KAModelTest.jar
deleted file mode 100644
index 612dc38699..0000000000
Binary files a/drools-compiler/src/test/resources/KAModelTest.jar and /dev/null
differ
diff --git a/drools-compiler/src/test/resources/eventing-example.jar
b/drools-compiler/src/test/resources/eventing-example.jar
deleted file mode 100644
index 928ddc81db..0000000000
Binary files a/drools-compiler/src/test/resources/eventing-example.jar and
/dev/null differ
diff --git a/drools-compiler/src/test/resources/primespoc.jar
b/drools-compiler/src/test/resources/primespoc.jar
deleted file mode 100644
index a52120ce7e..0000000000
Binary files a/drools-compiler/src/test/resources/primespoc.jar and /dev/null
differ
diff --git a/drools-legacy-test-util/src/test/resources/billasurf.jar
b/drools-legacy-test-util/src/test/resources/billasurf.jar
deleted file mode 100644
index 231890056b..0000000000
Binary files a/drools-legacy-test-util/src/test/resources/billasurf.jar and
/dev/null differ
diff --git
a/drools-serialization-protobuf/src/test/java/org/drools/serialization/protobuf/MarshallingTest.java
b/drools-serialization-protobuf/src/test/java/org/drools/serialization/protobuf/MarshallingTest.java
index 3258b90b1f..97e72f878d 100644
---
a/drools-serialization-protobuf/src/test/java/org/drools/serialization/protobuf/MarshallingTest.java
+++
b/drools-serialization-protobuf/src/test/java/org/drools/serialization/protobuf/MarshallingTest.java
@@ -871,48 +871,6 @@ public class MarshallingTest extends CommonTestMethodBase {
KeyStoreHelper.reInit();
}
- /**
- * In this case we are dealing with facts which are not on the systems
classpath.
- */
- @Test
- public void testSerializabilityWithJarFacts() throws Exception {
- MapBackedClassLoader loader = new MapBackedClassLoader(
this.getClass().getClassLoader() );
-
- JarInputStream jis = new JarInputStream(
this.getClass().getResourceAsStream( "/billasurf.jar" ) );
-
- JarEntry entry = null;
- byte[] buf = new byte[1024];
- int len = 0;
- while ( (entry = jis.getNextJarEntry()) != null ) {
- if ( !entry.isDirectory() ) {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- while ( (len = jis.read( buf )) >= 0 ) {
- out.write( buf,
- 0,
- len );
- }
- loader.addResource( entry.getName(),
- out.toByteArray() );
- }
- }
-
- String drl = "package foo.bar \n" +
- "import com.billasurf.Board\n" +
- "rule 'MyGoodRule' \n dialect 'mvel' \n when " +
- " Board() " +
- "then \n" +
- " System.err.println(42); \n" +
- "end\n";
-
-
- KnowledgeBuilderConfiguration kbuilderConf =
KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(null, loader);
-
- Collection<KiePackage> kpkgs =
loadKnowledgePackagesFromString(kbuilderConf, drl);
-
- kpkgs = SerializationHelper.serializeObject( kpkgs, loader );
-
- }
-
@Test
public void testEmptyRule() throws Exception {
String rule = "package org.drools.compiler.test;\n";
diff --git a/drools-test-coverage/drools-test-coverage-jars/README.md
b/drools-test-coverage/drools-test-coverage-jars/README.md
new file mode 100644
index 0000000000..b3a0d19167
--- /dev/null
+++ b/drools-test-coverage/drools-test-coverage-jars/README.md
@@ -0,0 +1,9 @@
+## 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.
+
+### How to add a jar project
+If the jar is not a kjar, you can simply add the jar project under this
project. `surf` project is an example.
+
+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.
+
+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/drools-test-coverage-jars-with-invoker/pom.xml
b/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/pom.xml
new file mode 100644
index 0000000000..4e6342ccb3
--- /dev/null
+++
b/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/pom.xml
@@ -0,0 +1,88 @@
+<?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>drools-test-coverage-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>
+
+ <name>Drools :: Test Coverage :: Jars for tests built by invoker</name>
+
+ <properties>
+
<java.module.name>org.drools.compiler.integrationtests.jars.with.invoker</java.module.name>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <org.kie.version>${project.version}</org.kie.version>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.kie</groupId>
+ <artifactId>kie-maven-plugin</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.kie</groupId>
+ <artifactId>kie-maven-plugin</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.maven.resolver</groupId>
+ <artifactId>maven-resolver-util</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-invoker-plugin</artifactId>
+ <configuration>
+ <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
+ <streamLogs>true</streamLogs>
+ <goal>clean</goal>
+ <goal>package</goal>
+ </configuration>
+ <executions>
+ <execution>
+ <id>integration-test</id>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
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/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kie-project-simple/pom.xml
new file mode 100644
index 0000000000..94e58d6b81
--- /dev/null
+++
b/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kie-project-simple/pom.xml
@@ -0,0 +1,79 @@
+<?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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.drools.testcoverage</groupId>
+ <artifactId>kie-project-simple</artifactId>
+ <version>1.0.0</version>
+ <packaging>kjar</packaging>
+
+ <name>kie-project-simple</name>
+ <url>http://maven.apache.org</url>
+
+ <properties>
+
<java.module.name>org.drools.compiler.integrationtests.kie.project.simple</java.module.name>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <maven.deploy.skip>true</maven.deploy.skip>
+ <maven.compiler.release>17</maven.compiler.release>
+ </properties>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.kie</groupId>
+ <artifactId>kie-maven-plugin</artifactId>
+ <version>@org.kie.version@</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+
+ <plugins>
+ <plugin>
+ <groupId>org.kie</groupId>
+ <artifactId>kie-maven-plugin</artifactId>
+ <extensions>true</extensions>
+ </plugin>
+
+ <plugin>
+ <groupId>com.coderplus.maven.plugins</groupId>
+ <artifactId>copy-rename-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>rename-file</id>
+ <phase>package</phase>
+ <goals>
+ <goal>copy</goal>
+ </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>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/drools-verifier/pom.xml
b/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
similarity index 50%
copy from drools-verifier/pom.xml
copy to
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
index a248d81268..0c77ec31e8 100644
--- a/drools-verifier/pom.xml
+++
b/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
@@ -19,29 +19,10 @@
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/maven-v4_0_0.xsd">
+<kmodule
+ xmlns="http://jboss.org/kie/6.0.0/kmodule">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.kie</groupId>
- <artifactId>drools-build-parent</artifactId>
- <version>999-SNAPSHOT</version>
- <relativePath>../build-parent/pom.xml</relativePath>
- </parent>
-
- <groupId>org.drools</groupId>
- <artifactId>drools-verifier</artifactId>
- <packaging>pom</packaging>
-
- <name>Drools :: Verifier</name>
- <description>Drools Verifier analyses the quality of Drools rules and
reports any issues.</description>
-
-
- <modules>
- <module>drools-verifier-drl</module>
- <module>drools-verifier-api</module>
- <module>drools-verifier-core</module>
- </modules>
-
-</project>
+ <kbase name="simpleKBase">
+ <ksession name="simpleKSession" default="true"/>
+ </kbase>
+</kmodule>
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/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kie-project-simple/src/main/resources/defaultkiesession/test.drl
new file mode 100644
index 0000000000..58142ad20d
--- /dev/null
+++
b/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kie-project-simple/src/main/resources/defaultkiesession/test.drl
@@ -0,0 +1,25 @@
+/**
+ * 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.mypackage
+
+rule "rule 1" when
+ $s: String()
+then
+ System.out.println("123 " + $s);
+end
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/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kjar-module-after/pom.xml
new file mode 100644
index 0000000000..32f3dd522b
--- /dev/null
+++
b/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kjar-module-after/pom.xml
@@ -0,0 +1,76 @@
+<?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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.kie.test</groupId>
+ <artifactId>test-module</artifactId>
+ <version>1.2.0-SNAPSHOT</version>
+ <packaging>kjar</packaging>
+
+ <properties>
+
<java.module.name>org.drools.compiler.integrationtests.kjar.module.before</java.module.name>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <maven.deploy.skip>true</maven.deploy.skip>
+ <maven.compiler.release>17</maven.compiler.release>
+ </properties>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.kie</groupId>
+ <artifactId>kie-maven-plugin</artifactId>
+ <version>@org.kie.version@</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+
+ <plugins>
+ <plugin>
+ <groupId>org.kie</groupId>
+ <artifactId>kie-maven-plugin</artifactId>
+ <extensions>true</extensions>
+ </plugin>
+
+ <plugin>
+ <groupId>com.coderplus.maven.plugins</groupId>
+ <artifactId>copy-rename-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>rename-file</id>
+ <phase>package</phase>
+ <goals>
+ <goal>copy</goal>
+ </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>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
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/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kjar-module-after/src/main/resources/KBase-test/kjar/rule1.drl
new file mode 100644
index 0000000000..f017b37b21
--- /dev/null
+++
b/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
@@ -0,0 +1,38 @@
+/**
+ * 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.test
+
+rule "Your Third Rule"
+
+ when
+ //conditions
+ then
+ //actions
+
+end
+
+rule "Your Forth Rule"
+ //include attributes such as "salience" here...
+ when
+ //conditions
+ then
+ //actions
+
+end
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/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kjar-module-after/src/main/resources/KBase-test/kjar/rule2.drl
new file mode 100644
index 0000000000..571f979031
--- /dev/null
+++
b/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
@@ -0,0 +1,39 @@
+/**
+ * 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.test
+
+
+rule "Your First Rule"
+
+ when
+ //conditions
+ then
+ //actions
+
+end
+
+rule "Your Second Rule"
+ //include attributes such as "salience" here...
+ when
+ //conditions
+ then
+ //actions
+
+end
diff --git a/drools-verifier/pom.xml
b/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
similarity index 50%
copy from drools-verifier/pom.xml
copy to
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
index a248d81268..929e3e61d9 100644
--- a/drools-verifier/pom.xml
+++
b/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
@@ -19,29 +19,13 @@
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/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.kie</groupId>
- <artifactId>drools-build-parent</artifactId>
- <version>999-SNAPSHOT</version>
- <relativePath>../build-parent/pom.xml</relativePath>
- </parent>
-
- <groupId>org.drools</groupId>
- <artifactId>drools-verifier</artifactId>
- <packaging>pom</packaging>
-
- <name>Drools :: Verifier</name>
- <description>Drools Verifier analyses the quality of Drools rules and
reports any issues.</description>
-
-
- <modules>
- <module>drools-verifier-drl</module>
- <module>drools-verifier-api</module>
- <module>drools-verifier-core</module>
- </modules>
-
-</project>
+<kmodule xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://jboss.org/kie/6.0.0/kmodule">
+ <kbase name="KBase-test" default="true" eventProcessingMode="stream"
equalsBehavior="equality" declarativeAgenda="disabled"
scope="javax.enterprise.context.ApplicationScoped" packages="*">
+ <ksession name="ksession-test" type="stateful" default="true"
clockType="realtime" scope="javax.enterprise.context.ApplicationScoped">
+ <workItemHandlers>
+ <workItemHandler name="Log" type="new
org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler()"/>
+ </workItemHandlers>
+ </ksession>
+ </kbase>
+</kmodule>
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/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kjar-module-before/pom.xml
new file mode 100644
index 0000000000..748882bb03
--- /dev/null
+++
b/drools-test-coverage/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kjar-module-before/pom.xml
@@ -0,0 +1,76 @@
+<?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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.kie.test</groupId>
+ <artifactId>test-module</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>kjar</packaging>
+
+ <properties>
+
<java.module.name>org.drools.compiler.integrationtests.kjar.module.before</java.module.name>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <maven.deploy.skip>true</maven.deploy.skip>
+ <maven.compiler.release>17</maven.compiler.release>
+ </properties>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.kie</groupId>
+ <artifactId>kie-maven-plugin</artifactId>
+ <version>@org.kie.version@</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+
+ <plugins>
+ <plugin>
+ <groupId>org.kie</groupId>
+ <artifactId>kie-maven-plugin</artifactId>
+ <extensions>true</extensions>
+ </plugin>
+
+ <plugin>
+ <groupId>com.coderplus.maven.plugins</groupId>
+ <artifactId>copy-rename-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>rename-file</id>
+ <phase>package</phase>
+ <goals>
+ <goal>copy</goal>
+ </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>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
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/drools-test-coverage-jars/drools-test-coverage-jars-with-invoker/src/it/kjar-module-before/src/main/resources/KBase-test/kjar/rule1.drl
new file mode 100644
index 0000000000..f017b37b21
--- /dev/null
+++
b/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
@@ -0,0 +1,38 @@
+/**
+ * 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.test
+
+rule "Your Third Rule"
+
+ when
+ //conditions
+ then
+ //actions
+
+end
+
+rule "Your Forth Rule"
+ //include attributes such as "salience" here...
+ when
+ //conditions
+ then
+ //actions
+
+end
diff --git a/drools-verifier/pom.xml
b/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
similarity index 50%
copy from drools-verifier/pom.xml
copy to
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
index a248d81268..929e3e61d9 100644
--- a/drools-verifier/pom.xml
+++
b/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
@@ -19,29 +19,13 @@
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/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.kie</groupId>
- <artifactId>drools-build-parent</artifactId>
- <version>999-SNAPSHOT</version>
- <relativePath>../build-parent/pom.xml</relativePath>
- </parent>
-
- <groupId>org.drools</groupId>
- <artifactId>drools-verifier</artifactId>
- <packaging>pom</packaging>
-
- <name>Drools :: Verifier</name>
- <description>Drools Verifier analyses the quality of Drools rules and
reports any issues.</description>
-
-
- <modules>
- <module>drools-verifier-drl</module>
- <module>drools-verifier-api</module>
- <module>drools-verifier-core</module>
- </modules>
-
-</project>
+<kmodule xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://jboss.org/kie/6.0.0/kmodule">
+ <kbase name="KBase-test" default="true" eventProcessingMode="stream"
equalsBehavior="equality" declarativeAgenda="disabled"
scope="javax.enterprise.context.ApplicationScoped" packages="*">
+ <ksession name="ksession-test" type="stateful" default="true"
clockType="realtime" scope="javax.enterprise.context.ApplicationScoped">
+ <workItemHandlers>
+ <workItemHandler name="Log" type="new
org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler()"/>
+ </workItemHandlers>
+ </ksession>
+ </kbase>
+</kmodule>
diff --git
a/drools-test-coverage/drools-test-coverage-jars/only-jar-pojo-not-kjar-no-kmodule/pom.xml
b/drools-test-coverage/drools-test-coverage-jars/only-jar-pojo-not-kjar-no-kmodule/pom.xml
new file mode 100644
index 0000000000..743140ddc6
--- /dev/null
+++
b/drools-test-coverage/drools-test-coverage-jars/only-jar-pojo-not-kjar-no-kmodule/pom.xml
@@ -0,0 +1,74 @@
+<?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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.drools.testcoverage</groupId>
+ <artifactId>only-jar-pojo-not-kjar-no-kmodule</artifactId>
+ <version>1.0.0</version>
+ <packaging>jar</packaging>
+
+ <name>Drools :: Test Coverage :: Jar without kmodule.xml</name>
+
+ <properties>
+
<java.module.name>org.drools.compiler.integrationtests.only.jar.pojo.not.kjar.no.kmodule</java.module.name>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <maven.deploy.skip>true</maven.deploy.skip>
+ <maven.compiler.release>17</maven.compiler.release>
+ </properties>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.8.1</version>
+ </plugin>
+ <plugin>
+ <groupId>com.coderplus.maven.plugins</groupId>
+ <artifactId>copy-rename-maven-plugin</artifactId>
+ <version>1.0</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>com.coderplus.maven.plugins</groupId>
+ <artifactId>copy-rename-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>rename-file</id>
+ <phase>package</phase>
+ <goals>
+ <goal>copy</goal>
+ </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>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git
a/drools-test-coverage/drools-test-coverage-jars/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/drools-test-coverage-jars/only-jar-pojo-not-kjar-no-kmodule/src/main/java/org/drools/compiler/integrationtests/only_jar_pojo_not_kjar_no_kmodule/MyPojo.java
new file mode 100644
index 0000000000..eda2ece404
--- /dev/null
+++
b/drools-test-coverage/drools-test-coverage-jars/only-jar-pojo-not-kjar-no-kmodule/src/main/java/org/drools/compiler/integrationtests/only_jar_pojo_not_kjar_no_kmodule/MyPojo.java
@@ -0,0 +1,38 @@
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.compiler.integrationtests.only_jar_pojo_not_kjar_no_kmodule;
+
+public class MyPojo {
+
+ private final String name;
+
+ public MyPojo(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("MyPojo [name=").append(name).append("]");
+ return builder.toString();
+ }
+}
\ No newline at end of file
diff --git a/drools-test-coverage/pom.xml
b/drools-test-coverage/drools-test-coverage-jars/pom.xml
similarity index 59%
copy from drools-test-coverage/pom.xml
copy to drools-test-coverage/drools-test-coverage-jars/pom.xml
index 7e54cdb19f..57f498e6e3 100644
--- a/drools-test-coverage/pom.xml
+++ b/drools-test-coverage/drools-test-coverage-jars/pom.xml
@@ -19,32 +19,30 @@
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">
- <modelVersion>4.0.0</modelVersion>
+<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>
- <groupId>org.kie</groupId>
- <artifactId>drools-build-parent</artifactId>
+ <artifactId>drools-test-coverage-parent</artifactId>
+ <groupId>org.drools.testcoverage</groupId>
<version>999-SNAPSHOT</version>
- <relativePath>../build-parent/pom.xml</relativePath>
</parent>
+ <modelVersion>4.0.0</modelVersion>
- <groupId>org.drools.testcoverage</groupId>
- <artifactId>drools-test-coverage-parent</artifactId>
+ <artifactId>drools-test-coverage-jars</artifactId>
<packaging>pom</packaging>
+ <name>Drools :: Test Coverage :: Jars for tests</name>
- <name>Drools :: Test Coverage</name>
+ <properties>
+ <parent.project.version>${project.version}</parent.project.version>
+ </properties>
<modules>
- <module>standalone</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>surf</module>
+ <module>testEnum</module>
+ <module>only-jar-pojo-not-kjar-no-kmodule</module>
+ <module>setter-overload</module>
+ <module>drools-test-coverage-jars-with-invoker</module>
</modules>
-
</project>
diff --git
a/drools-test-coverage/drools-test-coverage-jars/setter-overload/pom.xml
b/drools-test-coverage/drools-test-coverage-jars/setter-overload/pom.xml
new file mode 100644
index 0000000000..7e8d47c279
--- /dev/null
+++ b/drools-test-coverage/drools-test-coverage-jars/setter-overload/pom.xml
@@ -0,0 +1,66 @@
+<?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>drools-test-coverage-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>
+
+ <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>
+ <groupId>com.coderplus.maven.plugins</groupId>
+ <artifactId>copy-rename-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>rename-file</id>
+ <phase>package</phase>
+ <goals>
+ <goal>copy</goal>
+ </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>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
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/drools-test-coverage-jars/setter-overload/src/main/java/org/drools/compiler/integrationtests/setter/overload/SetterOverload.java
new file mode 100644
index 0000000000..bfee50f59e
--- /dev/null
+++
b/drools-test-coverage/drools-test-coverage-jars/setter-overload/src/main/java/org/drools/compiler/integrationtests/setter/overload/SetterOverload.java
@@ -0,0 +1,51 @@
+/**
+ * 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.compiler.integrationtests.setter.overload;
+
+import java.math.BigDecimal;
+
+public class SetterOverload {
+
+ private String echelle;
+ private BigDecimal quotiteRemuneration;
+
+ public SetterOverload() {
+ }
+
+ public String getEchelle() {
+ return echelle;
+ }
+
+ public void setEchelle(String echelle) {
+ this.echelle = echelle;
+ }
+
+ public BigDecimal getQuotiteRemuneration() {
+ return quotiteRemuneration;
+ }
+
+ public void setQuotiteRemuneration(BigDecimal num, BigDecimal den) {
+ setQuotiteRemuneration(num.divide(den, 10,
BigDecimal.ROUND_HALF_EVEN));
+ }
+
+ public void setQuotiteRemuneration(BigDecimal quotiteRemuneration) {
+ this.quotiteRemuneration = quotiteRemuneration;
+ }
+}
+
diff --git a/drools-test-coverage/drools-test-coverage-jars/surf/pom.xml
b/drools-test-coverage/drools-test-coverage-jars/surf/pom.xml
new file mode 100644
index 0000000000..4d64756f85
--- /dev/null
+++ b/drools-test-coverage/drools-test-coverage-jars/surf/pom.xml
@@ -0,0 +1,74 @@
+<?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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.drools.testcoverage</groupId>
+ <artifactId>surf</artifactId>
+ <version>1.0.0</version>
+ <packaging>jar</packaging>
+
+ <name>Drools :: Test Coverage :: Jar with simple pojo</name>
+
+ <properties>
+
<java.module.name>org.drools.compiler.integrationtests.surf</java.module.name>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <maven.deploy.skip>true</maven.deploy.skip>
+ <maven.compiler.release>17</maven.compiler.release>
+ </properties>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.8.1</version>
+ </plugin>
+ <plugin>
+ <groupId>com.coderplus.maven.plugins</groupId>
+ <artifactId>copy-rename-maven-plugin</artifactId>
+ <version>1.0</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>com.coderplus.maven.plugins</groupId>
+ <artifactId>copy-rename-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>rename-file</id>
+ <phase>package</phase>
+ <goals>
+ <goal>copy</goal>
+ </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>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git
a/drools-test-coverage/drools-test-coverage-jars/surf/src/main/java/org/example/surf/Board.java
b/drools-test-coverage/drools-test-coverage-jars/surf/src/main/java/org/example/surf/Board.java
new file mode 100644
index 0000000000..7b720157d8
--- /dev/null
+++
b/drools-test-coverage/drools-test-coverage-jars/surf/src/main/java/org/example/surf/Board.java
@@ -0,0 +1,50 @@
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.example.surf;
+
+public class Board {
+
+ private String type;
+ private String name;
+ private int cost;
+
+ public int getCost() {
+ return cost;
+ }
+
+ public void setCost(int cost) {
+ this.cost = cost;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+}
diff --git
a/drools-test-coverage/drools-test-coverage-jars/surf/src/main/java/org/example/surf/Person.java
b/drools-test-coverage/drools-test-coverage-jars/surf/src/main/java/org/example/surf/Person.java
new file mode 100644
index 0000000000..7dabbd3474
--- /dev/null
+++
b/drools-test-coverage/drools-test-coverage-jars/surf/src/main/java/org/example/surf/Person.java
@@ -0,0 +1,41 @@
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.example.surf;
+
+public class Person {
+
+ private String name;
+ private int age;
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
diff --git a/drools-test-coverage/drools-test-coverage-jars/testEnum/pom.xml
b/drools-test-coverage/drools-test-coverage-jars/testEnum/pom.xml
new file mode 100644
index 0000000000..3ad4359571
--- /dev/null
+++ b/drools-test-coverage/drools-test-coverage-jars/testEnum/pom.xml
@@ -0,0 +1,74 @@
+<?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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.drools.testcoverage</groupId>
+ <artifactId>testEnum</artifactId>
+ <version>1.0.0</version>
+ <packaging>jar</packaging>
+
+ <name>Drools :: Test Coverage :: Jar with enum</name>
+
+ <properties>
+
<java.module.name>org.drools.compiler.integrationtests.testEnum</java.module.name>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <maven.deploy.skip>true</maven.deploy.skip>
+ <maven.compiler.release>17</maven.compiler.release>
+ </properties>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.8.1</version>
+ </plugin>
+ <plugin>
+ <groupId>com.coderplus.maven.plugins</groupId>
+ <artifactId>copy-rename-maven-plugin</artifactId>
+ <version>1.0</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>com.coderplus.maven.plugins</groupId>
+ <artifactId>copy-rename-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>rename-file</id>
+ <phase>package</phase>
+ <goals>
+ <goal>copy</goal>
+ </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>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git
a/drools-test-coverage/drools-test-coverage-jars/testEnum/src/main/java/org/drools/Primitives.java
b/drools-test-coverage/drools-test-coverage-jars/testEnum/src/main/java/org/drools/Primitives.java
new file mode 100644
index 0000000000..947a28e86d
--- /dev/null
+++
b/drools-test-coverage/drools-test-coverage-jars/testEnum/src/main/java/org/drools/Primitives.java
@@ -0,0 +1,321 @@
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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;
+
+import java.io.Serializable;
+import java.util.Arrays;
+
+public class Primitives
+ implements Serializable {
+
+ public Primitives() {
+ }
+
+ public boolean isBooleanPrimitive() {
+ return booleanPrimitive;
+ }
+
+ public void setBooleanPrimitive(boolean booleanPrimitive) {
+ this.booleanPrimitive = booleanPrimitive;
+ }
+
+ public byte getBytePrimitive() {
+ return bytePrimitive;
+ }
+
+ public void setBytePrimitive(byte bytePrimitive) {
+ this.bytePrimitive = bytePrimitive;
+ }
+
+ public char getCharPrimitive() {
+ return charPrimitive;
+ }
+
+ public void setCharPrimitive(char charPrimitive) {
+ this.charPrimitive = charPrimitive;
+ }
+
+ public double getDoublePrimitive() {
+ return doublePrimitive;
+ }
+
+ public void setDoublePrimitive(double doublePrimitive) {
+ this.doublePrimitive = doublePrimitive;
+ }
+
+ public float getFloatPrimitive() {
+ return floatPrimitive;
+ }
+
+ public void setFloatPrimitive(float floatPrimitive) {
+ this.floatPrimitive = floatPrimitive;
+ }
+
+ public int getIntPrimitive() {
+ return intPrimitive;
+ }
+
+ public void setIntPrimitive(int intPrimitive) {
+ this.intPrimitive = intPrimitive;
+ }
+
+ public long getLongPrimitive() {
+ return longPrimitive;
+ }
+
+ public void setLongPrimitive(long longPrimitive) {
+ this.longPrimitive = longPrimitive;
+ }
+
+ public short getShortPrimitive() {
+ return shortPrimitive;
+ }
+
+ public void setShortPrimitive(short shortPrimitive) {
+ this.shortPrimitive = shortPrimitive;
+ }
+
+ public Object[] getArrayAttribute() {
+ return arrayAttribute;
+ }
+
+ public void setArrayAttribute(Object arrayAttribute[]) {
+ this.arrayAttribute = arrayAttribute;
+ }
+
+ public boolean[] getPrimitiveBooleanArray() {
+ return primitiveBooleanArray;
+ }
+
+ public void setPrimitiveBooleanArray(boolean primitiveBooleanArray[]) {
+ this.primitiveBooleanArray = primitiveBooleanArray;
+ }
+
+ public byte[] getPrimitiveByteArray() {
+ return primitiveByteArray;
+ }
+
+ public void setPrimitiveByteArray(byte primitiveByteArray[]) {
+ this.primitiveByteArray = primitiveByteArray;
+ }
+
+ public short[] getPrimitiveShortArray() {
+ return primitiveShortArray;
+ }
+
+ public void setPrimitiveShortArray(short primitiveShortArray[]) {
+ this.primitiveShortArray = primitiveShortArray;
+ }
+
+ public char[] getPrimitiveCharArray() {
+ return primitiveCharArray;
+ }
+
+ public void setPrimitiveCharArray(char primitiveCharArray[]) {
+ this.primitiveCharArray = primitiveCharArray;
+ }
+
+ public int[] getPrimitiveIntArray() {
+ return primitiveIntArray;
+ }
+
+ public void setPrimitiveIntArray(int primitiveArrayAttribute[]) {
+ primitiveIntArray = primitiveArrayAttribute;
+ }
+
+ public long[] getPrimitiveLongArray() {
+ return primitiveLongArray;
+ }
+
+ public void setPrimitiveLongArray(long primitiveLongArray[]) {
+ this.primitiveLongArray = primitiveLongArray;
+ }
+
+ public float[] getPrimitiveFloatArray() {
+ return primitiveFloatArray;
+ }
+
+ public void setPrimitiveFloatArray(float floatDoubleArray[]) {
+ primitiveFloatArray = floatDoubleArray;
+ }
+
+ public double[] getPrimitiveDoubleArray() {
+ return primitiveDoubleArray;
+ }
+
+ public void setPrimitiveDoubleArray(double
primitiveDoubleArrayAttribute[]) {
+ primitiveDoubleArray = primitiveDoubleArrayAttribute;
+ }
+
+ public String[] getStringArray() {
+ return stringArray;
+ }
+
+ public void setStringArray(String stringArray[]) {
+ this.stringArray = stringArray;
+ }
+
+ public String getStringAttribute() {
+ return stringAttribute;
+ }
+
+ public void setStringAttribute(String stringAttribute) {
+ this.stringAttribute = stringAttribute;
+ }
+
+ public Boolean getBooleanWrapper() {
+ return booleanWrapper;
+ }
+
+ public void setBooleanWrapper(Boolean booleanWrapper) {
+ this.booleanWrapper = booleanWrapper;
+ }
+
+ public Object getObject() {
+ return object;
+ }
+
+ public void setObject(Object object) {
+ this.object = object;
+ }
+
+ public int hashCode() {
+ int prime = 31;
+ int result = 1;
+ result = 31 * result + Arrays.hashCode(arrayAttribute);
+ result = 31 * result + (booleanPrimitive ? 1231 : '\u04D5');
+ result = 31 * result + (booleanWrapper != null ?
booleanWrapper.hashCode() : 0);
+ result = 31 * result + charPrimitive;
+ long doubeAsLongBits = Double.doubleToLongBits(doublePrimitive);
+ result = 31 * result + (int) (doubeAsLongBits ^ doubeAsLongBits >>>
32);
+ result = 31 * result + Float.floatToIntBits(floatPrimitive);
+ result = 31 * result + intPrimitive;
+ result = 31 * result + (int) (longPrimitive ^ longPrimitive >>> 32);
+ result = 31 * result + (object != null ? object.hashCode() : 0);
+ result = 31 * result + Arrays.hashCode(primitiveIntArray);
+ result = 31 * result + Arrays.hashCode(primitiveDoubleArray);
+ result = 31 * result + shortPrimitive;
+ result = 31 * result + Arrays.hashCode(stringArray);
+ result = 31 * result + (stringAttribute != null ?
stringAttribute.hashCode() : 0);
+ return result;
+ }
+
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ Primitives other = (Primitives) obj;
+ if (!Arrays.equals(arrayAttribute, other.arrayAttribute)) {
+ return false;
+ }
+ if (booleanPrimitive != other.booleanPrimitive) {
+ return false;
+ }
+ if (booleanWrapper == null) {
+ if (other.booleanWrapper != null) {
+ return false;
+ }
+ } else if (!booleanWrapper.equals(other.booleanWrapper)) {
+ return false;
+ }
+ if (bytePrimitive != other.bytePrimitive) {
+ return false;
+ }
+ if (charPrimitive != other.charPrimitive) {
+ return false;
+ }
+ if (Double.doubleToLongBits(doublePrimitive) !=
Double.doubleToLongBits(other.doublePrimitive)) {
+ return false;
+ }
+ if (Float.floatToIntBits(floatPrimitive) !=
Float.floatToIntBits(other.floatPrimitive)) {
+ return false;
+ }
+ if (intPrimitive != other.intPrimitive) {
+ return false;
+ }
+ if (longPrimitive != other.longPrimitive) {
+ return false;
+ }
+ if (object == null) {
+ if (other.object != null) {
+ return false;
+ }
+ } else if (!object.equals(other.object)) {
+ return false;
+ }
+ if (!Arrays.equals(primitiveIntArray, other.primitiveIntArray)) {
+ return false;
+ }
+ if (!Arrays.equals(primitiveDoubleArray, other.primitiveDoubleArray)) {
+ return false;
+ }
+ if (shortPrimitive != other.shortPrimitive) {
+ return false;
+ }
+ if (!Arrays.equals(stringArray, other.stringArray)) {
+ return false;
+ }
+ if (stringAttribute == null) {
+ if (other.stringAttribute != null) {
+ return false;
+ }
+ } else if (!stringAttribute.equals(other.stringAttribute)) {
+ return false;
+ }
+ return true;
+ }
+
+ public TestEnum getEnumValue() {
+ return enumValue;
+ }
+
+ public void setEnumValue(TestEnum enumValue) {
+ this.enumValue = enumValue;
+ }
+
+ private static final long serialVersionUID = 0xd646cef8675cdfa2L;
+ private boolean booleanPrimitive;
+ private char charPrimitive;
+ private byte bytePrimitive;
+ private short shortPrimitive;
+ private int intPrimitive;
+ private long longPrimitive;
+ private float floatPrimitive;
+ private double doublePrimitive;
+ private String stringAttribute;
+ private Object arrayAttribute[];
+ private boolean primitiveBooleanArray[];
+ private byte primitiveByteArray[];
+ private short primitiveShortArray[];
+ private char primitiveCharArray[];
+ private int primitiveIntArray[];
+ private long primitiveLongArray[];
+ private float primitiveFloatArray[];
+ private double primitiveDoubleArray[];
+ private String stringArray[];
+ private Boolean booleanWrapper;
+ private Object object;
+ private TestEnum enumValue;
+}
\ No newline at end of file
diff --git
a/drools-test-coverage/drools-test-coverage-jars/testEnum/src/main/java/org/drools/TestEnum.java
b/drools-test-coverage/drools-test-coverage-jars/testEnum/src/main/java/org/drools/TestEnum.java
new file mode 100644
index 0000000000..90fcd91c2a
--- /dev/null
+++
b/drools-test-coverage/drools-test-coverage-jars/testEnum/src/main/java/org/drools/TestEnum.java
@@ -0,0 +1,26 @@
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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;
+
+public enum TestEnum {
+
+ ONE,
+ TWO,
+ THREE;
+}
diff --git a/drools-test-coverage/pom.xml b/drools-test-coverage/pom.xml
index 7e54cdb19f..0659747802 100644
--- a/drools-test-coverage/pom.xml
+++ b/drools-test-coverage/pom.xml
@@ -39,6 +39,7 @@
<modules>
<module>standalone</module>
+ <module>drools-test-coverage-jars</module>
<module>test-suite</module>
<module>test-compiler-integration</module>
<module>test-integration-nomvel</module>
diff --git a/drools-test-coverage/test-compiler-integration/.gitignore
b/drools-test-coverage/test-compiler-integration/.gitignore
new file mode 100644
index 0000000000..c99076438b
--- /dev/null
+++ b/drools-test-coverage/test-compiler-integration/.gitignore
@@ -0,0 +1,22 @@
+# 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.
+
+surf.jar
+testEnum.jar
+kie-project-simple-1.0.0.jar
+only-jar-pojo-not-kjar-no-kmodule-1.0.0.jar
+setter-overload.jar
diff --git a/drools-test-coverage/test-compiler-integration/pom.xml
b/drools-test-coverage/test-compiler-integration/pom.xml
index f470744b64..b21878a9cf 100644
--- a/drools-test-coverage/test-compiler-integration/pom.xml
+++ b/drools-test-coverage/test-compiler-integration/pom.xml
@@ -39,6 +39,17 @@
<surefire.forkCount>2</surefire.forkCount>
</properties>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.drools.testcoverage</groupId>
+ <artifactId>drools-test-coverage-jars</artifactId>
+ <type>pom</type>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
<dependencies>
<dependency>
<groupId>org.drools</groupId>
@@ -96,6 +107,13 @@
<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>
@@ -197,6 +215,42 @@
<excludedGroups/>
</properties>
</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>
+ <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/JBRULESTest.java
b/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/JBRULESTest.java
index ef27b7d499..81c339d50a 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
@@ -19,6 +19,7 @@
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;
@@ -318,7 +319,10 @@ public class JBRULESTest {
// An internal specific test case so not enhanced for executable-model
final MapBackedClassLoader loader = new MapBackedClassLoader(
this.getClass().getClassLoader() );
- final JarInputStream jis = new JarInputStream(
this.getClass().getResourceAsStream( "/primespoc.jar" ) );
+ 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];
@@ -342,7 +346,7 @@ public class JBRULESTest {
final KnowledgeBuilderConfiguration conf =
KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(null, loader);
final KnowledgeBuilder kbuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder(conf);
- final String header = "import
fr.gouv.agriculture.dag.agorha.business.primes.SousPeriodePrimeAgent\n";
+ final String header = "import
org.drools.compiler.integrationtests.setter.overload.SetterOverload\n";
kbuilder.add(ResourceFactory.newByteArrayResource(header.getBytes()),
ResourceType.DRL);
assertThat(kbuilder.hasErrors()).isFalse();
@@ -350,14 +354,14 @@ public class JBRULESTest {
final String passingRule = "rule \"rule1\"\n"
+ "dialect \"mvel\"\n"
+ "when\n"
- + "SousPeriodePrimeAgent( echelle == \"abc\" )"
+ + "SetterOverload( echelle == \"abc\" )"
+ "then\n"
+ "end\n";
final String failingRule = "rule \"rule2\"\n"
+ "dialect \"mvel\"\n"
+ "when\n"
- + "SousPeriodePrimeAgent( quotiteRemuneration == 123 , echelle
== \"abc\" )"
+ + "SetterOverload( quotiteRemuneration == 123 , echelle ==
\"abc\" )"
+ "then\n"
+ "end\n";
diff --git
a/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/KieRepositoryTest.java
b/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/KieRepositoryTest.java
index 59e6d0980e..c126b29272 100644
---
a/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/KieRepositoryTest.java
+++
b/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/KieRepositoryTest.java
@@ -36,13 +36,16 @@ public class KieRepositoryTest {
// DROOLS-1335
ClassLoader cl = Thread.currentThread().getContextClassLoader();
- URLClassLoader urlClassLoader = new URLClassLoader( new
URL[]{this.getClass().getResource( "/kie-project-simple-1.0.0.jar" )} );
+ 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 );
try {
KieServices ks = KieServices.Factory.get();
KieRepository kieRepository = ks.getRepository();
- ReleaseId releaseId = ks.newReleaseId( "org.test",
"kie-project-simple", "1.0.0" );
+ 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);
@@ -56,13 +59,16 @@ public class KieRepositoryTest {
// DROOLS-1335
ClassLoader cl = Thread.currentThread().getContextClassLoader();
- URLClassLoader urlClassLoader = new URLClassLoader( new
URL[]{this.getClass().getResource( "/kie-project-simple-1.0.0.jar" )} );
+ 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 );
try {
KieServices ks = KieServices.Factory.get();
KieRepository kieRepository = ks.getRepository();
- ReleaseId releaseId = ks.newReleaseId( "org.test",
"kie-project-simple", "1.0.1" );
+ ReleaseId releaseId = ks.newReleaseId( "org.drools.testcoverage",
"kie-project-simple", "1.0.1" );
KieModule kieModule = kieRepository.getKieModule( releaseId );
assertThat(kieModule).isNull();
} finally {
@@ -75,13 +81,16 @@ public class KieRepositoryTest {
// DROOLS-1351
ClassLoader cl = Thread.currentThread().getContextClassLoader();
- URLClassLoader urlClassLoader = new URLClassLoader( new
URL[]{this.getClass().getResource(
"/only-jar-pojo-not-kjar-no-kmodule-1.0.0.jar" )} );
+ 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")
+ .isNotNull();
+ 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.test",
"only-jar-pojo-not-kjar-no-kmodule", "1.0.0" );
+ 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 {
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 cb5640ddf9..52530ecd9b 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
@@ -527,8 +527,11 @@ public class MBeansMonitoringTest {
public void testLoadKjarFromClasspath(KieBaseTestConfiguration
kieBaseTestConfiguration) {
// DROOLS-1335
ClassLoader cl = Thread.currentThread().getContextClassLoader();
-
- URLClassLoader urlClassLoader = new URLClassLoader( new
URL[]{this.getClass().getResource( "/kie-project-simple-1.0.0.jar" )} );
+
+ 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();
@@ -536,7 +539,7 @@ public class MBeansMonitoringTest {
try {
KieServices ks = KieServices.Factory.get();
KieRepository kieRepository = ks.getRepository();
- ReleaseId releaseId = ks.newReleaseId( "org.test",
"kie-project-simple", "1.0.0" );
+ 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);
diff --git
a/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/MarshallingTest.java
b/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/MarshallingTest.java
new file mode 100644
index 0000000000..9413d2d660
--- /dev/null
+++
b/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/integrationtests/MarshallingTest.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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.mvel.integrationtests;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.jar.JarEntry;
+import java.util.jar.JarInputStream;
+
+import org.drools.base.rule.MapBackedClassLoader;
+import org.junit.jupiter.api.Test;
+import org.kie.api.definition.KiePackage;
+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;
+import static org.assertj.core.api.Assertions.assertThatCode;
+
+class MarshallingTest {
+
+ /**
+ * In this case we are dealing with facts which are not on the systems
classpath.
+ */
+ @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")
+ .isNotNull();
+ JarInputStream jis = new JarInputStream(is);
+
+ JarEntry entry = null;
+ byte[] buf = new byte[1024];
+ int len = 0;
+ while ((entry = jis.getNextJarEntry()) != null) {
+ if (!entry.isDirectory()) {
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ while ((len = jis.read(buf)) >= 0) {
+ out.write(buf,
+ 0,
+ len);
+ }
+ loader.addResource(entry.getName(),
+ out.toByteArray());
+ }
+ }
+
+ String drl = "package foo.bar \n" +
+ "import org.example.surf.Board\n" +
+ "rule 'MyGoodRule' \n dialect 'mvel' \n when " +
+ " Board() " +
+ "then \n" +
+ " System.err.println(42); \n" +
+ "end\n";
+
+ KnowledgeBuilderConfiguration kbuilderConf =
KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(null, loader);
+
+ final KnowledgeBuilder kbuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder(kbuilderConf);
+ kbuilder.add(ResourceFactory.newByteArrayResource(drl.getBytes()),
ResourceType.DRL);
+
+
assertThat(kbuilder.hasErrors()).as(kbuilder.getErrors().toString()).isFalse();
+
+ Collection<KiePackage> kpkgs = kbuilder.getKnowledgePackages();
+
+ assertThatCode(() -> {
+ SerializationHelper.serializeObject(kpkgs, loader);
+ }).doesNotThrowAnyException();
+ }
+}
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 e1ebc19d96..0c594ef160 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
@@ -7165,7 +7165,7 @@ public class Misc2Test {
public void testKieBuilderWithClassLoader(KieBaseTestConfiguration
kieBaseTestConfiguration) {
// DROOLS-763
String drl =
- "import com.billasurf.Person\n" +
+ "import org.example.surf.Person\n" +
"\n" +
"global java.util.List list\n" +
"\n" +
@@ -7183,7 +7183,10 @@ public class Misc2Test {
" list.add($p.getAge());\n" +
"end\n";
- URLClassLoader urlClassLoader = new URLClassLoader( new
URL[]{this.getClass().getResource( "/billasurf.jar" )} );
+ 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();
diff --git
a/drools-test-coverage/test-compiler-integration/src/test/resources/billasurf.jar
b/drools-test-coverage/test-compiler-integration/src/test/resources/billasurf.jar
deleted file mode 100644
index 231890056b..0000000000
Binary files
a/drools-test-coverage/test-compiler-integration/src/test/resources/billasurf.jar
and /dev/null differ
diff --git
a/drools-test-coverage/test-compiler-integration/src/test/resources/kie-project-simple-1.0.0.jar
b/drools-test-coverage/test-compiler-integration/src/test/resources/kie-project-simple-1.0.0.jar
deleted file mode 100644
index 069cbf3186..0000000000
Binary files
a/drools-test-coverage/test-compiler-integration/src/test/resources/kie-project-simple-1.0.0.jar
and /dev/null differ
diff --git
a/drools-test-coverage/test-compiler-integration/src/test/resources/only-jar-pojo-not-kjar-no-kmodule-1.0.0.jar
b/drools-test-coverage/test-compiler-integration/src/test/resources/only-jar-pojo-not-kjar-no-kmodule-1.0.0.jar
deleted file mode 100644
index 6f5405fa21..0000000000
Binary files
a/drools-test-coverage/test-compiler-integration/src/test/resources/only-jar-pojo-not-kjar-no-kmodule-1.0.0.jar
and /dev/null differ
diff --git
a/drools-test-coverage/test-compiler-integration/src/test/resources/org/drools/mvel/compiler/compiler/xml/changeset/changeset.jar
b/drools-test-coverage/test-compiler-integration/src/test/resources/org/drools/mvel/compiler/compiler/xml/changeset/changeset.jar
deleted file mode 100644
index cb6be97f5a..0000000000
Binary files
a/drools-test-coverage/test-compiler-integration/src/test/resources/org/drools/mvel/compiler/compiler/xml/changeset/changeset.jar
and /dev/null differ
diff --git
a/drools-test-coverage/test-compiler-integration/src/test/resources/testEnum.jar
b/drools-test-coverage/test-compiler-integration/src/test/resources/testEnum.jar
deleted file mode 100755
index 13063f83e4..0000000000
Binary files
a/drools-test-coverage/test-compiler-integration/src/test/resources/testEnum.jar
and /dev/null differ
diff --git a/drools-test-coverage/test-suite/.gitignore
b/drools-test-coverage/test-suite/.gitignore
new file mode 100644
index 0000000000..cc641e2ed2
--- /dev/null
+++ b/drools-test-coverage/test-suite/.gitignore
@@ -0,0 +1,19 @@
+# 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.
+
+kjar-module-after.jar
+kjar-module-before.jar
diff --git a/drools-test-coverage/test-suite/pom.xml
b/drools-test-coverage/test-suite/pom.xml
index f68be80bd9..1e56254af0 100644
--- a/drools-test-coverage/test-suite/pom.xml
+++ b/drools-test-coverage/test-suite/pom.xml
@@ -40,6 +40,17 @@
<excludedGroups>org.kie.test.testcategory.TurtleTestCategory</excludedGroups>
</properties>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.drools.testcoverage</groupId>
+ <artifactId>drools-test-coverage-jars</artifactId>
+ <type>pom</type>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
<dependencies>
<!-- Internal dependencies -->
<dependency>
@@ -133,6 +144,13 @@
<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>
@@ -175,6 +193,42 @@
<excludedGroups/>
</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>
+ <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 04ba333d58..70fa060198 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,6 +20,7 @@ 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.Before;
@@ -31,9 +32,12 @@ 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;
@@ -125,4 +129,53 @@ public class KieContainerTest {
final KieBuilder kbuilder = kieServices.newKieBuilder(kfs);
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/drools-verifier/pom.xml
b/drools-test-coverage/test-suite/src/test/resources/kjar/pom-kjar.xml
similarity index 53%
copy from drools-verifier/pom.xml
copy to drools-test-coverage/test-suite/src/test/resources/kjar/pom-kjar.xml
index a248d81268..c4885aa7df 100644
--- a/drools-verifier/pom.xml
+++ b/drools-test-coverage/test-suite/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,29 +18,9 @@
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/maven-v4_0_0.xsd">
-
+<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>
- <parent>
- <groupId>org.kie</groupId>
- <artifactId>drools-build-parent</artifactId>
- <version>999-SNAPSHOT</version>
- <relativePath>../build-parent/pom.xml</relativePath>
- </parent>
-
- <groupId>org.drools</groupId>
- <artifactId>drools-verifier</artifactId>
- <packaging>pom</packaging>
-
- <name>Drools :: Verifier</name>
- <description>Drools Verifier analyses the quality of Drools rules and
reports any issues.</description>
-
-
- <modules>
- <module>drools-verifier-drl</module>
- <module>drools-verifier-api</module>
- <module>drools-verifier-core</module>
- </modules>
-
-</project>
+ <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-verifier/drools-verifier-drl/.gitignore
b/drools-verifier/drools-verifier-drl/.gitignore
new file mode 100644
index 0000000000..a3eb4324f0
--- /dev/null
+++ b/drools-verifier/drools-verifier-drl/.gitignore
@@ -0,0 +1,18 @@
+# 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.
+
+model.jar
\ No newline at end of file
diff --git a/drools-verifier/drools-verifier-drl/pom.xml
b/drools-verifier/drools-verifier-drl/pom.xml
index edbf986b9f..2b93a9c78b 100644
--- a/drools-verifier/drools-verifier-drl/pom.xml
+++ b/drools-verifier/drools-verifier-drl/pom.xml
@@ -45,6 +45,11 @@
<artifactId>pdfbox</artifactId>
<version>${version.org.apache.pdfbox}</version>
</dependency>
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-verifier-test-jar</artifactId>
+ <version>1.0.0</version>
+ </dependency>
</dependencies>
</dependencyManagement>
@@ -119,6 +124,12 @@
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-verifier-test-jar</artifactId>
+ <scope>test</scope>
+ </dependency>
+
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
@@ -131,4 +142,42 @@
</dependency>
</dependencies>
+ <profiles>
+ <!-- drools-verifier-drl requires test jars built by
drools-verifier-test-jar -->
+ <!-- This profile makes sure that drools-verifier-test-jar 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/org/drools/verifier/model.jar</missing>
+ </file>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-invoker-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>build-drools-verifier-test-jar</id>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <phase>generate-test-resources</phase>
+ <configuration>
+
<projectsDirectory>${basedir}/../drools-verifier-test-jar</projectsDirectory>
+ <goals>
+ <goal>clean</goal>
+ <goal>install</goal>
+ </goals>
+ <pomIncludes>pom.xml</pomIncludes> <!-- required to build
the immediate pom -->
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
diff --git
a/drools-verifier/drools-verifier-drl/src/test/java/org/drools/verifier/VerifierTest.java
b/drools-verifier/drools-verifier-drl/src/test/java/org/drools/verifier/VerifierTest.java
index 8afcb4a71e..e7149e8bdf 100644
---
a/drools-verifier/drools-verifier-drl/src/test/java/org/drools/verifier/VerifierTest.java
+++
b/drools-verifier/drools-verifier-drl/src/test/java/org/drools/verifier/VerifierTest.java
@@ -19,6 +19,7 @@
package org.drools.verifier;
import java.io.IOException;
+import java.io.InputStream;
import java.util.Collection;
import java.util.jar.JarInputStream;
@@ -79,8 +80,10 @@ public class VerifierTest {
Verifier verifier = vBuilder.newVerifier();
try {
-
- JarInputStream jar = new JarInputStream(
this.getClass().getResourceAsStream("model.jar") );
+ InputStream is = this.getClass().getResourceAsStream("model.jar");
+ assertThat(is).as("Make sure to build drools-verifier-test-jar
first")
+ .isNotNull();
+ JarInputStream jar = new JarInputStream( is );
verifier.addObjectModel(jar);
@@ -125,7 +128,10 @@ public class VerifierTest {
try {
- JarInputStream jar = new JarInputStream(
this.getClass().getResourceAsStream("model.jar") );
+ InputStream is = this.getClass().getResourceAsStream("model.jar");
+ assertThat(is).as("Make sure to build drools-verifier-test-jar
first")
+ .isNotNull();
+ JarInputStream jar = new JarInputStream( is );
verifier.addObjectModel(jar);
diff --git
a/drools-verifier/drools-verifier-drl/src/test/java/org/drools/verifier/jarloader/PackageHeaderLoaderTest.java
b/drools-verifier/drools-verifier-drl/src/test/java/org/drools/verifier/jarloader/PackageHeaderLoaderTest.java
index 8b274bff7a..38f86a17b0 100644
---
a/drools-verifier/drools-verifier-drl/src/test/java/org/drools/verifier/jarloader/PackageHeaderLoaderTest.java
+++
b/drools-verifier/drools-verifier-drl/src/test/java/org/drools/verifier/jarloader/PackageHeaderLoaderTest.java
@@ -19,6 +19,7 @@
package org.drools.verifier.jarloader;
import java.io.IOException;
+import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -40,8 +41,11 @@ public class PackageHeaderLoaderTest {
@BeforeEach
public void setUp() throws Exception {
+ InputStream is = Verifier.class.getResourceAsStream("model.jar");
+ assertThat(is).as("Make sure to build drools-verifier-test-jar first")
+ .isNotNull();
jarInputStreams = new ArrayList<JarInputStream>();
- jarInputStreams.add(new
JarInputStream(Verifier.class.getResourceAsStream("model.jar")));
+ jarInputStreams.add(new JarInputStream(is));
}
@AfterEach
diff --git
a/drools-verifier/drools-verifier-drl/src/test/java/org/drools/verifier/jarloader/VerifierMapBackedClassLoaderTest.java
b/drools-verifier/drools-verifier-drl/src/test/java/org/drools/verifier/jarloader/VerifierMapBackedClassLoaderTest.java
index e9f14c91be..32c9d26e34 100644
---
a/drools-verifier/drools-verifier-drl/src/test/java/org/drools/verifier/jarloader/VerifierMapBackedClassLoaderTest.java
+++
b/drools-verifier/drools-verifier-drl/src/test/java/org/drools/verifier/jarloader/VerifierMapBackedClassLoaderTest.java
@@ -19,6 +19,7 @@
package org.drools.verifier.jarloader;
import java.io.IOException;
+import java.io.InputStream;
import java.util.ArrayList;
import java.util.jar.JarInputStream;
@@ -34,8 +35,11 @@ public class VerifierMapBackedClassLoaderTest {
@Test
void testCheckResources() throws Exception {
+ InputStream is = Verifier.class.getResourceAsStream("model.jar");
+ assertThat(is).as("Make sure to build drools-verifier-test-jar first")
+ .isNotNull();
ArrayList<JarInputStream> jarInputStreams = new
ArrayList<JarInputStream>();
- jarInputStreams.add(new
JarInputStream(Verifier.class.getResourceAsStream("model.jar")));
+ jarInputStreams.add(new JarInputStream(is));
VerifierMapBackedClassLoader verifierMapBackedClassLoader = new
VerifierMapBackedClassLoader(jarInputStreams);
diff --git
a/drools-verifier/drools-verifier-drl/src/test/resources/org/drools/verifier/model.jar
b/drools-verifier/drools-verifier-drl/src/test/resources/org/drools/verifier/model.jar
deleted file mode 100644
index 84488a0465..0000000000
Binary files
a/drools-verifier/drools-verifier-drl/src/test/resources/org/drools/verifier/model.jar
and /dev/null differ
diff --git a/drools-verifier/drools-verifier-test-jar/pom.xml
b/drools-verifier/drools-verifier-test-jar/pom.xml
new file mode 100644
index 0000000000..415f171364
--- /dev/null
+++ b/drools-verifier/drools-verifier-test-jar/pom.xml
@@ -0,0 +1,74 @@
+<?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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.drools</groupId>
+ <artifactId>drools-verifier-test-jar</artifactId>
+ <version>1.0.0</version>
+ <packaging>jar</packaging>
+
+ <name>Drools :: Verifier :: jar for test</name>
+
+ <properties>
+ <java.module.name>org.drools.verifier.test.jar</java.module.name>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <maven.deploy.skip>true</maven.deploy.skip>
+ <maven.compiler.release>17</maven.compiler.release>
+ </properties>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.8.1</version>
+ </plugin>
+ <plugin>
+ <groupId>com.coderplus.maven.plugins</groupId>
+ <artifactId>copy-rename-maven-plugin</artifactId>
+ <version>1.0</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>com.coderplus.maven.plugins</groupId>
+ <artifactId>copy-rename-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>rename-file</id>
+ <phase>package</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+
<sourceFile>${project.build.directory}/${project.build.finalName}.jar</sourceFile>
+
<destinationFile>${project.build.directory}/../../drools-verifier-drl/src/test/resources/org/drools/verifier/model.jar</destinationFile>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git
a/drools-verifier/drools-verifier-test-jar/src/main/java/org/test/Person.java
b/drools-verifier/drools-verifier-test-jar/src/main/java/org/test/Person.java
new file mode 100644
index 0000000000..bd39db535c
--- /dev/null
+++
b/drools-verifier/drools-verifier-test-jar/src/main/java/org/test/Person.java
@@ -0,0 +1,65 @@
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.test;
+
+import java.util.Calendar;
+import java.util.List;
+
+public class Person {
+
+ public Person() {
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+ public Calendar getBirhtday() {
+ return birhtday;
+ }
+
+ public void setBirhtday(Calendar birhtday) {
+ this.birhtday = birhtday;
+ }
+
+ public List getPets() {
+ return pets;
+ }
+
+ public void setPets(List pets) {
+ this.pets = pets;
+ }
+
+ private String firstName;
+ private String lastName;
+ private Calendar birhtday;
+ private List pets;
+}
\ No newline at end of file
diff --git
a/drools-verifier/drools-verifier-test-jar/src/main/java/org/test/Pet.java
b/drools-verifier/drools-verifier-test-jar/src/main/java/org/test/Pet.java
new file mode 100644
index 0000000000..ddbea246ae
--- /dev/null
+++ b/drools-verifier/drools-verifier-test-jar/src/main/java/org/test/Pet.java
@@ -0,0 +1,46 @@
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.test;
+
+import java.util.Calendar;
+
+public class Pet {
+
+ public Pet() {
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Calendar getBirhtday() {
+ return birhtday;
+ }
+
+ public void setBirhtday(Calendar birhtday) {
+ this.birhtday = birhtday;
+ }
+
+ private String name;
+ private Calendar birhtday;
+}
\ No newline at end of file
diff --git
a/drools-verifier/drools-verifier-test-jar/src/main/java/org/test/Rambo.java
b/drools-verifier/drools-verifier-test-jar/src/main/java/org/test/Rambo.java
new file mode 100644
index 0000000000..4db151ba72
--- /dev/null
+++ b/drools-verifier/drools-verifier-test-jar/src/main/java/org/test/Rambo.java
@@ -0,0 +1,31 @@
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.test;
+
+public class Rambo {
+
+ public Rambo() {
+ }
+
+ public String getTheName() {
+ return "John Rambo";
+ }
+
+ private final String name = "John Rambo";
+}
\ No newline at end of file
diff --git a/drools-verifier/pom.xml b/drools-verifier/pom.xml
index a248d81268..e11a4ea4b7 100644
--- a/drools-verifier/pom.xml
+++ b/drools-verifier/pom.xml
@@ -39,6 +39,7 @@
<modules>
+ <module>drools-verifier-test-jar</module>
<module>drools-verifier-drl</module>
<module>drools-verifier-api</module>
<module>drools-verifier-core</module>
diff --git a/kie-ci/src/test/java/org/kie/scanner/KieModuleMavenTest.java
b/kie-ci/src/test/java/org/kie/scanner/KieModuleMavenTest.java
index 115ba52936..2d66e152fb 100644
--- a/kie-ci/src/test/java/org/kie/scanner/KieModuleMavenTest.java
+++ b/kie-ci/src/test/java/org/kie/scanner/KieModuleMavenTest.java
@@ -26,13 +26,13 @@ import java.util.Collection;
import java.util.HashSet;
import java.util.List;
+import org.drools.base.factmodel.ClassDefinition;
+import org.drools.base.factmodel.FieldDefinition;
import org.drools.compiler.compiler.io.memory.MemoryFileSystem;
import org.drools.compiler.kie.builder.impl.InternalKieModule;
import org.drools.compiler.kie.builder.impl.KieContainerImpl;
import org.drools.compiler.kie.builder.impl.KieRepositoryImpl;
import org.drools.compiler.kie.builder.impl.KieServicesImpl;
-import org.drools.base.factmodel.ClassDefinition;
-import org.drools.base.factmodel.FieldDefinition;
import org.drools.mvel.asm.DefaultBeanClassBuilder;
import org.junit.Test;
import org.kie.api.KieBase;
@@ -43,8 +43,6 @@ import org.kie.api.builder.KieModule;
import org.kie.api.builder.KieRepository;
import org.kie.api.builder.ReleaseId;
import org.kie.api.builder.model.KieBaseModel;
-import org.kie.api.definition.KiePackage;
-import org.kie.api.definition.rule.Rule;
import org.kie.api.runtime.KieContainer;
import org.kie.api.runtime.KieSession;
import org.kie.internal.utils.KieTypeResolver;
@@ -211,53 +209,6 @@ public class KieModuleMavenTest extends AbstractKieCiTest {
assertThat(list.size()).isEqualTo(1);
}
- @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);
-
- String prefix = new File(".").getAbsolutePath().contains("kie-ci") ?
"" : "kie-ci/";
-
- File kjar = new File(prefix +
"src/test/resources/kjar/kjar-module-before.jar");
- File pom = new File(prefix + "src/test/resources/kjar/pom-kjar.xml");
- MavenRepository repository = 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(prefix +
"src/test/resources/kjar/kjar-module-after.jar");
- File pom1 = new File(prefix + "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);
- }
-
@Test
public void testKieModuleFromMavenWithDependenciesProperties() throws
Exception {
final KieServices ks = new KieServicesImpl() {
@@ -423,5 +374,4 @@ public class KieModuleMavenTest extends AbstractKieCiTest {
"";
return s;
}
-
}
diff --git a/kie-ci/src/test/resources/kjar/kjar-module-after.jar
b/kie-ci/src/test/resources/kjar/kjar-module-after.jar
deleted file mode 100644
index 17095fd6f8..0000000000
Binary files a/kie-ci/src/test/resources/kjar/kjar-module-after.jar and
/dev/null differ
diff --git a/kie-ci/src/test/resources/kjar/kjar-module-before.jar
b/kie-ci/src/test/resources/kjar/kjar-module-before.jar
deleted file mode 100644
index 6546635586..0000000000
Binary files a/kie-ci/src/test/resources/kjar/kjar-module-before.jar and
/dev/null differ
diff --git a/kie-maven-plugin/pom.xml b/kie-maven-plugin/pom.xml
index cfb5f49f9e..f982fb0aaf 100644
--- a/kie-maven-plugin/pom.xml
+++ b/kie-maven-plugin/pom.xml
@@ -344,7 +344,11 @@
<artifactId>sisu-inject-plexus</artifactId>
<scope>test</scope>
</dependency>
-
+ <dependency>
+ <groupId>org.kie</groupId>
+ <artifactId>kie-pmml-dependencies</artifactId>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.mockito</groupId>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]