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
4a60e3cc
Commit
4a60e3cc
authored
Nov 29, 2013
by
Dave Syer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unignore condition tests
parent
a4cb09c4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
2 deletions
+26
-2
ConditionalOnBeanTests.java
.../boot/autoconfigure/condition/ConditionalOnBeanTests.java
+24
-0
ConditionalOnClassTests.java
...boot/autoconfigure/condition/ConditionalOnClassTests.java
+2
-2
foo.xml
.../org/springframework/boot/autoconfigure/condition/foo.xml
+0
-0
No files found.
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnBeanTests.java
View file @
4a60e3cc
...
...
@@ -16,6 +16,8 @@
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
import
java.util.Date
;
import
org.junit.Test
;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
import
org.springframework.context.annotation.Bean
;
...
...
@@ -45,6 +47,19 @@ public class ConditionalOnBeanTests {
assertEquals
(
"bar"
,
this
.
context
.
getBean
(
"bar"
));
}
@Test
public
void
testNameAndTypeOnBeanCondition
()
{
this
.
context
.
register
(
FooConfiguration
.
class
,
OnBeanNameAndTypeConfiguration
.
class
);
this
.
context
.
refresh
();
/*
* Arguably this should be true, but as things are implemented the conditions
* specified in the different attributes of @ConditionalOnBean are combined with
* logical OR (not AND) so if any of them match the condition is true.
*/
assertFalse
(
this
.
context
.
containsBean
(
"bar"
));
}
@Test
public
void
testNameOnBeanConditionReverseOrder
()
{
this
.
context
.
register
(
OnBeanNameConfiguration
.
class
,
FooConfiguration
.
class
);
...
...
@@ -94,6 +109,15 @@ public class ConditionalOnBeanTests {
}
}
@Configuration
@ConditionalOnMissingBean
(
name
=
"foo"
,
value
=
Date
.
class
)
protected
static
class
OnBeanNameAndTypeConfiguration
{
@Bean
public
String
bar
()
{
return
"bar"
;
}
}
@Configuration
@ConditionalOnBean
(
annotation
=
EnableScheduling
.
class
)
protected
static
class
OnAnnotationConfiguration
{
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnClassTests.java
View file @
4a60e3cc
...
...
@@ -95,13 +95,13 @@ public class ConditionalOnClassTests {
}
@Configuration
@ImportResource
(
"org/springframework/boot/
context
/foo.xml"
)
@ImportResource
(
"org/springframework/boot/
autoconfigure/condition
/foo.xml"
)
protected
static
class
XmlConfiguration
{
}
@Configuration
@Import
(
BasicConfiguration
.
class
)
@ImportResource
(
"org/springframework/boot/
context
/foo.xml"
)
@ImportResource
(
"org/springframework/boot/
autoconfigure/condition
/foo.xml"
)
protected
static
class
CombinedXmlConfiguration
{
}
}
spring-boot
/src/test/resources/org/springframework/boot/context
/foo.xml
→
spring-boot
-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/condition
/foo.xml
View file @
4a60e3cc
File moved
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