console: test simplified
authorSergey Simonchik <sergey.simonchik@jetbrains.com>
Wed, 25 Nov 2015 19:51:55 +0000 (22:51 +0300)
committerSergey Simonchik <sergey.simonchik@jetbrains.com>
Wed, 25 Nov 2015 19:51:55 +0000 (22:51 +0300)
platform/platform-tests/testSrc/com/intellij/execution/impl/ConsoleViewImplTest.java

index e2a7de97bc19d090e9b6301060382e9ac14d8fc1..b7037137548b54b46d55fd3cc1f50e79a3bfcf0d 100644 (file)
@@ -69,16 +69,10 @@ public class ConsoleViewImplTest extends LightPlatformTestCase {
   public void testDoubleClear() throws Exception {
     ConsoleViewImpl console = myConsole;
     Alarm alarm = new Alarm(Alarm.ThreadToUse.SHARED_THREAD);
-    CountDownLatch latch = new CountDownLatch(3);
+    CountDownLatch latch = new CountDownLatch(1);
     alarm.addRequest(() -> {
       console.clear();
-      latch.countDown();
-    }, 0);
-    alarm.addRequest(() -> {
       console.clear();
-      latch.countDown();
-    }, 0);
-    alarm.addRequest(() -> {
       console.print("Test", ConsoleViewContentType.NORMAL_OUTPUT);
       latch.countDown();
     }, 0);
@@ -94,7 +88,7 @@ public class ConsoleViewImplTest extends LightPlatformTestCase {
     ConsoleViewImpl console = myConsole;
     console.clear();
     EditorActionManager actionManager = EditorActionManager.getInstance();
-    final DataContext dataContext = DataManager.getInstance().getDataContext();
+    DataContext dataContext = DataManager.getInstance().getDataContext(console.getComponent());
     TypedAction action = actionManager.getTypedAction();
     action.actionPerformed(console.getEditor(), 'h', dataContext);
     assertEquals(1, console.getContentSize());