use of org.apache.ibatis.scripting.xmltags.XMLLanguageDriver in project mybatis-3 by mybatis.
the class XmlConfigBuilderTest method shouldSuccessfullyLoadMinimalXMLConfigFile.
@Test
void shouldSuccessfullyLoadMinimalXMLConfigFile() throws Exception {
// System.setProperty(XPathParser.KEY_USE_XSD, "true");
String resource = "org/apache/ibatis/builder/xsd/MinimalMapperConfig.xml";
try (InputStream inputStream = Resources.getResourceAsStream(resource)) {
XMLConfigBuilder builder = new XMLConfigBuilder(inputStream);
Configuration config = builder.parse();
assertNotNull(config);
assertEquals(AutoMappingBehavior.PARTIAL, config.getAutoMappingBehavior());
assertEquals(AutoMappingUnknownColumnBehavior.NONE, config.getAutoMappingUnknownColumnBehavior());
assertTrue(config.isCacheEnabled());
assertTrue(config.getProxyFactory() instanceof JavassistProxyFactory);
assertFalse(config.isLazyLoadingEnabled());
assertFalse(config.isAggressiveLazyLoading());
assertTrue(config.isMultipleResultSetsEnabled());
assertTrue(config.isUseColumnLabel());
assertFalse(config.isUseGeneratedKeys());
assertEquals(ExecutorType.SIMPLE, config.getDefaultExecutorType());
assertNull(config.getDefaultStatementTimeout());
assertNull(config.getDefaultFetchSize());
assertFalse(config.isMapUnderscoreToCamelCase());
assertFalse(config.isSafeRowBoundsEnabled());
assertEquals(LocalCacheScope.SESSION, config.getLocalCacheScope());
assertEquals(JdbcType.OTHER, config.getJdbcTypeForNull());
assertEquals(new HashSet<>(Arrays.asList("equals", "clone", "hashCode", "toString")), config.getLazyLoadTriggerMethods());
assertTrue(config.isSafeResultHandlerEnabled());
assertTrue(config.getDefaultScriptingLanguageInstance() instanceof XMLLanguageDriver);
assertFalse(config.isCallSettersOnNulls());
assertNull(config.getLogPrefix());
assertNull(config.getLogImpl());
assertNull(config.getConfigurationFactory());
assertFalse(config.isShrinkWhitespacesInSql());
} finally {
// System.clearProperty(XPathParser.KEY_USE_XSD);
}
}
Aggregations