improve test for operation log
This commit is contained in:
parent
ee315c6963
commit
13706c3c3a
@ -89,8 +89,8 @@ object OperationLog extends Logging {
|
||||
|
||||
class OperationLog(path: Path) extends Logging {
|
||||
|
||||
private lazy val writer = Files.newBufferedWriter(path, StandardCharsets.UTF_8)
|
||||
private lazy val reader = Files.newBufferedReader(path, StandardCharsets.UTF_8)
|
||||
private val writer = Files.newBufferedWriter(path, StandardCharsets.UTF_8)
|
||||
private val reader = Files.newBufferedReader(path, StandardCharsets.UTF_8)
|
||||
|
||||
/**
|
||||
* write log to the operation log file
|
||||
|
||||
@ -100,4 +100,19 @@ class OperationLogSuite extends KyuubiFunSuite {
|
||||
assert(list2.isEmpty)
|
||||
operationLog.close()
|
||||
}
|
||||
|
||||
test("exception when creating log files") {
|
||||
val sHandle = SessionHandle(TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10)
|
||||
val logRoot = Paths.get(OperationLog.LOG_ROOT, sHandle.identifier.toString).toFile
|
||||
logRoot.deleteOnExit()
|
||||
Files.createFile(Paths.get(OperationLog.LOG_ROOT, sHandle.identifier.toString))
|
||||
assert(logRoot.exists())
|
||||
OperationLog.createOperationLogRootDirectory(sHandle)
|
||||
assert(logRoot.isFile)
|
||||
val oHandle = OperationHandle(
|
||||
OperationType.EXECUTE_STATEMENT, TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10)
|
||||
val log = OperationLog.createOperationLog(sHandle, oHandle)
|
||||
assert(log === null)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user