This is an automated email from the ASF dual-hosted git repository.
benjobs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git
The following commit(s) were added to refs/heads/dev by this push:
new 8baa2ff3d [Imporve] Imporve CommandUtilsTest (#3642)
8baa2ff3d is described below
commit 8baa2ff3d204bba1664c2516011fa6ae3b0441ff
Author: Cancai Cai <[email protected]>
AuthorDate: Sat Mar 30 23:39:31 2024 +0800
[Imporve] Imporve CommandUtilsTest (#3642)
---
.../scala/org/apache/streampark/common/util/CommandUtilsTest.scala | 4 +---
.../test/scala/org/apache/streampark/common/util/FileUtilsTest.scala | 2 --
2 files changed, 1 insertion(+), 5 deletions(-)
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 859ac4446..edc5ec111 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 @@ class CommandUtilsTest extends AnyFunSuite {
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 @@ class CommandUtilsTest extends AnyFunSuite {
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 85fa7c776..56b7e12d4 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 @@ import java.io._
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))