1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.ibatis.builder.xsd;
17
18 import java.io.InputStream;
19
20 import org.apache.ibatis.builder.xml.XMLMapperBuilder;
21 import org.apache.ibatis.io.Resources;
22 import org.apache.ibatis.mapping.MappedStatement;
23 import org.apache.ibatis.mapping.ResultSetType;
24 import org.apache.ibatis.mapping.StatementType;
25 import org.apache.ibatis.session.Configuration;
26 import org.junit.jupiter.api.Assertions;
27 import org.junit.jupiter.api.Disabled;
28 import org.junit.jupiter.api.Test;
29
30 @Disabled("We'll try a different approach. See #1393")
31 class XmlMapperBuilderTest {
32
33 @Test
34 void mappedStatementWithOptions() throws Exception {
35
36 Configuration configuration = new Configuration();
37 String resource = "org/apache/ibatis/builder/xsd/AuthorMapper.xml";
38 try (InputStream inputStream = Resources.getResourceAsStream(resource)) {
39 XMLMapperBuilder builder = new XMLMapperBuilder(inputStream, configuration, resource,
40 configuration.getSqlFragments());
41 builder.parse();
42
43 MappedStatement mappedStatement = configuration.getMappedStatement("selectWithOptions");
44 Assertions.assertEquals(Integer.valueOf(200), mappedStatement.getFetchSize());
45 Assertions.assertEquals(Integer.valueOf(10), mappedStatement.getTimeout());
46 Assertions.assertEquals(StatementType.PREPARED, mappedStatement.getStatementType());
47 Assertions.assertEquals(ResultSetType.SCROLL_SENSITIVE, mappedStatement.getResultSetType());
48 Assertions.assertFalse(mappedStatement.isFlushCacheRequired());
49 Assertions.assertFalse(mappedStatement.isUseCache());
50 } finally {
51
52 }
53 }
54
55 }