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

KOGITO-6131 Enable codegen when RESTEasy reactive is used #1757

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
02276ba
add jaxrs reactive build item
evacchi Oct 19, 2021
807d1e2
wip
evacchi Oct 19, 2021
8c03132
wip
evacchi Oct 19, 2021
b9ad862
undertow is optional
evacchi Oct 19, 2021
b5546f4
KOGITO-6131 Enable codegen when RESTEasy reactive is used
evacchi Oct 20, 2021
294eca5
add test cases verifying behavior with resteasy classic / reactive / …
evacchi Oct 20, 2021
9d4df1a
formatting
evacchi Oct 21, 2021
fc68b12
Use DMN for testing (currently broken in resteasy-reactive)
evacchi Nov 4, 2021
22beba1
resteasy reactive: Generated static resources
evacchi Nov 4, 2021
ce3831a
`@QuarkusIntegrationTest`, but remove the useless kafka extension -> …
evacchi Nov 4, 2021
ad5f0d1
Merge branch 'main' into KOGITO-6131-resteasy-reactive
evacchi Nov 18, 2021
3273607
Merge remote-tracking branch 'upstream/main' into KOGITO-6131-resteas…
tkobayas Nov 29, 2021
844571f
- apply AdditionalStaticResourceBuildItem for static resource
tkobayas Nov 29, 2021
f42670f
formatting
tkobayas Nov 29, 2021
cf68319
Resteasy reactive is valid
tkobayas Nov 29, 2021
d363e49
Merge remote-tracking branch 'upstream/main' into KOGITO-6131-resteas…
tkobayas Nov 30, 2021
1f466e4
Merge remote-tracking branch 'upstream/main' into KOGITO-6131-resteas…
tkobayas Dec 1, 2021
edcf4a5
- Introduced GeneratedFileType.Category.META_INF_RESOURCE
tkobayas Dec 1, 2021
690600c
- Changed the category name to STATIC_HTTP_RESOURCE
tkobayas Dec 2, 2021
453060d
- formatting
tkobayas Dec 2, 2021
f85b7c4
- Removed temporary Exception
tkobayas Dec 2, 2021
94eedc4
- code smells
tkobayas Dec 3, 2021
de6d34c
Merge remote-tracking branch 'upstream/main' into KOGITO-6131-resteas…
tkobayas Dec 3, 2021
c33b879
Merge remote-tracking branch 'upstream/main' into KOGITO-6131-resteas…
tkobayas Dec 6, 2021
960f914
- Set quarkus.test.list.include to false for quarkus-platform failing…
tkobayas Dec 9, 2021
0c60aca
- Rename RESOURCE to INTERNAL_RESOURCE
tkobayas Dec 14, 2021
f4a1d58
- Automatically add "META-INF/resources/" to STATIC_HTTP_RESOURCE path
tkobayas Dec 14, 2021
d55e712
Merge remote-tracking branch 'upstream/main' into KOGITO-6131-resteas…
tkobayas Dec 14, 2021
2da7903
- formatting
tkobayas Dec 14, 2021
3cba00b
Merge remote-tracking branch 'upstream/main' into KOGITO-6131-resteas…
tkobayas Dec 16, 2021
d0df8f7
- fix assertion to meet STATIC_HTTP_RESOURCE
tkobayas Dec 16, 2021
767c63d
Merge remote-tracking branch 'upstream/main' into KOGITO-6131-resteas…
tkobayas Dec 21, 2021
8725335
Merge remote-tracking branch 'upstream/main' into KOGITO-6131-resteas…
tkobayas Dec 23, 2021
481e629
- Fixed unstable test
tkobayas Dec 23, 2021
a780475
- removing undertow from knative addon
tkobayas Dec 24, 2021
8eebf99
Merge remote-tracking branch 'upstream/main' into KOGITO-6131-resteas…
tkobayas Dec 24, 2021
9549a29
Merge remote-tracking branch 'upstream/main' into KOGITO-6131-resteas…
tkobayas Jan 5, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
<name>Kogito :: Integration Tests :: Quarkus :: Decisions</name>

<properties>
<quarkus.test.list.include>true</quarkus.test.list.include>
<!-- excluded because of https://issues.redhat.com/browse/KOGITO-6393 -->
<quarkus.test.list.include>false</quarkus.test.list.include>
</properties>

<dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

import org.junit.jupiter.api.Test;

import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.QuarkusIntegrationTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;

import static io.restassured.RestAssured.given;
import static org.hamcrest.Matchers.is;

@QuarkusTest
@QuarkusIntegrationTest
Copy link
Contributor

@evacchi evacchi Nov 30, 2021

Choose a reason for hiding this comment

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

honest question: why are we making this change as part of this PR?

Copy link
Contributor Author

@tkobayas tkobayas Nov 30, 2021

Choose a reason for hiding this comment

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

@evacchi Sorry about not having commented on that.

For example, if I leave BasicAddIT with @QuarkusTest (and others are @QuarkusIntegrationTest. At least, OASIT requires @QuarkusIntegrationTest), I hit the BindException because quarkus keeps running across the @QuarkusIntegrationTest tests.

[ERROR] Tests run: 4, Failures: 0, Errors: 1, Skipped: 3, Time elapsed: 6.403 s <<< FAILURE! - in org.kie.kogito.integrationtests.quarkus.BasicAddIT
[ERROR] org.kie.kogito.integrationtests.quarkus.BasicAddIT.testDs1  Time elapsed: 0.001 s  <<< ERROR!
java.lang.RuntimeException: java.lang.RuntimeException: Failed to start quarkus
Caused by: java.lang.RuntimeException: Failed to start quarkus
Caused by: java.lang.RuntimeException: Unable to start HTTP server
Caused by: java.util.concurrent.ExecutionException: java.net.BindException: Address already in use
Caused by: java.net.BindException: Address already in use

