Browse Source

DATAJDBC-198 - Prevent HSQL specific tests to run when a different database profile is selected.

Set active profile on HSQL specific tests to HSQL.

Fixed Readme to properly reflect the need to have a Docker installation.

Original pull request: #59.
pull/59/merge
Chr1st0ph 8 years ago committed by Jens Schauder
parent
commit
5382d3b94e
  1. 2
      README.adoc
  2. 2
      src/test/java/org/springframework/data/jdbc/mybatis/MyBatisCustomizingNamespaceHsqlIntegrationTests.java
  3. 2
      src/test/java/org/springframework/data/jdbc/mybatis/MyBatisHsqlIntegrationTests.java
  4. 2
      src/test/java/org/springframework/data/jdbc/repository/query/QueryAnnotationHsqlIntegrationTests.java

2
README.adoc

@ -339,7 +339,7 @@ This will execute unit tests and integration tests using an in-memory database. @@ -339,7 +339,7 @@ This will execute unit tests and integration tests using an in-memory database.
=== Running tests with a real database
To run the integration tests against a specific database you need to have the database running on your local machine and then execute.
In order to run the integration tests against a specific database you need to have a local Docker installation available, and then execute.
[source]
----

2
src/test/java/org/springframework/data/jdbc/mybatis/MyBatisCustomizingNamespaceHsqlIntegrationTests.java

@ -37,6 +37,7 @@ import org.springframework.data.jdbc.repository.config.EnableJdbcRepositories; @@ -37,6 +37,7 @@ import org.springframework.data.jdbc.repository.config.EnableJdbcRepositories;
import org.springframework.data.jdbc.testing.TestConfiguration;
import org.springframework.data.repository.CrudRepository;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.rules.SpringClassRule;
import org.springframework.test.context.junit4.rules.SpringMethodRule;
@ -49,6 +50,7 @@ import org.springframework.transaction.annotation.Transactional; @@ -49,6 +50,7 @@ import org.springframework.transaction.annotation.Transactional;
* @author Jens Schauder
*/
@ContextConfiguration
@ActiveProfiles("hsql")
@Transactional
public class MyBatisCustomizingNamespaceHsqlIntegrationTests {

2
src/test/java/org/springframework/data/jdbc/mybatis/MyBatisHsqlIntegrationTests.java

@ -36,6 +36,7 @@ import org.springframework.data.jdbc.repository.config.EnableJdbcRepositories; @@ -36,6 +36,7 @@ import org.springframework.data.jdbc.repository.config.EnableJdbcRepositories;
import org.springframework.data.jdbc.testing.TestConfiguration;
import org.springframework.data.repository.CrudRepository;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.rules.SpringClassRule;
import org.springframework.test.context.junit4.rules.SpringMethodRule;
@ -48,6 +49,7 @@ import org.springframework.transaction.annotation.Transactional; @@ -48,6 +49,7 @@ import org.springframework.transaction.annotation.Transactional;
* @author Greg Turnquist
*/
@ContextConfiguration
@ActiveProfiles("hsql")
@Transactional
public class MyBatisHsqlIntegrationTests {

2
src/test/java/org/springframework/data/jdbc/repository/query/QueryAnnotationHsqlIntegrationTests.java

@ -36,6 +36,7 @@ import org.springframework.data.jdbc.repository.config.EnableJdbcRepositories; @@ -36,6 +36,7 @@ import org.springframework.data.jdbc.repository.config.EnableJdbcRepositories;
import org.springframework.data.jdbc.testing.TestConfiguration;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.rules.SpringClassRule;
import org.springframework.test.context.junit4.rules.SpringMethodRule;
@ -48,6 +49,7 @@ import org.springframework.transaction.annotation.Transactional; @@ -48,6 +49,7 @@ import org.springframework.transaction.annotation.Transactional;
* @author Kazuki Shimizu
*/
@ContextConfiguration
@ActiveProfiles("hsql")
@Transactional
public class QueryAnnotationHsqlIntegrationTests {

Loading…
Cancel
Save