|
|
|
@ -17,8 +17,6 @@
|
|
|
|
|
|
|
|
|
|
package org.apache.dolphinscheduler.dao.utils; |
|
|
|
|
|
|
|
|
|
import static org.apache.dolphinscheduler.common.constants.Constants.CRC_SUFFIX; |
|
|
|
|
|
|
|
|
|
import org.apache.dolphinscheduler.common.enums.Flag; |
|
|
|
|
import org.apache.dolphinscheduler.common.utils.FileUtils; |
|
|
|
|
import org.apache.dolphinscheduler.dao.entity.TaskInstance; |
|
|
|
@ -36,6 +34,7 @@ import java.util.HashMap;
|
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
import org.junit.jupiter.api.AfterEach; |
|
|
|
|
import org.junit.jupiter.api.Assertions; |
|
|
|
|
import org.junit.jupiter.api.BeforeEach; |
|
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
@ -182,8 +181,8 @@ class TaskCacheUtilsTest {
|
|
|
|
|
@Test |
|
|
|
|
void testReplaceWithCheckSum() { |
|
|
|
|
String content = "abcdefg"; |
|
|
|
|
String filePath = "test/testFile.txt"; |
|
|
|
|
FileUtils.writeContent2File(content, filePath + CRC_SUFFIX); |
|
|
|
|
String filePath = "test/testFile.txt.crc"; |
|
|
|
|
FileUtils.writeContent2File(content, filePath); |
|
|
|
|
|
|
|
|
|
Property property = new Property(); |
|
|
|
|
property.setProp("f1"); |
|
|
|
@ -197,4 +196,9 @@ class TaskCacheUtilsTest {
|
|
|
|
|
String crc = TaskCacheUtils.getValCheckSum(property, taskExecutionContext, storageOperate); |
|
|
|
|
Assertions.assertEquals(crc, content); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@AfterEach |
|
|
|
|
public void tearDown() { |
|
|
|
|
FileUtils.deleteFile("test"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|