File tree Expand file tree Collapse file tree 5 files changed +7
-0
lines changed
main/java/org/apache/ibatis/builder/xml
test/java/org/apache/ibatis/builder Expand file tree Collapse file tree 5 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -268,6 +268,7 @@ private void settingsElement(Properties props) {
268
268
configuration .setReturnInstanceForEmptyRow (booleanValueOf (props .getProperty ("returnInstanceForEmptyRow" ), false ));
269
269
configuration .setLogPrefix (props .getProperty ("logPrefix" ));
270
270
configuration .setConfigurationFactory (resolveClass (props .getProperty ("configurationFactory" )));
271
+ configuration .setShrinkWhitespacesInSql (booleanValueOf (props .getProperty ("shrinkWhitespacesInSql" ), false ));
271
272
}
272
273
273
274
private void environmentsElement (XNode context ) throws Exception {
Original file line number Diff line number Diff line change 54
54
<setting name =" vfsImpl" value =" org.apache.ibatis.io.JBoss6VFS" />
55
55
<setting name =" configurationFactory" value =" java.lang.String" />
56
56
<setting name =" defaultEnumTypeHandler" value =" org.apache.ibatis.type.EnumOrdinalTypeHandler" />
57
+ <setting name =" shrinkWhitespacesInSql" value =" true" />
57
58
</settings >
58
59
59
60
<typeAliases >
Original file line number Diff line number Diff line change @@ -100,6 +100,7 @@ void shouldSuccessfullyLoadMinimalXMLConfigFile() throws Exception {
100
100
assertNull (config .getLogImpl ());
101
101
assertNull (config .getConfigurationFactory ());
102
102
assertThat (config .getTypeHandlerRegistry ().getTypeHandler (RoundingMode .class )).isInstanceOf (EnumTypeHandler .class );
103
+ assertThat (config .isShrinkWhitespacesInSql ()).isFalse ();
103
104
}
104
105
}
105
106
@@ -194,6 +195,7 @@ void shouldSuccessfullyLoadXMLConfigFile() throws Exception {
194
195
assertThat (config .getLogImpl ().getName ()).isEqualTo (Slf4jImpl .class .getName ());
195
196
assertThat (config .getVfsImpl ().getName ()).isEqualTo (JBoss6VFS .class .getName ());
196
197
assertThat (config .getConfigurationFactory ().getName ()).isEqualTo (String .class .getName ());
198
+ assertThat (config .isShrinkWhitespacesInSql ()).isTrue ();
197
199
198
200
assertThat (config .getTypeAliasRegistry ().getTypeAliases ().get ("blogauthor" )).isEqualTo (Author .class );
199
201
assertThat (config .getTypeAliasRegistry ().getTypeAliases ().get ("blog" )).isEqualTo (Blog .class );
Original file line number Diff line number Diff line change 50
50
<setting name =" logImpl" value =" SLF4J" />
51
51
<setting name =" vfsImpl" value =" org.apache.ibatis.io.JBoss6VFS" />
52
52
<setting name =" configurationFactory" value =" java.lang.String" />
53
+ <setting name =" shrinkWhitespacesInSql" value =" true" />
53
54
</settings >
54
55
55
56
<typeAliases >
Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ void shouldSuccessfullyLoadMinimalXMLConfigFile() throws Exception {
84
84
assertNull (config .getLogPrefix ());
85
85
assertNull (config .getLogImpl ());
86
86
assertNull (config .getConfigurationFactory ());
87
+ assertFalse (config .isShrinkWhitespacesInSql ());
87
88
} finally {
88
89
// System.clearProperty(XPathParser.KEY_USE_XSD);
89
90
}
@@ -121,6 +122,7 @@ void shouldSuccessfullyLoadXMLConfigFile() throws Exception {
121
122
assertEquals (Slf4jImpl .class .getName (), config .getLogImpl ().getName ());
122
123
assertEquals (JBoss6VFS .class .getName (), config .getVfsImpl ().getName ());
123
124
assertEquals (String .class .getName (), config .getConfigurationFactory ().getName ());
125
+ assertTrue (config .isShrinkWhitespacesInSql ());
124
126
125
127
assertEquals (Author .class , config .getTypeAliasRegistry ().getTypeAliases ().get ("blogauthor" ));
126
128
assertEquals (Blog .class , config .getTypeAliasRegistry ().getTypeAliases ().get ("blog" ));
You can’t perform that action at this time.
0 commit comments