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
2aa56231
Commit
2aa56231
authored
Feb 20, 2014
by
Dave Syer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable JMX autoconfig by default in user tests
parent
b2b487ee
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
0 deletions
+58
-0
SpringApplicationRunListener.java
...rg/springframework/boot/SpringApplicationRunListener.java
+0
-0
EventPublishingRunListener.java
...mework/boot/context/event/EventPublishingRunListener.java
+0
-0
SpringApplicationContextLoader.java
...ngframework/boot/test/SpringApplicationContextLoader.java
+2
-0
SpringApplicationConfigurationJmxTests.java
...ork/boot/test/SpringApplicationConfigurationJmxTests.java
+56
-0
No files found.
spring-boot/src/main/java/org/springframework/boot/SpringApplicationRun
Participant
.java
→
spring-boot/src/main/java/org/springframework/boot/SpringApplicationRun
Listener
.java
View file @
2aa56231
File moved
spring-boot/src/main/java/org/springframework/boot/context/event/EventPublishingRun
Participant
.java
→
spring-boot/src/main/java/org/springframework/boot/context/event/EventPublishingRun
Listener
.java
View file @
2aa56231
File moved
spring-boot/src/main/java/org/springframework/boot/test/SpringApplicationContextLoader.java
View file @
2aa56231
...
...
@@ -116,6 +116,8 @@ public class SpringApplicationContextLoader extends AbstractContextLoader {
Map
<
String
,
Object
>
args
=
new
LinkedHashMap
<
String
,
Object
>();
// Not running an embedded server, just setting up web context
args
.
put
(
"server.port"
,
"-1"
);
// JMX bean names will clash if the same bean is used in multiple contexts
args
.
put
(
"spring.jmx.enabled"
,
"false"
);
return
args
;
}
...
...
spring-boot/src/test/java/org/springframework/boot/test/SpringApplicationConfigurationJmxTests.java
0 → 100644
View file @
2aa56231
/*
* Copyright 2012-2014 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
test
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.support.PropertySourcesPlaceholderConfigurer
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
static
org
.
junit
.
Assert
.
assertFalse
;
/**
* Tests for disabling JMX by default
*
* @author Dave Syer
*/
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringApplicationConfiguration
public
class
SpringApplicationConfigurationJmxTests
{
@Value
(
"${spring.jmx.enabled}"
)
private
boolean
jmx
;
@Test
public
void
disabledByDefault
()
{
assertFalse
(
this
.
jmx
);
}
@Configuration
protected
static
class
Config
{
@Bean
public
static
PropertySourcesPlaceholderConfigurer
propertySourcesPlaceholderConfigurer
()
{
return
new
PropertySourcesPlaceholderConfigurer
();
}
}
}
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