From 99d9680ed867e81709cb5a49cf037a62ed8e1647 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Tue, 7 Apr 2015 15:05:57 +0200 Subject: [PATCH] Cleanup (L for duration) --- .../sm/runner/events/TestFinishedEvent.java | 8 +++++++- .../GeneralToSMTRunnerEventsConvertorTest.java | 14 +++++++------- .../sm/runner/SMTRunnerConsoleTest.java | 4 ++-- .../sm/runner/ui/SMTestRunnerResultsFormTest.java | 10 +++++----- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/events/TestFinishedEvent.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/events/TestFinishedEvent.java index da3f3522c232..7ad941b50a8a 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/events/TestFinishedEvent.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/events/TestFinishedEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,6 +35,12 @@ public class TestFinishedEvent extends TreeNodeEvent { myDuration = duration; } + public TestFinishedEvent(@NotNull String name, long duration) { + this(name, -1, duration); + } + + /** @deprecated use {@link #TestFinishedEvent(String, long)} (to be removed in IDEA 16) */ + @SuppressWarnings("unused") public TestFinishedEvent(@NotNull String name, int duration) { this(name, -1, duration); } diff --git a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralToSMTRunnerEventsConvertorTest.java b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralToSMTRunnerEventsConvertorTest.java index aadd499db254..aa27dc594a21 100644 --- a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralToSMTRunnerEventsConvertorTest.java +++ b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralToSMTRunnerEventsConvertorTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -218,7 +218,7 @@ public class GeneralToSMTRunnerEventsConvertorTest extends BaseSMTRunnerTestCase onTestStarted("some_test"); final String fullName = myEventsProcessor.getFullTestName("some_test"); final SMTestProxy proxy = myEventsProcessor.getProxyByFullTestName(fullName); - myEventsProcessor.onTestFinished(new TestFinishedEvent("some_test", 10)); + myEventsProcessor.onTestFinished(new TestFinishedEvent("some_test", 10l)); assertEquals(0, myEventsProcessor.getRunningTestsQuantity()); assertEquals(0, myEventsProcessor.getFailedTestsSet().size()); @@ -263,7 +263,7 @@ public class GeneralToSMTRunnerEventsConvertorTest extends BaseSMTRunnerTestCase public void testOnFinishedTesting_WithFailure() { onTestStarted("test"); myEventsProcessor.onTestFailure(new TestFailedEvent("test", "", "", false, null, null)); - myEventsProcessor.onTestFinished(new TestFinishedEvent("test", 10)); + myEventsProcessor.onTestFinished(new TestFinishedEvent("test", 10l)); myEventsProcessor.onFinishTesting(); //Tree @@ -279,7 +279,7 @@ public class GeneralToSMTRunnerEventsConvertorTest extends BaseSMTRunnerTestCase public void testOnFinishedTesting_WithError() { onTestStarted("test"); myEventsProcessor.onTestFailure(new TestFailedEvent("test", "", "", true, null, null)); - myEventsProcessor.onTestFinished(new TestFinishedEvent("test", 10)); + myEventsProcessor.onTestFinished(new TestFinishedEvent("test", 10l)); myEventsProcessor.onFinishTesting(); //Tree @@ -295,7 +295,7 @@ public class GeneralToSMTRunnerEventsConvertorTest extends BaseSMTRunnerTestCase public void testOnFinishedTesting_WithIgnored() { onTestStarted("test"); myEventsProcessor.onTestIgnored(new TestIgnoredEvent("test", "", null)); - myEventsProcessor.onTestFinished(new TestFinishedEvent("test", 10)); + myEventsProcessor.onTestFinished(new TestFinishedEvent("test", 10l)); myEventsProcessor.onFinishTesting(); //Tree @@ -342,7 +342,7 @@ public class GeneralToSMTRunnerEventsConvertorTest extends BaseSMTRunnerTestCase assertEquals("suite3", test2.getParent().getName()); assertEquals("suite2", test2.getParent().getParent().getName()); - myEventsProcessor.onTestFinished(new TestFinishedEvent("test2", 10)); + myEventsProcessor.onTestFinished(new TestFinishedEvent("test2", 10l)); //check that after finishing suite (suite3), current will be parent of finished suite (i.e. suite2) myEventsProcessor.onSuiteFinished(new TestSuiteFinishedEvent("suite3")); @@ -387,7 +387,7 @@ public class GeneralToSMTRunnerEventsConvertorTest extends BaseSMTRunnerTestCase myEventsProcessor.onSuiteFinished(new TestSuiteFinishedEvent("suite1")); myEventsProcessor.onSuiteStarted(new TestSuiteStartedEvent("suite2", null)); - myEventsProcessor.onTestFinished(new TestFinishedEvent("suite2.test1", 10)); + myEventsProcessor.onTestFinished(new TestFinishedEvent("suite2.test1", 10l)); myEventsProcessor.onSuiteFinished(new TestSuiteFinishedEvent("suite2")); assertNotNull(test1); diff --git a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTRunnerConsoleTest.java b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTRunnerConsoleTest.java index 0682c4f38b64..07c82db63f26 100644 --- a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTRunnerConsoleTest.java +++ b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTRunnerConsoleTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -341,7 +341,7 @@ public class SMTRunnerConsoleTest extends BaseSMTRunnerTestCase { "method1:1\n" + "method2:2\n" + "stderr1 ", ""); - myEventsProcessor.onTestFinished(new TestFinishedEvent("my_test", 1)); + myEventsProcessor.onTestFinished(new TestFinishedEvent("my_test", 1l)); myTest1.setFinished(); //other output order diff --git a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsFormTest.java b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsFormTest.java index 430ac8f4bb66..a8d7c8234494 100644 --- a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsFormTest.java +++ b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsFormTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -235,14 +235,14 @@ public class SMTestRunnerResultsFormTest extends BaseSMTRunnerTestCase { myResultsViewer.performUpdate(); myEventsProcessor.onTestFailure(new TestFailedEvent("test_failed", "", "", false, null, null)); myResultsViewer.performUpdate(); - myEventsProcessor.onTestFinished(new TestFinishedEvent("test_failed", 10)); + myEventsProcessor.onTestFinished(new TestFinishedEvent("test_failed", 10l)); myResultsViewer.performUpdate(); myEventsProcessor.onTestStarted(new TestStartedEvent("test", null)); myResultsViewer.performUpdate(); assertEquals(2, myTreeModel.getChildCount(myTreeModel.getChild(myTreeModel.getRoot(), 0))); - myEventsProcessor.onTestFinished(new TestFinishedEvent("test", 10)); + myEventsProcessor.onTestFinished(new TestFinishedEvent("test", 10l)); assertEquals(2, myTreeModel.getChildCount(myTreeModel.getChild(myTreeModel.getRoot(), 0))); myEventsProcessor.onSuiteFinished(new TestSuiteFinishedEvent("suite")); @@ -262,13 +262,13 @@ public class SMTestRunnerResultsFormTest extends BaseSMTRunnerTestCase { myResultsViewer.performUpdate(); myEventsProcessor.onTestFailure(new TestFailedEvent("test_failed", "", "", false, null, null)); myResultsViewer.performUpdate(); - myEventsProcessor.onTestFinished(new TestFinishedEvent("test_failed", 10)); + myEventsProcessor.onTestFinished(new TestFinishedEvent("test_failed", 10l)); myResultsViewer.performUpdate(); myEventsProcessor.onTestStarted(new TestStartedEvent("test", null)); myResultsViewer.performUpdate(); - myEventsProcessor.onTestFinished(new TestFinishedEvent("test", 10)); + myEventsProcessor.onTestFinished(new TestFinishedEvent("test", 10l)); myResultsViewer.performUpdate(); myEventsProcessor.onSuiteFinished(new TestSuiteFinishedEvent("suite2"));