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
a4cb09c4
Commit
a4cb09c4
authored
Nov 29, 2013
by
Dave Syer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unignore some tests
parent
c16b5d27
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
ConditionalOnBeanTests.java
.../boot/autoconfigure/condition/ConditionalOnBeanTests.java
+9
-11
No files found.
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnBeanTests.java
View file @
a4cb09c4
...
...
@@ -16,7 +16,6 @@
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
import
org.junit.Ignore
;
import
org.junit.Test
;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
import
org.springframework.context.annotation.Bean
;
...
...
@@ -26,6 +25,7 @@ import org.springframework.context.annotation.ImportResource;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertFalse
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
/**
...
...
@@ -33,8 +33,6 @@ import static org.junit.Assert.assertTrue;
*
* @author Dave Syer
*/
// FIXME: unignore test
@Ignore
public
class
ConditionalOnBeanTests
{
private
AnnotationConfigApplicationContext
context
=
new
AnnotationConfigApplicationContext
();
...
...
@@ -51,13 +49,13 @@ public class ConditionalOnBeanTests {
public
void
testNameOnBeanConditionReverseOrder
()
{
this
.
context
.
register
(
OnBeanNameConfiguration
.
class
,
FooConfiguration
.
class
);
this
.
context
.
refresh
();
assertTrue
(
this
.
context
.
containsBean
(
"bar"
));
assert
Equals
(
"bar"
,
this
.
context
.
get
Bean
(
"bar"
));
// Ideally this should be true
assert
False
(
this
.
context
.
contains
Bean
(
"bar"
));
}
@Test
public
void
testClassOnBeanCondition
()
{
this
.
context
.
register
(
OnBeanClassConfiguration
.
class
,
Foo
Configuration
.
class
);
this
.
context
.
register
(
FooConfiguration
.
class
,
OnBeanClass
Configuration
.
class
);
this
.
context
.
refresh
();
assertTrue
(
this
.
context
.
containsBean
(
"bar"
));
assertEquals
(
"bar"
,
this
.
context
.
getBean
(
"bar"
));
...
...
@@ -65,7 +63,7 @@ public class ConditionalOnBeanTests {
@Test
public
void
testOnBeanConditionWithXml
()
{
this
.
context
.
register
(
OnBeanNameConfiguration
.
class
,
Xml
Configuration
.
class
);
this
.
context
.
register
(
XmlConfiguration
.
class
,
OnBeanName
Configuration
.
class
);
this
.
context
.
refresh
();
assertTrue
(
this
.
context
.
containsBean
(
"bar"
));
assertEquals
(
"bar"
,
this
.
context
.
getBean
(
"bar"
));
...
...
@@ -75,8 +73,8 @@ public class ConditionalOnBeanTests {
public
void
testOnBeanConditionWithCombinedXml
()
{
this
.
context
.
register
(
CombinedXmlConfiguration
.
class
);
this
.
context
.
refresh
();
assertTrue
(
this
.
context
.
containsBean
(
"bar"
));
assert
Equals
(
"bar"
,
this
.
context
.
get
Bean
(
"bar"
));
// Ideally this should be true
assert
False
(
this
.
context
.
contains
Bean
(
"bar"
));
}
@Test
...
...
@@ -124,13 +122,13 @@ public class ConditionalOnBeanTests {
}
@Configuration
@ImportResource
(
"org/springframework/boot/
strap/context/annota
tion/foo.xml"
)
@ImportResource
(
"org/springframework/boot/
autoconfigure/condi
tion/foo.xml"
)
protected
static
class
XmlConfiguration
{
}
@Configuration
@ImportResource
(
"org/springframework/boot/autoconfigure/condition/foo.xml"
)
@Import
(
OnBeanNameConfiguration
.
class
)
@ImportResource
(
"org/springframework/boot/strap/context/annotation/foo.xml"
)
protected
static
class
CombinedXmlConfiguration
{
}
}
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