|
|
@@ -1,13 +1,13 @@
|
|
|
package com.seecoder.dataanalysis.logic.parser.impl;
|
|
|
|
|
|
import com.seecoder.dataanalysis.util.FileUtil;
|
|
|
+import com.seecoder.dataanalysis.vo.EvalExamInfoDTO;
|
|
|
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 static org.junit.jupiter.api.Assertions.assertEquals;
|
|
|
-import static org.junit.jupiter.api.Assertions.assertNull;
|
|
|
+import static org.junit.jupiter.api.Assertions.*;
|
|
|
|
|
|
/**
|
|
|
* @author miaomuzhi
|
|
|
@@ -19,6 +19,7 @@ class LogParsingServiceImplTest {
|
|
|
@BeforeEach
|
|
|
void setUp() {
|
|
|
parsingService = new LogParsingServiceImpl();
|
|
|
+ parsingService.buildOpTypesTable();
|
|
|
}
|
|
|
|
|
|
@AfterEach
|
|
|
@@ -36,9 +37,16 @@ class LogParsingServiceImplTest {
|
|
|
|
|
|
@Test
|
|
|
void parseLogData() {
|
|
|
+ String logContent = FileUtil.readFile(getClass().getResource("/sample_logs/gen0.log").getFile());
|
|
|
+ SimpleLog simpleLog = parsingService.parseLog(logContent);
|
|
|
+ Object o = parsingService.parseLogData(simpleLog, false);
|
|
|
+ assertTrue(o instanceof EvalExamInfoDTO);
|
|
|
+ System.out.println(o);
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
void parseOpType() {
|
|
|
+ assertEquals("com.seecoder.dataanalysis.data.entity.eval.EvalExamInfo", parsingService.parseOpType(0));
|
|
|
+ assertNull(parsingService.parseOpType(-1));
|
|
|
}
|
|
|
}
|