File tree Expand file tree Collapse file tree 3 files changed +49
-2
lines changed
src/test/java/com/isea533/mybatis/test Expand file tree Collapse file tree 3 files changed +49
-2
lines changed Original file line number Diff line number Diff line change 113
113
<groupId >org.springframework</groupId >
114
114
<artifactId >spring-aop</artifactId >
115
115
</dependency >
116
+ <dependency >
117
+ <groupId >org.springframework</groupId >
118
+ <artifactId >spring-test</artifactId >
119
+ </dependency >
116
120
117
121
<!-- spring-oxm依赖-->
118
122
<dependency >
202
206
</dependencies >
203
207
</dependencyManagement >
204
208
<repositories >
205
- <repository >
209
+ <!-- <repository>
206
210
<id>nexus</id>
207
211
<name>local private nexus</name>
208
212
<url>http://maven.oschina.net/content/groups/public/</url>
212
216
<snapshots>
213
217
<enabled>false</enabled>
214
218
</snapshots>
215
- </repository >
219
+ </repository>-->
216
220
<repository >
217
221
<id >sonatype-nexus-releases</id >
218
222
<name >Sonatype Nexus Releases</name >
Original file line number Diff line number Diff line change
1
+ package com .isea533 .mybatis .test ;
2
+
3
+ import org .junit .runner .RunWith ;
4
+ import org .springframework .test .context .ContextConfiguration ;
5
+ import org .springframework .test .context .junit4 .SpringJUnit4ClassRunner ;
6
+
7
+ /**
8
+ * Created by liuzh on 2015/3/7.
9
+ */
10
+ @ RunWith (SpringJUnit4ClassRunner .class )
11
+ @ ContextConfiguration ("classpath:applicationContext.xml" )
12
+ public class BasicTest {
13
+ }
Original file line number Diff line number Diff line change
1
+ package com .isea533 .mybatis .test ;
2
+
3
+ import com .github .abel533 .entity .EntityMapper ;
4
+ import com .github .abel533 .entity .Example ;
5
+ import com .github .pagehelper .PageHelper ;
6
+ import com .github .pagehelper .PageInfo ;
7
+ import com .isea533 .mybatis .model .Country ;
8
+ import org .junit .Test ;
9
+ import org .springframework .beans .factory .annotation .Autowired ;
10
+
11
+ import java .util .List ;
12
+
13
+ /**
14
+ * Created by liuzh on 2015/3/7.
15
+ */
16
+ public class PageEntityMapperTest extends BasicTest {
17
+
18
+ @ Autowired
19
+ private EntityMapper entityMapper ;
20
+
21
+ @ Test
22
+ public void test (){
23
+ Example example = new Example (Country .class );
24
+ example .createCriteria ().andGreaterThan ("id" ,100 );
25
+ PageHelper .startPage (2 ,10 );
26
+ List <Country > countries = entityMapper .selectByExample (example );
27
+ PageInfo <Country > pageInfo = new PageInfo <Country >(countries );
28
+ System .out .println (pageInfo .getTotal ());
29
+ }
30
+ }
You can’t perform that action at this time.
0 commit comments