From 12f45246ccc20c037aa6068d6c58b4b627232be6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Kubitz?= Date: Tue, 13 Feb 2024 14:09:32 +0100 Subject: [PATCH] tests: hide most warnings use utf8 suppress deprecation undocumentedEmptyBlock=ignore --- .../.project | 11 +++++++++ .../org.eclipse.core.resources.prefs | 2 ++ .../p2/tests/ui/query/AbstractQueryTest.java | 1 + .../tests/ui/query/QueryDescriptorTest.java | 2 ++ .../.settings/org.eclipse.jdt.core.prefs | 13 +++++++++- .../equinox/p2/tests/TestActivator.java | 1 + ...actRepositoryWithReferenceDescriptors.java | 1 + .../processing/ProcessingStepHandlerTest.java | 2 +- .../p2/tests/core/AggregateQueryTest.java | 1 + .../equinox/p2/tests/core/CollectorTest.java | 1 + .../p2/tests/core/CompoundQueryableTest.java | 1 + .../equinox/p2/tests/core/QueryTest.java | 1 + .../p2/tests/engine/ActionManagerTest.java | 7 ++++-- .../tests/engine/TouchpointManagerTest.java | 3 ++- .../p2/tests/generator/GeneratorTests.java | 2 +- .../InstallDescriptionParserTest.java | 13 +++++++--- .../metadata/repository/AllServerTests.java | 1 + .../CompositeMetadataRepositoryTest.java | 24 +++++++++++++++---- .../repository/SPIMetadataRepositoryTest.java | 1 + .../mirror/ArtifactMirrorApplicationTest.java | 4 ++-- .../mirror/ArtifactRepositoryCleanupTest.java | 1 + .../mirror/MetadataMirrorApplicationTest.java | 1 + .../mirror/MetadataRepositoryCleanupTest.java | 1 + .../NewMirrorApplicationMetadataTest.java | 1 + .../MetadataRepositoryPerformanceTest.java | 1 - .../tests/perf/PublisherPerformanceTest.java | 2 -- .../publisher/actions/RootIUActionTest.java | 1 + .../equinox/p2/tests/ql/EvaluatorTest.java | 1 + .../equinox/p2/tests/ql/PerformanceTest.java | 1 + .../SimpleConfiguratorTest.java | 3 +++ .../SimpleConfiguratorUtilsTest.java | 2 +- .../helper/TestServerController.java | 1 + .../eclipse/EclipseTouchpointTest.java | 21 ++++++++++++---- .../p2/tests/touchpoint/eclipse/UtilTest.java | 1 + org.eclipse.equinox.p2.releng/.project | 11 +++++++++ 35 files changed, 117 insertions(+), 24 deletions(-) create mode 100644 bundles/org.eclipse.equinox.p2.tests.reconciler.product/.project create mode 100644 bundles/org.eclipse.equinox.p2.tests.reconciler.product/.settings/org.eclipse.core.resources.prefs create mode 100644 org.eclipse.equinox.p2.releng/.project diff --git a/bundles/org.eclipse.equinox.p2.tests.reconciler.product/.project b/bundles/org.eclipse.equinox.p2.tests.reconciler.product/.project new file mode 100644 index 0000000000..10cbe266c8 --- /dev/null +++ b/bundles/org.eclipse.equinox.p2.tests.reconciler.product/.project @@ -0,0 +1,11 @@ + + + org.eclipse.equinox.p2.tests.reconciler.product + + + + + + + + diff --git a/bundles/org.eclipse.equinox.p2.tests.reconciler.product/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.equinox.p2.tests.reconciler.product/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000000..99f26c0203 --- /dev/null +++ b/bundles/org.eclipse.equinox.p2.tests.reconciler.product/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AbstractQueryTest.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AbstractQueryTest.java index 5ca02fd422..a3a1ed8a51 100644 --- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AbstractQueryTest.java +++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AbstractQueryTest.java @@ -24,6 +24,7 @@ /** * Abstract class to set up the mock query provider */ +@SuppressWarnings("deprecation") // MatchQuery public abstract class AbstractQueryTest extends AbstractProvisioningTest { @Override protected void setUp() throws Exception { diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryDescriptorTest.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryDescriptorTest.java index 03ef5d0fd5..f00ce4cf52 100644 --- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryDescriptorTest.java +++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryDescriptorTest.java @@ -70,6 +70,7 @@ protected Object wrap(Object item) { } } + @SuppressWarnings("deprecation") // MatchQuery class SimpleMatchQuery extends MatchQuery { @Override @@ -81,6 +82,7 @@ public boolean isMatch(Object candidate) { } } + @SuppressWarnings("deprecation") // MatchQuery class SimpleMatchQuery2 extends MatchQuery { @Override @Deprecated diff --git a/bundles/org.eclipse.equinox.p2.tests/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.tests/.settings/org.eclipse.jdt.core.prefs index 6fd17e0054..c913c0c35c 100644 --- a/bundles/org.eclipse.equinox.p2.tests/.settings/org.eclipse.jdt.core.prefs +++ b/bundles/org.eclipse.equinox.p2.tests/.settings/org.eclipse.jdt.core.prefs @@ -1,5 +1,6 @@ eclipse.preferences.version=1 instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true +org.eclipse.jdt.core.builder.annotationPath.allLocations=disabled org.eclipse.jdt.core.builder.cleanOutputFolder=clean org.eclipse.jdt.core.builder.duplicateResourceTask=warning org.eclipse.jdt.core.builder.invalidClasspath=abort @@ -14,9 +15,12 @@ org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonN org.eclipse.jdt.core.compiler.annotation.nonnull.secondary= org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= +org.eclipse.jdt.core.compiler.annotation.notowning=org.eclipse.jdt.annotation.NotOwning org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable org.eclipse.jdt.core.compiler.annotation.nullable.secondary= org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled +org.eclipse.jdt.core.compiler.annotation.owning=org.eclipse.jdt.annotation.Owning +org.eclipse.jdt.core.compiler.annotation.resourceanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 @@ -27,6 +31,8 @@ org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.doc.comment.support=disabled org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000 +org.eclipse.jdt.core.compiler.problem.APILeak=warning +org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated=info org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.autoboxing=ignore @@ -49,8 +55,10 @@ org.eclipse.jdt.core.compiler.problem.forbiddenReference=error org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompatibleOwningContract=warning org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning +org.eclipse.jdt.core.compiler.problem.insufficientResourceAnalysis=warning org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled @@ -101,13 +109,15 @@ org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.suppressWarningsNotFullyAnalysed=info org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning +org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled @@ -115,6 +125,7 @@ org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestActivator.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestActivator.java index de039c2eef..c4680cbddc 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestActivator.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestActivator.java @@ -26,6 +26,7 @@ import org.osgi.framework.ServiceReference; import org.osgi.service.packageadmin.PackageAdmin; +@SuppressWarnings("deprecation") // PackageAdmin public class TestActivator implements BundleActivator { public static final String PI_PROV_TESTS = "org.eclipse.equinox.p2.test"; public static BundleContext context; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactRepositoryWithReferenceDescriptors.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactRepositoryWithReferenceDescriptors.java index 0443eeb24f..9bc50dfdfd 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactRepositoryWithReferenceDescriptors.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactRepositoryWithReferenceDescriptors.java @@ -39,6 +39,7 @@ public class ArtifactRepositoryWithReferenceDescriptors extends AbstractProvisio // @Override + @SuppressWarnings("deprecation") // java.io.File.toURL() protected void setUp() throws Exception { super.setUp(); repo = createArtifactRepository(getTempFolder().toURI(), null); diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/ProcessingStepHandlerTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/ProcessingStepHandlerTest.java index c23833a3d3..0c96290c2f 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/ProcessingStepHandlerTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/ProcessingStepHandlerTest.java @@ -39,6 +39,7 @@ import org.eclipse.equinox.p2.repository.artifact.spi.ProcessingStepDescriptor; import org.junit.Test; +@SuppressWarnings("deprecation") // MD5Verifier public class ProcessingStepHandlerTest { // private static final int BUFFER_SIZE = 8 * 1024; @@ -198,7 +199,6 @@ public void testCreateByteShifterPS() { assertEquals(ByteShifter.class, steps[0].getClass()); } - @SuppressWarnings("deprecation") @Test public void testCreateMD5VerifierPS() { String processorId = "org.eclipse.equinox.p2.processing.MD5Verifier"; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/AggregateQueryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/AggregateQueryTest.java index 3eab671a70..4e7bbfb879 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/AggregateQueryTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/AggregateQueryTest.java @@ -32,6 +32,7 @@ /** * This tests both Compound and Composite queries */ +@SuppressWarnings("deprecation") // MatchQuery public class AggregateQueryTest { public List getABCDE() { diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CollectorTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CollectorTest.java index a1865ab3bc..3707f12df9 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CollectorTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CollectorTest.java @@ -26,6 +26,7 @@ /** * Tests for {@link Collector}. */ +@SuppressWarnings("deprecation") // MatchQuery public class CollectorTest extends AbstractProvisioningTest { public void testAccept() { Collector collector = new Collector<>(); diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CompoundQueryableTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CompoundQueryableTest.java index d8b434d744..1b102b92c5 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CompoundQueryableTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CompoundQueryableTest.java @@ -33,6 +33,7 @@ /** * Tests the compound queryable */ +@SuppressWarnings("deprecation") // MatchQuery public class CompoundQueryableTest { public static class CompoundQueryTestProgressMonitor extends TestProgressMonitor { diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/QueryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/QueryTest.java index 0fdc0341b1..0c56b9510f 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/QueryTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/QueryTest.java @@ -26,6 +26,7 @@ /** * Tests for the {@link org.eclipse.equinox.p2.query.Query} class. */ +@SuppressWarnings("deprecation") // MatchQuery public class QueryTest { static class AnyStringQuery extends MatchQuery { diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ActionManagerTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ActionManagerTest.java index bb1bcdc2a3..1e617bc981 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ActionManagerTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ActionManagerTest.java @@ -7,7 +7,7 @@ * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -16,7 +16,9 @@ import java.io.File; import java.net.MalformedURLException; import org.eclipse.equinox.internal.p2.engine.ActionManager; -import org.eclipse.equinox.p2.metadata.*; +import org.eclipse.equinox.p2.metadata.MetadataFactory; +import org.eclipse.equinox.p2.metadata.Version; +import org.eclipse.equinox.p2.metadata.VersionRange; import org.eclipse.equinox.p2.tests.AbstractProvisioningTest; import org.eclipse.equinox.p2.tests.TestActivator; import org.osgi.framework.Bundle; @@ -50,6 +52,7 @@ public void testGetActionWithNullVersion() { assertNotNull(manager.getAction("test1.test", null)); } + @SuppressWarnings("deprecation") // java.io.File.toURL() // temporarily disabling this test until API is done public void DISABLED_testDynamicAction() throws MalformedURLException, BundleException, InterruptedException { ActionManager manager = new ActionManager(); diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/TouchpointManagerTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/TouchpointManagerTest.java index 9ff5222165..c9842b8e8c 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/TouchpointManagerTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/TouchpointManagerTest.java @@ -7,7 +7,7 @@ * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -49,6 +49,7 @@ public void testGetTouchpointByIdWithNullVersion() { assertNotNull(manager.getTouchpoint("phaseTest", null)); } + @SuppressWarnings("deprecation") // java.io.File.toURL() // temporarily disabling this test until API is done public void DISABLED_testDynamicTouchpoint() throws MalformedURLException, BundleException, InterruptedException { TouchpointManager manager = new TouchpointManager(); diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/generator/GeneratorTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/generator/GeneratorTests.java index 2730efc029..1cad17ad81 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/generator/GeneratorTests.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/generator/GeneratorTests.java @@ -16,7 +16,6 @@ import java.io.File; import java.io.PrintStream; import java.util.Map; - import org.eclipse.core.runtime.FileLocator; import org.eclipse.equinox.app.IApplicationContext; import org.eclipse.equinox.internal.p2.publisher.Messages; @@ -81,6 +80,7 @@ public Object go(String[] arguments, StringBuilder buffer) throws Exception { } } + @SuppressWarnings("deprecation") // java.io.File.toURL() public void test233240_artifactsDeleted() throws Exception { //this also covers 220494 File rootFolder = getTestFolder("artifactsDeleted"); diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/installer/InstallDescriptionParserTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/installer/InstallDescriptionParserTest.java index dc6ada790d..766a02535e 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/installer/InstallDescriptionParserTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/installer/InstallDescriptionParserTest.java @@ -7,7 +7,7 @@ * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -15,8 +15,13 @@ import java.io.File; import java.io.IOException; -import java.net.*; -import org.eclipse.core.runtime.*; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.SubMonitor; +import org.eclipse.core.runtime.URIUtil; import org.eclipse.equinox.internal.p2.installer.InstallDescriptionParser; import org.eclipse.equinox.internal.provisional.p2.installer.InstallDescription; import org.eclipse.equinox.p2.metadata.IVersionedId; @@ -42,6 +47,7 @@ protected void assertEquals(String message, InstallDescription expected, Install assertEquals(message, expected.isAutoStart(), actual.isAutoStart()); } + @SuppressWarnings("deprecation") // java.io.File.toURL() private InstallDescription loadDescription(String filename) { URL location = null; try { @@ -136,6 +142,7 @@ public void testLoadBadDescription() { /** * Tests loading a missing install description */ + @SuppressWarnings("deprecation") // java.io.File.toURL() public void testLoadMissing() { try { InstallDescriptionParser.createDescription(new File("/does/not/exist/InstallDescriptionParserTest").toURL().toExternalForm(), SubMonitor.convert(getMonitor())); diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/AllServerTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/AllServerTests.java index 924f67fb03..76a244a06e 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/AllServerTests.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/AllServerTests.java @@ -35,6 +35,7 @@ * Performs all automated metadata repository tests that requires a local test server running * on port 8080. */ +@SuppressWarnings("deprecation") // PackageAdmin public class AllServerTests extends TestCase { private static final String BUNDLE_EQUINOX_HTTP = "org.eclipse.equinox.http"; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/CompositeMetadataRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/CompositeMetadataRepositoryTest.java index 8b29a33efb..67045d61fc 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/CompositeMetadataRepositoryTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/CompositeMetadataRepositoryTest.java @@ -19,24 +19,38 @@ import java.io.PrintStream; import java.net.URI; import java.net.URISyntaxException; -import java.util.*; -import org.eclipse.core.runtime.*; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.OperationCanceledException; +import org.eclipse.core.runtime.URIUtil; import org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository; import org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepositoryFactory; import org.eclipse.equinox.internal.p2.persistence.CompositeRepositoryState; import org.eclipse.equinox.p2.core.ProvisionException; -import org.eclipse.equinox.p2.metadata.*; +import org.eclipse.equinox.p2.metadata.IInstallableUnit; +import org.eclipse.equinox.p2.metadata.MetadataFactory; import org.eclipse.equinox.p2.metadata.MetadataFactory.InstallableUnitDescription; -import org.eclipse.equinox.p2.query.*; +import org.eclipse.equinox.p2.metadata.Version; +import org.eclipse.equinox.p2.query.IQuery; +import org.eclipse.equinox.p2.query.IQueryResult; +import org.eclipse.equinox.p2.query.MatchQuery; +import org.eclipse.equinox.p2.query.QueryUtil; import org.eclipse.equinox.p2.repository.IRepository; import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository; import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager; -import org.eclipse.equinox.p2.tests.*; +import org.eclipse.equinox.p2.tests.AbstractProvisioningTest; +import org.eclipse.equinox.p2.tests.StringBufferStream; +import org.eclipse.equinox.p2.tests.TestData; import org.eclipse.equinox.p2.tests.core.CompoundQueryableTest.CompoundQueryTestProgressMonitor; /** * Test API of the local metadata repository implementation. */ +@SuppressWarnings("deprecation") // MatchQuery public class CompositeMetadataRepositoryTest extends AbstractProvisioningTest { private static final String TEST_KEY = "TestKey"; private static final String TEST_VALUE = "TestValue"; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java index bdb3822937..151014d526 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java @@ -67,6 +67,7 @@ /** * Test API of the metadata interfaces with an SPI implementation. */ +@SuppressWarnings("deprecation") // MatchQuery public class SPIMetadataRepositoryTest extends AbstractProvisioningTest { protected File repoLocation; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java index 351cc537e5..3aa6fe0dda 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java @@ -25,7 +25,6 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Map; - import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; @@ -59,6 +58,7 @@ /** * Test API of the basic mirror application functionality's implementation. */ +@SuppressWarnings("deprecation") // java.io.File.toURL() public class ArtifactMirrorApplicationTest extends AbstractProvisioningTest { private static final String DOWNLOAD_CHECKSUM = IArtifactDescriptor.DOWNLOAD_CHECKSUM + ".sha-256"; private static final String COMPARATOR = ArtifactChecksumComparator.COMPARATOR_ID + ".sha-256"; @@ -1100,7 +1100,7 @@ public synchronized IArtifactDescriptor[] getArtifactDescriptors(IArtifactKey ke } @Override - public Iterator everything() { + public synchronized Iterator everything() { return ((SimpleArtifactRepository) source).everything(); } diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactRepositoryCleanupTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactRepositoryCleanupTest.java index b2d27c7c25..e379acb568 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactRepositoryCleanupTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactRepositoryCleanupTest.java @@ -57,6 +57,7 @@ protected void tearDown() throws Exception { /** * runs default mirror. source is the source repo, destination is the destination repo */ + @SuppressWarnings("deprecation") // java.io.File.toURL() private void runMirrorApplication(final File source, final File destination, final boolean append) throws Exception { MirrorApplication application = new MirrorApplication(); String[] args = new String[] {"-source", source.toURL().toExternalForm(), "-destination", destination.toURL().toExternalForm(), append ? "-append" : ""}; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/MetadataMirrorApplicationTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/MetadataMirrorApplicationTest.java index 410651c1e2..e219f2f1bb 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/MetadataMirrorApplicationTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/MetadataMirrorApplicationTest.java @@ -33,6 +33,7 @@ /** * Test API of the basic mirror application functionality's implementation. */ +@SuppressWarnings("deprecation") // java.io.File.toURL() public class MetadataMirrorApplicationTest extends AbstractProvisioningTest { protected File destRepoLocation; protected File sourceRepoLocation; //helloworldfeature diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/MetadataRepositoryCleanupTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/MetadataRepositoryCleanupTest.java index 066795deff..869a69806d 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/MetadataRepositoryCleanupTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/MetadataRepositoryCleanupTest.java @@ -57,6 +57,7 @@ protected void tearDown() throws Exception { /** * runs default mirror. source is the source repo, destination is the destination repo */ + @SuppressWarnings("deprecation") // java.io.File.toURL() private void runMirrorApplication(final File source, final File destination, final boolean append) throws Exception { MirrorApplication application = new MirrorApplication(); String[] args = new String[] {"-source", source.toURL().toExternalForm(), "-destination", destination.toURL().toExternalForm(), append ? "-append" : ""}; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationMetadataTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationMetadataTest.java index 4d8c2ac714..0a8b543ad2 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationMetadataTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationMetadataTest.java @@ -38,6 +38,7 @@ /* * Modified from MetadataMirrorApplicationTest */ +@SuppressWarnings("deprecation") // java.io.File.toURL() public class NewMirrorApplicationMetadataTest extends AbstractProvisioningTest { protected File destRepoLocation; protected File sourceRepoLocation; //helloworldfeature diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/perf/MetadataRepositoryPerformanceTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/perf/MetadataRepositoryPerformanceTest.java index b7c0a361c6..998b50cb51 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/perf/MetadataRepositoryPerformanceTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/perf/MetadataRepositoryPerformanceTest.java @@ -52,7 +52,6 @@ protected void tearDown() throws Exception { public void testQueryLocalRepository() { final int IU_COUNT = 3000; new PerformanceTestRunner() { - @SuppressWarnings("unchecked") IQuery[] queries = new IQuery[IU_COUNT]; @Override diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/perf/PublisherPerformanceTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/perf/PublisherPerformanceTest.java index 8215c47725..9d2d61ba9e 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/perf/PublisherPerformanceTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/perf/PublisherPerformanceTest.java @@ -29,7 +29,6 @@ public class PublisherPerformanceTest extends ProvisioningPerformanceTest { public void testQueryPublisherResult() { final int IU_COUNT = 3000; new PerformanceTestRunner() { - @SuppressWarnings("unchecked") IQuery[] queries = new IQuery[IU_COUNT]; PublisherResult result; @@ -56,7 +55,6 @@ protected void test() { public void testLimitQueryPublisherResult() { final int IU_COUNT = 3000; new PerformanceTestRunner() { - @SuppressWarnings("unchecked") IQuery[] queries = new IQuery[IU_COUNT]; PublisherResult result; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/RootIUActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/RootIUActionTest.java index 637465c39f..d0d3e256c8 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/RootIUActionTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/RootIUActionTest.java @@ -42,6 +42,7 @@ import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository; import org.eclipse.equinox.p2.tests.TestMetadataRepository; +@SuppressWarnings("deprecation") // MatchQuery public class RootIUActionTest extends ActionTest { private static final int CONTAINS_A = 1; private static final int CONTAINS_B = 2; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/EvaluatorTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/EvaluatorTest.java index 986c63bf51..7f9ea256c6 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/EvaluatorTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/EvaluatorTest.java @@ -58,6 +58,7 @@ import org.eclipse.equinox.p2.tests.TestActivator; import org.osgi.framework.Filter; +@SuppressWarnings("deprecation") // MatchQuery public class EvaluatorTest extends AbstractProvisioningTest { private static final IExpressionParser parser = ExpressionUtil.getParser(); private static final IExpressionFactory factory = ExpressionUtil.getFactory(); diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/PerformanceTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/PerformanceTest.java index 27911c3cca..08f5e645f2 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/PerformanceTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/PerformanceTest.java @@ -44,6 +44,7 @@ import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager; import org.eclipse.equinox.p2.tests.AbstractProvisioningTest; +@SuppressWarnings("deprecation") // MatchQuery public class PerformanceTest extends AbstractProvisioningTest { public void testParserPerformance() throws Exception { IExpressionParser parser = ExpressionUtil.getParser(); diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorTest.java index b3c96083ae..028075d12b 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorTest.java @@ -37,6 +37,7 @@ public class SimpleConfiguratorTest extends AbstractProvisioningTest { protected URL[] localConfiguration = new URL[1]; protected SimpleConfiguratorImpl configurator; + @SuppressWarnings("deprecation") // java.io.File.toURL() @Override public void setUp() throws Exception { relativeURL = new URL("file://bundles.info"); @@ -83,11 +84,13 @@ public void testSimpleConfiguration() throws MalformedURLException { assertIsPropertySet(false); } + @SuppressWarnings("deprecation") // java.io.File.toURL() public void testNotExistingConfigiration() throws MalformedURLException { assertNull(configurator.chooseConfigurationURL(relativeURL, new URL[] {new File(".", "notexisting").toURL()})); assertIsPropertySet(false); } + @SuppressWarnings("deprecation") // java.io.File.toURL() public void testSharedConfigurationUserNotExisting() throws MalformedURLException { sharedConfiguration[0] = new File(".", "notexisting").toURL(); assertEquals(sharedConfiguration[1], configurator.chooseConfigurationURL(relativeURL, sharedConfiguration)); diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorUtilsTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorUtilsTest.java index 6764ef343e..ce0af6cf1f 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorUtilsTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorUtilsTest.java @@ -19,12 +19,12 @@ import java.net.URI; import java.net.URISyntaxException; import java.util.List; - import org.eclipse.equinox.internal.simpleconfigurator.Activator; import org.eclipse.equinox.internal.simpleconfigurator.utils.BundleInfo; import org.eclipse.equinox.internal.simpleconfigurator.utils.SimpleConfiguratorUtils; import org.eclipse.equinox.p2.tests.AbstractProvisioningTest; +@SuppressWarnings("deprecation") // java.io.File.toURL() public class SimpleConfiguratorUtilsTest extends AbstractProvisioningTest { private static final boolean WINDOWS = java.io.File.separatorChar == '\\'; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/testserver/helper/TestServerController.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/testserver/helper/TestServerController.java index 82104d4523..ec94064c55 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/testserver/helper/TestServerController.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/testserver/helper/TestServerController.java @@ -33,6 +33,7 @@ * that require the test server to be running. * Also see {@link AbstractTestServerClientCase} for a base class for test in such a suite. */ +@SuppressWarnings("deprecation") // PackageAdmin public class TestServerController { private static final String BUNDLE_EQUINOX_HTTP = "org.eclipse.equinox.http"; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/EclipseTouchpointTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/EclipseTouchpointTest.java index df47e14ec6..572062fbc8 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/EclipseTouchpointTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/EclipseTouchpointTest.java @@ -14,15 +14,27 @@ package org.eclipse.equinox.p2.tests.touchpoint.eclipse; import java.io.File; -import java.net.*; -import java.util.*; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URL; +import java.util.Collection; +import java.util.Dictionary; +import java.util.HashMap; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.Map; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.equinox.internal.p2.director.ProfileChangeRequest; -import org.eclipse.equinox.internal.p2.touchpoint.eclipse.*; +import org.eclipse.equinox.internal.p2.touchpoint.eclipse.AggregatedBundleRepository; +import org.eclipse.equinox.internal.p2.touchpoint.eclipse.EclipseTouchpoint; +import org.eclipse.equinox.internal.p2.touchpoint.eclipse.Util; import org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.ActionConstants; import org.eclipse.equinox.p2.core.ProvisionException; -import org.eclipse.equinox.p2.engine.*; +import org.eclipse.equinox.p2.engine.IEngine; +import org.eclipse.equinox.p2.engine.IProfile; +import org.eclipse.equinox.p2.engine.IProvisioningPlan; +import org.eclipse.equinox.p2.engine.ProvisioningContext; import org.eclipse.equinox.p2.metadata.IArtifactKey; import org.eclipse.equinox.p2.metadata.IInstallableUnit; import org.eclipse.equinox.p2.planner.IPlanner; @@ -93,6 +105,7 @@ public void testQualifyAction() { /** * Tests loading cache extensions from a profile whose install directory contains spaces */ + @SuppressWarnings("deprecation") // java.io.File.toURL() public void testBug262073() throws MalformedURLException { Map properties = new HashMap<>(); File site = getTestData("Repository", "/testData/artifactRepo/simple with spaces/"); diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/UtilTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/UtilTest.java index 819885ce5d..bef5a84767 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/UtilTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/UtilTest.java @@ -53,6 +53,7 @@ public void testDefaultBundlePool() { assertEquals(agentLocation.getDataArea("org.eclipse.equinox.p2.touchpoint.eclipse"), Util.getBundlePoolLocation(getAgent(), profile)); } + @SuppressWarnings("deprecation") // java.io.File.toURL() public void testExplicitBundlePool() throws MalformedURLException { Map props = new HashMap<>(); File cacheDir = new File(System.getProperty("java.io.tmpdir"), "cache"); diff --git a/org.eclipse.equinox.p2.releng/.project b/org.eclipse.equinox.p2.releng/.project new file mode 100644 index 0000000000..5383151e6d --- /dev/null +++ b/org.eclipse.equinox.p2.releng/.project @@ -0,0 +1,11 @@ + + + org.eclipse.equinox.p2.releng + + + + + + + +