Skip to content

Commit

Permalink
Test Extended Architecture (XA) connection
Browse files Browse the repository at this point in the history
  • Loading branch information
fedinskiy committed Jan 3, 2023
1 parent 15247bf commit ce15b26
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@
<ts.global.s2i.quarkus.native.builder.image>${ts.global.s2i.quarkus.native.builder.image}</ts.global.s2i.quarkus.native.builder.image>
<!-- Services used in test suite -->
<postgresql.latest.image>${postgresql.latest.image}</postgresql.latest.image>
<!-- FIXME: if the same image name is used in two test classes, the second one fails -->
<postgresql.also.latest.image>docker.io/library/postgres:15.1</postgresql.also.latest.image>
<!-- TODO: investigate further in https://github.com/quarkus-qe/quarkus-test-suite/issues/627 -->
<elastic.71.image>docker.io/bitnami/elasticsearch:7.17.6</elastic.71.image>
<!--TODO change into 5.7 when this fixed https://github.com/docker-library/mysql/issues/844 -->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package io.quarkus.ts.sqldb.sqlapp;

import io.quarkus.test.bootstrap.PostgresqlService;
import io.quarkus.test.bootstrap.RestService;
import io.quarkus.test.scenarios.QuarkusScenario;
import io.quarkus.test.services.Container;
import io.quarkus.test.services.QuarkusApplication;

@QuarkusScenario
public class XAPostgresIT extends AbstractSqlDatabaseIT {

static final int POSTGRESQL_PORT = 5432;

@Container(image = "${postgresql.also.latest.image}", port = POSTGRESQL_PORT, expectedLog = "listening on IPv4 address")
static PostgresqlService database = new PostgresqlService()
.withUser("user")
.withPassword("user")
.withDatabase("mydb");

@QuarkusApplication
static RestService app = new RestService().withProperties("postgresql.properties")
.withProperty("quarkus.datasource.username", database.getUser())
.withProperty("quarkus.datasource.password", database.getPassword())
.withProperty("quarkus.datasource.jdbc.transactions", "xa")
.withProperty("quarkus.datasource.jdbc.url", database::getJdbcUrl);
}

0 comments on commit ce15b26

Please sign in to comment.