Skip to content

Commit

Permalink
test(apollo-client): fix 'there is no value for xxx.from.system.prope…
Browse files Browse the repository at this point in the history
…rty'. Merge similar xml file.
  • Loading branch information
Anilople committed Nov 22, 2020
1 parent 27c043d commit b5eb6f0
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public void testResolveNamespacesWithDefaultValue() throws Exception {
int someBatch = 2000;
this.prepare(someTimeout, anotherTimeout, someBatch);

check("spring/config.namespace.resolve.to.default.xml", anotherTimeout, someBatch);
check("spring/config.namespace.placeholder.with.default.value.xml", anotherTimeout, someBatch);
}

@Test
Expand All @@ -155,7 +155,7 @@ public void testResolveNamespacesFromSystemProperty() throws Exception {
int someBatch = 2000;
this.prepare(someTimeout, anotherTimeout, someBatch);

check("spring/config.namespace.resolve.from.system.property.xml", anotherTimeout, someBatch);
check("spring/config.namespace.placeholder.xml", anotherTimeout, someBatch);
}

@Test(expected = FatalBeanException.class)
Expand All @@ -165,7 +165,7 @@ public void testUnresolvedNamespaces() {
int someBatch = 2000;
this.prepare(someTimeout, anotherTimeout, someBatch);

check("spring/config.namespace.unresolved.xml", anotherTimeout, someBatch);
check("spring/config.namespace.placeholder.xml", anotherTimeout, someBatch);
}

private static void check(String xmlLocation, int expectedTimeout, int expectedBatch) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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="${xxx.random:application}"/>
<apollo:config namespaces="${yyy.random:FX.apollo}" order="10"/>

<bean class="com.ctrip.framework.apollo.spring.XmlConfigPlaceholderTest.TestXmlBean">
<property name="timeout" value="${timeout:100}"/>
<property name="batch" value="${batch:200}"/>
</bean>
</beans>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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="${xxx.from.system.property}"/>
<apollo:config namespaces="${yyy.from.system.property}" order="10"/>

<bean class="com.ctrip.framework.apollo.spring.XmlConfigPlaceholderTest.TestXmlBean">
<property name="timeout" value="${timeout:100}"/>
<property name="batch" value="${batch:200}"/>
</bean>
</beans>

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit b5eb6f0

Please sign in to comment.