Skip to content

Commit 796cf2f

Browse files
committed
Restored two missing tests #1848
1 parent b4568d9 commit 796cf2f

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/test/java/org/apache/ibatis/builder/PostMapper.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757
<resultMap id="mutablePostLiteMap" type="org.apache.ibatis.domain.blog.PostLite">
5858
<result property="blogId" column="blog_id"/>
59-
<association property="id" column="id" resultMap="postLiteIdMap"/>
59+
<association property="id" resultMap="mutablePostLiteIdMap"/>
6060
</resultMap>
6161

6262
<resultMap id="mutablePostLiteIdMap" type="org.apache.ibatis.domain.blog.PostLiteId">

src/test/java/org/apache/ibatis/session/SqlSessionManagerTest.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,18 @@
1515
*/
1616
package org.apache.ibatis.session;
1717

18+
import static org.junit.jupiter.api.Assertions.assertEquals;
1819
import static org.junit.jupiter.api.Assertions.assertNotNull;
1920
import static org.junit.jupiter.api.Assertions.assertNull;
2021
import static org.junit.jupiter.api.Assertions.assertTrue;
2122
import static org.junit.jupiter.api.Assertions.fail;
2223

2324
import java.io.Reader;
25+
import java.util.List;
2426

2527
import org.apache.ibatis.BaseDataTest;
2628
import org.apache.ibatis.domain.blog.Author;
29+
import org.apache.ibatis.domain.blog.PostLite;
2730
import org.apache.ibatis.domain.blog.mappers.AuthorMapper;
2831
import org.apache.ibatis.exceptions.PersistenceException;
2932
import org.apache.ibatis.io.Resources;
@@ -96,4 +99,16 @@ void shouldImplicitlyRollbackInsertedAuthor() {
9699
assertNull(actual);
97100
}
98101

102+
@Test
103+
public void shouldFindAllPostLites() throws Exception {
104+
List<PostLite> posts = manager.selectList("org.apache.ibatis.domain.blog.mappers.PostMapper.selectPostLite");
105+
assertEquals(2, posts.size()); // old gcode issue #392, new #1848
106+
}
107+
108+
@Test
109+
public void shouldFindAllMutablePostLites() throws Exception {
110+
List<PostLite> posts = manager.selectList("org.apache.ibatis.domain.blog.mappers.PostMapper.selectMutablePostLite");
111+
assertEquals(2, posts.size()); // old gcode issue #392, new #1848
112+
}
113+
99114
}

0 commit comments

Comments
 (0)