HaikangApplicationTests.java
2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package com.sincere.haikang;
import com.alibaba.fastjson.JSONObject;
import com.sincere.haikang.bean.StudentBean;
import com.sincere.haikang.dao.UserDao;
import com.sincere.haikang.server.AttendanceService;
import com.sincere.haikang.test.TK_Question;
import com.sincere.haikang.utils.ApiHelper;
import com.sincere.haikang.utils.FileUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.util.StringUtils;
import org.springframework.web.client.RestTemplate;
import java.io.*;
import java.util.*;
@RunWith(SpringRunner.class)
@SpringBootTest
public class HaikangApplicationTests {
// @Autowired
// AttendanceService attendanceService;
@Autowired
UserDao userDao;
// private String url = "http://172.16.3.174:8001/";
private String url = "http://114.55.30.100:9020/";
@Test
public void my() throws IOException {
//
// File file = new File("C:\\TaoHandong\\copy\\21_qiandaoErr.txt");
// BufferedReader bufferedReader = new BufferedReader(new FileReader(file));
//
// String content = "";
// String result = "";
// while ((content=bufferedReader.readLine())!=null){
//
// if (content.split("cardNo:").length>1&&!result.contains(content.split("cardNo:")[1])){
// result+="\'"+content.split("cardNo:")[1]+"\',";
// }
//
// }
// System.out.println("result:"+result+result.split(",").length);
}
@Test
public void contextLoads() {
/*try {
BufferedReader bufferedReader = new BufferedReader(new FileReader("C:\\TaoHandong\\copy\\1\\21_寝室签到接口记录.txt"));
String content = null;
// StringBuilder stringBuilder = new StringBuilder();
Set<String> strings = new HashSet<>();
String mapString = "";
while ((content = bufferedReader.readLine()) != null) {
strings.add(content);
if (!StringUtils.isEmpty(content)){
// System.out.println("content:" + content.split("传入参数:")[1]);
mapString = content.split("传入参数:")[1];
String urlHXY ="http://campus.myjxt.com/api/XiaoAnCommon/SendHXY";
String result2 = ApiHelper.doPost(urlHXY, new HashMap<String, String>(), mapString);
// JSONObject jsonObject = JSONObject.parseObject(result2);
System.out.println("urlHXY:" + result2);
}
}
}catch (Exception e){
e.printStackTrace();
}*/
}
@Test
public void test(){
}
}