Skip to content

Commit 3d87435

Browse files
committed
Failing test for #165
1 parent a498f45 commit 3d87435

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

src/test/java/org/apache/ibatis/type/TypeHandlerRegistryTest.java

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,23 @@
1515
*/
1616
package org.apache.ibatis.type;
1717

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+
1823
import java.net.URI;
1924
import java.sql.CallableStatement;
2025
import java.sql.PreparedStatement;
2126
import java.sql.ResultSet;
2227
import java.sql.SQLException;
2328
import java.util.List;
2429

25-
import domain.misc.RichType;
26-
import static org.junit.Assert.*;
30+
import org.junit.Ignore;
2731
import org.junit.Test;
2832

33+
import domain.misc.RichType;
34+
2935
public class TypeHandlerRegistryTest {
3036

3137
private TypeHandlerRegistry typeHandlerRegistry = new TypeHandlerRegistry();
@@ -116,4 +122,15 @@ public List<URI> getNullableResult( CallableStatement cs, int columnIndex )
116122
assertSame(fakeHandler, typeHandlerRegistry.getTypeHandler(new TypeReference<List<URI>>(){}));
117123
}
118124

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+
119136
}

0 commit comments

Comments
 (0)