Skip to content

Commit baab2b7

Browse files
committed
Fix build error on JDK 1.6
1 parent 1d0b2dd commit baab2b7

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/test/java/org/apache/ibatis/builder/XmlMapperBuilderTest.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
import org.apache.ibatis.mapping.StatementType;
2626
import org.apache.ibatis.session.Configuration;
2727
import org.apache.ibatis.type.TypeHandler;
28+
import org.hamcrest.CoreMatchers;
2829
import org.junit.Rule;
2930
import org.junit.Test;
3031
import org.junit.rules.ExpectedException;
3132

3233
import static org.junit.Assert.assertThat;
33-
import static org.hamcrest.core.Is.is;
34-
import static org.hamcrest.core.IsNull.nullValue;
34+
import static org.hamcrest.CoreMatchers.*;
3535

3636
public class XmlMapperBuilderTest {
3737

@@ -84,23 +84,26 @@ public void parseExpression() {
8484
public void resolveJdbcTypeWithUndefinedValue() {
8585
BaseBuilder builder = new BaseBuilder(new Configuration()){{}};
8686
expectedException.expect(BuilderException.class);
87-
expectedException.expectMessage(is("Error resolving JdbcType. Cause: java.lang.IllegalArgumentException: No enum constant org.apache.ibatis.type.JdbcType.aaa"));
87+
expectedException.expectMessage(startsWith("Error resolving JdbcType. Cause: java.lang.IllegalArgumentException: No enum"));
88+
expectedException.expectMessage(endsWith("org.apache.ibatis.type.JdbcType.aaa"));
8889
builder.resolveJdbcType("aaa");
8990
}
9091

9192
@Test
9293
public void resolveResultSetTypeWithUndefinedValue() {
9394
BaseBuilder builder = new BaseBuilder(new Configuration()){{}};
9495
expectedException.expect(BuilderException.class);
95-
expectedException.expectMessage(is("Error resolving ResultSetType. Cause: java.lang.IllegalArgumentException: No enum constant org.apache.ibatis.mapping.ResultSetType.bbb"));
96+
expectedException.expectMessage(startsWith("Error resolving ResultSetType. Cause: java.lang.IllegalArgumentException: No enum"));
97+
expectedException.expectMessage(endsWith("org.apache.ibatis.mapping.ResultSetType.bbb"));
9698
builder.resolveResultSetType("bbb");
9799
}
98100

99101
@Test
100102
public void resolveParameterModeWithUndefinedValue() {
101103
BaseBuilder builder = new BaseBuilder(new Configuration()){{}};
102104
expectedException.expect(BuilderException.class);
103-
expectedException.expectMessage(is("Error resolving ParameterMode. Cause: java.lang.IllegalArgumentException: No enum constant org.apache.ibatis.mapping.ParameterMode.ccc"));
105+
expectedException.expectMessage(startsWith("Error resolving ParameterMode. Cause: java.lang.IllegalArgumentException: No enum"));
106+
expectedException.expectMessage(endsWith("org.apache.ibatis.mapping.ParameterMode.ccc"));
104107
builder.resolveParameterMode("ccc");
105108
}
106109

0 commit comments

Comments
 (0)