Skip to content

Commit

Permalink
- binaries for KieRepositoryTest.
Browse files Browse the repository at this point in the history
  • Loading branch information
tkobayas committed Nov 6, 2024
1 parent dc729d2 commit 8d916ed
Show file tree
Hide file tree
Showing 14 changed files with 349 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?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>only-jar-pojo-not-kjar-no-kmodule</name>
<url>http://maven.apache.org</url>

<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>
</properties>

<build>
<pluginManagement>
<plugins>
<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>
Original file line number Diff line number Diff line change
@@ -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();
}
}
6 changes: 6 additions & 0 deletions drools-test-coverage/test-compiler-integration-jars/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@
<packaging>pom</packaging>
<name>Drools :: Test Coverage :: Jars for Compiler integration tests</name>

<properties>
<parent.project.version>${project.version}</parent.project.version>
</properties>

<modules>
<module>only-jar-pojo-not-kjar-no-kmodule</module>
<module>test-compiler-integration-jars-setter-overload</module>
<module>test-compiler-integration-jars-with-invoker</module>
</modules>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

<properties>
<java.module.name>org.drools.compiler.integrationtests.setter.overload</java.module.name>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>test-compiler-integration-jars</artifactId>
<groupId>org.drools.testcoverage</groupId>
<version>999-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<groupId>org.drools.testcoverage</groupId>
<artifactId>test-compiler-integration-jars-with-invoker</artifactId>

<name>test-compiler-integration-jars-with-invoker</name>

<!-- This project is to build kjars using maven-invoker-plugin when we want to
use the project version kie-maven-plugin
and specify a fixed version (e.g. 1.0.0) for the kjar -->

<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>
<org.kie.version>${project.version}</org.kie.version>
</properties>

<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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?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>
</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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?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.
-->
<kmodule
xmlns="http://jboss.org/kie/6.0.0/kmodule">

<kbase name="simpleKBase">
<ksession name="simpleKSession" default="true"/>
</kbase>
</kmodule>
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions drools-test-coverage/test-compiler-integration/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@
# specific language governing permissions and limitations
# under the License.

kie-project-simple-1.0.0.jar
only-jar-pojo-not-kjar-no-kmodule-1.0.0.jar
test-compiler-integration-jars-setter-overload.jar
25 changes: 25 additions & 0 deletions drools-test-coverage/test-compiler-integration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
<artifactId>test-compiler-integration-jars-setter-overload</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.drools.testcoverage</groupId>
<artifactId>only-jar-pojo-not-kjar-no-kmodule</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down Expand Up @@ -111,6 +116,11 @@
<artifactId>test-compiler-integration-jars-setter-overload</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.drools.testcoverage</groupId>
<artifactId>only-jar-pojo-not-kjar-no-kmodule</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.thoughtworks.xstream</groupId>
Expand Down Expand Up @@ -201,6 +211,21 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- With this configuration, this project excludes the dependencies to test purpose jars while still being built after building and copying those jars -->
<!-- , because we want to use those jars as external jars and the test environment is not affected by the projects -->
<classpathDependencyExcludes>org.drools.testcoverage:only-jar-pojo-not-kjar-no-kmodule</classpathDependencyExcludes>
<classpathDependencyExcludes>org.drools.testcoverage:test-compiler-integration-jars-setter-overload</classpathDependencyExcludes>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>runTurtleTests</id>
Expand Down
Loading

0 comments on commit 8d916ed

Please sign in to comment.