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
bccf9464
Commit
bccf9464
authored
Oct 03, 2017
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
1fd184f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
JdbcTemplateAutoConfigurationTests.java
...utoconfigure/jdbc/JdbcTemplateAutoConfigurationTests.java
+1
-1
TestDataSource.java
...ringframework/boot/autoconfigure/jdbc/TestDataSource.java
+16
-2
No files found.
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/JdbcTemplateAutoConfigurationTests.java
View file @
bccf9464
...
...
@@ -192,7 +192,7 @@ public class JdbcTemplateAutoConfigurationTests {
@Bean
public
DataSource
customDataSource
()
{
return
new
TestDataSource
(
"overridedb"
);
return
new
TestDataSource
();
}
}
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/TestDataSource.java
View file @
bccf9464
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -16,6 +16,8 @@
package
org
.
springframework
.
boot
.
autoconfigure
.
jdbc
;
import
java.util.UUID
;
import
org.apache.commons.dbcp2.BasicDataSource
;
/**
...
...
@@ -23,13 +25,25 @@ import org.apache.commons.dbcp2.BasicDataSource;
*
* @author Phillip Webb
* @author Kazuki Shimizu
* @author Stephane Nicoll
*/
public
class
TestDataSource
extends
BasicDataSource
{
/**
* Create an in-memory database with the specified name.
* @param name the name of the database
*/
public
TestDataSource
(
String
name
)
{
setDriverClassName
(
"org.hsqldb.jdbcDriver"
);
setUrl
(
"jdbc:hsqldb:
target/
"
+
name
);
setUrl
(
"jdbc:hsqldb:
mem:
"
+
name
);
setUsername
(
"sa"
);
}
/**
* Create an in-memory database with a random name.
*/
public
TestDataSource
()
{
this
(
UUID
.
randomUUID
().
toString
());
}
}
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