Deprecate test classes in maven-compat which cause lots of warnings

This commit is contained in:
Guillaume Nodet 2024-04-24 13:05:32 +02:00
parent 5d1cfd47f3
commit 728473c54f
63 changed files with 69 additions and 7 deletions

View File

@ -532,6 +532,7 @@ public class DefaultArtifactResolver implements ArtifactResolver, Disposable {
/**
* ThreadCreator for creating daemon threads with fixed ThreadGroup-name.
*/
@Deprecated
static final class DaemonThreadCreator implements ThreadFactory {
static final String THREADGROUP_NAME = "org.apache.maven.artifact.resolver.DefaultArtifactResolver";

View File

@ -59,6 +59,7 @@ import static org.codehaus.plexus.testing.PlexusExtension.getBasedir;
import static org.mockito.Mockito.mock;
@PlexusTest
@Deprecated
public abstract class AbstractCoreMavenComponentTestCase {
@Inject

View File

@ -36,6 +36,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.endsWith;
import static org.junit.jupiter.api.Assertions.assertEquals;
@Deprecated
class ProjectDependenciesResolverTest extends AbstractCoreMavenComponentTestCase {
@Inject
private ProjectDependenciesResolver resolver;

View File

@ -82,6 +82,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
/**
*/
@PlexusTest
@Deprecated
public abstract class AbstractArtifactComponentTestCase // extends PlexusTestCase
{
@Inject

View File

@ -38,6 +38,7 @@ import static org.mockito.Mockito.mock;
/**
*/
@Deprecated
class ArtifactDeployerTest extends AbstractArtifactComponentTestCase {
@Inject
private ArtifactDeployer artifactDeployer;

View File

@ -34,6 +34,7 @@ import org.apache.maven.repository.legacy.metadata.ResolutionGroup;
@Named("classpath")
@Singleton
@Deprecated
public class SimpleArtifactMetadataSource implements ArtifactMetadataSource {
public ResolutionGroup retrieve(
Artifact artifact, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories) {

View File

@ -28,6 +28,7 @@ import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@PlexusTest
@Deprecated
class DefaultArtifactFactoryTest {
@Inject

View File

@ -33,6 +33,7 @@ import static org.mockito.Mockito.mock;
/**
*/
@Deprecated
class ArtifactInstallerTest extends AbstractArtifactComponentTestCase {
@Inject
private ArtifactInstaller artifactInstaller;

View File

@ -33,6 +33,7 @@ import org.eclipse.sisu.Priority;
@Singleton
@Priority(10)
@Named
@Deprecated
public class SwitchableMetadataSource implements ArtifactMetadataSource {
private ArtifactMetadataSource delegate;

View File

@ -34,6 +34,7 @@ import org.apache.maven.repository.legacy.metadata.MetadataResolutionRequest;
@Named("test")
@Singleton
@Deprecated
public class TestMetadataSource implements ArtifactMetadataSource {
@Inject
private ArtifactFactory factory;

View File

@ -23,6 +23,7 @@ import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
@Deprecated
class MavenArtifactRepositoryTest {
private static class MavenArtifactRepositorySubclass extends MavenArtifactRepository {
String id;

View File

@ -51,6 +51,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
/**
*/
@Deprecated
class ArtifactResolverTest extends AbstractArtifactComponentTestCase {
@Inject
private ArtifactResolver artifactResolver;

View File

@ -24,12 +24,12 @@ import java.util.Collections;
import org.apache.maven.artifact.AbstractArtifactComponentTestCase;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.resolver.DefaultArtifactResolver.DaemonThreadCreator;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
@Deprecated
class DefaultArtifactResolverTest extends AbstractArtifactComponentTestCase {
@Inject
private ArtifactResolver artifactResolver;
@ -67,7 +67,7 @@ class DefaultArtifactResolverTest extends AbstractArtifactComponentTestCase {
boolean seen = false;
for (ThreadGroup aTgList : tgList) {
if (!aTgList.getName().equals(DaemonThreadCreator.THREADGROUP_NAME)) {
if (!aTgList.getName().equals(DefaultArtifactResolver.DaemonThreadCreator.THREADGROUP_NAME)) {
continue;
}
@ -84,7 +84,7 @@ class DefaultArtifactResolverTest extends AbstractArtifactComponentTestCase {
}
}
assertTrue(seen, "Could not find ThreadGroup: " + DaemonThreadCreator.THREADGROUP_NAME);
assertTrue(seen, "Could not find ThreadGroup: " + DefaultArtifactResolver.DaemonThreadCreator.THREADGROUP_NAME);
}
@Test

View File

@ -35,6 +35,7 @@ public class TestFileWagon extends FileWagon {
private TestTransferListener testTransferListener;
private boolean insideGet;
@Deprecated
protected void getTransfer(Resource resource, File destination, InputStream input, boolean closeInput, int maxSize)
throws TransferFailedException {
addTransfer("getTransfer " + resource.getName());

View File

@ -30,6 +30,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
* Tests {@link OrArtifactFilter}.
*
*/
@Deprecated
class OrArtifactFilterTest {
private ArtifactFilter newSubFilter() {

View File

@ -30,6 +30,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
@Deprecated
public class TestFileManager {
public static final String TEMP_DIR_PATH = System.getProperty("java.io.tmpdir");

View File

@ -34,6 +34,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
@PlexusTest
@Deprecated
class TransformationManagerTest {
@Inject
ArtifactTransformationManager tm;

View File

@ -37,6 +37,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@PlexusTest
@Deprecated
class DefaultProfileManagerTest {
@Inject

View File

@ -49,6 +49,7 @@ import static org.mockito.Mockito.mock;
/**
*/
@PlexusTest
@Deprecated
public abstract class AbstractMavenProjectTestCase {
protected ProjectBuilder projectBuilder;

View File

@ -41,6 +41,7 @@ import org.eclipse.aether.transfer.ArtifactNotFoundException;
*/
@Named("classpath")
@Singleton
@Deprecated
public class ClasspathArtifactResolver implements ArtifactResolver {
public List<ArtifactResult> resolveArtifacts(

View File

@ -45,6 +45,7 @@ import static org.apache.maven.api.Lifecycle.DEFAULT;
@Singleton
@Named
@Priority(5)
@Deprecated
public class EmptyLifecycleBindingsInjector extends DefaultLifecycleBindingsInjector {
private static LifecycleRegistry lifecycleRegistry;

View File

@ -36,6 +36,7 @@ import org.apache.maven.plugin.MojoExecution;
* plugin artifact resolution from repositories.
*
*/
@Deprecated
public class EmptyLifecycleExecutor implements LifecycleExecutor {
public MavenExecutionPlan calculateExecutionPlan(MavenSession session, String... tasks) {

View File

@ -35,6 +35,7 @@ import org.eclipse.aether.repository.RemoteRepository;
/**
*/
@Deprecated
public class LegacyLocalRepositoryManager implements LocalRepositoryManager {
private final LocalRepository repository;

View File

@ -32,6 +32,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
@Deprecated
class ProjectClasspathTestType extends AbstractMavenProjectTestCase {
static final String dir = "projects/scope/";

View File

@ -27,6 +27,7 @@ import org.apache.maven.artifact.resolver.DefaultArtifactResolver;
@Named("classpath")
@Singleton
@Deprecated
public class TestArtifactResolver extends DefaultArtifactResolver {
private ArtifactMetadataSource source;

View File

@ -27,6 +27,7 @@ import org.apache.maven.repository.legacy.LegacyRepositorySystem;
@Named("classpath")
@Singleton
@Deprecated
public class TestMavenRepositorySystem extends LegacyRepositorySystem {
@Inject
private ArtifactResolver artifactResolver;

View File

@ -36,6 +36,7 @@ import org.eclipse.aether.impl.RemoteRepositoryManager;
@Named("classpath")
@Singleton
@Deprecated
public class TestProjectBuilder extends DefaultProjectBuilder {
@Inject
public TestProjectBuilder(

View File

@ -24,7 +24,6 @@ import java.util.Collections;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.resolver.filter.ExcludesArtifactFilter;
import org.apache.maven.project.artifact.DefaultMavenMetadataCache.CacheKey;
import org.apache.maven.repository.DelegatingLocalArtifactRepository;
import org.apache.maven.repository.RepositorySystem;
import org.apache.maven.repository.TestRepositorySystem;
@ -36,6 +35,7 @@ import static org.junit.jupiter.api.Assertions.assertNotSame;
/**
*/
@Deprecated
class DefaultMavenMetadataCacheTest {
private RepositorySystem repositorySystem;
@ -63,8 +63,10 @@ class DefaultMavenMetadataCacheTest {
assertNotSame(lr1, lr2);
assertNotSame(rr1, rr2);
CacheKey k1 = new CacheKey(a1, false, lr1, Collections.singletonList(rr1));
CacheKey k2 = new CacheKey(a2, false, lr2, Collections.singletonList(rr2));
DefaultMavenMetadataCache.CacheKey k1 =
new DefaultMavenMetadataCache.CacheKey(a1, false, lr1, Collections.singletonList(rr1));
DefaultMavenMetadataCache.CacheKey k2 =
new DefaultMavenMetadataCache.CacheKey(a2, false, lr2, Collections.singletonList(rr2));
assertEquals(k1.hashCode(), k2.hashCode());
}

View File

@ -27,6 +27,7 @@ import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
@PlexusTest
@Deprecated
class MavenMetadataSourceTest {
@Inject
private RepositorySystem repositorySystem;

View File

@ -28,6 +28,7 @@ import static org.codehaus.plexus.testing.PlexusExtension.getTestFile;
/**
*/
@Deprecated
public abstract class AbstractProjectInheritanceTestCase extends AbstractMavenProjectTestCase {
protected String getTestSeries() {
String className = getClass().getPackage().getName();

View File

@ -34,6 +34,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
* down in the lineage are bubbling up where they should.
*
*/
@Deprecated
class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
// ----------------------------------------------------------------------
//

View File

@ -30,6 +30,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
* not clobbered by the same elements elsewhere in the lineage.
*
*/
@Deprecated
class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
// ----------------------------------------------------------------------
//

View File

@ -46,6 +46,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
* down in the lineage are bubbling up where they should.
*
*/
@Deprecated
class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
// ----------------------------------------------------------------------
//

View File

@ -36,6 +36,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
* down in the lineage are bubbling up where they should.
*
*/
@Deprecated
class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
// ----------------------------------------------------------------------
//

View File

@ -36,6 +36,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
* dependency, listed transitively.
*
*/
@Deprecated
class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
// ----------------------------------------------------------------------
//

View File

@ -34,6 +34,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
* A test which demonstrates maven's dependency management
*
*/
@Deprecated
class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
// ----------------------------------------------------------------------
//

View File

@ -35,6 +35,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
* A test which demonstrates maven's dependency management
*
*/
@Deprecated
class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
// ----------------------------------------------------------------------
//

View File

@ -35,6 +35,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
* A test which demonstrates maven's dependency management
*
*/
@Deprecated
class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
// ----------------------------------------------------------------------
//

View File

@ -35,6 +35,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
* A test which demonstrates maven's dependency management
*
*/
@Deprecated
class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
// ----------------------------------------------------------------------
//

View File

@ -35,6 +35,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
* transitive dependencies.
*
*/
@Deprecated
class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
// ----------------------------------------------------------------------
//

View File

@ -41,6 +41,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
* they do not explicitly state a scope.
*
*/
@Deprecated
class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
// ----------------------------------------------------------------------
//

View File

@ -32,6 +32,7 @@ import static org.junit.jupiter.api.Assertions.assertNull;
*
* @see <a href="https://issues.apache.org/jira/browse/MNG-2919">MNG-2919</a>
*/
@Deprecated
class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
// ----------------------------------------------------------------------
//

View File

@ -33,6 +33,7 @@ import static org.junit.jupiter.api.Assertions.assertNull;
* Verifies that plugin execution sections in the parent POM that have
* inherit == false are not inherited to the child POM.
*/
@Deprecated
class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
// ----------------------------------------------------------------------
//

View File

@ -30,6 +30,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
* Verifies SCM inheritance uses modules statement from parent.
*
*/
@Deprecated
class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
// ----------------------------------------------------------------------
//

View File

@ -24,7 +24,7 @@ import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@SuppressWarnings("deprecation")
@Deprecated
class DefaultPathTranslatorTest {
@Test

View File

@ -24,6 +24,7 @@ import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertFalse;
@Deprecated
class DefaultMirrorSelectorTest {
@Test
void testMirrorWithMirrorOfPatternContainingANegationIsNotSelected() {

View File

@ -60,6 +60,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
*/
@PlexusTest
@Deprecated
class LegacyRepositorySystemTest {
@Inject
private LegacyRepositorySystem repositorySystem;

View File

@ -36,6 +36,7 @@ import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertTrue;
@PlexusTest
@Deprecated
class MirrorProcessorTest {
@Inject
private DefaultMirrorSelector mirrorSelector;

View File

@ -24,6 +24,7 @@ import org.apache.maven.artifact.handler.ArtifactHandler;
* Assists unit testing.
*
*/
@Deprecated
class TestArtifactHandler implements ArtifactHandler {
private String type;

View File

@ -61,6 +61,7 @@ import org.eclipse.sisu.Priority;
@Named
@Singleton
@Priority(10)
@Deprecated
public class TestRepositorySystem implements RepositorySystem {
private final ModelReader modelReader;

View File

@ -39,6 +39,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
@Deprecated
class DefaultUpdateCheckManagerTest extends AbstractArtifactComponentTestCase {
@Inject

View File

@ -59,6 +59,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
/**
*/
@PlexusTest
@Deprecated
class DefaultWagonManagerTest {
@Inject
private WagonManager wagonManager;

View File

@ -37,6 +37,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
*
*/
@PlexusTest
@Deprecated
class LegacyRepositorySystemTest {
@Inject
private LegacyRepositorySystem repositorySystem;

View File

@ -63,6 +63,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
*/
@PlexusTest
@Deprecated
class DefaultArtifactCollectorTest {
@Inject
private LegacyArtifactCollector artifactCollector;

View File

@ -40,6 +40,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
*
*/
@PlexusTest
@Deprecated
public abstract class AbstractConflictResolverTest {
// constants --------------------------------------------------------------

View File

@ -26,6 +26,7 @@ import org.junit.jupiter.api.Test;
*
* @see FarthestConflictResolver
*/
@Deprecated
class FarthestConflictResolverTest extends AbstractConflictResolverTest {
// constructors -----------------------------------------------------------

View File

@ -26,6 +26,7 @@ import org.junit.jupiter.api.Test;
*
* @see NearestConflictResolver
*/
@Deprecated
class NearestConflictResolverTest extends AbstractConflictResolverTest {
// constructors -----------------------------------------------------------

View File

@ -26,6 +26,7 @@ import org.junit.jupiter.api.Test;
*
* @see NewestConflictResolver
*/
@Deprecated
class NewestConflictResolverTest extends AbstractConflictResolverTest {
// constructors -----------------------------------------------------------

View File

@ -26,6 +26,7 @@ import org.junit.jupiter.api.Test;
*
* @see OldestConflictResolver
*/
@Deprecated
class OldestConflictResolverTest extends AbstractConflictResolverTest {
// constructors -----------------------------------------------------------

View File

@ -33,6 +33,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
*
*/
@PlexusTest
@Deprecated
class DefaultClasspathTransformationTestType {
@Inject
ClasspathTransformation transform;

View File

@ -27,6 +27,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
*
*
*/
@Deprecated
class DefaultGraphConflictResolutionPolicyTest {
GraphConflictResolutionPolicy policy;
MetadataGraphEdge e1;

View File

@ -33,6 +33,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
*
*/
@PlexusTest
@Deprecated
class DefaultGraphConflictResolverTest {
@Inject
GraphConflictResolver resolver;

View File

@ -37,6 +37,7 @@ import org.apache.maven.repository.legacy.metadata.ResolutionGroup;
@Named
@Singleton
@Deprecated
public class TestMetadataSource implements ArtifactMetadataSource {
@Inject
private ArtifactFactory factory;