| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- package com.seecoder.dataanalysis.logic.parser.impl;
- import com.seecoder.dataanalysis.util.FileUtil;
- 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;
- /**
- * @author miaomuzhi
- * @since 2022/1/30
- */
- class LogParsingServiceImplTest {
- private LogParsingServiceImpl parsingService;
- @BeforeEach
- void setUp() {
- parsingService = new LogParsingServiceImpl();
- }
- @AfterEach
- void tearDown() {
- }
- @Test
- void parseLog() {
- assertNull(parsingService.parseLog("dsaf"));
- String logContent = FileUtil.readFile(getClass().getResource("/sample_logs/gen0.log").getFile());
- SimpleLog simpleLog = parsingService.parseLog(logContent);
- assertEquals(0, simpleLog.getOpType());
- assertEquals(1, simpleLog.getTarget());
- }
- @Test
- void parseLogData() {
- }
- @Test
- void parseOpType() {
- }
- }
|