Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[incubator-kie-drools-6158] Remove remaining binaries from test resou… #6171

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .rat-excludes
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 23 additions & 0 deletions efesto/efesto-core/efesto-common-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Original file line number Diff line number Diff line change
@@ -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"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TestJar.jar creation is done at process-test-resources phase, so TestJar.jar usually exists before running tests. One exception is running tests via IDE before running mvn. For the case, I added this message.

String newString = "jar:" + retrieved + "!/IndexFile.testb_json";
return new URL(newString);
}
Expand Down
Binary file not shown.
24 changes: 23 additions & 1 deletion efesto/efesto-core/efesto-common-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Original file line number Diff line number Diff line change
@@ -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"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Original file line number Diff line number Diff line change
@@ -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"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
Binary file not shown.
Loading