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
03667c7d
Commit
03667c7d
authored
Mar 21, 2014
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename a few `setup` methods to `configure`
Fixes gh-537
parent
701bb6ee
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
CommonsDataSourceConfiguration.java
...ot/autoconfigure/jdbc/CommonsDataSourceConfiguration.java
+2
-2
SpringApplicationContextLoader.java
...ngframework/boot/test/SpringApplicationContextLoader.java
+7
-5
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/CommonsDataSourceConfiguration.java
View file @
03667c7d
...
@@ -51,11 +51,11 @@ public class CommonsDataSourceConfiguration extends AbstractDataSourceConfigurat
...
@@ -51,11 +51,11 @@ public class CommonsDataSourceConfiguration extends AbstractDataSourceConfigurat
public
DataSource
dataSource
()
{
public
DataSource
dataSource
()
{
logger
.
info
(
"Hint: using Commons DBCP BasicDataSource. It's going to work, "
logger
.
info
(
"Hint: using Commons DBCP BasicDataSource. It's going to work, "
+
"but the Tomcat DataSource is more reliable."
);
+
"but the Tomcat DataSource is more reliable."
);
this
.
pool
=
createAnd
Setup
Pool
();
this
.
pool
=
createAnd
Configure
Pool
();
return
this
.
pool
;
return
this
.
pool
;
}
}
private
BasicDataSource
createAnd
Setup
Pool
()
{
private
BasicDataSource
createAnd
Configure
Pool
()
{
BasicDataSource
pool
=
new
BasicDataSource
();
BasicDataSource
pool
=
new
BasicDataSource
();
pool
.
setDriverClassName
(
getDriverClassName
());
pool
.
setDriverClassName
(
getDriverClassName
());
pool
.
setUrl
(
getUrl
());
pool
.
setUrl
(
getUrl
());
...
...
spring-boot/src/main/java/org/springframework/boot/test/SpringApplicationContextLoader.java
View file @
03667c7d
...
@@ -77,7 +77,7 @@ public class SpringApplicationContextLoader extends AbstractContextLoader {
...
@@ -77,7 +77,7 @@ public class SpringApplicationContextLoader extends AbstractContextLoader {
List
<
ApplicationContextInitializer
<?>>
initializers
=
getInitializers
(
List
<
ApplicationContextInitializer
<?>>
initializers
=
getInitializers
(
mergedConfig
,
application
);
mergedConfig
,
application
);
if
(
mergedConfig
instanceof
WebMergedContextConfiguration
)
{
if
(
mergedConfig
instanceof
WebMergedContextConfiguration
)
{
new
WebConfigurer
().
setup
(
mergedConfig
,
application
,
initializers
);
new
WebConfigurer
().
configure
(
mergedConfig
,
application
,
initializers
);
}
}
else
{
else
{
application
.
setWebEnvironment
(
false
);
application
.
setWebEnvironment
(
false
);
...
@@ -168,20 +168,22 @@ public class SpringApplicationContextLoader extends AbstractContextLoader {
...
@@ -168,20 +168,22 @@ public class SpringApplicationContextLoader extends AbstractContextLoader {
}
}
private
static
class
WebConfigurer
{
private
static
class
WebConfigurer
{
void
setup
(
MergedContextConfiguration
mergedConfig
,
void
configure
(
MergedContextConfiguration
configuration
,
SpringApplication
application
,
SpringApplication
application
,
List
<
ApplicationContextInitializer
<?>>
initializers
)
{
List
<
ApplicationContextInitializer
<?>>
initializers
)
{
WebMergedContextConfiguration
webConfig
=
(
WebMergedContextConfiguration
)
mergedConfig
;
WebMergedContextConfiguration
webConfig
uration
=
(
WebMergedContextConfiguration
)
configuration
;
if
(
AnnotationUtils
.
findAnnotation
(
webConfig
.
getTestClass
(),
if
(
AnnotationUtils
.
findAnnotation
(
webConfig
uration
.
getTestClass
(),
IntegrationTest
.
class
)
==
null
)
{
IntegrationTest
.
class
)
==
null
)
{
MockServletContext
servletContext
=
new
MockServletContext
(
MockServletContext
servletContext
=
new
MockServletContext
(
webConfig
.
getResourceBasePath
());
webConfig
uration
.
getResourceBasePath
());
initializers
.
add
(
0
,
new
ServletContextApplicationContextInitializer
(
initializers
.
add
(
0
,
new
ServletContextApplicationContextInitializer
(
servletContext
));
servletContext
));
application
application
.
setApplicationContextClass
(
GenericWebApplicationContext
.
class
);
.
setApplicationContextClass
(
GenericWebApplicationContext
.
class
);
}
}
}
}
}
}
}
}
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