Skip to content

Commit 3dc8fc8

Browse files
i10320yrodiere
i10320
authored andcommitted
Add IT for Hibernate reactive with oracle reactive client
1 parent 22d8b35 commit 3dc8fc8

17 files changed

+1033
-2
lines changed

.github/native-tests.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
},
4545
{
4646
"category": "Data7",
47-
"timeout": 90,
48-
"test-modules": "reactive-oracle-client, reactive-mysql-client, reactive-db2-client, hibernate-reactive-db2, hibernate-reactive-mariadb, hibernate-reactive-mssql, hibernate-reactive-mysql, hibernate-reactive-mysql-agroal-flyway, hibernate-reactive-panache, hibernate-reactive-panache-kotlin",
47+
"timeout": 95,
48+
"test-modules": "reactive-oracle-client, reactive-mysql-client, reactive-db2-client, hibernate-reactive-db2, hibernate-reactive-mariadb, hibernate-reactive-mssql, hibernate-reactive-mysql, hibernate-reactive-mysql-agroal-flyway, hibernate-reactive-panache, hibernate-reactive-panache-kotlin, hibernate-reactive-oracle",
4949
"os-name": "ubuntu-latest"
5050
},
5151
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>quarkus-integration-tests-parent</artifactId>
7+
<groupId>io.quarkus</groupId>
8+
<version>999-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>quarkus-integration-test-hibernate-reactive-oracle</artifactId>
13+
<name>Quarkus - Integration Tests - Hibernate Reactive - Oracle</name>
14+
<description>Hibernate Reactive related tests running with the Oracle database</description>
15+
16+
<properties>
17+
<reactive-oracle.url>vertx-reactive:oracle:thin:@localhost:1520/hibernate_orm_test</reactive-oracle.url>
18+
</properties>
19+
20+
<dependencies>
21+
<dependency>
22+
<groupId>io.quarkus</groupId>
23+
<artifactId>quarkus-hibernate-reactive</artifactId>
24+
</dependency>
25+
<dependency>
26+
<groupId>io.quarkus</groupId>
27+
<artifactId>quarkus-reactive-oracle-client</artifactId>
28+
</dependency>
29+
<dependency>
30+
<groupId>io.quarkus</groupId>
31+
<artifactId>quarkus-rest-jsonb</artifactId>
32+
</dependency>
33+
<dependency>
34+
<groupId>io.quarkus</groupId>
35+
<artifactId>quarkus-elytron-security-properties-file</artifactId>
36+
</dependency>
37+
38+
<!-- test dependencies -->
39+
<dependency>
40+
<groupId>io.quarkus</groupId>
41+
<artifactId>quarkus-junit5</artifactId>
42+
<scope>test</scope>
43+
</dependency>
44+
<dependency>
45+
<groupId>io.rest-assured</groupId>
46+
<artifactId>rest-assured</artifactId>
47+
<scope>test</scope>
48+
</dependency>
49+
50+
<!-- Minimal test dependencies to *-deployment artifacts for consistent build order -->
51+
<dependency>
52+
<groupId>io.quarkus</groupId>
53+
<artifactId>quarkus-hibernate-reactive-deployment</artifactId>
54+
<version>${project.version}</version>
55+
<type>pom</type>
56+
<scope>test</scope>
57+
<exclusions>
58+
<exclusion>
59+
<groupId>*</groupId>
60+
<artifactId>*</artifactId>
61+
</exclusion>
62+
</exclusions>
63+
</dependency>
64+
<dependency>
65+
<groupId>io.quarkus</groupId>
66+
<artifactId>quarkus-reactive-oracle-client-deployment</artifactId>
67+
<version>${project.version}</version>
68+
<type>pom</type>
69+
<scope>test</scope>
70+
<exclusions>
71+
<exclusion>
72+
<groupId>*</groupId>
73+
<artifactId>*</artifactId>
74+
</exclusion>
75+
</exclusions>
76+
</dependency>
77+
<dependency>
78+
<groupId>io.quarkus</groupId>
79+
<artifactId>quarkus-rest-jsonb-deployment</artifactId>
80+
<version>${project.version}</version>
81+
<type>pom</type>
82+
<scope>test</scope>
83+
<exclusions>
84+
<exclusion>
85+
<groupId>*</groupId>
86+
<artifactId>*</artifactId>
87+
</exclusion>
88+
</exclusions>
89+
</dependency>
90+
<dependency>
91+
<groupId>io.quarkus</groupId>
92+
<artifactId>quarkus-elytron-security-properties-file-deployment</artifactId>
93+
<version>${project.version}</version>
94+
<type>pom</type>
95+
<scope>test</scope>
96+
<exclusions>
97+
<exclusion>
98+
<groupId>*</groupId>
99+
<artifactId>*</artifactId>
100+
</exclusion>
101+
</exclusions>
102+
</dependency>
103+
</dependencies>
104+
105+
<build>
106+
<resources>
107+
<resource>
108+
<directory>src/main/resources</directory>
109+
<filtering>true</filtering>
110+
</resource>
111+
</resources>
112+
<plugins>
113+
<plugin>
114+
<artifactId>maven-surefire-plugin</artifactId>
115+
<configuration>
116+
<skip>true</skip>
117+
<systemPropertyVariables>
118+
<org.hibernate.reactive.common.InternalStateAssertions.ENFORCE>true
119+
</org.hibernate.reactive.common.InternalStateAssertions.ENFORCE>
120+
</systemPropertyVariables>
121+
</configuration>
122+
</plugin>
123+
<plugin>
124+
<artifactId>maven-failsafe-plugin</artifactId>
125+
<configuration>
126+
<skip>true</skip>
127+
<systemPropertyVariables>
128+
<org.hibernate.reactive.common.InternalStateAssertions.ENFORCE>true
129+
</org.hibernate.reactive.common.InternalStateAssertions.ENFORCE>
130+
</systemPropertyVariables>
131+
</configuration>
132+
</plugin>
133+
<plugin>
134+
<groupId>io.quarkus</groupId>
135+
<artifactId>quarkus-maven-plugin</artifactId>
136+
<executions>
137+
<execution>
138+
<goals>
139+
<goal>build</goal>
140+
</goals>
141+
</execution>
142+
</executions>
143+
</plugin>
144+
</plugins>
145+
</build>
146+
147+
<profiles>
148+
<profile>
149+
<id>test-oracle</id>
150+
<activation>
151+
<property>
152+
<name>test-containers</name>
153+
</property>
154+
</activation>
155+
<build>
156+
<plugins>
157+
<plugin>
158+
<artifactId>maven-surefire-plugin</artifactId>
159+
<configuration>
160+
<skip>false</skip>
161+
</configuration>
162+
</plugin>
163+
<plugin>
164+
<artifactId>maven-failsafe-plugin</artifactId>
165+
<configuration>
166+
<skip>false</skip>
167+
</configuration>
168+
</plugin>
169+
</plugins>
170+
</build>
171+
</profile>
172+
173+
<profile>
174+
<id>docker-oracle</id>
175+
<activation>
176+
<property>
177+
<name>start-containers</name>
178+
</property>
179+
</activation>
180+
<build>
181+
<plugins>
182+
<plugin>
183+
<groupId>io.fabric8</groupId>
184+
<artifactId>docker-maven-plugin</artifactId>
185+
<configuration>
186+
<images>
187+
<image>
188+
<name>${oracle.image}</name>
189+
<alias>oracle</alias>
190+
<run>
191+
<env>
192+
<ORACLE_DATABASE>hibernate_orm_test</ORACLE_DATABASE>
193+
<ORACLE_PASSWORD>hibernate_orm_test</ORACLE_PASSWORD>
194+
<APP_USER>hibernate_orm_test</APP_USER>
195+
<APP_USER_PASSWORD>hibernate_orm_test</APP_USER_PASSWORD>
196+
</env>
197+
<ports>
198+
<port>1520:1521</port>
199+
</ports>
200+
<log>
201+
<prefix>ORACLE:</prefix>
202+
<date>default</date>
203+
<color>cyan</color>
204+
</log>
205+
</run>
206+
</image>
207+
</images>
208+
<!--Stops all postgres images currently running, not just those we just started.
209+
Useful to stop processes still running from a previously failed integration test run -->
210+
<allContainers>true</allContainers>
211+
</configuration>
212+
<executions>
213+
<execution>
214+
<id>docker-start</id>
215+
<phase>pre-integration-test</phase>
216+
<goals>
217+
<goal>stop</goal>
218+
<goal>build</goal>
219+
<goal>start</goal>
220+
</goals>
221+
</execution>
222+
<execution>
223+
<id>docker-stop</id>
224+
<phase>post-integration-test</phase>
225+
<goals>
226+
<goal>stop</goal>
227+
</goals>
228+
</execution>
229+
</executions>
230+
</plugin>
231+
<plugin>
232+
<groupId>org.codehaus.mojo</groupId>
233+
<artifactId>exec-maven-plugin</artifactId>
234+
<executions>
235+
<execution>
236+
<id>docker-prune</id>
237+
<phase>generate-resources</phase>
238+
<goals>
239+
<goal>exec</goal>
240+
</goals>
241+
<configuration>
242+
<executable>${docker-prune.location}</executable>
243+
</configuration>
244+
</execution>
245+
</executions>
246+
</plugin>
247+
</plugins>
248+
</build>
249+
</profile>
250+
</profiles>
251+
252+
253+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package io.quarkus.it.hibernate.reactive.oracle.model;
2+
3+
import jakarta.persistence.Entity;
4+
import jakarta.persistence.GeneratedValue;
5+
import jakarta.persistence.Id;
6+
import jakarta.persistence.Table;
7+
8+
@Entity
9+
@Table(name = "Cow")
10+
public class FriesianCow {
11+
12+
@Id
13+
@GeneratedValue
14+
public Long id;
15+
16+
public String name;
17+
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
package io.quarkus.it.hibernate.reactive.oracle.model;
2+
3+
import java.util.Objects;
4+
5+
import jakarta.persistence.Entity;
6+
import jakarta.persistence.Id;
7+
import jakarta.persistence.NamedNativeQuery;
8+
import jakarta.persistence.Table;
9+
10+
@Entity
11+
@Table(name = "Pig")
12+
@NamedNativeQuery(name = "pig.all", query = "select * from Pig", resultClass = GuineaPig.class)
13+
public class GuineaPig {
14+
15+
@Id
16+
private Integer id;
17+
private String name;
18+
19+
public GuineaPig() {
20+
}
21+
22+
public GuineaPig(Integer id, String name) {
23+
this.id = id;
24+
this.name = name;
25+
}
26+
27+
public Integer getId() {
28+
return id;
29+
}
30+
31+
public void setId(Integer id) {
32+
this.id = id;
33+
}
34+
35+
public String getName() {
36+
return name;
37+
}
38+
39+
public void setName(String name) {
40+
this.name = name;
41+
}
42+
43+
@Override
44+
public String toString() {
45+
return id + ": " + name;
46+
}
47+
48+
@Override
49+
public boolean equals(Object o) {
50+
if (this == o) {
51+
return true;
52+
}
53+
if (o == null || getClass() != o.getClass()) {
54+
return false;
55+
}
56+
GuineaPig guineaPig = (GuineaPig) o;
57+
return Objects.equals(name, guineaPig.name);
58+
}
59+
60+
@Override
61+
public int hashCode() {
62+
return Objects.hash(name);
63+
}
64+
}

0 commit comments

Comments
 (0)