Skip to content

Commit 5382d3b

Browse files
Chr1st0phschauder
authored andcommitted
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.
1 parent eb0f621 commit 5382d3b

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ This will execute unit tests and integration tests using an in-memory database.
339339

340340
=== Running tests with a real database
341341

342-
To run the integration tests against a specific database you need to have the database running on your local machine and then execute.
342+
In order to run the integration tests against a specific database you need to have a local Docker installation available, and then execute.
343343

344344
[source]
345345
----

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import org.springframework.data.jdbc.testing.TestConfiguration;
3838
import org.springframework.data.repository.CrudRepository;
3939
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
40+
import org.springframework.test.context.ActiveProfiles;
4041
import org.springframework.test.context.ContextConfiguration;
4142
import org.springframework.test.context.junit4.rules.SpringClassRule;
4243
import org.springframework.test.context.junit4.rules.SpringMethodRule;
@@ -49,6 +50,7 @@
4950
* @author Jens Schauder
5051
*/
5152
@ContextConfiguration
53+
@ActiveProfiles("hsql")
5254
@Transactional
5355
public class MyBatisCustomizingNamespaceHsqlIntegrationTests {
5456

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import org.springframework.data.jdbc.testing.TestConfiguration;
3737
import org.springframework.data.repository.CrudRepository;
3838
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
39+
import org.springframework.test.context.ActiveProfiles;
3940
import org.springframework.test.context.ContextConfiguration;
4041
import org.springframework.test.context.junit4.rules.SpringClassRule;
4142
import org.springframework.test.context.junit4.rules.SpringMethodRule;
@@ -48,6 +49,7 @@
4849
* @author Greg Turnquist
4950
*/
5051
@ContextConfiguration
52+
@ActiveProfiles("hsql")
5153
@Transactional
5254
public class MyBatisHsqlIntegrationTests {
5355

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import org.springframework.data.jdbc.testing.TestConfiguration;
3737
import org.springframework.data.repository.CrudRepository;
3838
import org.springframework.data.repository.query.Param;
39+
import org.springframework.test.context.ActiveProfiles;
3940
import org.springframework.test.context.ContextConfiguration;
4041
import org.springframework.test.context.junit4.rules.SpringClassRule;
4142
import org.springframework.test.context.junit4.rules.SpringMethodRule;
@@ -48,6 +49,7 @@
4849
* @author Kazuki Shimizu
4950
*/
5051
@ContextConfiguration
52+
@ActiveProfiles("hsql")
5153
@Transactional
5254
public class QueryAnnotationHsqlIntegrationTests {
5355

0 commit comments

Comments
 (0)