diff --git a/src/test/java/com/insigma/utils/LinuxCommandUtilTest.java b/src/test/java/com/insigma/utils/LinuxCommandUtilTest.java new file mode 100644 index 0000000..532f9ac --- /dev/null +++ b/src/test/java/com/insigma/utils/LinuxCommandUtilTest.java @@ -0,0 +1,23 @@ +package com.insigma.utils; + + +import lombok.extern.slf4j.Slf4j; +import org.junit.Test; + +import java.io.File; + +import static org.junit.jupiter.api.Assertions.*; + +@Slf4j +public class LinuxCommandUtilTest { + + @Test + public void run() { + // 注意:该部分需要注意使用的分割线 下划线- + String dir = "/Users/zhangxianwei/Downloads/ccc"; + new LinuxCommandUtil("mkdir " + dir).run(); + File file = new File(dir); + assertTrue(file.exists()); + log.info("测试完成!"); + } +} \ No newline at end of file