[Imporve] Imporve CommandUtilsTest (#3642)
diff --git a/streampark-common/src/test/scala/org/apache/streampark/common/util/CommandUtilsTest.scala b/streampark-common/src/test/scala/org/apache/streampark/common/util/CommandUtilsTest.scala
index 859ac44..edc5ec1 100644
--- a/streampark-common/src/test/scala/org/apache/streampark/common/util/CommandUtilsTest.scala
+++ b/streampark-common/src/test/scala/org/apache/streampark/common/util/CommandUtilsTest.scala
@@ -23,9 +23,8 @@
test("execute single command") {
val (exitCode, output) = CommandUtils.execute("echo Hello")
- println(s"Exit code: $exitCode")
- println(s"Output:\n$output")
assert(exitCode == 0)
+ assert(output == "Hello\n")
}
test("execute multiple commands") {
@@ -37,7 +36,6 @@
override def accept(output: String): Unit = println(output)
}
val exitCode = CommandUtils.execute(directory, commands, outputConsumer)
- println(s"Exit code: $exitCode")
assert(exitCode == 0)
}
}
diff --git a/streampark-common/src/test/scala/org/apache/streampark/common/util/FileUtilsTest.scala b/streampark-common/src/test/scala/org/apache/streampark/common/util/FileUtilsTest.scala
index 85fa7c7..56b7e12 100644
--- a/streampark-common/src/test/scala/org/apache/streampark/common/util/FileUtilsTest.scala
+++ b/streampark-common/src/test/scala/org/apache/streampark/common/util/FileUtilsTest.scala
@@ -25,14 +25,12 @@
class FileUtilsTest extends AnyFunSuite {
test("isJarFileType should return true for a valid jar file") {
- // "PK\03\04"
val jarFileContent = Array[Byte](0x50, 0x4b, 0x03, 0x04)
val jarInputStream = new ByteArrayInputStream(jarFileContent)
assert(FileUtils.isJarFileType(jarInputStream))
}
test("isJarFileType should return false for a non-jar file") {
- // TEST
val textFileContent = Array[Byte](0x54, 0x45, 0x53, 0x54)
val textInputStream = new ByteArrayInputStream(textFileContent)
assert(!FileUtils.isJarFileType(textInputStream))