diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/SMRunnerUtil.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/SMRunnerUtil.java index ef5bb630c95b..ee0fbeef383b 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/SMRunnerUtil.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/SMRunnerUtil.java @@ -1,18 +1,4 @@ -/* - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.execution.testframework.sm; import com.intellij.openapi.application.Application; @@ -21,9 +7,6 @@ import com.intellij.openapi.application.ModalityState; import com.intellij.openapi.diagnostic.Logger; import com.intellij.util.ui.UIUtil; -import javax.swing.*; -import java.awt.event.ActionEvent; - /** * @author Roman Chernyatchik */ diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/SMTestRunnerConnectionUtil.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/SMTestRunnerConnectionUtil.java index 71656ff77b8d..6fd11582f6c4 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/SMTestRunnerConnectionUtil.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/SMTestRunnerConnectionUtil.java @@ -1,4 +1,4 @@ -// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.execution.testframework.sm; import com.intellij.execution.ExecutionException; @@ -72,8 +72,6 @@ public class SMTestRunnerConnectionUtil { * @param processHandler Process handler * @param consoleProperties Console properties for test console actions * @return Console view - * @throws ExecutionException If IDEA cannot execute process this exception will - * be caught and shown in error message box */ @NotNull public static BaseTestsOutputConsoleView createAndAttachConsole(@NotNull String testFrameworkName, diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTRunnerEventsListener.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTRunnerEventsListener.java index 90797a0bd989..4aceb529114d 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTRunnerEventsListener.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTRunnerEventsListener.java @@ -1,26 +1,10 @@ -/* - * Copyright 2000-2009 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.execution.testframework.sm.runner; import com.intellij.util.messages.Topic; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.List; - /** * @author Roman Chernyatchik * @@ -36,7 +20,7 @@ public interface SMTRunnerEventsListener { void onTestingStarted(@NotNull SMTestProxy.SMRootTestProxy testsRoot); /** * After test framework finish testing - * @param testsRootNode + * @param testsRoot */ void onTestingFinished(@NotNull SMTestProxy.SMRootTestProxy testsRoot); /* diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTRunnerTreeBuilder.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTRunnerTreeBuilder.java index a1db456c0710..74f1816c09c7 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTRunnerTreeBuilder.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTRunnerTreeBuilder.java @@ -1,23 +1,8 @@ -/* - * Copyright 2000-2009 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.execution.testframework.sm.runner; import com.intellij.execution.testframework.ui.AbstractTestTreeBuilder; import com.intellij.ide.util.treeView.AbstractTreeStructure; -import com.intellij.ide.util.treeView.AbstractTreeUpdater; import com.intellij.ide.util.treeView.IndexComparator; import com.intellij.ide.util.treeView.NodeDescriptor; diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/TestSuiteStack.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/TestSuiteStack.java index 59301e27b2f6..cc328d8ba022 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/TestSuiteStack.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/TestSuiteStack.java @@ -1,24 +1,9 @@ -/* - * Copyright 2000-2009 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.execution.testframework.sm.runner; import com.intellij.execution.testframework.sm.SMTestRunnerConnectionUtil; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.util.text.StringUtil; -import com.intellij.util.Function; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/history/ImportedTestContentHandler.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/history/ImportedTestContentHandler.java index e4f56bb1f864..d628df491a12 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/history/ImportedTestContentHandler.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/history/ImportedTestContentHandler.java @@ -1,18 +1,4 @@ -/* - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.execution.testframework.sm.runner.history; import com.intellij.execution.process.ProcessOutputTypes; @@ -74,12 +60,12 @@ public class ImportedTestContentHandler extends DefaultHandler { } @Override - public void characters(char[] ch, int start, int length) throws SAXException { + public void characters(char[] ch, int start, int length) { currentValue.append(ch, start, length); } @Override - public void endElement(String uri, String localName, String qName) throws SAXException { + public void endElement(String uri, String localName, String qName) { final String currentText = StringUtil.unescapeXml(currentValue.toString()); final boolean isTestOutput = myCurrentTest == null || TestResultsXmlFormatter.STATUS_PASSED.equals(myStatus) || myErrorOutput; if (isTestOutput) { diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/history/ImportedTestRunnableState.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/history/ImportedTestRunnableState.java index 640c71d51c1a..0398f868378c 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/history/ImportedTestRunnableState.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/history/ImportedTestRunnableState.java @@ -1,22 +1,7 @@ -/* - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.execution.testframework.sm.runner.history; import com.intellij.execution.DefaultExecutionResult; -import com.intellij.execution.ExecutionException; import com.intellij.execution.ExecutionResult; import com.intellij.execution.Executor; import com.intellij.execution.configurations.RunProfile; @@ -47,7 +32,7 @@ public class ImportedTestRunnableState implements RunProfileState { @Nullable @Override - public ExecutionResult execute(Executor executor, @NotNull ProgramRunner runner) throws ExecutionException { + public ExecutionResult execute(Executor executor, @NotNull ProgramRunner runner) { final MyEmptyProcessHandler handler = new MyEmptyProcessHandler(); final SMTRunnerConsoleProperties properties = myRunProfile.getProperties(); RunProfile configuration; diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/history/actions/ImportTestsFromFileAction.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/history/actions/ImportTestsFromFileAction.java index e4b08904ea47..8ae9394d6135 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/history/actions/ImportTestsFromFileAction.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/history/actions/ImportTestsFromFileAction.java @@ -1,22 +1,7 @@ -/* - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.execution.testframework.sm.runner.history.actions; import com.intellij.execution.testframework.sm.runner.SMTRunnerConsoleProperties; -import com.intellij.icons.AllIcons; import com.intellij.openapi.fileChooser.FileChooser; import com.intellij.openapi.fileChooser.FileChooserDescriptor; import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory; diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/states/TestFailedState.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/states/TestFailedState.java index f013dfb11cc8..ebf7438fb45b 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/states/TestFailedState.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/states/TestFailedState.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2009 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.execution.testframework.sm.runner.states; import com.intellij.execution.process.ProcessOutputTypes; @@ -25,7 +11,6 @@ import com.intellij.util.containers.ContainerUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -47,7 +32,7 @@ public class TestFailedState extends AbstractState implements Disposable{ if (msg != null) { myPresentationText.add(msg); if (printer != null) { - printError(printer, Arrays.asList(msg), false); + printError(printer, Collections.singletonList(msg), false); } } } diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/TestTreeRenderer.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/TestTreeRenderer.java index fc86e92b12a9..c185d0cd591f 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/TestTreeRenderer.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/TestTreeRenderer.java @@ -1,18 +1,4 @@ -/* - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.execution.testframework.sm.runner.ui; import com.intellij.execution.testframework.TestConsoleProperties; @@ -44,7 +30,7 @@ public class TestTreeRenderer extends ColoredTreeCellRenderer { myConsoleProperties = consoleProperties; } - public void customizeCellRenderer(final JTree tree, + public void customizeCellRenderer(@NotNull final JTree tree, final Object value, final boolean selected, final boolean expanded, diff --git a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/UITestUtil.java b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/UITestUtil.java index c92dba9f9f2b..7b87ccba72d0 100644 --- a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/UITestUtil.java +++ b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/UITestUtil.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2009 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.execution.testframework.sm; import com.intellij.openapi.util.Pair; @@ -55,9 +41,5 @@ public class UITestUtil { public SimpleTextAttributes getAttribsAt(final int index) { return myFragments.get(index).second; } - - public void clear() { - myFragments.clear(); - } } } diff --git a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/BaseSMTRunnerTestCase.java b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/BaseSMTRunnerTestCase.java index b90bf5beb882..b6b8ba036154 100644 --- a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/BaseSMTRunnerTestCase.java +++ b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/BaseSMTRunnerTestCase.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2009 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.execution.testframework.sm.runner; import com.intellij.execution.configurations.ModuleRunConfiguration; @@ -95,21 +81,4 @@ public abstract class BaseSMTRunnerTestCase extends LightPlatformTestCase { return consoleProperties; } - - protected void doPassTest(final SMTestProxy test) { - test.setStarted(); - test.setFinished(); - } - - protected void doFailTest(final SMTestProxy test) { - test.setStarted(); - test.setTestFailed("", "", false); - test.setFinished(); - } - - protected void doErrorTest(final SMTestProxy test) { - test.setStarted(); - test.setTestFailed("", "", true); - test.setFinished(); - } } 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 148fe19e2d52..3fd2978d13f9 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,22 +1,7 @@ -/* - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.execution.testframework.sm.runner; import com.intellij.execution.executors.DefaultRunExecutor; -import com.intellij.execution.runners.ExecutionEnvironment; import com.intellij.execution.testframework.Filter; import com.intellij.execution.testframework.TestConsoleProperties; import com.intellij.execution.testframework.actions.AbstractRerunFailedTestsAction; @@ -63,10 +48,10 @@ public class GeneralToSMTRunnerEventsConvertorTest extends BaseSMTRunnerTestCase private class MyConsoleView extends SMTRunnerConsoleView { private final TestsOutputConsolePrinter myTestsOutputConsolePrinter; - private MyConsoleView(final TestConsoleProperties consoleProperties, final ExecutionEnvironment environment) { + private MyConsoleView(final TestConsoleProperties consoleProperties) { super(consoleProperties); - myTestsOutputConsolePrinter = new TestsOutputConsolePrinter(MyConsoleView.this, consoleProperties, null) { + myTestsOutputConsolePrinter = new TestsOutputConsolePrinter(this, consoleProperties, null) { @Override public void print(final String text, final ConsoleViewContentType contentType) { myMockResettablePrinter.print(text, contentType); @@ -91,9 +76,8 @@ public class GeneralToSMTRunnerEventsConvertorTest extends BaseSMTRunnerTestCase TestConsoleProperties.SELECT_FIRST_DEFECT.set(consoleProperties, false); TestConsoleProperties.TRACK_RUNNING_TEST.set(consoleProperties, false); - final ExecutionEnvironment environment = new ExecutionEnvironment(); myMockResettablePrinter = new MockPrinter(true); - myConsole = new MyConsoleView(consoleProperties, environment); + myConsole = new MyConsoleView(consoleProperties); myConsole.initUI(); myResultsViewer = myConsole.getResultsViewer(); myEventsProcessor = new GeneralToSMTRunnerEventsConvertor(consoleProperties.getProject(), myResultsViewer.getTestsRootNode(), "SMTestFramework"); @@ -262,7 +246,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", 10l)); + myEventsProcessor.onTestFinished(new TestFinishedEvent("some_test", 10L)); assertEquals(0, myEventsProcessor.getRunningTestsQuantity()); @@ -306,7 +290,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", 10l)); + myEventsProcessor.onTestFinished(new TestFinishedEvent("test", 10L)); myEventsProcessor.onFinishTesting(); //Tree @@ -322,7 +306,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", 10l)); + myEventsProcessor.onTestFinished(new TestFinishedEvent("test", 10L)); myEventsProcessor.onFinishTesting(); //Tree @@ -338,7 +322,7 @@ public class GeneralToSMTRunnerEventsConvertorTest extends BaseSMTRunnerTestCase public void testOnFinishedTesting_WithIgnored() { onTestStarted("test"); myEventsProcessor.onTestIgnored(new TestIgnoredEvent("test", "", null)); - myEventsProcessor.onTestFinished(new TestFinishedEvent("test", 10l)); + myEventsProcessor.onTestFinished(new TestFinishedEvent("test", 10L)); myEventsProcessor.onFinishTesting(); //Tree @@ -385,7 +369,7 @@ public class GeneralToSMTRunnerEventsConvertorTest extends BaseSMTRunnerTestCase assertEquals("suite3", test2.getParent().getName()); assertEquals("suite2", test2.getParent().getParent().getName()); - myEventsProcessor.onTestFinished(new TestFinishedEvent("test2", 10l)); + 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")); @@ -430,7 +414,7 @@ public class GeneralToSMTRunnerEventsConvertorTest extends BaseSMTRunnerTestCase myEventsProcessor.onSuiteFinished(new TestSuiteFinishedEvent("suite1")); myEventsProcessor.onSuiteStarted(new TestSuiteStartedEvent("suite2", null)); - myEventsProcessor.onTestFinished(new TestFinishedEvent("suite2.test1", 10l)); + 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 fea18b12a3b2..0daabebd40e7 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 @@ -32,7 +32,7 @@ public class SMTRunnerConsoleTest extends BaseSMTRunnerTestCase { private MyConsoleView(final TestConsoleProperties consoleProperties) { super(consoleProperties); - myTestsOutputConsolePrinter = new TestsOutputConsolePrinter(MyConsoleView.this, consoleProperties, null) { + myTestsOutputConsolePrinter = new TestsOutputConsolePrinter(this, consoleProperties, null) { @Override public void print(final String text, final ConsoleViewContentType contentType) { myMockResettablePrinter.print(text, contentType); diff --git a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/ui/MockTestResultsViewer.java b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/ui/MockTestResultsViewer.java index 3df7f0510aa7..87ef9318f8ea 100644 --- a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/ui/MockTestResultsViewer.java +++ b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/ui/MockTestResultsViewer.java @@ -1,28 +1,12 @@ -/* - * Copyright 2000-2009 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.execution.testframework.sm.runner.ui; import com.intellij.execution.testframework.AbstractTestProxy; import com.intellij.execution.testframework.TestConsoleProperties; import com.intellij.execution.testframework.sm.runner.SMTestProxy; -import com.intellij.ui.tabs.JBTabs; +import com.intellij.openapi.util.Disposer; import org.jetbrains.annotations.Nullable; -import javax.swing.*; - /** * @author Roman Chernyatchik */ @@ -30,19 +14,11 @@ public class MockTestResultsViewer implements TestResultsViewer { private final TestConsoleProperties myProperties; private final SMTestProxy myRootSuite; - public MockTestResultsViewer(final TestConsoleProperties properties, - final SMTestProxy suite) { + public MockTestResultsViewer(TestConsoleProperties properties, SMTestProxy suite) { myProperties = properties; myRootSuite = suite; } - public void addTab(final String name, @Nullable final String tooltip, final Icon icon, final JComponent contentPane) {} - - @Nullable - public JComponent getContentPane() { - return null; - } - @Override public SMTestProxy getTestsRootNode() { return myRootSuite; @@ -54,12 +30,9 @@ public class MockTestResultsViewer implements TestResultsViewer { @Override public void addEventsListener(final EventsListener listener) {} - public JBTabs getTabs() { return null; } - - @Override public void dispose() { - myProperties.dispose(); + Disposer.dispose(myProperties); } @Override