diff --git a/integration-tests/jpa-mssql/README.md b/integration-tests/jpa-mssql/README.md new file mode 100644 index 000000000..52e8e9e34 --- /dev/null +++ b/integration-tests/jpa-mssql/README.md @@ -0,0 +1,39 @@ +# JPA example with Microsoft SQL Server + +## Running the tests + +By default, the tests of this module are disabled. + +To run the tests in a standard JVM with SQL Server started as a Docker container, you can run the following command: + +``` +mvn clean install -Ddocker -Dtest-mssql +``` + +To also test as a native image, add `-Dnative`: + +``` +mvn clean install -Ddocker -Dtest-mssql -Dnative +``` + +Alternatively you can connect to your own SQL Server. +Reconfigure the connection URL with `-Dmssqldb.url=jdbc:sqlserver://...`; +you'll probably want to change the authentication password too: `-Dmssqldb.sa-password=NotS0Secret`. + +## Limitations + +### Active Directory + +Authentication to the server via Active Directory is a feature of the official JDBC driver, but this was disabled in Quarkus so to minimize the dependencies. + +If you really need this feature, please let us know. + +### Localization, Encoding an Character sets + +SQL Server by default uses collation `SQL_Latin1_General_CP1_CI_AS` ; attempting to use this in a native-image will result in an error: + + java.io.UnsupportedEncodingException: "Codepage Cp1252 is not supported by the Java environment." + +The solution is simple: you'll need to make sure your native images contains additional, non-default character sets. + +Just set the flag `addAllCharsets` in the `native-image` configuration of your favourite build tool. diff --git a/integration-tests/jpa-mssql/pom.xml b/integration-tests/jpa-mssql/pom.xml index b485829e6..7ce2ec6c5 100644 --- a/integration-tests/jpa-mssql/pom.xml +++ b/integration-tests/jpa-mssql/pom.xml @@ -29,6 +29,12 @@ quarkus-integration-test-jpa-mssql Quarkus - Integration Tests - JPA - MSSQL Module that contains JPA related tests running in strict mode with the MSSQL database + + + SomeJDBCUrl + SomeJDBCPassword + + @@ -70,6 +76,18 @@ + + maven-surefire-plugin + + true + + + + maven-failsafe-plugin + + true + + ${project.groupId} quarkus-maven-plugin @@ -85,6 +103,31 @@ + + test-mssql + + + test-mssql + + + + + + maven-surefire-plugin + + false + + + + maven-failsafe-plugin + + false + + + + + + native-image @@ -141,6 +184,78 @@ + + docker-mssql + + + docker + + + + jdbc:sqlserver://localhost:1433;databaseName=tempdb + + ActuallyRequired11Complexity + + + + + io.fabric8 + docker-maven-plugin + + + + microsoft/mssql-server-linux:2017-CU12 + quarkus-test-mssqldb + + + 1433:1433 + + + Y + ActuallyRequired11Complexity + + + MS SQL Server: + default + cyan + + + + + direct + + 1433 + + + + + + + + + + + + docker-start + compile + + stop + start + + + + docker-stop + post-integration-test + + stop + + + + + + + + diff --git a/integration-tests/jpa-mssql/src/main/resources/application.properties b/integration-tests/jpa-mssql/src/main/resources/application.properties index 384726e0e..5f135623b 100644 --- a/integration-tests/jpa-mssql/src/main/resources/application.properties +++ b/integration-tests/jpa-mssql/src/main/resources/application.properties @@ -1,7 +1,7 @@ -quarkus.datasource.url=jdbc:sqlserver://localhost:1433;databaseName=tempdb +quarkus.datasource.url=${mssqldb.url} quarkus.datasource.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver quarkus.datasource.username=sa -quarkus.datasource.password=ActuallyRequired11Complexity +quarkus.datasource.password=${mssqldb.sa-password} quarkus.datasource.max-size=8 quarkus.datasource.min-size=2 quarkus.hibernate-orm.dialect=org.hibernate.dialect.SQLServer2012Dialect