From 7141f8db8a12af46d0a3076f311a14d29a10e24b Mon Sep 17 00:00:00 2001 From: qggwy Date: Wed, 20 Apr 2022 20:34:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4Linux=20=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../insigma/utils/LinuxCommandUtilTest.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/test/java/com/insigma/utils/LinuxCommandUtilTest.java 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