From aeb963f21b24071230f7d26fa24c559ab8b178f0 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Fri, 20 Dec 2019 14:45:43 +0100 Subject: [PATCH] Cleanup (warnings; modern assertions) GitOrigin-RevId: 834a5b75bbfa8e8edb9068ebf11865ca7fe671e1 --- .../openapi/vfs/local/JarFileSystemTest.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/JarFileSystemTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/JarFileSystemTest.java index 07ff00c652c1..b29c264d9ded 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/JarFileSystemTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/JarFileSystemTest.java @@ -41,8 +41,6 @@ import java.util.zip.ZipOutputStream; import static com.intellij.openapi.util.io.IoTestUtil.assertTimestampsEqual; import static com.intellij.testFramework.PlatformTestUtil.assertPathsEqual; -import static com.intellij.testFramework.UsefulTestCase.assertOneElement; -import static com.intellij.testFramework.UsefulTestCase.assertSameElements; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.*; @@ -96,8 +94,7 @@ public class JarFileSystemTest extends BareTestFixtureTestCase { assertNotNull(vFile); VirtualFile jarRoot = findByPath(jar.getPath() + JarFileSystem.JAR_SEPARATOR); - VirtualFile child = assertOneElement(jarRoot.getChildren()); - assertEquals("META-INF", child.getName()); + assertThat(ContainerUtil.map(jarRoot.getChildren(), VirtualFile::getName)).containsExactly("META-INF"); VirtualFile entry = findByPath(jar.getPath() + JarFileSystem.JAR_SEPARATOR + JarFile.MANIFEST_NAME); assertEquals("", VfsUtilCore.loadText(entry)); @@ -124,9 +121,7 @@ public class JarFileSystemTest extends BareTestFixtureTestCase { assertTrue(updated.get()); assertTrue(entry.isValid()); assertEquals("update", VfsUtilCore.loadText(entry)); - List children = ContainerUtil.map(jarRoot.getChildren(), f -> f.getName()); - assertEquals(2, children.size()); - assertSameElements(children, "META-INF", "some.txt"); + assertThat(ContainerUtil.map(jarRoot.getChildren(), VirtualFile::getName)).containsExactlyInAnyOrder("META-INF", "some.txt"); VirtualFile newEntry = findByPath(jar.getPath() + JarFileSystem.JAR_SEPARATOR + "some.txt"); assertEquals("some text", VfsUtilCore.loadText(newEntry)); @@ -165,7 +160,7 @@ public class JarFileSystemTest extends BareTestFixtureTestCase { int N = Math.max(2, Runtime.getRuntime().availableProcessors()); for (int iteration = 0; iteration < 200; ++iteration) { - List futuresToWait = new ArrayList<>(); + List> futuresToWait = new ArrayList<>(); CountDownLatch sameStartCondition = new CountDownLatch(N); for (int i = 0; i < N; ++i) { @@ -190,7 +185,7 @@ public class JarFileSystemTest extends BareTestFixtureTestCase { })); } - for (Future future : futuresToWait) future.get(2, TimeUnit.SECONDS); + for (Future future : futuresToWait) future.get(2, TimeUnit.SECONDS); } } catch (TimeoutException e) {