Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
7c22e717
Commit
7c22e717
authored
Oct 01, 2020
by
Madhura Bhave
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish "Deprecate EmbeddedDatabaseConnection#HSQL"
See gh-23565
parent
d5a1421b
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
12 additions
and
10 deletions
+12
-10
DataSourceHealthIndicatorTests.java
...ork/boot/actuate/jdbc/DataSourceHealthIndicatorTests.java
+1
-1
LiquibaseEndpointTests.java
...mework/boot/actuate/liquibase/LiquibaseEndpointTests.java
+1
-1
JdbcTestWithAutoConfigureTestDatabaseReplaceAutoConfiguredIntegrationTests.java
...ureTestDatabaseReplaceAutoConfiguredIntegrationTests.java
+1
-1
JdbcTestWithAutoConfigureTestDatabaseReplaceExplicitIntegrationTests.java
...ConfigureTestDatabaseReplaceExplicitIntegrationTests.java
+1
-1
JdbcTestWithAutoConfigureTestDatabaseReplacePropertyAnyIntegrationTests.java
...figureTestDatabaseReplacePropertyAnyIntegrationTests.java
+1
-1
JdbcTestWithAutoConfigureTestDatabaseReplacePropertyAutoConfiguredIntegrationTests.java
...atabaseReplacePropertyAutoConfiguredIntegrationTests.java
+1
-1
EmbeddedDatabaseConnection.java
...springframework/boot/jdbc/EmbeddedDatabaseConnection.java
+2
-0
EmbeddedDatabaseConnectionTests.java
...gframework/boot/jdbc/EmbeddedDatabaseConnectionTests.java
+4
-4
No files found.
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/jdbc/DataSourceHealthIndicatorTests.java
View file @
7c22e717
...
@@ -52,7 +52,7 @@ class DataSourceHealthIndicatorTests {
...
@@ -52,7 +52,7 @@ class DataSourceHealthIndicatorTests {
@BeforeEach
@BeforeEach
void
init
()
{
void
init
()
{
EmbeddedDatabaseConnection
db
=
EmbeddedDatabaseConnection
.
HSQL
;
EmbeddedDatabaseConnection
db
=
EmbeddedDatabaseConnection
.
HSQL
DB
;
this
.
dataSource
=
new
SingleConnectionDataSource
(
db
.
getUrl
(
"testdb"
)
+
";shutdown=true"
,
"sa"
,
""
,
false
);
this
.
dataSource
=
new
SingleConnectionDataSource
(
db
.
getUrl
(
"testdb"
)
+
";shutdown=true"
,
"sa"
,
""
,
false
);
this
.
dataSource
.
setDriverClassName
(
db
.
getDriverClassName
());
this
.
dataSource
.
setDriverClassName
(
db
.
getDriverClassName
());
}
}
...
...
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/liquibase/LiquibaseEndpointTests.java
View file @
7c22e717
...
@@ -163,7 +163,7 @@ class LiquibaseEndpointTests {
...
@@ -163,7 +163,7 @@ class LiquibaseEndpointTests {
private
DataSource
createEmbeddedDatabase
()
{
private
DataSource
createEmbeddedDatabase
()
{
return
new
EmbeddedDatabaseBuilder
().
generateUniqueName
(
true
)
return
new
EmbeddedDatabaseBuilder
().
generateUniqueName
(
true
)
.
setType
(
EmbeddedDatabaseConnection
.
HSQL
.
getType
()).
build
();
.
setType
(
EmbeddedDatabaseConnection
.
HSQL
DB
.
getType
()).
build
();
}
}
private
SpringLiquibase
createSpringLiquibase
(
String
changeLog
,
DataSource
dataSource
)
{
private
SpringLiquibase
createSpringLiquibase
(
String
changeLog
,
DataSource
dataSource
)
{
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jdbc/JdbcTestWithAutoConfigureTestDatabaseReplaceAutoConfiguredIntegrationTests.java
View file @
7c22e717
...
@@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
*/
@JdbcTest
@JdbcTest
@AutoConfigureTestDatabase
(
replace
=
AutoConfigureTestDatabase
.
Replace
.
AUTO_CONFIGURED
,
@AutoConfigureTestDatabase
(
replace
=
AutoConfigureTestDatabase
.
Replace
.
AUTO_CONFIGURED
,
connection
=
EmbeddedDatabaseConnection
.
HSQL
)
connection
=
EmbeddedDatabaseConnection
.
HSQL
DB
)
class
JdbcTestWithAutoConfigureTestDatabaseReplaceAutoConfiguredIntegrationTests
{
class
JdbcTestWithAutoConfigureTestDatabaseReplaceAutoConfiguredIntegrationTests
{
@Autowired
@Autowired
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jdbc/JdbcTestWithAutoConfigureTestDatabaseReplaceExplicitIntegrationTests.java
View file @
7c22e717
...
@@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Stephane Nicoll
* @author Stephane Nicoll
*/
*/
@JdbcTest
@JdbcTest
@AutoConfigureTestDatabase
(
connection
=
EmbeddedDatabaseConnection
.
HSQL
)
@AutoConfigureTestDatabase
(
connection
=
EmbeddedDatabaseConnection
.
HSQL
DB
)
class
JdbcTestWithAutoConfigureTestDatabaseReplaceExplicitIntegrationTests
{
class
JdbcTestWithAutoConfigureTestDatabaseReplaceExplicitIntegrationTests
{
@Autowired
@Autowired
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jdbc/JdbcTestWithAutoConfigureTestDatabaseReplacePropertyAnyIntegrationTests.java
View file @
7c22e717
...
@@ -38,7 +38,7 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -38,7 +38,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Stephane Nicoll
* @author Stephane Nicoll
*/
*/
@JdbcTest
@JdbcTest
@AutoConfigureTestDatabase
(
connection
=
EmbeddedDatabaseConnection
.
HSQL
)
@AutoConfigureTestDatabase
(
connection
=
EmbeddedDatabaseConnection
.
HSQL
DB
)
@TestPropertySource
(
properties
=
"spring.test.database.replace=ANY"
)
@TestPropertySource
(
properties
=
"spring.test.database.replace=ANY"
)
class
JdbcTestWithAutoConfigureTestDatabaseReplacePropertyAnyIntegrationTests
{
class
JdbcTestWithAutoConfigureTestDatabaseReplacePropertyAnyIntegrationTests
{
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jdbc/JdbcTestWithAutoConfigureTestDatabaseReplacePropertyAutoConfiguredIntegrationTests.java
View file @
7c22e717
...
@@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Stephane Nicoll
* @author Stephane Nicoll
*/
*/
@JdbcTest
@JdbcTest
@AutoConfigureTestDatabase
(
connection
=
EmbeddedDatabaseConnection
.
HSQL
)
@AutoConfigureTestDatabase
(
connection
=
EmbeddedDatabaseConnection
.
HSQL
DB
)
@TestPropertySource
(
properties
=
"spring.test.database.replace=AUTO_CONFIGURED"
)
@TestPropertySource
(
properties
=
"spring.test.database.replace=AUTO_CONFIGURED"
)
class
JdbcTestWithAutoConfigureTestDatabaseReplacePropertyAutoConfiguredIntegrationTests
{
class
JdbcTestWithAutoConfigureTestDatabaseReplacePropertyAutoConfiguredIntegrationTests
{
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/EmbeddedDatabaseConnection.java
View file @
7c22e717
...
@@ -35,6 +35,7 @@ import org.springframework.util.ClassUtils;
...
@@ -35,6 +35,7 @@ import org.springframework.util.ClassUtils;
* @author Phillip Webb
* @author Phillip Webb
* @author Dave Syer
* @author Dave Syer
* @author Stephane Nicoll
* @author Stephane Nicoll
* @author Nidhi Desai
* @since 1.0.0
* @since 1.0.0
* @see #get(ClassLoader)
* @see #get(ClassLoader)
*/
*/
...
@@ -58,6 +59,7 @@ public enum EmbeddedDatabaseConnection {
...
@@ -58,6 +59,7 @@ public enum EmbeddedDatabaseConnection {
/**
/**
* HSQL Database Connection.
* HSQL Database Connection.
* @deprecated since 2.4.0 in favor of {@link EmbeddedDatabaseConnection#HSQLDB}.
*/
*/
@Deprecated
@Deprecated
HSQL
(
EmbeddedDatabaseType
.
HSQL
,
DatabaseDriver
.
HSQLDB
.
getDriverClassName
(),
"org.hsqldb.jdbcDriver"
,
HSQL
(
EmbeddedDatabaseType
.
HSQL
,
DatabaseDriver
.
HSQLDB
.
getDriverClassName
(),
"org.hsqldb.jdbcDriver"
,
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jdbc/EmbeddedDatabaseConnectionTests.java
View file @
7c22e717
...
@@ -25,6 +25,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException
...
@@ -25,6 +25,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException
* Tests for {@link EmbeddedDatabaseConnection}.
* Tests for {@link EmbeddedDatabaseConnection}.
*
*
* @author Stephane Nicoll
* @author Stephane Nicoll
* @author Nidhi Desai
*/
*/
class
EmbeddedDatabaseConnectionTests
{
class
EmbeddedDatabaseConnectionTests
{
...
@@ -40,27 +41,26 @@ class EmbeddedDatabaseConnectionTests {
...
@@ -40,27 +41,26 @@ class EmbeddedDatabaseConnectionTests {
.
isEqualTo
(
"jdbc:derby:memory:myderbydb;create=true"
);
.
isEqualTo
(
"jdbc:derby:memory:myderbydb;create=true"
);
}
}
@Deprecated
@Test
@Test
@Deprecated
void
hsqlCustomDatabaseName
()
{
void
hsqlCustomDatabaseName
()
{
assertThat
(
EmbeddedDatabaseConnection
.
HSQL
.
getUrl
(
"myhsql"
)).
isEqualTo
(
"jdbc:hsqldb:mem:myhsql"
);
assertThat
(
EmbeddedDatabaseConnection
.
HSQL
.
getUrl
(
"myhsql"
)).
isEqualTo
(
"jdbc:hsqldb:mem:myhsql"
);
}
}
@Deprecated
@Test
@Test
@Deprecated
void
getUrlWithNullDatabaseName
()
{
void
getUrlWithNullDatabaseName
()
{
assertThatIllegalArgumentException
().
isThrownBy
(()
->
EmbeddedDatabaseConnection
.
HSQL
.
getUrl
(
null
))
assertThatIllegalArgumentException
().
isThrownBy
(()
->
EmbeddedDatabaseConnection
.
HSQL
.
getUrl
(
null
))
.
withMessageContaining
(
"DatabaseName must not be empty"
);
.
withMessageContaining
(
"DatabaseName must not be empty"
);
}
}
@Deprecated
@Test
@Test
@Deprecated
void
getUrlWithEmptyDatabaseName
()
{
void
getUrlWithEmptyDatabaseName
()
{
assertThatIllegalArgumentException
().
isThrownBy
(()
->
EmbeddedDatabaseConnection
.
HSQL
.
getUrl
(
" "
))
assertThatIllegalArgumentException
().
isThrownBy
(()
->
EmbeddedDatabaseConnection
.
HSQL
.
getUrl
(
" "
))
.
withMessageContaining
(
"DatabaseName must not be empty"
);
.
withMessageContaining
(
"DatabaseName must not be empty"
);
}
}
// HSQLDB connection tests added
@Test
@Test
void
hsqldbCustomDatabaseName
()
{
void
hsqldbCustomDatabaseName
()
{
assertThat
(
EmbeddedDatabaseConnection
.
HSQLDB
.
getUrl
(
"myhsqldb"
)).
isEqualTo
(
"jdbc:hsqldb:mem:myhsqldb"
);
assertThat
(
EmbeddedDatabaseConnection
.
HSQLDB
.
getUrl
(
"myhsqldb"
)).
isEqualTo
(
"jdbc:hsqldb:mem:myhsqldb"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment