|
|
@@ -1,5 +1,9 @@
|
|
|
package com.seecoder.dataanalysis.logic.parser.impl;
|
|
|
|
|
|
+import com.seecoder.dataanalysis.aspect.auth.Authorized;
|
|
|
+import com.seecoder.dataanalysis.data.dao.devcloud.DevcloudInfoDao;
|
|
|
+import com.seecoder.dataanalysis.data.dao.eval.EvalExamInfoDao;
|
|
|
+import com.seecoder.dataanalysis.data.dao.eval.EvalExamRecordDao;
|
|
|
import com.seecoder.dataanalysis.logic.parser.ParsingException;
|
|
|
import com.seecoder.dataanalysis.util.FileUtil;
|
|
|
import com.seecoder.dataanalysis.vo.CommitInfoDTO;
|
|
|
@@ -8,6 +12,8 @@ import com.seecoder.dataanalysis.vo.SimpleLog;
|
|
|
import org.junit.jupiter.api.AfterEach;
|
|
|
import org.junit.jupiter.api.BeforeEach;
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
@@ -18,12 +24,21 @@ import static org.junit.jupiter.api.Assertions.*;
|
|
|
* @author miaomuzhi
|
|
|
* @since 2022/1/30
|
|
|
*/
|
|
|
+@SpringBootTest
|
|
|
class LogParsingServiceImplTest {
|
|
|
private LogParsingServiceImpl parsingService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ EvalExamInfoDao evalExamInfoDao;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ DevcloudInfoDao devcloudInfoDao;
|
|
|
+
|
|
|
@BeforeEach
|
|
|
void setUp() {
|
|
|
parsingService = new LogParsingServiceImpl();
|
|
|
+ parsingService.setEvalExamInfoDao(evalExamInfoDao);
|
|
|
+ parsingService.setDevcloudInfoDao(devcloudInfoDao);
|
|
|
parsingService.buildOpTypesTable();
|
|
|
}
|
|
|
|
|
|
@@ -47,7 +62,7 @@ class LogParsingServiceImplTest {
|
|
|
|
|
|
@Test
|
|
|
void parseLogData() throws ParsingException {
|
|
|
- String logContent = FileUtil.readFile(getClass().getResource("/sample_logs/gen0.log").getFile());
|
|
|
+ String logContent = FileUtil.readFile(getClass().getResource("/sample_logs/dev106.log").getFile());
|
|
|
SimpleLog simpleLog = parsingService.parseLog(logContent);
|
|
|
Object o = parsingService.parseLogData(simpleLog, false);
|
|
|
assertTrue(o instanceof EvalExamInfoDTO);
|
|
|
@@ -68,4 +83,11 @@ class LogParsingServiceImplTest {
|
|
|
assertEquals(ParsingException.class.getName(), e.getClass().getName());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Test
|
|
|
+ void parseEval() throws ParsingException {
|
|
|
+ String logContent = FileUtil.readFile(getClass().getResource("/sample_logs/dev106.log").getFile());
|
|
|
+ SimpleLog simpleLog = parsingService.parseLog(logContent);
|
|
|
+ parsingService.parseLogData(simpleLog, true);
|
|
|
+ }
|
|
|
}
|