|
15 | 15 | */
|
16 | 16 | package org.apache.ibatis.type;
|
17 | 17 |
|
| 18 | +import static org.junit.Assert.assertEquals; |
| 19 | +import static org.junit.Assert.assertFalse; |
| 20 | +import static org.junit.Assert.assertSame; |
| 21 | +import static org.junit.Assert.assertTrue; |
| 22 | + |
18 | 23 | import java.net.URI;
|
19 | 24 | import java.sql.CallableStatement;
|
20 | 25 | import java.sql.PreparedStatement;
|
21 | 26 | import java.sql.ResultSet;
|
22 | 27 | import java.sql.SQLException;
|
23 | 28 | import java.util.List;
|
24 | 29 |
|
25 |
| -import domain.misc.RichType; |
26 |
| -import static org.junit.Assert.*; |
| 30 | +import org.junit.Ignore; |
27 | 31 | import org.junit.Test;
|
28 | 32 |
|
| 33 | +import domain.misc.RichType; |
| 34 | + |
29 | 35 | public class TypeHandlerRegistryTest {
|
30 | 36 |
|
31 | 37 | private TypeHandlerRegistry typeHandlerRegistry = new TypeHandlerRegistry();
|
@@ -116,4 +122,15 @@ public List<URI> getNullableResult( CallableStatement cs, int columnIndex )
|
116 | 122 | assertSame(fakeHandler, typeHandlerRegistry.getTypeHandler(new TypeReference<List<URI>>(){}));
|
117 | 123 | }
|
118 | 124 |
|
| 125 | + @Ignore("See https://github.com/mybatis/mybatis-3/issues/165") |
| 126 | + @Test |
| 127 | + public void registerWrapperHandlerBeforePrimitive() { |
| 128 | + |
| 129 | + typeHandlerRegistry.register(int.class, DateTypeHandler.class); |
| 130 | + typeHandlerRegistry.register(Integer.class, IntegerTypeHandler.class); |
| 131 | + |
| 132 | + assertSame(IntegerTypeHandler.class, typeHandlerRegistry.getTypeHandler(Integer.class).getClass()); |
| 133 | + assertSame(DateTypeHandler.class, typeHandlerRegistry.getTypeHandler(int.class).getClass()); |
| 134 | + } |
| 135 | + |
119 | 136 | }
|
0 commit comments