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 63a65a08b8 [incubator-kie-drools-6158] Remove remaining binaries from
test resources on main (#6171)
63a65a08b8 is described below
commit 63a65a08b8f60f8291312ecf5c7e6472f0f57364
Author: Toshiya Kobayashi <[email protected]>
AuthorDate: Mon Nov 25 23:58:34 2024 +0900
[incubator-kie-drools-6158] Remove remaining binaries from test resources
on main (#6171)
- Create TestJar.jar on the fly
---
.rat-excludes | 6 ++++++
efesto/efesto-core/efesto-common-api/pom.xml | 23 ++++++++++++++++++++
.../src/test/custom-resources/IndexFile.testb_json | 15 +++++++++++++
.../common/api/utils/MemoryFileUtilsTest.java | 2 +-
.../src/test/resources/TestJar.jar | Bin 340 -> 0 bytes
efesto/efesto-core/efesto-common-core/pom.xml | 24 ++++++++++++++++++++-
.../src/test/custom-resources/IndexFile.testb_json | 15 +++++++++++++
.../efesto/common/core/utils/JSONUtilsTest.java | 2 +-
.../src/test/resources/TestJar.jar | Bin 340 -> 0 bytes
.../efesto-runtime-manager-core/pom.xml | 24 ++++++++++++++++++++-
.../src/test/custom-resources/IndexFile.testb_json | 20 +++++++++++++++++
.../core/utils/GeneratedResourceUtilsTest.java | 2 +-
.../src/test/resources/TestJar.jar | Bin 347 -> 0 bytes
13 files changed, 128 insertions(+), 5 deletions(-)
diff --git a/.rat-excludes b/.rat-excludes
index 6e6a73c922..16ea79745b 100644
--- a/.rat-excludes
+++ b/.rat-excludes
@@ -84,16 +84,22 @@ CompositeKnowledgeBuilderImpl_build.sdt
PMMLAssemblerService_addResourceAfterRules_withoutConfigurations.sdt
#
efesto/documentation/sdt/PMMLAssemblerService_addResourcesAfterRules_withConfigurations.sdt
PMMLAssemblerService_addResourcesAfterRules_withConfigurations.sdt
+#
efesto/efesto-core/efesto-common-api/src/test/custom-resources/IndexFile.testb_json
+IndexFile.testb_json
# efesto/efesto-core/efesto-common-api/src/test/resources/IndexFile.test_json
IndexFile.test_json
# efesto/efesto-core/efesto-common-api/src/test/resources/TestingEmptyFile.txt
TestingEmptyFile.txt
+#
efesto/efesto-core/efesto-common-core/src/test/custom-resources/IndexFile.testb_json
+IndexFile.testb_json
# efesto/efesto-core/efesto-common-core/src/test/resources/IndexFile.test_json
IndexFile.test_json
# efesto/efesto-core/efesto-common-core/src/test/resources/TestingEmptyFile.txt
TestingEmptyFile.txt
#
efesto/efesto-core/efesto-compilation-manager/efesto-compilation-manager-core/src/test/resources/IndexFile.test_json
IndexFile.test_json
+#
efesto/efesto-core/efesto-runtime-manager/efesto-runtime-manager-core/src/test/custom-resources/IndexFile.testb_json
+IndexFile.testb_json
#
efesto/efesto-core/efesto-runtime-manager/efesto-runtime-manager-core/src/test/resources/IndexFile.test_json
IndexFile.test_json
#
kie-archetypes/kie-drools-dmn-archetype/src/test/resources/projects/integrationtestDefaults/goal.txt
diff --git a/efesto/efesto-core/efesto-common-api/pom.xml
b/efesto/efesto-core/efesto-common-api/pom.xml
index ae1b879663..31e007ae74 100644
--- a/efesto/efesto-core/efesto-common-api/pom.xml
+++ b/efesto/efesto-core/efesto-common-api/pom.xml
@@ -55,5 +55,28 @@
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>process-test-resources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <target>
+ <jar
destfile="${project.build.testOutputDirectory}/TestJar.jar">
+ <fileset dir="${project.basedir}/src/test/custom-resources"/>
+ </jar>
+ </target>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
diff --git
a/efesto/efesto-core/efesto-common-api/src/test/custom-resources/IndexFile.testb_json
b/efesto/efesto-core/efesto-common-api/src/test/custom-resources/IndexFile.testb_json
new file mode 100644
index 0000000000..511b17790a
--- /dev/null
+++
b/efesto/efesto-core/efesto-common-api/src/test/custom-resources/IndexFile.testb_json
@@ -0,0 +1,15 @@
+[
+ {
+ "step-type": "executable",
+ "modelLocalUriId": {
+ "model": "foo",
+ "basePath": "/this/is/fri",
+ "fullPath": "/foo/this/is/fri"
+ },
+ "fullClassNames": ["full.class.Name"]
+ },
+ {
+ "step-type": "class",
+ "fullClassName": "full.class.Name"
+ }
+]
diff --git
a/efesto/efesto-core/efesto-common-api/src/test/java/org/kie/efesto/common/api/utils/MemoryFileUtilsTest.java
b/efesto/efesto-core/efesto-common-api/src/test/java/org/kie/efesto/common/api/utils/MemoryFileUtilsTest.java
index f4a54f83f0..38531d4bcb 100644
---
a/efesto/efesto-core/efesto-common-api/src/test/java/org/kie/efesto/common/api/utils/MemoryFileUtilsTest.java
+++
b/efesto/efesto-core/efesto-common-api/src/test/java/org/kie/efesto/common/api/utils/MemoryFileUtilsTest.java
@@ -128,7 +128,7 @@ class MemoryFileUtilsTest {
private static URL getJarUrl() throws MalformedURLException {
URL retrieved =
Thread.currentThread().getContextClassLoader().getResource("TestJar.jar");
- assertThat(retrieved).isNotNull();
+ assertThat(retrieved).as("Run `mvn test` to build
TestJar.jar").isNotNull();
String newString = "jar:" + retrieved + "!/IndexFile.testb_json";
return new URL(newString);
}
diff --git
a/efesto/efesto-core/efesto-common-api/src/test/resources/TestJar.jar
b/efesto/efesto-core/efesto-common-api/src/test/resources/TestJar.jar
deleted file mode 100644
index 6baf61d20b..0000000000
Binary files
a/efesto/efesto-core/efesto-common-api/src/test/resources/TestJar.jar and
/dev/null differ
diff --git a/efesto/efesto-core/efesto-common-core/pom.xml
b/efesto/efesto-core/efesto-common-core/pom.xml
index 3d2f0a74f1..ce4acd2a75 100644
--- a/efesto/efesto-core/efesto-common-core/pom.xml
+++ b/efesto/efesto-core/efesto-common-core/pom.xml
@@ -55,5 +55,27 @@
</dependency>
</dependencies>
-
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>process-test-resources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <target>
+ <jar
destfile="${project.build.testOutputDirectory}/TestJar.jar">
+ <fileset dir="${project.basedir}/src/test/custom-resources"/>
+ </jar>
+ </target>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
diff --git
a/efesto/efesto-core/efesto-common-core/src/test/custom-resources/IndexFile.testb_json
b/efesto/efesto-core/efesto-common-core/src/test/custom-resources/IndexFile.testb_json
new file mode 100644
index 0000000000..511b17790a
--- /dev/null
+++
b/efesto/efesto-core/efesto-common-core/src/test/custom-resources/IndexFile.testb_json
@@ -0,0 +1,15 @@
+[
+ {
+ "step-type": "executable",
+ "modelLocalUriId": {
+ "model": "foo",
+ "basePath": "/this/is/fri",
+ "fullPath": "/foo/this/is/fri"
+ },
+ "fullClassNames": ["full.class.Name"]
+ },
+ {
+ "step-type": "class",
+ "fullClassName": "full.class.Name"
+ }
+]
diff --git
a/efesto/efesto-core/efesto-common-core/src/test/java/org/kie/efesto/common/core/utils/JSONUtilsTest.java
b/efesto/efesto-core/efesto-common-core/src/test/java/org/kie/efesto/common/core/utils/JSONUtilsTest.java
index 9be10a7382..57b801160b 100644
---
a/efesto/efesto-core/efesto-common-core/src/test/java/org/kie/efesto/common/core/utils/JSONUtilsTest.java
+++
b/efesto/efesto-core/efesto-common-core/src/test/java/org/kie/efesto/common/core/utils/JSONUtilsTest.java
@@ -201,7 +201,7 @@ class JSONUtilsTest {
private ClassLoader addJarToClassLoader() {
ClassLoader originalClassLoader =
Thread.currentThread().getContextClassLoader();
URL jarUrl =
Thread.currentThread().getContextClassLoader().getResource("TestJar.jar");
- assertThat(jarUrl).isNotNull();
+ assertThat(jarUrl).as("Run `mvn test` to build
TestJar.jar").isNotNull();
URL fileUrl =
Thread.currentThread().getContextClassLoader().getResource("IndexFile.testb_json");
assertThat(fileUrl).isNull();
URL[] urls = {jarUrl};
diff --git
a/efesto/efesto-core/efesto-common-core/src/test/resources/TestJar.jar
b/efesto/efesto-core/efesto-common-core/src/test/resources/TestJar.jar
deleted file mode 100644
index 6baf61d20b..0000000000
Binary files
a/efesto/efesto-core/efesto-common-core/src/test/resources/TestJar.jar and
/dev/null differ
diff --git
a/efesto/efesto-core/efesto-runtime-manager/efesto-runtime-manager-core/pom.xml
b/efesto/efesto-core/efesto-runtime-manager/efesto-runtime-manager-core/pom.xml
index 6336caec13..b33045ebc3 100644
---
a/efesto/efesto-core/efesto-runtime-manager/efesto-runtime-manager-core/pom.xml
+++
b/efesto/efesto-core/efesto-runtime-manager/efesto-runtime-manager-core/pom.xml
@@ -49,5 +49,27 @@
</dependency>
</dependencies>
-
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>process-test-resources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <target>
+ <jar
destfile="${project.build.testOutputDirectory}/TestJar.jar">
+ <fileset dir="${project.basedir}/src/test/custom-resources"/>
+ </jar>
+ </target>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
diff --git
a/efesto/efesto-core/efesto-runtime-manager/efesto-runtime-manager-core/src/test/custom-resources/IndexFile.testb_json
b/efesto/efesto-core/efesto-runtime-manager/efesto-runtime-manager-core/src/test/custom-resources/IndexFile.testb_json
new file mode 100644
index 0000000000..33cf7f1749
--- /dev/null
+++
b/efesto/efesto-core/efesto-runtime-manager/efesto-runtime-manager-core/src/test/custom-resources/IndexFile.testb_json
@@ -0,0 +1,20 @@
+[
+ {
+ "step-type": "executable",
+ "modelLocalUriId": {
+ "model": "testb",
+ "basePath": "/testmod",
+ "fullPath": "/testb/testmod"
+ },
+ "fullClassNames": [""]
+ },
+ {
+ "step-type": "redirect",
+ "modelLocalUriId": {
+ "model": "testb",
+ "basePath": "/redirecttestmod",
+ "fullPath": "/testb/redirecttestmod"
+ },
+ "target": "other"
+ }
+]
\ No newline at end of file
diff --git
a/efesto/efesto-core/efesto-runtime-manager/efesto-runtime-manager-core/src/test/java/org/kie/efesto/runtimemanager/core/utils/GeneratedResourceUtilsTest.java
b/efesto/efesto-core/efesto-runtime-manager/efesto-runtime-manager-core/src/test/java/org/kie/efesto/runtimemanager/core/utils/GeneratedResourceUtilsTest.java
index e0ea0b2853..371df15d41 100644
---
a/efesto/efesto-core/efesto-runtime-manager/efesto-runtime-manager-core/src/test/java/org/kie/efesto/runtimemanager/core/utils/GeneratedResourceUtilsTest.java
+++
b/efesto/efesto-core/efesto-runtime-manager/efesto-runtime-manager-core/src/test/java/org/kie/efesto/runtimemanager/core/utils/GeneratedResourceUtilsTest.java
@@ -75,7 +75,7 @@ class GeneratedResourceUtilsTest {
private ClassLoader addJarToClassLoader() {
ClassLoader originalClassLoader =
Thread.currentThread().getContextClassLoader();
URL jarUrl =
Thread.currentThread().getContextClassLoader().getResource("TestJar.jar");
- assertThat(jarUrl).isNotNull();
+ assertThat(jarUrl).as("Run `mvn test` to build
TestJar.jar").isNotNull();
URL fileUrl =
Thread.currentThread().getContextClassLoader().getResource("IndexFile.testb_json");
assertThat(fileUrl).isNull();
URL[] urls = {jarUrl};
diff --git
a/efesto/efesto-core/efesto-runtime-manager/efesto-runtime-manager-core/src/test/resources/TestJar.jar
b/efesto/efesto-core/efesto-runtime-manager/efesto-runtime-manager-core/src/test/resources/TestJar.jar
deleted file mode 100644
index 1778634bdd..0000000000
Binary files
a/efesto/efesto-core/efesto-runtime-manager/efesto-runtime-manager-core/src/test/resources/TestJar.jar
and /dev/null differ
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]