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

HHH-13724 Add testing configs and dialect for CockroachDB #3280

Closed
Closed
1 change: 1 addition & 0 deletions documentation/documentation.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ dependencies {
testRuntime( libraries.mariadb )
testRuntime( libraries.mssql )
testRuntime( libraries.hana )
testRuntime( libraries.cockroachdb )

testCompile( project( ':hibernate-jcache' ) )
testRuntime( libraries.ehcache3 )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.hibernate.CacheMode;
import org.hibernate.ScrollableResults;
import org.hibernate.Session;
import org.hibernate.dialect.CockroachDB192Dialect;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.dialect.MySQL5Dialect;
import org.hibernate.dialect.Oracle8iDialect;
Expand Down Expand Up @@ -1296,6 +1297,7 @@ public void test_hql_mod_function_example() {
}

@Test
@SkipForDialect(value = CockroachDB192Dialect.class, comment = "https://github.com/cockroachdb/cockroach/issues/26710")
public void test_hql_sqrt_function_example() {
doInJPA( this::entityManagerFactory, entityManager -> {
//tag::hql-sqrt-function-example[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,13 @@
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Version;

import org.hibernate.annotations.OptimisticLock;
import org.hibernate.dialect.CockroachDB192Dialect;
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;

import org.hibernate.testing.SkipForDialect;
import org.junit.Test;

import org.jboss.logging.Logger;

import static org.hibernate.testing.transaction.TransactionUtil.doInJPA;

/**
Expand All @@ -34,6 +31,7 @@ protected Class<?>[] getAnnotatedClasses() {
}

@Test
@SkipForDialect(value = CockroachDB192Dialect.class, comment = "Fails at SERIALIZABLE isolation")
public void test() {
doInJPA( this::entityManagerFactory, entityManager -> {
Phone phone = new Phone();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,9 @@
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Version;

import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;

import org.junit.Test;

import org.jboss.logging.Logger;

import static org.hibernate.testing.transaction.TransactionUtil.doInJPA;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.hibernate.Session;
import org.hibernate.annotations.Nationalized;
import org.hibernate.dialect.AbstractHANADialect;
import org.hibernate.dialect.CockroachDB192Dialect;
import org.hibernate.dialect.MySQL5Dialect;
import org.hibernate.dialect.PostgreSQL81Dialect;
import org.hibernate.engine.jdbc.NClobProxy;
Expand All @@ -37,7 +38,8 @@
value = {
PostgreSQL81Dialect.class,
MySQL5Dialect.class,
AbstractHANADialect.class
AbstractHANADialect.class,
CockroachDB192Dialect.class
},
comment = "@see https://hibernate.atlassian.net/browse/HHH-10693 and https://hibernate.atlassian.net/browse/HHH-10695"
)
Expand Down
10 changes: 9 additions & 1 deletion gradle/databases.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@ ext {
'jdbc.user' : 'VLAD',
'jdbc.pass' : 'V1ad_test',
'jdbc.url' : 'jdbc:sap://localhost:39015/'
]
],
cockroachdb : [
'db.dialect' : 'org.hibernate.dialect.CockroachDB192Dialect',
// CockroachDB uses the same pgwire protocol as PostgreSQL, so the driver is the same.
'jdbc.driver': 'org.postgresql.Driver',
'jdbc.user' : 'root',
'jdbc.pass' : '',
'jdbc.url' : 'jdbc:postgresql://localhost:26257/defaultdb?sslmode=disable'
],
]
}
1 change: 1 addition & 0 deletions gradle/java-module.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ dependencies {
testRuntime( libraries.mssql )
testRuntime( libraries.informix )
testRuntime( libraries.hana )
testRuntime( libraries.cockroachdb )

asciidoclet 'org.asciidoctor:asciidoclet:1.+'

Expand Down
1 change: 1 addition & 0 deletions gradle/libraries.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ ext {
postgresql: 'org.postgresql:postgresql:42.2.2',
mysql: 'mysql:mysql-connector-java:8.0.17',
mariadb: 'org.mariadb.jdbc:mariadb-java-client:2.2.3',
cockroachdb: 'org.postgresql:postgresql:42.2.8',

oracle: 'com.oracle.jdbc:ojdbc8:12.2.0.1',
mssql: 'com.microsoft.sqlserver:mssql-jdbc:7.2.1.jre8',
Expand Down
Loading