From 63a65a08b8f60f8291312ecf5c7e6472f0f57364 Mon Sep 17 00:00:00 2001 From: Toshiya Kobayashi Date: Mon, 25 Nov 2024 23:58:34 +0900 Subject: [PATCH] [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 +++++++++++++++++ .../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 +++++++++++++++++- .../custom-resources/IndexFile.testb_json | 15 +++++++++++ .../common/core/utils/JSONUtilsTest.java | 2 +- .../src/test/resources/TestJar.jar | Bin 340 -> 0 bytes .../efesto-runtime-manager-core/pom.xml | 24 +++++++++++++++++- .../custom-resources/IndexFile.testb_json | 20 +++++++++++++++ .../utils/GeneratedResourceUtilsTest.java | 2 +- .../src/test/resources/TestJar.jar | Bin 347 -> 0 bytes 13 files changed, 128 insertions(+), 5 deletions(-) create mode 100644 efesto/efesto-core/efesto-common-api/src/test/custom-resources/IndexFile.testb_json delete mode 100644 efesto/efesto-core/efesto-common-api/src/test/resources/TestJar.jar create mode 100644 efesto/efesto-core/efesto-common-core/src/test/custom-resources/IndexFile.testb_json delete mode 100644 efesto/efesto-core/efesto-common-core/src/test/resources/TestJar.jar create mode 100644 efesto/efesto-core/efesto-runtime-manager/efesto-runtime-manager-core/src/test/custom-resources/IndexFile.testb_json delete mode 100644 efesto/efesto-core/efesto-runtime-manager/efesto-runtime-manager-core/src/test/resources/TestJar.jar diff --git a/.rat-excludes b/.rat-excludes index 6e6a73c922c..16ea79745bb 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 ae1b879663d..31e007ae743 100644 --- a/efesto/efesto-core/efesto-common-api/pom.xml +++ b/efesto/efesto-core/efesto-common-api/pom.xml @@ -55,5 +55,28 @@ + + + + org.apache.maven.plugins + maven-antrun-plugin + + + process-test-resources + + run + + + + + + + + + + + + + \ 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 00000000000..511b17790ad --- /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 f4a54f83f00..38531d4bcb5 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 @@ private static URL getResourceUrl() { 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 6baf61d20b92ed8a28ca9567854632e63da222b1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 340 zcmWIWW@Zs#U|`^22v3s=ZF8H7tKxEUB(&h24j028_WhTMk?1X{oU=_=T~ZTITQ3XdLzSjAlC){XJZ z3|i6g|89(w=+c7id%o{2_guQA?#NZCngxaO@01TZGV7*1Yv2`r6INZI`|+maliOG3 z-{M%ibGxeM>zHGUZ!K7^-R9S0RI*q9@r{-Lh04U%fBY(pC`gS zwR$pII|5es - + + + + org.apache.maven.plugins + maven-antrun-plugin + + + process-test-resources + + run + + + + + + + + + + + + + \ 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 00000000000..511b17790ad --- /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 9be10a73828..57b801160b4 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 @@ void getModelLocalUriIdObject() throws JsonProcessingException { 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 6baf61d20b92ed8a28ca9567854632e63da222b1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 340 zcmWIWW@Zs#U|`^22v3s=ZF8H7tKxEUB(&h24j028_WhTMk?1X{oU=_=T~ZTITQ3XdLzSjAlC){XJZ z3|i6g|89(w=+c7id%o{2_guQA?#NZCngxaO@01TZGV7*1Yv2`r6INZI`|+maliOG3 z-{M%ibGxeM>zHGUZ!K7^-R9S0RI*q9@r{-Lh04U%fBY(pC`gS zwR$pII|5es - + + + + org.apache.maven.plugins + maven-antrun-plugin + + + process-test-resources + + run + + + + + + + + + + + + + \ 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 00000000000..33cf7f17490 --- /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 e0ea0b2853a..371df15d416 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 @@ void getGeneratedRedirectResourceFromJar() { 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 1778634bdd6c522888d62b1d4b2cf96d64284970..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 347 zcmWIWW@Zs#U|`^2I94bX`f1lizPUhN3nK%A2!jlRXI@HbgQQX3`+U; zwv0czTH@dJr=R!4+x;jJpKtI}+v28f_y^9uMI!tG-i%Cg%(y%&0rWNl1JK_LTN*(u b>|SSucpc5#0p6@^AU%vg7zLzXgE$NT!R2@p