|
1 | 1 | /**
|
2 |
| - * Copyright 2009-2016 the original author or authors. |
| 2 | + * Copyright 2009-2017 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
17 | 17 |
|
18 | 18 | import java.io.InputStream;
|
19 | 19 | import java.io.StringReader;
|
| 20 | +import java.math.RoundingMode; |
20 | 21 | import java.sql.CallableStatement;
|
21 | 22 | import java.sql.PreparedStatement;
|
22 | 23 | import java.sql.ResultSet;
|
|
50 | 51 | import org.apache.ibatis.session.LocalCacheScope;
|
51 | 52 | import org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory;
|
52 | 53 | import org.apache.ibatis.type.BaseTypeHandler;
|
| 54 | +import org.apache.ibatis.type.EnumOrdinalTypeHandler; |
| 55 | +import org.apache.ibatis.type.EnumTypeHandler; |
53 | 56 | import org.apache.ibatis.type.JdbcType;
|
54 | 57 | import org.apache.ibatis.type.TypeHandler;
|
55 | 58 | import org.apache.ibatis.type.TypeHandlerRegistry;
|
@@ -96,6 +99,7 @@ public void shouldSuccessfullyLoadMinimalXMLConfigFile() throws Exception {
|
96 | 99 | assertNull(config.getLogPrefix());
|
97 | 100 | assertNull(config.getLogImpl());
|
98 | 101 | assertNull(config.getConfigurationFactory());
|
| 102 | + assertThat(config.getTypeHandlerRegistry().getTypeHandler(RoundingMode.class), is(instanceOf(EnumTypeHandler.class))); |
99 | 103 | }
|
100 | 104 |
|
101 | 105 | enum MyEnum {
|
@@ -197,6 +201,7 @@ public void shouldSuccessfullyLoadXMLConfigFile() throws Exception {
|
197 | 201 | assertThat(config.getTypeHandlerRegistry().getTypeHandler(Long.class), is(instanceOf(CustomLongTypeHandler.class)));
|
198 | 202 | assertThat(config.getTypeHandlerRegistry().getTypeHandler(String.class), is(instanceOf(CustomStringTypeHandler.class)));
|
199 | 203 | assertThat(config.getTypeHandlerRegistry().getTypeHandler(String.class, JdbcType.VARCHAR), is(instanceOf(CustomStringTypeHandler.class)));
|
| 204 | + assertThat(config.getTypeHandlerRegistry().getTypeHandler(RoundingMode.class), is(instanceOf(EnumOrdinalTypeHandler.class))); |
200 | 205 |
|
201 | 206 | ExampleObjectFactory objectFactory = (ExampleObjectFactory)config.getObjectFactory();
|
202 | 207 | assertThat(objectFactory.getProperties().size(), is(1));
|
|
0 commit comments