From 3633415d46e5d5034754f61a1d0df488ca2beb4c Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Wed, 17 Apr 2019 16:04:33 +0300 Subject: [PATCH] cleanup --- .../codeInsight/completion/LightCompletionTestCase.java | 4 ++-- .../util/concurrency/BackgroundTaskQueueTest.java | 9 ++++----- .../testFramework/LightPlatformCodeInsightTestCase.java | 6 +++--- .../src/com/intellij/lang/ant/AntCompletionTest.java | 4 ++-- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/java/testFramework/src/com/intellij/codeInsight/completion/LightCompletionTestCase.java b/java/testFramework/src/com/intellij/codeInsight/completion/LightCompletionTestCase.java index e6b530192df6..46d8d0f1b1a9 100644 --- a/java/testFramework/src/com/intellij/codeInsight/completion/LightCompletionTestCase.java +++ b/java/testFramework/src/com/intellij/codeInsight/completion/LightCompletionTestCase.java @@ -49,8 +49,8 @@ public abstract class LightCompletionTestCase extends LightCodeInsightTestCase { } @Override - protected void configureByFile(@NotNull String filePath) { - super.configureByFile(filePath); + protected void configureByFile(@NotNull String relativePath) { + super.configureByFile(relativePath); complete(); } diff --git a/platform/platform-tests/testSrc/com/intellij/util/concurrency/BackgroundTaskQueueTest.java b/platform/platform-tests/testSrc/com/intellij/util/concurrency/BackgroundTaskQueueTest.java index 9b48148f0363..3504ca5a1d5d 100644 --- a/platform/platform-tests/testSrc/com/intellij/util/concurrency/BackgroundTaskQueueTest.java +++ b/platform/platform-tests/testSrc/com/intellij/util/concurrency/BackgroundTaskQueueTest.java @@ -248,7 +248,7 @@ public class BackgroundTaskQueueTest extends PlatformTestCase { }; final AtomicInteger cntThreads = new AtomicInteger(THREADS); - myThreadRunner.run(THREADS, i -> { + myThreadRunner.run(THREADS, __ -> { for (int j = 0; j < RUNS_PER_THREAD; j++) { sleepX(7); myQueue.run(task); @@ -260,7 +260,6 @@ public class BackgroundTaskQueueTest extends PlatformTestCase { Assert.assertTrue(myQueue.isEmpty()); Assert.assertEquals(0, cntThreads.get()); - myThreadRunner.finish(); } private static void assertSucceeded(TestTask task) { @@ -283,7 +282,7 @@ public class BackgroundTaskQueueTest extends PlatformTestCase { private static void waitForTasks(TestTask... tasks) throws InterruptedException { for (TestTask task : tasks) { - task.waitFor(1_000); + task.waitFor(1, TimeUnit.SECONDS); } } @@ -357,8 +356,8 @@ public class BackgroundTaskQueueTest extends PlatformTestCase { assertNotSame(TaskState.CREATED, myState.get()); } - public void waitFor(int timeout) throws InterruptedException { - assertTrue(mySemaphore.tryAcquire(1, timeout, TimeUnit.MILLISECONDS)); + public void waitFor(int timeout, TimeUnit timeUnit) throws InterruptedException { + assertTrue(mySemaphore.tryAcquire(1, timeout, timeUnit)); mySemaphore.release(); } diff --git a/platform/testFramework/src/com/intellij/testFramework/LightPlatformCodeInsightTestCase.java b/platform/testFramework/src/com/intellij/testFramework/LightPlatformCodeInsightTestCase.java index 7429a3ec09bb..df090cbaf8da 100644 --- a/platform/testFramework/src/com/intellij/testFramework/LightPlatformCodeInsightTestCase.java +++ b/platform/testFramework/src/com/intellij/testFramework/LightPlatformCodeInsightTestCase.java @@ -97,11 +97,11 @@ public abstract class LightPlatformCodeInsightTestCase extends LightPlatformTest * Configure test from data file. Data file is usual java, xml or whatever file that needs to be tested except it * has <caret> marker where caret should be placed when file is loaded in editor and <selection></selection> * denoting selection bounds. - * @param filePath - relative path from %IDEA_INSTALLATION_HOME%/testData/ + * @param relativePath - relative path from %IDEA_INSTALLATION_HOME%/testData/ */ - protected void configureByFile(@TestDataFile @NonNls @NotNull String filePath) { + protected void configureByFile(@TestDataFile @NonNls @NotNull String relativePath) { try { - String fullPath = getTestDataPath() + filePath; + String fullPath = getTestDataPath() + relativePath; final File ioFile = new File(fullPath); checkCaseSensitiveFS(fullPath, ioFile); String fileText = FileUtilRt.loadFile(ioFile, CharsetToolkit.UTF8, true); diff --git a/plugins/ant/tests/src/com/intellij/lang/ant/AntCompletionTest.java b/plugins/ant/tests/src/com/intellij/lang/ant/AntCompletionTest.java index 48d925424ef5..ad263d9b2494 100644 --- a/plugins/ant/tests/src/com/intellij/lang/ant/AntCompletionTest.java +++ b/plugins/ant/tests/src/com/intellij/lang/ant/AntCompletionTest.java @@ -24,8 +24,8 @@ public class AntCompletionTest extends LightCodeInsightTestCase { } @Override - protected void configureByFile(@NotNull @TestDataFile @NonNls String filePath) { - super.configureByFile(filePath); + protected void configureByFile(@NotNull @TestDataFile @NonNls String relativePath) { + super.configureByFile(relativePath); AntSupport.markFileAsAntFile(myVFile, myFile.getProject(), true); }