Skip to content

Commit d026ad2

Browse files
committed
Add test for ParameterExpression
1 parent 735d6df commit d026ad2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,17 @@
1717

1818
import java.util.Map;
1919
import org.junit.Assert;
20+
import org.junit.Rule;
2021
import org.junit.Test;
22+
import org.junit.rules.ExpectedException;
23+
24+
import static org.hamcrest.core.Is.is;
2125

2226
public class ParameterExpressionTest {
2327

28+
@Rule
29+
public ExpectedException expectedException = ExpectedException.none();
30+
2431
@Test
2532
public void simpleProperty() {
2633
Map<String, String> result = new ParameterExpression("id");
@@ -124,4 +131,11 @@ public void shouldIgnoreLeadingAndTrailingSpaces() {
124131
Assert.assertEquals("val2", result.get("attr2"));
125132
}
126133

134+
@Test
135+
public void invalidOldJdbcTypeFormat() {
136+
expectedException.expect(BuilderException.class);
137+
expectedException.expectMessage(is("Parsing error in {id:} in position 3"));
138+
new ParameterExpression("id:");
139+
}
140+
127141
}

0 commit comments

Comments
 (0)