-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DevServices DS test cases for reactive Oracle, Pg and MySQL clients
- Loading branch information
1 parent
c4a4640
commit a2b1712
Showing
6 changed files
with
132 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...nt/src/test/java/io/quarkus/reactive/mysql/client/DevServicesMySQLDatasourceTestCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package io.quarkus.reactive.mysql.client; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import java.time.Duration; | ||
import java.util.Locale; | ||
import java.util.logging.Level; | ||
import java.util.logging.LogRecord; | ||
|
||
import javax.inject.Inject; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
import io.vertx.mutiny.mysqlclient.MySQLPool; | ||
|
||
public class DevServicesMySQLDatasourceTestCase { | ||
|
||
@RegisterExtension | ||
static QuarkusUnitTest test = new QuarkusUnitTest() | ||
.withEmptyApplication() | ||
// Expect no warnings from reactive | ||
.setLogRecordPredicate(record -> record.getLevel().intValue() >= Level.WARNING.intValue() | ||
&& record.getMessage().toLowerCase(Locale.ENGLISH).contains("reactive")) | ||
.assertLogRecords(records -> assertThat(records) | ||
// This is just to get meaningful error messages, as LogRecord doesn't have a toString() | ||
.extracting(LogRecord::getMessage) | ||
.isEmpty()); | ||
|
||
@Inject | ||
MySQLPool pool; | ||
|
||
@Test | ||
public void testDatasource() throws Exception { | ||
pool.withConnection(conn -> conn.query("SELECT 1").execute().replaceWithVoid()) | ||
.await().atMost(Duration.ofMinutes(2)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
.../src/test/java/io/quarkus/reactive/oracle/client/DevServicesOracleDatasourceTestCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package io.quarkus.reactive.oracle.client; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import java.time.Duration; | ||
import java.util.Locale; | ||
import java.util.logging.Level; | ||
import java.util.logging.LogRecord; | ||
|
||
import javax.inject.Inject; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
import io.vertx.mutiny.oracleclient.OraclePool; | ||
|
||
public class DevServicesOracleDatasourceTestCase { | ||
|
||
@RegisterExtension | ||
static QuarkusUnitTest test = new QuarkusUnitTest() | ||
.withEmptyApplication() | ||
// Expect no warnings from reactive | ||
.setLogRecordPredicate(record -> record.getLevel().intValue() >= Level.WARNING.intValue() | ||
&& record.getMessage().toLowerCase(Locale.ENGLISH).contains("reactive")) | ||
.assertLogRecords(records -> assertThat(records) | ||
// This is just to get meaningful error messages, as LogRecord doesn't have a toString() | ||
.extracting(LogRecord::getMessage) | ||
.isEmpty()); | ||
|
||
@Inject | ||
OraclePool pool; | ||
|
||
@Test | ||
public void testDatasource() throws Exception { | ||
pool.withConnection(conn -> conn.query("SELECT 1 FROM DUAL").execute().replaceWithVoid()) | ||
.await().atMost(Duration.ofMinutes(2)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
.../src/test/java/io/quarkus/reactive/pg/client/DevServicesPostgresqlDatasourceTestCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package io.quarkus.reactive.pg.client; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import java.time.Duration; | ||
import java.util.Locale; | ||
import java.util.logging.Level; | ||
import java.util.logging.LogRecord; | ||
|
||
import javax.inject.Inject; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
import io.vertx.mutiny.pgclient.PgPool; | ||
|
||
public class DevServicesPostgresqlDatasourceTestCase { | ||
|
||
@RegisterExtension | ||
static QuarkusUnitTest test = new QuarkusUnitTest() | ||
.withEmptyApplication() | ||
// Expect no warnings from reactive | ||
.setLogRecordPredicate(record -> record.getLevel().intValue() >= Level.WARNING.intValue() | ||
&& record.getMessage().toLowerCase(Locale.ENGLISH).contains("reactive")) | ||
.assertLogRecords(records -> assertThat(records) | ||
// This is just to get meaningful error messages, as LogRecord doesn't have a toString() | ||
.extracting(LogRecord::getMessage) | ||
.isEmpty()); | ||
|
||
@Inject | ||
PgPool pool; | ||
|
||
@Test | ||
public void testDatasource() throws Exception { | ||
pool.withConnection(conn -> conn.query("SELECT 1").execute().replaceWithVoid()) | ||
.await().atMost(Duration.ofMinutes(2)); | ||
} | ||
} |