[tests] close zip file to fix test on Windows

GitOrigin-RevId: e337cacbfa873e6e56d251d4c185e7c4821eaff4
This commit is contained in:
Nikolay Chashnikov
2021-01-27 08:06:58 +00:00
committed by intellij-monorepo-bot
parent b6c6b45116
commit ce98d98e08
@@ -102,12 +102,18 @@ class ReorderJarsTest {
}
private fun testOldJarResourceImpl(file: Path, data: ByteArray) {
val loader = JdkZipResourceFile(file, true, false, false).preload(file)
assertThat(loader).isNotNull()
val bytes = loader!!.getBytes("org/jetbrains/annotations/Nullable.class")
assertThat(bytes).isNotNull()
assertThat(bytes).hasSize(548)
assertThat(data.contentEquals(bytes)).isTrue()
val resourceFile = JdkZipResourceFile(file, true, false, false)
try {
val loader = resourceFile.preload(file)
assertThat(loader).isNotNull()
val bytes = loader!!.getBytes("org/jetbrains/annotations/Nullable.class")
assertThat(bytes).isNotNull()
assertThat(bytes).hasSize(548)
assertThat(data.contentEquals(bytes)).isTrue()
}
finally {
resourceFile.close()
}
}
@Test