Skip to content

Commit

Permalink
tests: hide most warnings
Browse files Browse the repository at this point in the history
use utf8
suppress deprecation
undocumentedEmptyBlock=ignore
  • Loading branch information
EcljpseB0T authored and jukzi committed Feb 13, 2024
1 parent 67fcfe4 commit 12f4524
Show file tree
Hide file tree
Showing 35 changed files with 117 additions and 24 deletions.
11 changes: 11 additions & 0 deletions bundles/org.eclipse.equinox.p2.tests.reconciler.product/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.equinox.p2.tests.reconciler.product</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ protected Object wrap(Object item) {
}
}

@SuppressWarnings("deprecation") // MatchQuery
class SimpleMatchQuery extends MatchQuery<Object> {

@Override
Expand All @@ -81,6 +82,7 @@ public boolean isMatch(Object candidate) {
}
}

@SuppressWarnings("deprecation") // MatchQuery
class SimpleMatchQuery2 extends MatchQuery<Object> {
@Override
@Deprecated
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -101,20 +109,23 @@ 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
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class ArtifactRepositoryWithReferenceDescriptors extends AbstractProvisio
// </artifact>

@Override
@SuppressWarnings("deprecation") // java.io.File.toURL()
protected void setUp() throws Exception {
super.setUp();
repo = createArtifactRepository(getTempFolder().toURI(), null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
/**
* This tests both Compound and Composite queries
*/
@SuppressWarnings("deprecation") // MatchQuery
public class AggregateQueryTest {

public List<String> getABCDE() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
/**
* Tests for {@link Collector}.
*/
@SuppressWarnings("deprecation") // MatchQuery
public class CollectorTest extends AbstractProvisioningTest {
public void testAccept() {
Collector<Object> collector = new Collector<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
/**
* Tests the compound queryable
*/
@SuppressWarnings("deprecation") // MatchQuery
public class CompoundQueryableTest {

public static class CompoundQueryTestProgressMonitor extends TestProgressMonitor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*******************************************************************************/
Expand All @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*******************************************************************************/
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,21 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.equinox.p2.tests.installer;

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;
Expand All @@ -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 {
Expand Down Expand Up @@ -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()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -1100,7 +1100,7 @@ public synchronized IArtifactDescriptor[] getArtifactDescriptors(IArtifactKey ke
}

@Override
public Iterator<IArtifactKey> everything() {
public synchronized Iterator<IArtifactKey> everything() {
return ((SimpleArtifactRepository) source).everything();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" : ""};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" : ""};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ protected void tearDown() throws Exception {
public void testQueryLocalRepository() {
final int IU_COUNT = 3000;
new PerformanceTestRunner() {
@SuppressWarnings("unchecked")
IQuery<IInstallableUnit>[] queries = new IQuery[IU_COUNT];

@Override
Expand Down
Loading

0 comments on commit 12f4524

Please sign in to comment.