From 7458b960c98c40748897773bb255fe15eedcecde Mon Sep 17 00:00:00 2001 From: Alexander Fedorov Date: Mon, 30 Mar 2020 17:33:55 +0300 Subject: [PATCH] Bug 561582 - Revise API for CDT Codan Clean-up "org.eclipse.cdt.codan.checkers.ui.tests" test bundle Change-Id: I0f5198cc85c85b0829f5a73574cec54f152ba0cf Signed-off-by: Alexander Fedorov --- .../META-INF/MANIFEST.MF | 15 ++------ .../build.properties | 15 ++++++++ .../cdt/codan/checkers/ui/Activator.java | 38 ------------------- .../quickfix/QuickFixCreateNewClassTest.java | 6 +-- 4 files changed, 22 insertions(+), 52 deletions(-) delete mode 100644 codan/org.eclipse.cdt.codan.checkers.ui.tests/src/org/eclipse/cdt/codan/checkers/ui/Activator.java diff --git a/codan/org.eclipse.cdt.codan.checkers.ui.tests/META-INF/MANIFEST.MF b/codan/org.eclipse.cdt.codan.checkers.ui.tests/META-INF/MANIFEST.MF index e3a90dc02fc..88ad34187fa 100644 --- a/codan/org.eclipse.cdt.codan.checkers.ui.tests/META-INF/MANIFEST.MF +++ b/codan/org.eclipse.cdt.codan.checkers.ui.tests/META-INF/MANIFEST.MF @@ -2,23 +2,16 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.eclipse.cdt.codan.checkers.ui.tests -Bundle-Version: 3.2.0.qualifier -Bundle-Activator: org.eclipse.cdt.codan.checkers.ui.Activator +Bundle-Version: 3.3.0.qualifier Require-Bundle: org.eclipse.core.runtime, - org.eclipse.cdt.codan.checkers.ui, org.eclipse.core.resources, - org.eclipse.cdt.codan.ui, org.eclipse.cdt.codan.ui.cxx, - org.eclipse.ui, - org.eclipse.ui.ide, org.junit, org.mockito, - org.hamcrest, - org.eclipse.cdt.core, - org.eclipse.jface.text, - org.eclipse.ui.workbench.texteditor, - org.eclipse.ui.editors + org.eclipse.cdt.core +Fragment-Host: org.eclipse.cdt.codan.checkers.ui Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Bundle-Vendor: %Bundle-Vendor Automatic-Module-Name: org.eclipse.cdt.codan.checkers.ui.tests +Export-Package: org.eclipse.cdt.codan.checkers.ui.quickfix;x-internal:=true diff --git a/codan/org.eclipse.cdt.codan.checkers.ui.tests/build.properties b/codan/org.eclipse.cdt.codan.checkers.ui.tests/build.properties index 32ba2c04917..2e4c2456d4b 100644 --- a/codan/org.eclipse.cdt.codan.checkers.ui.tests/build.properties +++ b/codan/org.eclipse.cdt.codan.checkers.ui.tests/build.properties @@ -1,7 +1,22 @@ +############################################################################### +# Copyright (c) 2016, 2020 COSEDA Technologies GmbH and others. +# +# This program and the accompanying materials +# are made available under the terms of the Eclipse Public License 2.0 +# which accompanies this distribution, and is available at +# https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# Dominic Scharfe (COSEDA Technologies GmbH) - initial API and implementation +# Alexander Fedorov (alexander.fedorov@arsysop.ru) - Bug 561582 +############################################################################### source.. = src/ output.. = bin/ bin.includes = META-INF/,\ .,\ + OSGI-INF/,\ about.html,\ ui-test-plugin.properties src.includes = about.html diff --git a/codan/org.eclipse.cdt.codan.checkers.ui.tests/src/org/eclipse/cdt/codan/checkers/ui/Activator.java b/codan/org.eclipse.cdt.codan.checkers.ui.tests/src/org/eclipse/cdt/codan/checkers/ui/Activator.java deleted file mode 100644 index ab07e237c5b..00000000000 --- a/codan/org.eclipse.cdt.codan.checkers.ui.tests/src/org/eclipse/cdt/codan/checkers/ui/Activator.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2016 COSEDA Technologies GmbH - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Dominic Scharfe (COSEDA Technologies GmbH) - initial implementation - * - *******************************************************************************/ -package org.eclipse.cdt.codan.checkers.ui; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -public class Activator implements BundleActivator { - - private static BundleContext context; - - static BundleContext getContext() { - return context; - } - - @Override - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - } - - @Override - public void stop(BundleContext bundleContext) throws Exception { - Activator.context = null; - } - -} diff --git a/codan/org.eclipse.cdt.codan.checkers.ui.tests/src/org/eclipse/cdt/codan/checkers/ui/quickfix/QuickFixCreateNewClassTest.java b/codan/org.eclipse.cdt.codan.checkers.ui.tests/src/org/eclipse/cdt/codan/checkers/ui/quickfix/QuickFixCreateNewClassTest.java index 8d8e276ede2..9e597070cd3 100644 --- a/codan/org.eclipse.cdt.codan.checkers.ui.tests/src/org/eclipse/cdt/codan/checkers/ui/quickfix/QuickFixCreateNewClassTest.java +++ b/codan/org.eclipse.cdt.codan.checkers.ui.tests/src/org/eclipse/cdt/codan/checkers/ui/quickfix/QuickFixCreateNewClassTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2016 COSEDA Technologies GmbH + * Copyright (c) 2016, 2020 COSEDA Technologies GmbH and others * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -10,7 +10,7 @@ * * Contributors: * Dominic Scharfe (COSEDA Technologies GmbH) - initial implementation - * + * Alexander Fedorov (alexander.fedorov@arsysop.ru) - Bug 561582 *******************************************************************************/ package org.eclipse.cdt.codan.checkers.ui.quickfix; @@ -34,7 +34,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) public class QuickFixCreateNewClassTest {