So I think we should not mix @QuarkusTest and @QuarkusIntegrationTest in the same integration-test phase.

Copy link

Choose a reason for hiding this comment

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

Yes, you should not mix them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the confirmation!

Copy link
Contributor

Choose a reason for hiding this comment

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

ok !

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for pointing me out to this thread @tkobayas , I would like to explore if it's feasible to produce a more meaningful help/warn message, reported in quarkusio/quarkus#28526

class BasicAddIT {

static {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@

import org.junit.jupiter.api.Test;

import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.QuarkusIntegrationTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;

import static io.restassured.RestAssured.given;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;

@QuarkusTest
@QuarkusIntegrationTest
class DSCoercionIT {

static {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import org.junit.jupiter.api.Test;

import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.QuarkusIntegrationTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;

Expand All @@ -26,7 +26,7 @@
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue;

@QuarkusTest
@QuarkusIntegrationTest
class ElementAtIndexIT {

static {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import org.junit.jupiter.api.Test;

import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.QuarkusIntegrationTest;
import io.restassured.http.ContentType;

import static io.restassured.RestAssured.given;
Expand All @@ -29,7 +29,7 @@
* Part of build certification process. Please do not remove.
* Smoke test of kogito end-to-end scenarios.
*/
@QuarkusTest
@QuarkusIntegrationTest
public class FaceMaskIT {

@Test
Expand Down Expand Up @@ -140,4 +140,4 @@ public void testSurgicalMaskNeededInCity() {
.statusCode(200)
.body("'Face Mask Needed'", equalTo("Surgical Mask"));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import org.junit.jupiter.api.Test;

import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.QuarkusIntegrationTest;
import io.restassured.http.ContentType;

import static io.restassured.RestAssured.given;
Expand All @@ -30,7 +30,7 @@
* Part of build certification process. Please do not remove.
* Smoke test of kogito end-to-end scenarios.
*/
@QuarkusTest
@QuarkusIntegrationTest
public class HospitalsIT {

@Test
Expand Down Expand Up @@ -121,4 +121,4 @@ public void testDiabetes() {
"National Hospital",
"University Hospital")));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import org.junit.jupiter.api.Test;

import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.QuarkusIntegrationTest;
import io.restassured.http.ContentType;

import static io.restassured.RestAssured.given;
Expand All @@ -27,7 +27,7 @@
* Part of build certification process. Please do not remove.
* Smoke test of kogito end-to-end scenarios.
*/
@QuarkusTest
@QuarkusIntegrationTest
public class HospitalsStatusIT {

@Test
Expand All @@ -45,4 +45,4 @@ public void testHospitalStatus() {
.statusCode(200)
.body("'Current Status'", equalTo("red"));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import org.junit.jupiter.api.Test;

import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.QuarkusIntegrationTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
import io.restassured.path.json.config.JsonPathConfig;
Expand All @@ -28,7 +28,7 @@
import static io.restassured.config.JsonConfig.jsonConfig;
import static org.hamcrest.Matchers.closeTo;

@QuarkusTest
@QuarkusIntegrationTest
class JavaFNctxIT {

static {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.junit.jupiter.api.Test;

import io.quarkus.test.common.http.TestHTTPResource;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.QuarkusIntegrationTest;
import io.restassured.RestAssured;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.PathItem;
Expand All @@ -32,7 +32,7 @@
import static org.hamcrest.Matchers.aMapWithSize;
import static org.hamcrest.Matchers.greaterThan;

@QuarkusTest
@QuarkusIntegrationTest
class OASIT {

static {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@

import org.junit.jupiter.api.Test;

import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.QuarkusIntegrationTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;

import static org.hamcrest.CoreMatchers.is;

@QuarkusTest
@QuarkusIntegrationTest
class OneOfEachTypeIT {

static {
Expand Down
145 changes: 145 additions & 0 deletions integration-tests/integration-tests-quarkus-resteasy-classic/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.kie.kogito</groupId>
<artifactId>integration-tests</artifactId>
<version>2.0.0-SNAPSHOT</version>
</parent>
<artifactId>integration-tests-quarkus-resteasy-classic</artifactId>
<name>Kogito :: Integration Tests :: Quarkus :: RESTEasy Classic</name>

<properties>
<!-- excluded because of https://issues.redhat.com/browse/KOGITO-6394 -->
<quarkus.test.list.include>false</quarkus.test.list.include>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>kogito-quarkus-bom</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>


<dependencies>
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>kogito-quarkus</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-openapi</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-jackson</artifactId>
</dependency>

<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.swagger.parser.v3</groupId>
<artifactId>swagger-parser</artifactId>
<scope>test</scope>
<exclusions>
<exclusion> <!-- Kogito-on-Quarkus uses Kogito-Codegen's CP instead of PCL, so we need to manually exclude. -->
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- this is used implicitly by quarkus tests so let's make Maven aware of it -->
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>kogito-quarkus-deployment</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<configuration>
<noDeps>true</noDeps>
<skip>${skipTests}</skip>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<container.image.infinispan>${container.image.infinispan}</container.image.infinispan>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>native</id>
<activation>
<property>
<name>native</name>
</property>
</activation>
<properties>
<quarkus.package.type>native</quarkus.package.type>
</properties>
</profile>
</profiles>
</project>
Loading