Skip to content

Commit

Permalink
Update XmlConfigBuilderTest
Browse files Browse the repository at this point in the history
  • Loading branch information
elfhazard committed May 17, 2020
1 parent 7c3ff97 commit 660cef1
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ private void settingsElement(Properties props) {
configuration.setReturnInstanceForEmptyRow(booleanValueOf(props.getProperty("returnInstanceForEmptyRow"), false));
configuration.setLogPrefix(props.getProperty("logPrefix"));
configuration.setConfigurationFactory(resolveClass(props.getProperty("configurationFactory")));
configuration.setShrinkWhitespacesInSql(booleanValueOf(props.getProperty("shrinkWhitespacesInSql"), false));
}

private void environmentsElement(XNode context) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
<setting name="vfsImpl" value="org.apache.ibatis.io.JBoss6VFS"/>
<setting name="configurationFactory" value="java.lang.String"/>
<setting name="defaultEnumTypeHandler" value="org.apache.ibatis.type.EnumOrdinalTypeHandler"/>
<setting name="shrinkWhitespacesInSql" value="true"/>
</settings>

<typeAliases>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ void shouldSuccessfullyLoadMinimalXMLConfigFile() throws Exception {
assertNull(config.getLogImpl());
assertNull(config.getConfigurationFactory());
assertThat(config.getTypeHandlerRegistry().getTypeHandler(RoundingMode.class)).isInstanceOf(EnumTypeHandler.class);
assertThat(config.isShrinkWhitespacesInSql()).isFalse();
}
}

Expand Down Expand Up @@ -194,6 +195,7 @@ void shouldSuccessfullyLoadXMLConfigFile() throws Exception {
assertThat(config.getLogImpl().getName()).isEqualTo(Slf4jImpl.class.getName());
assertThat(config.getVfsImpl().getName()).isEqualTo(JBoss6VFS.class.getName());
assertThat(config.getConfigurationFactory().getName()).isEqualTo(String.class.getName());
assertThat(config.isShrinkWhitespacesInSql()).isTrue();

assertThat(config.getTypeAliasRegistry().getTypeAliases().get("blogauthor")).isEqualTo(Author.class);
assertThat(config.getTypeAliasRegistry().getTypeAliases().get("blog")).isEqualTo(Blog.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<setting name="logImpl" value="SLF4J"/>
<setting name="vfsImpl" value="org.apache.ibatis.io.JBoss6VFS"/>
<setting name="configurationFactory" value="java.lang.String"/>
<setting name="shrinkWhitespacesInSql" value="true"/>
</settings>

<typeAliases>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ void shouldSuccessfullyLoadMinimalXMLConfigFile() throws Exception {
assertNull(config.getLogPrefix());
assertNull(config.getLogImpl());
assertNull(config.getConfigurationFactory());
assertFalse(config.isShrinkWhitespacesInSql());
} finally {
// System.clearProperty(XPathParser.KEY_USE_XSD);
}
Expand Down Expand Up @@ -121,6 +122,7 @@ void shouldSuccessfullyLoadXMLConfigFile() throws Exception {
assertEquals(Slf4jImpl.class.getName(), config.getLogImpl().getName());
assertEquals(JBoss6VFS.class.getName(), config.getVfsImpl().getName());
assertEquals(String.class.getName(), config.getConfigurationFactory().getName());
assertTrue(config.isShrinkWhitespacesInSql());

assertEquals(Author.class, config.getTypeAliasRegistry().getTypeAliases().get("blogauthor"));
assertEquals(Blog.class, config.getTypeAliasRegistry().getTypeAliases().get("blog"));
Expand Down

0 comments on commit 660cef1

Please sign in to comment.