Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
Overview
Details
Activity
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
openSource
apollo
Commits
cfdbc4ac
Unverified
Commit
cfdbc4ac
authored
Feb 09, 2018
by
Jason Song
Committed by
GitHub
Feb 09, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #965 from nobodyiam/more-test-for-pr962
add xml config test for PR #962
parents
a3c3aba7
1681ec38
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
+31
-0
XmlConfigPlaceholderTest.java
...rip/framework/apollo/spring/XmlConfigPlaceholderTest.java
+18
-0
XmlConfigPlaceholderTest6.xml
...t/src/test/resources/spring/XmlConfigPlaceholderTest6.xml
+13
-0
No files found.
apollo-client/src/test/java/com/ctrip/framework/apollo/spring/XmlConfigPlaceholderTest.java
View file @
cfdbc4ac
...
...
@@ -93,6 +93,24 @@ public class XmlConfigPlaceholderTest extends AbstractSpringIntegrationTest {
}
@Test
public
void
testMultiplePropertySourcesWithSameProperties2
()
throws
Exception
{
int
someTimeout
=
1000
;
int
anotherTimeout
=
someTimeout
+
1
;
int
someBatch
=
2000
;
Config
application
=
mock
(
Config
.
class
);
when
(
application
.
getProperty
(
eq
(
TIMEOUT_PROPERTY
),
anyString
())).
thenReturn
(
String
.
valueOf
(
someTimeout
));
when
(
application
.
getProperty
(
eq
(
BATCH_PROPERTY
),
anyString
())).
thenReturn
(
String
.
valueOf
(
someBatch
));
mockConfig
(
ConfigConsts
.
NAMESPACE_APPLICATION
,
application
);
Config
fxApollo
=
mock
(
Config
.
class
);
when
(
fxApollo
.
getProperty
(
eq
(
TIMEOUT_PROPERTY
),
anyString
())).
thenReturn
(
String
.
valueOf
(
anotherTimeout
));
mockConfig
(
FX_APOLLO_NAMESPACE
,
fxApollo
);
check
(
"spring/XmlConfigPlaceholderTest6.xml"
,
anotherTimeout
,
someBatch
);
}
@Test
public
void
testMultiplePropertySourcesWithSamePropertiesWithWeight
()
throws
Exception
{
int
someTimeout
=
1000
;
int
anotherTimeout
=
someTimeout
+
1
;
...
...
apollo-client/src/test/resources/spring/XmlConfigPlaceholderTest6.xml
0 → 100644
View file @
cfdbc4ac
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns=
"http://www.springframework.org/schema/beans"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:apollo=
"http://www.ctrip.com/schema/apollo"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd"
>
<apollo:config
namespaces=
"FX.apollo,application"
/>
<bean
class=
"com.ctrip.framework.apollo.spring.XmlConfigPlaceholderTest.TestXmlBean"
>
<property
name=
"timeout"
value=
"${timeout:100}"
/>
<property
name=
"batch"
value=
"${batch:200}"
/>
</bean>
</beans>
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