mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[gui-test] ScreenshotsDuringTest: screenshot folder should be removed after executorService is stopped if test is successful
This commit is contained in:
+4
-1
@@ -19,6 +19,7 @@ class ScreenshotsDuringTest @JvmOverloads constructor(private val myPeriod: Int
|
||||
private val myScreenshotTaker = ScreenshotTaker()
|
||||
private val myExecutorService: ScheduledExecutorService = Executors.newScheduledThreadPool(1)
|
||||
private var myFolder: File? = null
|
||||
private var isTestSuccessful = false
|
||||
|
||||
override fun starting(description: Description) {
|
||||
val folderName = description.testClass.simpleName + "-" + description.methodName
|
||||
@@ -49,9 +50,11 @@ class ScreenshotsDuringTest @JvmOverloads constructor(private val myPeriod: Int
|
||||
catch (e: InterruptedException) {
|
||||
// Do not report the timeout
|
||||
}
|
||||
if(isTestSuccessful && myFolder != null) FileUtilRt.delete(myFolder!!)
|
||||
}
|
||||
|
||||
override fun succeeded(description: Description?) {
|
||||
if (myFolder != null) FileUtilRt.delete(myFolder!!)
|
||||
isTestSuccessful = true
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user