Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e48f910

Browse files
committed
修复错误
1 parent dcc0074 commit e48f910

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

‎application/src/test/java/Test11.java‎

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
import info.xiaomo.application.ApplicationMain;
2-
import info.xiaomo.application.dao.CountryDao;
3-
import info.xiaomo.application.model.CountryModel;
42
import org.junit.Test;
53
import org.junit.runner.RunWith;
6-
import org.springframework.beans.factory.annotation.Autowired;
74
import org.springframework.boot.test.SpringApplicationConfiguration;
85
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
96
import org.springframework.test.context.web.WebAppConfiguration;
107

118
import java.io.IOException;
12-
import java.util.Date;
139
import java.util.List;
1410

1511
import static info.xiaomo.core.untils.ExcelUtil.getListData;
@@ -23,20 +19,20 @@
2319
@WebAppConfiguration // 由于是Web项目,Junit需要模拟ServletContext,因此我们需要给我们的测试类加上@WebAppConfiguration。
2420
public class Test11 {
2521

26-
@Autowired
27-
private
28-
CountryDao dao;
22+
// @Autowired
23+
// private
24+
// CountryDao dao;
2925

3026
@Test
3127
public void test() throws IOException {
3228
List<List<String>> listData = getListData("E:\\thinkpage_cities.xls", 1);
3329
for (List<String> listDatum : listData) {
34-
CountryModel model = new CountryModel();
35-
model.setCityName(listDatum.get(0));
36-
model.setName(listDatum.get(1));
37-
model.setCreateTime(new Date());
38-
model.setUpdateTime(new Date());
39-
dao.save(model);
30+
// CountryModel model = new CountryModel();
31+
// model.setCityName(listDatum.get(0));
32+
// model.setName(listDatum.get(1));
33+
// model.setCreateTime(new Date());
34+
// model.setUpdateTime(new Date());
35+
// dao.save(model);
4036
}
4137

4238
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /