From c49c4e0b18b70abb42c0bbf463d958a6567c4166 Mon Sep 17 00:00:00 2001 From: Karl Heinz Marbaise Date: Sat, 15 Apr 2023 19:23:43 +0200 Subject: [PATCH] [MNG-7451] - Remove public modifier from test methods / test classes --- .../maven/settings/GlobalSettingsTest.java | 4 +- .../maven/api/settings/SettingsTest.java | 2 +- .../maven/artifact/ArtifactUtilsTest.java | 8 +- .../maven/artifact/DefaultArtifactTest.java | 26 +- .../versioning/ComparableVersionIT.java | 4 +- .../versioning/ComparableVersionTest.java | 30 +-- .../DefaultArtifactVersionTest.java | 16 +- .../artifact/versioning/VersionRangeTest.java | 22 +- .../building/DefaultProblemCollectorTest.java | 6 +- .../maven/building/DefaultProblemTest.java | 16 +- .../apache/maven/building/FileSourceTest.java | 10 +- .../building/ProblemCollectorFactoryTest.java | 4 +- .../maven/building/StringSourceTest.java | 8 +- .../apache/maven/building/UrlSourceTest.java | 8 +- .../deployer/ArtifactDeployerTest.java | 4 +- .../factory/DefaultArtifactFactoryTest.java | 4 +- .../installer/ArtifactInstallerTest.java | 4 +- .../MavenArtifactRepositoryTest.java | 4 +- .../ArtifactResolutionExceptionTest.java | 4 +- .../resolver/ArtifactResolverTest.java | 19 +- .../resolver/DefaultArtifactResolverTest.java | 6 +- .../filter/AndArtifactFilterTest.java | 4 +- .../resolver/filter/FilterHashEqualsTest.java | 4 +- .../resolver/filter/OrArtifactFilterTest.java | 4 +- .../filter/ScopeArtifactFilterTest.java | 12 +- .../transform/TransformationManagerTest.java | 4 +- .../manager/DefaultProfileManagerTest.java | 14 +- .../maven/project/ProjectClasspathTest.java | 4 +- .../t00/ProjectInheritanceTest.java | 4 +- .../t01/ProjectInheritanceTest.java | 4 +- .../t02/ProjectInheritanceTest.java | 4 +- .../t03/ProjectInheritanceTest.java | 4 +- .../t04/ProjectInheritanceTest.java | 4 +- .../t05/ProjectInheritanceTest.java | 4 +- .../t06/ProjectInheritanceTest.java | 4 +- .../t07/ProjectInheritanceTest.java | 4 +- .../t08/ProjectInheritanceTest.java | 4 +- .../t09/ProjectInheritanceTest.java | 6 +- .../t10/ProjectInheritanceTest.java | 4 +- .../t11/ProjectInheritanceTest.java | 4 +- .../t12/ProjectInheritanceTest.java | 4 +- .../t12scm/ProjectInheritanceTest.java | 6 +- .../path/DefaultPathTranslatorTest.java | 8 +- .../repository/DefaultMirrorSelectorTest.java | 4 +- .../LegacyRepositorySystemTest.java | 6 +- .../maven/repository/MirrorProcessorTest.java | 18 +- .../legacy/DefaultUpdateCheckManagerTest.java | 16 +- .../legacy/DefaultWagonManagerTest.java | 18 +- .../legacy/LegacyRepositorySystemTest.java | 6 +- .../DefaultArtifactCollectorTest.java | 81 +++--- .../FarthestConflictResolverTest.java | 10 +- .../conflict/NearestConflictResolverTest.java | 10 +- .../conflict/NewestConflictResolverTest.java | 10 +- .../conflict/OldestConflictResolverTest.java | 10 +- .../DefaultClasspathTransformationTest.java | 14 +- ...aultGraphConflictResolutionPolicyTest.java | 8 +- .../DefaultGraphConflictResolverTest.java | 14 +- .../org/apache/maven/DefaultMavenTest.java | 8 +- .../maven/MavenLifecycleParticipantTest.java | 6 +- .../ProjectDependenciesResolverTest.java | 6 +- .../artifact/handler/ArtifactHandlerTest.java | 4 +- .../filter/ExclusionArtifactFilterTest.java | 22 +- .../DefaultBeanConfiguratorPathTest.java | 12 +- .../DefaultBeanConfiguratorTest.java | 12 +- .../DefaultExceptionHandlerTest.java | 8 +- .../DefaultBuildResumptionAnalyzerTest.java | 14 +- ...aultBuildResumptionDataRepositoryTest.java | 12 +- ...ultMavenExecutionRequestPopulatorTest.java | 4 +- .../execution/DefaultMavenExecutionTest.java | 6 +- .../internal/MojoExecutionScopeTest.java | 6 +- .../maven/graph/DefaultGraphBuilderTest.java | 2 +- .../DefaultProjectDependencyGraphTest.java | 19 +- .../internal/MultilineMessageHelperTest.java | 6 +- .../ReverseTreeRepositoryListenerTest.java | 8 +- .../internal/impl/PropertiesAsMapTest.java | 4 +- .../apache/maven/internal/impl/TestApi.java | 2 +- .../ConsumerPomArtifactTransformerTest.java | 4 +- .../lifecycle/DefaultLifecyclesTest.java | 14 +- .../LifecycleExecutorSubModulesTest.java | 4 +- .../lifecycle/LifecycleExecutorTest.java | 24 +- .../lifecycle/MavenExecutionPlanTest.java | 10 +- .../internal/BuildListCalculatorTest.java | 4 +- .../ConcurrencyDependencyGraphTest.java | 6 +- .../LifecycleDependencyResolverTest.java | 4 +- .../LifecycleExecutionPlanCalculatorTest.java | 4 +- .../internal/LifecycleModuleBuilderTest.java | 4 +- ...ifecycleTaskSegmentCalculatorImplTest.java | 4 +- .../lifecycle/internal/PhaseRecorderTest.java | 4 +- .../internal/ProjectBuildListTest.java | 4 +- .../internal/builder/BuilderCommonTest.java | 12 +- .../ConcurrencyDependencyGraphTest.java | 4 +- .../multithreaded/ThreadOutputMuxerTest.java | 6 +- .../stub/ProjectDependencyGraphStubTest.java | 10 +- .../lifecycle/mapping/LifecyclePhaseTest.java | 6 +- .../maven/plugin/PluginManagerTest.java | 24 +- .../plugin/PluginParameterExceptionTest.java | 10 +- ...luginParameterExpressionEvaluatorTest.java | 34 +-- .../internal/DefaultLegacySupportTest.java | 4 +- .../internal/MavenPluginValidatorTest.java | 10 +- .../DefaultMavenProjectBuilderTest.java | 30 +-- .../ExtensionDescriptorBuilderTest.java | 10 +- .../maven/project/MavenProjectTest.java | 24 +- .../maven/project/PomConstructionTest.java | 244 +++++++++--------- .../maven/project/ProjectBuilderTest.java | 28 +- .../project/ProjectModelResolverTest.java | 23 +- .../maven/project/ProjectSorterTest.java | 26 +- .../DefaultMavenMetadataCacheTest.java | 6 +- .../DefaultProjectArtifactsCacheTest.java | 6 +- .../artifact/MavenMetadataSourceTest.java | 8 +- .../CanonicalProjectBuilderTest.java | 4 +- .../DefaultRuntimeInformationTest.java | 6 +- .../PomConstructionWithSettingsTest.java | 10 +- .../maven/settings/SettingsUtilsTest.java | 6 +- .../DefaultToolchainManagerPrivateTest.java | 12 +- .../DefaultToolchainManagerTest.java | 14 +- .../maven/toolchain/DefaultToolchainTest.java | 16 +- .../RequirementMatcherFactoryTest.java | 6 +- .../cli/CLIManagerDocumentationTest.java | 6 +- .../maven/cli/CLIReportingUtilsTest.java | 4 +- .../apache/maven/cli/CleanArgumentTest.java | 8 +- .../org/apache/maven/cli/MavenCliTest.java | 46 ++-- .../cli/event/ExecutionEventLoggerTest.java | 6 +- .../cli/transfer/FileSizeFormatTest.java | 18 +- .../model/building/ComplexActivationTest.java | 4 +- .../DefaultModelBuilderFactoryTest.java | 6 +- .../building/DefaultModelBuilderTest.java | 6 +- .../model/building/FileModelSourceTest.java | 6 +- .../building/FileToRawModelMergerTest.java | 4 +- .../DefaultInheritanceAssemblerTest.java | 22 +- .../MavenBuildTimestampTest.java | 4 +- .../model/merge/MavenModelMergerTest.java | 10 +- .../model/path/DefaultUrlNormalizerTest.java | 16 +- .../activation/FileProfileActivatorTest.java | 8 +- .../JdkVersionProfileActivatorTest.java | 16 +- .../PropertyProfileActivatorTest.java | 22 +- .../validation/DefaultModelValidatorTest.java | 132 +++++----- .../transform/CiFriendlyXMLFilterTest.java | 4 +- .../transform/ConsumerPomXMLFilterTest.java | 10 +- .../model/transform/ModulesXMLFilterTest.java | 12 +- .../model/transform/ParentXMLFilterTest.java | 26 +- .../ReactorDependencyXMLFilterTest.java | 12 +- .../transform/RelativePathXMLFilterTest.java | 8 +- .../maven/model/ActivationFileTest.java | 10 +- .../apache/maven/model/ActivationOSTest.java | 10 +- .../maven/model/ActivationPropertyTest.java | 10 +- .../apache/maven/model/ActivationTest.java | 10 +- .../org/apache/maven/model/BuildTest.java | 10 +- .../apache/maven/model/CiManagementTest.java | 10 +- .../apache/maven/model/ContributorTest.java | 10 +- .../maven/model/DependencyManagementTest.java | 10 +- .../apache/maven/model/DependencyTest.java | 10 +- .../maven/model/DeploymentRepositoryTest.java | 10 +- .../org/apache/maven/model/DeveloperTest.java | 10 +- .../model/DistributionManagementTest.java | 10 +- .../org/apache/maven/model/ExclusionTest.java | 10 +- .../org/apache/maven/model/ExtensionTest.java | 10 +- .../maven/model/IssueManagementTest.java | 10 +- .../org/apache/maven/model/LicenseTest.java | 10 +- .../apache/maven/model/MailingListTest.java | 10 +- .../org/apache/maven/model/ModelTest.java | 10 +- .../org/apache/maven/model/NotifierTest.java | 10 +- .../apache/maven/model/OrganizationTest.java | 10 +- .../org/apache/maven/model/ParentTest.java | 10 +- .../maven/model/PluginConfigurationTest.java | 10 +- .../maven/model/PluginContainerTest.java | 10 +- .../maven/model/PluginExecutionTest.java | 10 +- .../maven/model/PluginManagementTest.java | 10 +- .../org/apache/maven/model/PluginTest.java | 10 +- .../apache/maven/model/PrerequisitesTest.java | 10 +- .../org/apache/maven/model/ProfileTest.java | 10 +- .../apache/maven/model/RelocationTest.java | 10 +- .../apache/maven/model/ReportPluginTest.java | 10 +- .../org/apache/maven/model/ReportSetTest.java | 10 +- .../org/apache/maven/model/ReportingTest.java | 10 +- .../maven/model/RepositoryPolicyTest.java | 10 +- .../apache/maven/model/RepositoryTest.java | 10 +- .../org/apache/maven/model/ResourceTest.java | 10 +- .../java/org/apache/maven/model/ScmTest.java | 10 +- .../apache/maven/model/SerializationTest.java | 4 +- .../java/org/apache/maven/model/SiteTest.java | 10 +- .../maven/model/merge/MavenMergerTest.java | 8 +- .../apache/maven/model/v4/ModelXmlTest.java | 4 +- .../plugin/descriptor/MojoDescriptorTest.java | 4 +- .../PluginDescriptorBuilderTest.java | 4 +- .../repository/metadata/MetadataTest.java | 2 +- .../DefaultArtifactDescriptorReaderTest.java | 4 +- .../internal/DefaultModelResolverTest.java | 23 +- .../internal/DefaultVersionResolverTest.java | 6 +- .../MavenRepositorySystemUtilsTest.java | 4 +- .../internal/RemoteSnapshotMetadataTest.java | 8 +- .../internal/RepositorySystemTest.java | 24 +- .../DefaultSettingsBuilderFactoryTest.java | 4 +- .../DefaultSettingsValidatorTest.java | 22 +- .../slf4j/impl/MavenLoggerFactoryTest.java | 10 +- .../logwrapper/LogLevelRecorderTest.java | 10 +- .../DefaultToolchainsBuilderTest.java | 22 +- .../ToolchainsBuildingExceptionTest.java | 10 +- .../merge/MavenToolchainMergerTest.java | 10 +- .../internal/xml/XmlNodeBuilderTest.java | 4 +- .../maven/internal/xml/XmlNodeImplTest.java | 43 ++- 200 files changed, 1205 insertions(+), 1209 deletions(-) diff --git a/apache-maven/src/test/java/org/apache/maven/settings/GlobalSettingsTest.java b/apache-maven/src/test/java/org/apache/maven/settings/GlobalSettingsTest.java index 0fc2a3c725..9512d4a934 100644 --- a/apache-maven/src/test/java/org/apache/maven/settings/GlobalSettingsTest.java +++ b/apache-maven/src/test/java/org/apache/maven/settings/GlobalSettingsTest.java @@ -34,10 +34,10 @@ * * @author Benjamin Bentmann */ -public class GlobalSettingsTest { +class GlobalSettingsTest { @Test - public void testValidGlobalSettings() throws Exception { + void testValidGlobalSettings() throws Exception { String basedir = System.getProperty("basedir", System.getProperty("user.dir")); File globalSettingsFile = new File(basedir, "src/assembly/maven/conf/settings.xml"); diff --git a/api/maven-api-settings/src/test/java/org/apache/maven/api/settings/SettingsTest.java b/api/maven-api-settings/src/test/java/org/apache/maven/api/settings/SettingsTest.java index 2f525094c7..b78630752a 100644 --- a/api/maven-api-settings/src/test/java/org/apache/maven/api/settings/SettingsTest.java +++ b/api/maven-api-settings/src/test/java/org/apache/maven/api/settings/SettingsTest.java @@ -23,7 +23,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; -public class SettingsTest { +class SettingsTest { @Test void testSetLocalRepository() { diff --git a/maven-artifact/src/test/java/org/apache/maven/artifact/ArtifactUtilsTest.java b/maven-artifact/src/test/java/org/apache/maven/artifact/ArtifactUtilsTest.java index 63c48a0765..6611952543 100644 --- a/maven-artifact/src/test/java/org/apache/maven/artifact/ArtifactUtilsTest.java +++ b/maven-artifact/src/test/java/org/apache/maven/artifact/ArtifactUtilsTest.java @@ -35,14 +35,14 @@ * * @author Benjamin Bentmann */ -public class ArtifactUtilsTest { +class ArtifactUtilsTest { private Artifact newArtifact(String aid) { return new DefaultArtifact("group", aid, VersionRange.createFromVersion("1.0"), "test", "jar", "tests", null); } @Test - public void testIsSnapshot() { + void testIsSnapshot() { assertFalse(ArtifactUtils.isSnapshot(null)); assertFalse(ArtifactUtils.isSnapshot("")); assertFalse(ArtifactUtils.isSnapshot("1.2.3")); @@ -53,7 +53,7 @@ public void testIsSnapshot() { } @Test - public void testToSnapshotVersion() { + void testToSnapshotVersion() { assertEquals("1.2.3", ArtifactUtils.toSnapshotVersion("1.2.3")); assertEquals("1.2.3-SNAPSHOT", ArtifactUtils.toSnapshotVersion("1.2.3-SNAPSHOT")); assertEquals("1.2.3-SNAPSHOT", ArtifactUtils.toSnapshotVersion("1.2.3-20090413.094722-2")); @@ -64,7 +64,7 @@ public void testToSnapshotVersion() { * Tests that the ordering of the map resembles the ordering of the input collection of artifacts. */ @Test - public void testArtifactMapByVersionlessIdOrdering() throws Exception { + void testArtifactMapByVersionlessIdOrdering() throws Exception { List list = new ArrayList<>(); list.add(newArtifact("b")); list.add(newArtifact("a")); diff --git a/maven-artifact/src/test/java/org/apache/maven/artifact/DefaultArtifactTest.java b/maven-artifact/src/test/java/org/apache/maven/artifact/DefaultArtifactTest.java index e6c9c6f245..7235d17239 100644 --- a/maven-artifact/src/test/java/org/apache/maven/artifact/DefaultArtifactTest.java +++ b/maven-artifact/src/test/java/org/apache/maven/artifact/DefaultArtifactTest.java @@ -27,7 +27,7 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; -public class DefaultArtifactTest { +class DefaultArtifactTest { private DefaultArtifact artifact; @@ -49,7 +49,7 @@ public class DefaultArtifactTest { private ArtifactHandlerMock artifactHandler; @BeforeEach - public void setUp() throws Exception { + void setUp() throws Exception { artifactHandler = new ArtifactHandlerMock(); versionRange = VersionRange.createFromVersion(version); artifact = new DefaultArtifact(groupId, artifactId, versionRange, scope, type, classifier, artifactHandler); @@ -60,7 +60,7 @@ public void setUp() throws Exception { } @Test - public void testGetVersionReturnsResolvedVersionOnSnapshot() { + void testGetVersionReturnsResolvedVersionOnSnapshot() { assertEquals(snapshotResolvedVersion, snapshotArtifact.getVersion()); // this is FOUL! @@ -70,55 +70,55 @@ public void testGetVersionReturnsResolvedVersionOnSnapshot() { } @Test - public void testGetDependencyConflictId() { + void testGetDependencyConflictId() { assertEquals(groupId + ":" + artifactId + ":" + type + ":" + classifier, artifact.getDependencyConflictId()); } @Test - public void testGetDependencyConflictIdNullGroupId() { + void testGetDependencyConflictIdNullGroupId() { artifact.setGroupId(null); assertEquals(null + ":" + artifactId + ":" + type + ":" + classifier, artifact.getDependencyConflictId()); } @Test - public void testGetDependencyConflictIdNullClassifier() { + void testGetDependencyConflictIdNullClassifier() { artifact = new DefaultArtifact(groupId, artifactId, versionRange, scope, type, null, artifactHandler); assertEquals(groupId + ":" + artifactId + ":" + type, artifact.getDependencyConflictId()); } @Test - public void testGetDependencyConflictIdNullScope() { + void testGetDependencyConflictIdNullScope() { artifact.setScope(null); assertEquals(groupId + ":" + artifactId + ":" + type + ":" + classifier, artifact.getDependencyConflictId()); } @Test - public void testToString() { + void testToString() { assertEquals( groupId + ":" + artifactId + ":" + type + ":" + classifier + ":" + version + ":" + scope, artifact.toString()); } @Test - public void testToStringNullGroupId() { + void testToStringNullGroupId() { artifact.setGroupId(null); assertEquals(artifactId + ":" + type + ":" + classifier + ":" + version + ":" + scope, artifact.toString()); } @Test - public void testToStringNullClassifier() { + void testToStringNullClassifier() { artifact = new DefaultArtifact(groupId, artifactId, versionRange, scope, type, null, artifactHandler); assertEquals(groupId + ":" + artifactId + ":" + type + ":" + version + ":" + scope, artifact.toString()); } @Test - public void testToStringNullScope() { + void testToStringNullScope() { artifact.setScope(null); assertEquals(groupId + ":" + artifactId + ":" + type + ":" + classifier + ":" + version, artifact.toString()); } @Test - public void testComparisonByVersion() { + void testComparisonByVersion() { Artifact artifact1 = new DefaultArtifact( groupId, artifactId, VersionRange.createFromVersion("5.0"), scope, type, classifier, artifactHandler); Artifact artifact2 = new DefaultArtifact( @@ -134,7 +134,7 @@ public void testComparisonByVersion() { } @Test - public void testNonResolvedVersionRangeConsistentlyYieldsNullVersions() throws Exception { + void testNonResolvedVersionRangeConsistentlyYieldsNullVersions() throws Exception { VersionRange vr = VersionRange.createFromVersionSpec("[1.0,2.0)"); artifact = new DefaultArtifact(groupId, artifactId, vr, scope, type, null, artifactHandler); assertNull(artifact.getVersion()); diff --git a/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionIT.java b/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionIT.java index eaa403b834..a78591dafd 100644 --- a/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionIT.java +++ b/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionIT.java @@ -32,10 +32,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals; -public class ComparableVersionIT { +class ComparableVersionIT { @Test - public void test() throws Exception { + void test() throws Exception { Files.walkFileTree(Paths.get("target"), new SimpleFileVisitor() { Pattern mavenArtifactJar = Pattern.compile("maven-artifact-[\\d.]+(-SNAPSHOT)?\\.jar"); diff --git a/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionTest.java b/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionTest.java index fc382046ee..c4d2125b64 100644 --- a/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionTest.java +++ b/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionTest.java @@ -31,7 +31,7 @@ * @author Hervé Boutemy */ @SuppressWarnings("unchecked") -public class ComparableVersionTest { +class ComparableVersionTest { private ComparableVersion newComparable(String version) { ComparableVersion ret = new ComparableVersion(version); String canonical = ret.getCanonical(); @@ -115,17 +115,17 @@ private void checkVersionsOrder(String v1, String v2) { } @Test - public void testVersionsQualifier() { + void testVersionsQualifier() { checkVersionsOrder(VERSIONS_QUALIFIER); } @Test - public void testVersionsNumber() { + void testVersionsNumber() { checkVersionsOrder(VERSIONS_NUMBER); } @Test - public void testVersionsEqual() { + void testVersionsEqual() { newComparable("1.0-alpha"); checkVersionsEqual("1", "1"); checkVersionsEqual("1", "1.0"); @@ -178,7 +178,7 @@ public void testVersionsEqual() { } @Test - public void testVersionComparing() { + void testVersionComparing() { checkVersionsOrder("1", "2"); checkVersionsOrder("1.5", "2"); checkVersionsOrder("1", "2.5"); @@ -209,13 +209,13 @@ public void testVersionComparing() { } @Test - public void testLeadingZeroes() { + void testLeadingZeroes() { checkVersionsOrder("0.7", "2"); checkVersionsOrder("0.2", "1.0.7"); } @Test - public void testGetCanonical() { + void testGetCanonical() { // MNG-7700 newComparable("0.x"); newComparable("0-x"); @@ -236,7 +236,7 @@ public void testGetCanonical() { * 226100 */ @Test - public void testMng5568() { + void testMng5568() { String a = "6.1.0"; String b = "6.1.0rc3"; String c = "6.1H.5-beta"; // this is the unusual version string, with 'H' in the middle @@ -250,7 +250,7 @@ public void testMng5568() { * Test MNG-6572 optimization. */ @Test - public void testMng6572() { + void testMng6572() { String a = "20190126.230843"; // resembles a SNAPSHOT String b = "1234567890.12345"; // 10 digit number String c = "123456789012345.1H.5-beta"; // 15 digit number @@ -269,7 +269,7 @@ public void testMng6572() { * (related to MNG-6572 optimization) */ @Test - public void testVersionEqualWithLeadingZeroes() { + void testVersionEqualWithLeadingZeroes() { // versions with string lengths from 1 to 19 String[] arr = new String[] { "0000000000000000001", @@ -301,7 +301,7 @@ public void testVersionEqualWithLeadingZeroes() { * (related to MNG-6572 optimization) */ @Test - public void testVersionZeroEqualWithLeadingZeroes() { + void testVersionZeroEqualWithLeadingZeroes() { // versions with string lengths from 1 to 19 String[] arr = new String[] { "0000000000000000000", @@ -333,7 +333,7 @@ public void testVersionZeroEqualWithLeadingZeroes() { * for qualifiers that start with "-0.", which was showing A == C and B == C but A < B. */ @Test - public void testMng6964() { + void testMng6964() { String a = "1-0.alpha"; String b = "1-0.beta"; String c = "1"; @@ -344,7 +344,7 @@ public void testMng6964() { } @Test - public void testLocaleIndependent() { + void testLocaleIndependent() { Locale orig = Locale.getDefault(); Locale[] locales = {Locale.ENGLISH, new Locale("tr"), Locale.getDefault()}; try { @@ -358,7 +358,7 @@ public void testLocaleIndependent() { } @Test - public void testReuse() { + void testReuse() { ComparableVersion c1 = new ComparableVersion("1"); c1.parseVersion("2"); @@ -373,7 +373,7 @@ public void testReuse() { * 1.0.0.X1 < 1.0.0-X2 for any string X */ @Test - public void testMng7644() { + void testMng7644() { for (String x : new String[] {"abc", "alpha", "a", "beta", "b", "def", "milestone", "m", "RC"}) { // 1.0.0.X1 < 1.0.0-X2 for any string x checkVersionsOrder("1.0.0." + x + "1", "1.0.0-" + x + "2"); diff --git a/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/DefaultArtifactVersionTest.java b/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/DefaultArtifactVersionTest.java index 8f8e222ca0..48f9c955af 100644 --- a/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/DefaultArtifactVersionTest.java +++ b/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/DefaultArtifactVersionTest.java @@ -29,7 +29,7 @@ * * @author Brett Porter */ -public class DefaultArtifactVersionTest { +class DefaultArtifactVersionTest { private ArtifactVersion newArtifactVersion(String version) { return new DefaultArtifactVersion(version); } @@ -49,7 +49,7 @@ private void checkVersionParsing( } @Test - public void testVersionParsing() { + void testVersionParsing() { checkVersionParsing("1", 1, 0, 0, 0, null); checkVersionParsing("1.2", 1, 2, 0, 0, null); checkVersionParsing("1.2.3", 1, 2, 3, 0, null); @@ -86,7 +86,7 @@ public void testVersionParsing() { } @Test - public void testVersionComparing() { + void testVersionComparing() { assertVersionEqual("1", "1"); assertVersionOlder("1", "2"); assertVersionOlder("1.5", "2"); @@ -133,7 +133,7 @@ public void testVersionComparing() { } @Test - public void testVersionSnapshotComparing() { + void testVersionSnapshotComparing() { assertVersionEqual("1-SNAPSHOT", "1-SNAPSHOT"); assertVersionOlder("1-SNAPSHOT", "2-SNAPSHOT"); assertVersionOlder("1.5-SNAPSHOT", "2-SNAPSHOT"); @@ -167,14 +167,14 @@ public void testVersionSnapshotComparing() { } @Test - public void testSnapshotVsReleases() { + void testSnapshotVsReleases() { assertVersionOlder("1.0-RC1", "1.0-SNAPSHOT"); assertVersionOlder("1.0-rc1", "1.0-SNAPSHOT"); assertVersionOlder("1.0-rc-1", "1.0-SNAPSHOT"); } @Test - public void testHashCode() { + void testHashCode() { ArtifactVersion v1 = newArtifactVersion("1"); ArtifactVersion v2 = newArtifactVersion("1.0"); assertTrue(v1.equals(v2)); @@ -182,12 +182,12 @@ public void testHashCode() { } @Test - public void testEqualsNullSafe() { + void testEqualsNullSafe() { assertFalse(newArtifactVersion("1").equals(null)); } @Test - public void testEqualsTypeSafe() { + void testEqualsTypeSafe() { assertFalse(newArtifactVersion("1").equals("non-an-artifact-version-instance")); } diff --git a/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/VersionRangeTest.java b/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/VersionRangeTest.java index b4aa8d603b..5ae1ea3ef3 100644 --- a/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/VersionRangeTest.java +++ b/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/VersionRangeTest.java @@ -35,7 +35,7 @@ * * @author Brett Porter */ -public class VersionRangeTest { +class VersionRangeTest { private static final String CHECK_NUM_RESTRICTIONS = "check number of restrictions"; private static final String CHECK_UPPER_BOUND = "check upper bound"; @@ -53,7 +53,7 @@ public class VersionRangeTest { private static final String CHECK_SELECTED_VERSION = "check selected version"; @Test - public void testRange() throws InvalidVersionSpecificationException, OverConstrainedVersionException { + void testRange() throws InvalidVersionSpecificationException, OverConstrainedVersionException { Artifact artifact = null; VersionRange range = VersionRange.createFromVersionSpec("(,1.0]"); @@ -157,14 +157,14 @@ public void testRange() throws InvalidVersionSpecificationException, OverConstra } @Test - public void testSameUpperAndLowerBoundRoundtrip() throws InvalidVersionSpecificationException { + void testSameUpperAndLowerBoundRoundtrip() throws InvalidVersionSpecificationException { VersionRange range = VersionRange.createFromVersionSpec("[1.0]"); VersionRange range2 = VersionRange.createFromVersionSpec(range.toString()); assertEquals(range, range2); } @Test - public void testInvalidRanges() { + void testInvalidRanges() { checkInvalidRange("(1.0)"); checkInvalidRange("[1.0)"); checkInvalidRange("(1.0]"); @@ -182,7 +182,7 @@ public void testInvalidRanges() { } @Test - public void testIntersections() throws InvalidVersionSpecificationException { + void testIntersections() throws InvalidVersionSpecificationException { VersionRange range1 = VersionRange.createFromVersionSpec("1.0"); VersionRange range2 = VersionRange.createFromVersionSpec("1.1"); VersionRange mergedRange = range1.restrict(range2); @@ -664,7 +664,7 @@ public void testIntersections() throws InvalidVersionSpecificationException { } @Test - public void testReleaseRangeBoundsContainsSnapshots() throws InvalidVersionSpecificationException { + void testReleaseRangeBoundsContainsSnapshots() throws InvalidVersionSpecificationException { VersionRange range = VersionRange.createFromVersionSpec("[1.0,1.2]"); assertTrue(range.containsVersion(new DefaultArtifactVersion("1.1-SNAPSHOT"))); @@ -673,7 +673,7 @@ public void testReleaseRangeBoundsContainsSnapshots() throws InvalidVersionSpeci } @Test - public void testSnapshotRangeBoundsCanContainSnapshots() throws InvalidVersionSpecificationException { + void testSnapshotRangeBoundsCanContainSnapshots() throws InvalidVersionSpecificationException { VersionRange range = VersionRange.createFromVersionSpec("[1.0,1.2-SNAPSHOT]"); assertTrue(range.containsVersion(new DefaultArtifactVersion("1.1-SNAPSHOT"))); @@ -686,7 +686,7 @@ public void testSnapshotRangeBoundsCanContainSnapshots() throws InvalidVersionSp } @Test - public void testSnapshotSoftVersionCanContainSnapshot() throws InvalidVersionSpecificationException { + void testSnapshotSoftVersionCanContainSnapshot() throws InvalidVersionSpecificationException { VersionRange range = VersionRange.createFromVersionSpec("1.0-SNAPSHOT"); assertTrue(range.containsVersion(new DefaultArtifactVersion("1.0-SNAPSHOT"))); @@ -700,7 +700,7 @@ private void checkInvalidRange(String version) { } @Test - public void testContains() throws InvalidVersionSpecificationException { + void testContains() throws InvalidVersionSpecificationException { ArtifactVersion actualVersion = new DefaultArtifactVersion("2.0.5"); assertTrue(enforceVersion("2.0.5", actualVersion)); assertTrue(enforceVersion("2.0.4", actualVersion)); @@ -723,13 +723,13 @@ public boolean enforceVersion(String requiredVersionRange, ArtifactVersion actua } @Test - public void testOrder0() { + void testOrder0() { // assertTrue( new DefaultArtifactVersion( "1.0-alpha10" ).compareTo( new DefaultArtifactVersion( "1.0-alpha1" ) // ) > 0 ); } @Test - public void testCache() throws InvalidVersionSpecificationException { + void testCache() throws InvalidVersionSpecificationException { VersionRange range = VersionRange.createFromVersionSpec("[1.0,1.2]"); assertSame(range, VersionRange.createFromVersionSpec("[1.0,1.2]")); // same instance from spec cache diff --git a/maven-builder-support/src/test/java/org/apache/maven/building/DefaultProblemCollectorTest.java b/maven-builder-support/src/test/java/org/apache/maven/building/DefaultProblemCollectorTest.java index 9ff152c020..4ff6750e5a 100644 --- a/maven-builder-support/src/test/java/org/apache/maven/building/DefaultProblemCollectorTest.java +++ b/maven-builder-support/src/test/java/org/apache/maven/building/DefaultProblemCollectorTest.java @@ -25,10 +25,10 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; -public class DefaultProblemCollectorTest { +class DefaultProblemCollectorTest { @Test - public void testGetProblems() { + void testGetProblems() { DefaultProblemCollector collector = new DefaultProblemCollector(null); assertNotNull(collector.getProblems()); assertEquals(0, collector.getProblems().size()); @@ -56,7 +56,7 @@ public void testGetProblems() { } @Test - public void testSetSource() { + void testSetSource() { DefaultProblemCollector collector = new DefaultProblemCollector(null); collector.add(null, "PROBLEM1", -1, -1, null); diff --git a/maven-builder-support/src/test/java/org/apache/maven/building/DefaultProblemTest.java b/maven-builder-support/src/test/java/org/apache/maven/building/DefaultProblemTest.java index 4bbe56b891..3bd8a9aa9e 100644 --- a/maven-builder-support/src/test/java/org/apache/maven/building/DefaultProblemTest.java +++ b/maven-builder-support/src/test/java/org/apache/maven/building/DefaultProblemTest.java @@ -25,10 +25,10 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertSame; -public class DefaultProblemTest { +class DefaultProblemTest { @Test - public void testGetSeverity() { + void testGetSeverity() { DefaultProblem problem = new DefaultProblem(null, null, null, -1, -1, null); assertEquals(Severity.ERROR, problem.getSeverity()); @@ -43,7 +43,7 @@ public void testGetSeverity() { } @Test - public void testGetLineNumber() { + void testGetLineNumber() { DefaultProblem problem = new DefaultProblem(null, null, null, -1, -1, null); assertEquals(-1, problem.getLineNumber()); @@ -59,7 +59,7 @@ public void testGetLineNumber() { } @Test - public void testGetColumnNumber() { + void testGetColumnNumber() { DefaultProblem problem = new DefaultProblem(null, null, null, -1, -1, null); assertEquals(-1, problem.getColumnNumber()); @@ -75,7 +75,7 @@ public void testGetColumnNumber() { } @Test - public void testGetException() { + void testGetException() { DefaultProblem problem = new DefaultProblem(null, null, null, -1, -1, null); assertNull(problem.getException()); @@ -85,7 +85,7 @@ public void testGetException() { } @Test - public void testGetSource() { + void testGetSource() { DefaultProblem problem = new DefaultProblem(null, null, null, -1, -1, null); assertEquals("", problem.getSource()); @@ -97,7 +97,7 @@ public void testGetSource() { } @Test - public void testGetLocation() { + void testGetLocation() { DefaultProblem problem = new DefaultProblem(null, null, null, -1, -1, null); assertEquals("", problem.getLocation()); @@ -115,7 +115,7 @@ public void testGetLocation() { } @Test - public void testGetMessage() { + void testGetMessage() { DefaultProblem problem = new DefaultProblem("MESSAGE", null, null, -1, -1, null); assertEquals("MESSAGE", problem.getMessage()); diff --git a/maven-builder-support/src/test/java/org/apache/maven/building/FileSourceTest.java b/maven-builder-support/src/test/java/org/apache/maven/building/FileSourceTest.java index 1b10a24af8..cfdc9d7e57 100644 --- a/maven-builder-support/src/test/java/org/apache/maven/building/FileSourceTest.java +++ b/maven-builder-support/src/test/java/org/apache/maven/building/FileSourceTest.java @@ -27,17 +27,17 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; -public class FileSourceTest { +class FileSourceTest { @Test - public void testFileSource() { + void testFileSource() { NullPointerException e = assertThrows( NullPointerException.class, () -> new FileSource(null), "Should fail, since you must specify a file"); assertEquals("file cannot be null", e.getMessage()); } @Test - public void testGetInputStream() throws Exception { + void testGetInputStream() throws Exception { File txtFile = new File("target/test-classes/source.txt"); FileSource source = new FileSource(txtFile); @@ -49,14 +49,14 @@ public void testGetInputStream() throws Exception { } @Test - public void testGetLocation() { + void testGetLocation() { File txtFile = new File("target/test-classes/source.txt"); FileSource source = new FileSource(txtFile); assertEquals(txtFile.getAbsolutePath(), source.getLocation()); } @Test - public void testGetFile() { + void testGetFile() { File txtFile = new File("target/test-classes/source.txt"); FileSource source = new FileSource(txtFile); assertEquals(txtFile.getAbsoluteFile(), source.getFile()); diff --git a/maven-builder-support/src/test/java/org/apache/maven/building/ProblemCollectorFactoryTest.java b/maven-builder-support/src/test/java/org/apache/maven/building/ProblemCollectorFactoryTest.java index cefd06c124..6705992bef 100644 --- a/maven-builder-support/src/test/java/org/apache/maven/building/ProblemCollectorFactoryTest.java +++ b/maven-builder-support/src/test/java/org/apache/maven/building/ProblemCollectorFactoryTest.java @@ -25,10 +25,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotSame; -public class ProblemCollectorFactoryTest { +class ProblemCollectorFactoryTest { @Test - public void testNewInstance() { + void testNewInstance() { ProblemCollector collector1 = ProblemCollectorFactory.newInstance(null); Problem problem = new DefaultProblem("MESSAGE1", null, null, -1, -1, null); diff --git a/maven-builder-support/src/test/java/org/apache/maven/building/StringSourceTest.java b/maven-builder-support/src/test/java/org/apache/maven/building/StringSourceTest.java index cfb6e0cbe5..8bd2a41587 100644 --- a/maven-builder-support/src/test/java/org/apache/maven/building/StringSourceTest.java +++ b/maven-builder-support/src/test/java/org/apache/maven/building/StringSourceTest.java @@ -25,9 +25,9 @@ import static org.junit.jupiter.api.Assertions.assertEquals; -public class StringSourceTest { +class StringSourceTest { @Test - public void testGetInputStream() throws Exception { + void testGetInputStream() throws Exception { StringSource source = new StringSource("Hello World!"); try (InputStream is = source.getInputStream(); @@ -37,7 +37,7 @@ public void testGetInputStream() throws Exception { } @Test - public void testGetLocation() { + void testGetLocation() { StringSource source = new StringSource("Hello World!"); assertEquals("(memory)", source.getLocation()); @@ -46,7 +46,7 @@ public void testGetLocation() { } @Test - public void testGetContent() { + void testGetContent() { StringSource source = new StringSource(null); assertEquals("", source.getContent()); diff --git a/maven-builder-support/src/test/java/org/apache/maven/building/UrlSourceTest.java b/maven-builder-support/src/test/java/org/apache/maven/building/UrlSourceTest.java index bb1455f987..216c5d7c72 100644 --- a/maven-builder-support/src/test/java/org/apache/maven/building/UrlSourceTest.java +++ b/maven-builder-support/src/test/java/org/apache/maven/building/UrlSourceTest.java @@ -28,17 +28,17 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; -public class UrlSourceTest { +class UrlSourceTest { @Test - public void testUrlSource() { + void testUrlSource() { NullPointerException e = assertThrows( NullPointerException.class, () -> new UrlSource(null), "Should fail, since you must specify a url"); assertEquals("url cannot be null", e.getMessage()); } @Test - public void testGetInputStream() throws Exception { + void testGetInputStream() throws Exception { URL txtFile = new File("target/test-classes/source.txt").toURI().toURL(); UrlSource source = new UrlSource(txtFile); try (InputStream is = source.getInputStream(); @@ -48,7 +48,7 @@ public void testGetInputStream() throws Exception { } @Test - public void testGetLocation() throws Exception { + void testGetLocation() throws Exception { URL txtFile = new File("target/test-classes/source.txt").toURI().toURL(); UrlSource source = new UrlSource(txtFile); assertEquals(txtFile.toExternalForm(), source.getLocation()); diff --git a/maven-compat/src/test/java/org/apache/maven/artifact/deployer/ArtifactDeployerTest.java b/maven-compat/src/test/java/org/apache/maven/artifact/deployer/ArtifactDeployerTest.java index d34af30fdd..9684a260d2 100644 --- a/maven-compat/src/test/java/org/apache/maven/artifact/deployer/ArtifactDeployerTest.java +++ b/maven-compat/src/test/java/org/apache/maven/artifact/deployer/ArtifactDeployerTest.java @@ -39,7 +39,7 @@ /** * @author Jason van Zyl */ -public class ArtifactDeployerTest extends AbstractArtifactComponentTestCase { +class ArtifactDeployerTest extends AbstractArtifactComponentTestCase { @Inject private ArtifactDeployer artifactDeployer; @@ -51,7 +51,7 @@ protected String component() { } @Test - public void testArtifactInstallation() throws Exception { + void testArtifactInstallation() throws Exception { sessionScope.enter(); try { sessionScope.seed(MavenSession.class, mock(MavenSession.class)); diff --git a/maven-compat/src/test/java/org/apache/maven/artifact/factory/DefaultArtifactFactoryTest.java b/maven-compat/src/test/java/org/apache/maven/artifact/factory/DefaultArtifactFactoryTest.java index 216ea37807..8e1974735c 100644 --- a/maven-compat/src/test/java/org/apache/maven/artifact/factory/DefaultArtifactFactoryTest.java +++ b/maven-compat/src/test/java/org/apache/maven/artifact/factory/DefaultArtifactFactoryTest.java @@ -28,13 +28,13 @@ import static org.junit.jupiter.api.Assertions.assertEquals; @PlexusTest -public class DefaultArtifactFactoryTest { +class DefaultArtifactFactoryTest { @Inject ArtifactFactory factory; @Test - public void testPropagationOfSystemScopeRegardlessOfInheritedScope() { + void testPropagationOfSystemScopeRegardlessOfInheritedScope() { Artifact artifact = factory.createDependencyArtifact( "test-grp", "test-artifact", VersionRange.createFromVersion("1.0"), "type", null, "system", "provided"); Artifact artifact2 = factory.createDependencyArtifact( diff --git a/maven-compat/src/test/java/org/apache/maven/artifact/installer/ArtifactInstallerTest.java b/maven-compat/src/test/java/org/apache/maven/artifact/installer/ArtifactInstallerTest.java index 2d1215176a..6aef8c3521 100644 --- a/maven-compat/src/test/java/org/apache/maven/artifact/installer/ArtifactInstallerTest.java +++ b/maven-compat/src/test/java/org/apache/maven/artifact/installer/ArtifactInstallerTest.java @@ -34,7 +34,7 @@ /** * @author Jason van Zyl */ -public class ArtifactInstallerTest extends AbstractArtifactComponentTestCase { +class ArtifactInstallerTest extends AbstractArtifactComponentTestCase { @Inject private ArtifactInstaller artifactInstaller; @@ -46,7 +46,7 @@ protected String component() { } @Test - public void testArtifactInstallation() throws Exception { + void testArtifactInstallation() throws Exception { sessionScope.enter(); try { sessionScope.seed(MavenSession.class, mock(MavenSession.class)); diff --git a/maven-compat/src/test/java/org/apache/maven/artifact/repository/MavenArtifactRepositoryTest.java b/maven-compat/src/test/java/org/apache/maven/artifact/repository/MavenArtifactRepositoryTest.java index 77cf7236e9..9ba2d57299 100644 --- a/maven-compat/src/test/java/org/apache/maven/artifact/repository/MavenArtifactRepositoryTest.java +++ b/maven-compat/src/test/java/org/apache/maven/artifact/repository/MavenArtifactRepositoryTest.java @@ -23,7 +23,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -public class MavenArtifactRepositoryTest { +class MavenArtifactRepositoryTest { private static class MavenArtifactRepositorySubclass extends MavenArtifactRepository { String id; @@ -38,7 +38,7 @@ public String getId() { } @Test - public void testHashCodeEquals() { + void testHashCodeEquals() { MavenArtifactRepositorySubclass r1 = new MavenArtifactRepositorySubclass("foo"); MavenArtifactRepositorySubclass r2 = new MavenArtifactRepositorySubclass("foo"); MavenArtifactRepositorySubclass r3 = new MavenArtifactRepositorySubclass("bar"); diff --git a/maven-compat/src/test/java/org/apache/maven/artifact/resolver/ArtifactResolutionExceptionTest.java b/maven-compat/src/test/java/org/apache/maven/artifact/resolver/ArtifactResolutionExceptionTest.java index 440e8c1a81..6e674e5fdd 100644 --- a/maven-compat/src/test/java/org/apache/maven/artifact/resolver/ArtifactResolutionExceptionTest.java +++ b/maven-compat/src/test/java/org/apache/maven/artifact/resolver/ArtifactResolutionExceptionTest.java @@ -30,11 +30,11 @@ * * @author Mauro Talevi */ -public class ArtifactResolutionExceptionTest { +class ArtifactResolutionExceptionTest { private static final String LS = System.lineSeparator(); @Test - public void testMissingArtifactMessageFormat() { + void testMissingArtifactMessageFormat() { String message = "Missing artifact"; String indentation = " "; String groupId = "aGroupId"; diff --git a/maven-compat/src/test/java/org/apache/maven/artifact/resolver/ArtifactResolverTest.java b/maven-compat/src/test/java/org/apache/maven/artifact/resolver/ArtifactResolverTest.java index 9ed4e43f3a..e760a37aa4 100644 --- a/maven-compat/src/test/java/org/apache/maven/artifact/resolver/ArtifactResolverTest.java +++ b/maven-compat/src/test/java/org/apache/maven/artifact/resolver/ArtifactResolverTest.java @@ -52,7 +52,7 @@ /** * @author Jason van Zyl */ -public class ArtifactResolverTest extends AbstractArtifactComponentTestCase { +class ArtifactResolverTest extends AbstractArtifactComponentTestCase { @Inject private ArtifactResolver artifactResolver; @@ -79,7 +79,7 @@ protected String component() { } @Test - public void testResolutionOfASingleArtifactWhereTheArtifactIsPresentInTheLocalRepository() throws Exception { + void testResolutionOfASingleArtifactWhereTheArtifactIsPresentInTheLocalRepository() throws Exception { Artifact a = createLocalArtifact("a", "1.0"); artifactResolver.resolve(a, remoteRepositories(), localRepository()); @@ -88,9 +88,8 @@ public void testResolutionOfASingleArtifactWhereTheArtifactIsPresentInTheLocalRe } @Test - public void - testResolutionOfASingleArtifactWhereTheArtifactIsNotPresentLocallyAndMustBeRetrievedFromTheRemoteRepository() - throws Exception { + void testResolutionOfASingleArtifactWhereTheArtifactIsNotPresentLocallyAndMustBeRetrievedFromTheRemoteRepository() + throws Exception { Artifact b = createRemoteArtifact("b", "1.0-SNAPSHOT"); deleteLocalArtifact(b); artifactResolver.resolve(b, remoteRepositories(), localRepository()); @@ -104,7 +103,7 @@ protected Artifact createArtifact(String groupId, String artifactId, String vers } @Test - public void testTransitiveResolutionWhereAllArtifactsArePresentInTheLocalRepository() throws Exception { + void testTransitiveResolutionWhereAllArtifactsArePresentInTheLocalRepository() throws Exception { Artifact g = createLocalArtifact("g", "1.0"); Artifact h = createLocalArtifact("h", "1.0"); @@ -126,7 +125,7 @@ public void testTransitiveResolutionWhereAllArtifactsArePresentInTheLocalReposit } @Test - public void + void testTransitiveResolutionWhereAllArtifactsAreNotPresentInTheLocalRepositoryAndMustBeRetrievedFromTheRemoteRepository() throws Exception { Artifact i = createRemoteArtifact("i", "1.0-SNAPSHOT"); @@ -152,7 +151,7 @@ public void testTransitiveResolutionWhereAllArtifactsArePresentInTheLocalReposit } @Test - public void testResolutionFailureWhenArtifactNotPresentInRemoteRepository() throws Exception { + void testResolutionFailureWhenArtifactNotPresentInRemoteRepository() throws Exception { Artifact k = createArtifact("k", "1.0"); assertThrows( @@ -162,7 +161,7 @@ public void testResolutionFailureWhenArtifactNotPresentInRemoteRepository() thro } @Test - public void testResolutionOfAnArtifactWhereOneRemoteRepositoryIsBadButOneIsGood() throws Exception { + void testResolutionOfAnArtifactWhereOneRemoteRepositoryIsBadButOneIsGood() throws Exception { Artifact l = createRemoteArtifact("l", "1.0-SNAPSHOT"); deleteLocalArtifact(l); @@ -187,7 +186,7 @@ public void testReadRepoFromModel() throws Exception { } @Test - public void testTransitiveResolutionOrder() throws Exception { + void testTransitiveResolutionOrder() throws Exception { Artifact m = createLocalArtifact("m", "1.0"); Artifact n = createLocalArtifact("n", "1.0"); diff --git a/maven-compat/src/test/java/org/apache/maven/artifact/resolver/DefaultArtifactResolverTest.java b/maven-compat/src/test/java/org/apache/maven/artifact/resolver/DefaultArtifactResolverTest.java index 4ff3d02d1b..f1a6f770d8 100644 --- a/maven-compat/src/test/java/org/apache/maven/artifact/resolver/DefaultArtifactResolverTest.java +++ b/maven-compat/src/test/java/org/apache/maven/artifact/resolver/DefaultArtifactResolverTest.java @@ -30,7 +30,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; -public class DefaultArtifactResolverTest extends AbstractArtifactComponentTestCase { +class DefaultArtifactResolverTest extends AbstractArtifactComponentTestCase { @Inject private ArtifactResolver artifactResolver; @@ -49,7 +49,7 @@ protected String component() { } @Test - public void testMNG4738() throws Exception { + void testMNG4738() throws Exception { Artifact g = createLocalArtifact("g", "1.0"); createLocalArtifact("h", "1.0"); artifactResolver.resolveTransitively( @@ -88,7 +88,7 @@ public void testMNG4738() throws Exception { } @Test - public void testLookup() throws Exception { + void testLookup() throws Exception { ArtifactResolver resolver = getContainer().lookup(ArtifactResolver.class, "default"); } } diff --git a/maven-compat/src/test/java/org/apache/maven/artifact/resolver/filter/AndArtifactFilterTest.java b/maven-compat/src/test/java/org/apache/maven/artifact/resolver/filter/AndArtifactFilterTest.java index f6738d701f..724371c68d 100644 --- a/maven-compat/src/test/java/org/apache/maven/artifact/resolver/filter/AndArtifactFilterTest.java +++ b/maven-compat/src/test/java/org/apache/maven/artifact/resolver/filter/AndArtifactFilterTest.java @@ -31,14 +31,14 @@ * * @author Benjamin Bentmann */ -public class AndArtifactFilterTest { +class AndArtifactFilterTest { private ArtifactFilter newSubFilter() { return artifact -> false; } @Test - public void testEquals() { + void testEquals() { AndArtifactFilter filter1 = new AndArtifactFilter(); AndArtifactFilter filter2 = new AndArtifactFilter(Arrays.asList(newSubFilter())); diff --git a/maven-compat/src/test/java/org/apache/maven/artifact/resolver/filter/FilterHashEqualsTest.java b/maven-compat/src/test/java/org/apache/maven/artifact/resolver/filter/FilterHashEqualsTest.java index 704e6e9771..4212d68d1b 100644 --- a/maven-compat/src/test/java/org/apache/maven/artifact/resolver/filter/FilterHashEqualsTest.java +++ b/maven-compat/src/test/java/org/apache/maven/artifact/resolver/filter/FilterHashEqualsTest.java @@ -28,10 +28,10 @@ /** * @author Igor Fedorenko */ -public class FilterHashEqualsTest { +class FilterHashEqualsTest { @Test - public void testIncludesExcludesArtifactFilter() { + void testIncludesExcludesArtifactFilter() { List patterns = Arrays.asList("c", "d", "e"); IncludesArtifactFilter f1 = new IncludesArtifactFilter(patterns); diff --git a/maven-compat/src/test/java/org/apache/maven/artifact/resolver/filter/OrArtifactFilterTest.java b/maven-compat/src/test/java/org/apache/maven/artifact/resolver/filter/OrArtifactFilterTest.java index 87c15eced3..6a2fe13479 100644 --- a/maven-compat/src/test/java/org/apache/maven/artifact/resolver/filter/OrArtifactFilterTest.java +++ b/maven-compat/src/test/java/org/apache/maven/artifact/resolver/filter/OrArtifactFilterTest.java @@ -31,14 +31,14 @@ * * @author Benjamin Bentmann */ -public class OrArtifactFilterTest { +class OrArtifactFilterTest { private ArtifactFilter newSubFilter() { return artifact -> false; } @Test - public void testEquals() { + void testEquals() { OrArtifactFilter filter1 = new OrArtifactFilter(); OrArtifactFilter filter2 = new OrArtifactFilter(Arrays.asList(newSubFilter())); diff --git a/maven-compat/src/test/java/org/apache/maven/artifact/resolver/filter/ScopeArtifactFilterTest.java b/maven-compat/src/test/java/org/apache/maven/artifact/resolver/filter/ScopeArtifactFilterTest.java index 08ff3157c7..5bc77d6c33 100644 --- a/maven-compat/src/test/java/org/apache/maven/artifact/resolver/filter/ScopeArtifactFilterTest.java +++ b/maven-compat/src/test/java/org/apache/maven/artifact/resolver/filter/ScopeArtifactFilterTest.java @@ -30,14 +30,14 @@ * * @author Benjamin Bentmann */ -public class ScopeArtifactFilterTest { +class ScopeArtifactFilterTest { private Artifact newArtifact(String scope) { return new DefaultArtifact("g", "a", "1.0", scope, "jar", "", null); } @Test - public void testInclude_Compile() { + void testInclude_Compile() { ScopeArtifactFilter filter = new ScopeArtifactFilter(Artifact.SCOPE_COMPILE); assertTrue(filter.include(newArtifact(Artifact.SCOPE_COMPILE))); @@ -48,7 +48,7 @@ public void testInclude_Compile() { } @Test - public void testInclude_CompilePlusRuntime() { + void testInclude_CompilePlusRuntime() { ScopeArtifactFilter filter = new ScopeArtifactFilter(Artifact.SCOPE_COMPILE_PLUS_RUNTIME); assertTrue(filter.include(newArtifact(Artifact.SCOPE_COMPILE))); @@ -59,7 +59,7 @@ public void testInclude_CompilePlusRuntime() { } @Test - public void testInclude_Runtime() { + void testInclude_Runtime() { ScopeArtifactFilter filter = new ScopeArtifactFilter(Artifact.SCOPE_RUNTIME); assertTrue(filter.include(newArtifact(Artifact.SCOPE_COMPILE))); @@ -70,7 +70,7 @@ public void testInclude_Runtime() { } @Test - public void testInclude_RuntimePlusSystem() { + void testInclude_RuntimePlusSystem() { ScopeArtifactFilter filter = new ScopeArtifactFilter(Artifact.SCOPE_RUNTIME_PLUS_SYSTEM); assertTrue(filter.include(newArtifact(Artifact.SCOPE_COMPILE))); @@ -81,7 +81,7 @@ public void testInclude_RuntimePlusSystem() { } @Test - public void testInclude_Test() { + void testInclude_Test() { ScopeArtifactFilter filter = new ScopeArtifactFilter(Artifact.SCOPE_TEST); assertTrue(filter.include(newArtifact(Artifact.SCOPE_COMPILE))); diff --git a/maven-compat/src/test/java/org/apache/maven/artifact/transform/TransformationManagerTest.java b/maven-compat/src/test/java/org/apache/maven/artifact/transform/TransformationManagerTest.java index f93e584d47..54323d4250 100644 --- a/maven-compat/src/test/java/org/apache/maven/artifact/transform/TransformationManagerTest.java +++ b/maven-compat/src/test/java/org/apache/maven/artifact/transform/TransformationManagerTest.java @@ -35,12 +35,12 @@ /** @author Jason van Zyl */ @PlexusTest -public class TransformationManagerTest { +class TransformationManagerTest { @Inject ArtifactTransformationManager tm; @Test - public void testTransformationManager() { + void testTransformationManager() { List tms = tm.getArtifactTransformations(); assertEquals(3, tms.size()); diff --git a/maven-compat/src/test/java/org/apache/maven/profiles/manager/DefaultProfileManagerTest.java b/maven-compat/src/test/java/org/apache/maven/profiles/manager/DefaultProfileManagerTest.java index e50b0d7baa..22ebf8122d 100644 --- a/maven-compat/src/test/java/org/apache/maven/profiles/manager/DefaultProfileManagerTest.java +++ b/maven-compat/src/test/java/org/apache/maven/profiles/manager/DefaultProfileManagerTest.java @@ -37,7 +37,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; @PlexusTest -public class DefaultProfileManagerTest { +class DefaultProfileManagerTest { @Inject PlexusContainer container; @@ -47,7 +47,7 @@ protected PlexusContainer getContainer() { } @Test - public void testShouldActivateDefaultProfile() throws Exception { + void testShouldActivateDefaultProfile() throws Exception { Profile notActivated = new Profile(); notActivated.setId("notActivated"); @@ -81,7 +81,7 @@ public void testShouldActivateDefaultProfile() throws Exception { } @Test - public void testShouldNotActivateDefaultProfile() throws Exception { + void testShouldNotActivateDefaultProfile() throws Exception { Profile syspropActivated = new Profile(); syspropActivated.setId("syspropActivated"); @@ -118,7 +118,7 @@ public void testShouldNotActivateDefaultProfile() throws Exception { } @Test - public void testShouldNotActivateReversalOfPresentSystemProperty() throws Exception { + void testShouldNotActivateReversalOfPresentSystemProperty() throws Exception { Profile syspropActivated = new Profile(); syspropActivated.setId("syspropActivated"); @@ -144,7 +144,7 @@ public void testShouldNotActivateReversalOfPresentSystemProperty() throws Except } @Test - public void testShouldOverrideAndActivateInactiveProfile() throws Exception { + void testShouldOverrideAndActivateInactiveProfile() throws Exception { Profile syspropActivated = new Profile(); syspropActivated.setId("syspropActivated"); @@ -173,7 +173,7 @@ public void testShouldOverrideAndActivateInactiveProfile() throws Exception { } @Test - public void testShouldOverrideAndDeactivateActiveProfile() throws Exception { + void testShouldOverrideAndDeactivateActiveProfile() throws Exception { Profile syspropActivated = new Profile(); syspropActivated.setId("syspropActivated"); @@ -202,7 +202,7 @@ public void testShouldOverrideAndDeactivateActiveProfile() throws Exception { @Test @Disabled - public void testOsActivationProfile() throws Exception { + void testOsActivationProfile() throws Exception { /* Profile osActivated = new Profile(); osActivated.setId( "os-profile" ); diff --git a/maven-compat/src/test/java/org/apache/maven/project/ProjectClasspathTest.java b/maven-compat/src/test/java/org/apache/maven/project/ProjectClasspathTest.java index d85bae13f6..41fc6ae6df 100644 --- a/maven-compat/src/test/java/org/apache/maven/project/ProjectClasspathTest.java +++ b/maven-compat/src/test/java/org/apache/maven/project/ProjectClasspathTest.java @@ -32,7 +32,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; -public class ProjectClasspathTest extends AbstractMavenProjectTestCase { +class ProjectClasspathTest extends AbstractMavenProjectTestCase { static final String dir = "projects/scope/"; @Override @@ -51,7 +51,7 @@ public void setUp() throws Exception { } @Test - public void testProjectClasspath() throws Exception { + void testProjectClasspath() throws Exception { File f = getFileForClasspathResource(dir + "project-with-scoped-dependencies.xml"); MavenProject project = getProjectWithDependencies(f); diff --git a/maven-compat/src/test/java/org/apache/maven/project/inheritance/t00/ProjectInheritanceTest.java b/maven-compat/src/test/java/org/apache/maven/project/inheritance/t00/ProjectInheritanceTest.java index 45830f0c88..22d9ae9ade 100644 --- a/maven-compat/src/test/java/org/apache/maven/project/inheritance/t00/ProjectInheritanceTest.java +++ b/maven-compat/src/test/java/org/apache/maven/project/inheritance/t00/ProjectInheritanceTest.java @@ -35,7 +35,7 @@ * * @author Jason van Zyl */ -public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { +class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { // ---------------------------------------------------------------------- // // p4 inherits from p3 @@ -51,7 +51,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { // ---------------------------------------------------------------------- @Test - public void testProjectInheritance() throws Exception { + void testProjectInheritance() throws Exception { MavenProject p4 = getProject(projectFile("p4")); assertEquals("p4", p4.getName()); diff --git a/maven-compat/src/test/java/org/apache/maven/project/inheritance/t01/ProjectInheritanceTest.java b/maven-compat/src/test/java/org/apache/maven/project/inheritance/t01/ProjectInheritanceTest.java index 4aa25efc30..dd78af724b 100644 --- a/maven-compat/src/test/java/org/apache/maven/project/inheritance/t01/ProjectInheritanceTest.java +++ b/maven-compat/src/test/java/org/apache/maven/project/inheritance/t01/ProjectInheritanceTest.java @@ -31,7 +31,7 @@ * * @author Jason van Zyl */ -public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { +class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { // ---------------------------------------------------------------------- // // p4 inherits from p3 @@ -47,7 +47,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { // ---------------------------------------------------------------------- @Test - public void testProjectInheritance() throws Exception { + void testProjectInheritance() throws Exception { // ---------------------------------------------------------------------- // Check p0 value for org name // ---------------------------------------------------------------------- diff --git a/maven-compat/src/test/java/org/apache/maven/project/inheritance/t02/ProjectInheritanceTest.java b/maven-compat/src/test/java/org/apache/maven/project/inheritance/t02/ProjectInheritanceTest.java index 850efcd662..b16c8946d6 100644 --- a/maven-compat/src/test/java/org/apache/maven/project/inheritance/t02/ProjectInheritanceTest.java +++ b/maven-compat/src/test/java/org/apache/maven/project/inheritance/t02/ProjectInheritanceTest.java @@ -45,7 +45,7 @@ * * @author Jason van Zyl */ -public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { +class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { // ---------------------------------------------------------------------- // // p4 inherits from p3 @@ -61,7 +61,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { // ---------------------------------------------------------------------- @Test - public void testProjectInheritance() throws Exception { + void testProjectInheritance() throws Exception { File localRepo = getLocalRepositoryPath(); System.out.println("Local repository is at: " + localRepo.getAbsolutePath()); diff --git a/maven-compat/src/test/java/org/apache/maven/project/inheritance/t03/ProjectInheritanceTest.java b/maven-compat/src/test/java/org/apache/maven/project/inheritance/t03/ProjectInheritanceTest.java index 90e62e53ae..eb5e885026 100644 --- a/maven-compat/src/test/java/org/apache/maven/project/inheritance/t03/ProjectInheritanceTest.java +++ b/maven-compat/src/test/java/org/apache/maven/project/inheritance/t03/ProjectInheritanceTest.java @@ -37,7 +37,7 @@ * * @author Jason van Zyl */ -public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { +class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { // ---------------------------------------------------------------------- // // p1 inherits from p0 @@ -50,7 +50,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { // ---------------------------------------------------------------------- @Test - public void testProjectInheritance() throws Exception { + void testProjectInheritance() throws Exception { File localRepo = getLocalRepositoryPath(); File pom0 = new File(localRepo, "p0/pom.xml"); diff --git a/maven-compat/src/test/java/org/apache/maven/project/inheritance/t04/ProjectInheritanceTest.java b/maven-compat/src/test/java/org/apache/maven/project/inheritance/t04/ProjectInheritanceTest.java index 0bb7cec02e..e1920a6676 100644 --- a/maven-compat/src/test/java/org/apache/maven/project/inheritance/t04/ProjectInheritanceTest.java +++ b/maven-compat/src/test/java/org/apache/maven/project/inheritance/t04/ProjectInheritanceTest.java @@ -37,7 +37,7 @@ * * @author Patrick Schneider */ -public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { +class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { // ---------------------------------------------------------------------- // // p1 inherits from p0 @@ -54,7 +54,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { // ---------------------------------------------------------------------- @Test - public void testDependencyManagementOverridesTransitiveDependencyVersion() throws Exception { + void testDependencyManagementOverridesTransitiveDependencyVersion() throws Exception { File localRepo = getLocalRepositoryPath(); File pom0 = new File(localRepo, "p0/pom.xml"); File pom0Basedir = pom0.getParentFile(); diff --git a/maven-compat/src/test/java/org/apache/maven/project/inheritance/t05/ProjectInheritanceTest.java b/maven-compat/src/test/java/org/apache/maven/project/inheritance/t05/ProjectInheritanceTest.java index d8df6f97e9..c362f39ea0 100644 --- a/maven-compat/src/test/java/org/apache/maven/project/inheritance/t05/ProjectInheritanceTest.java +++ b/maven-compat/src/test/java/org/apache/maven/project/inheritance/t05/ProjectInheritanceTest.java @@ -35,7 +35,7 @@ * * @author Ralph Goers */ -public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { +class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { // ---------------------------------------------------------------------- // // p1 inherits from p0 @@ -48,7 +48,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { // ---------------------------------------------------------------------- @Test - public void testDependencyManagement() throws Exception { + void testDependencyManagement() throws Exception { File localRepo = getLocalRepositoryPath(); File pom0 = new File(localRepo, "p0/pom.xml"); diff --git a/maven-compat/src/test/java/org/apache/maven/project/inheritance/t06/ProjectInheritanceTest.java b/maven-compat/src/test/java/org/apache/maven/project/inheritance/t06/ProjectInheritanceTest.java index 97ebf2892a..6b89a27be6 100644 --- a/maven-compat/src/test/java/org/apache/maven/project/inheritance/t06/ProjectInheritanceTest.java +++ b/maven-compat/src/test/java/org/apache/maven/project/inheritance/t06/ProjectInheritanceTest.java @@ -36,7 +36,7 @@ * * @author Ralph Goers */ -public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { +class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { // ---------------------------------------------------------------------- // // p1 inherits from p0 @@ -49,7 +49,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { // ---------------------------------------------------------------------- @Test - public void testDependencyManagement() throws Exception { + void testDependencyManagement() throws Exception { File localRepo = getLocalRepositoryPath(); File pom0 = new File(localRepo, "p0/pom.xml"); diff --git a/maven-compat/src/test/java/org/apache/maven/project/inheritance/t07/ProjectInheritanceTest.java b/maven-compat/src/test/java/org/apache/maven/project/inheritance/t07/ProjectInheritanceTest.java index 49a90dd181..ca68ae8a2f 100644 --- a/maven-compat/src/test/java/org/apache/maven/project/inheritance/t07/ProjectInheritanceTest.java +++ b/maven-compat/src/test/java/org/apache/maven/project/inheritance/t07/ProjectInheritanceTest.java @@ -36,7 +36,7 @@ * * @author Jason van Zyl */ -public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { +class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { // ---------------------------------------------------------------------- // // p1 inherits from p0 @@ -49,7 +49,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { // ---------------------------------------------------------------------- @Test - public void testDependencyManagement() throws Exception { + void testDependencyManagement() throws Exception { File localRepo = getLocalRepositoryPath(); File pom0 = new File(localRepo, "p0/pom.xml"); diff --git a/maven-compat/src/test/java/org/apache/maven/project/inheritance/t08/ProjectInheritanceTest.java b/maven-compat/src/test/java/org/apache/maven/project/inheritance/t08/ProjectInheritanceTest.java index eb993e12ac..b5e6e70ab3 100644 --- a/maven-compat/src/test/java/org/apache/maven/project/inheritance/t08/ProjectInheritanceTest.java +++ b/maven-compat/src/test/java/org/apache/maven/project/inheritance/t08/ProjectInheritanceTest.java @@ -36,7 +36,7 @@ * * @author Ralph Goers */ -public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { +class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { // ---------------------------------------------------------------------- // // p1 inherits from p0 @@ -49,7 +49,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { // ---------------------------------------------------------------------- @Test - public void testDependencyManagement() throws Exception { + void testDependencyManagement() throws Exception { File localRepo = getLocalRepositoryPath(); File pom0 = new File(localRepo, "p0/pom.xml"); diff --git a/maven-compat/src/test/java/org/apache/maven/project/inheritance/t09/ProjectInheritanceTest.java b/maven-compat/src/test/java/org/apache/maven/project/inheritance/t09/ProjectInheritanceTest.java index 8de5dedc57..f0849a695f 100644 --- a/maven-compat/src/test/java/org/apache/maven/project/inheritance/t09/ProjectInheritanceTest.java +++ b/maven-compat/src/test/java/org/apache/maven/project/inheritance/t09/ProjectInheritanceTest.java @@ -36,7 +36,7 @@ * * @author Patrick Schneider */ -public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { +class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { // ---------------------------------------------------------------------- // // p1 inherits from p0 @@ -61,7 +61,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { * a & b only. */ @Test - public void testDependencyManagementExclusionsExcludeTransitively() throws Exception { + void testDependencyManagementExclusionsExcludeTransitively() throws Exception { File localRepo = getLocalRepositoryPath(); File pom0 = new File(localRepo, "p0/pom.xml"); @@ -96,7 +96,7 @@ public void testDependencyManagementExclusionsExcludeTransitively() throws Excep * @throws Exception */ @Test - public void testDependencyManagementExclusionDoesNotOverrideGloballyForTransitives() throws Exception { + void testDependencyManagementExclusionDoesNotOverrideGloballyForTransitives() throws Exception { File localRepo = getLocalRepositoryPath(); File pom0 = new File(localRepo, "p0/pom.xml"); diff --git a/maven-compat/src/test/java/org/apache/maven/project/inheritance/t10/ProjectInheritanceTest.java b/maven-compat/src/test/java/org/apache/maven/project/inheritance/t10/ProjectInheritanceTest.java index 5298cd590b..3d4a24ca0e 100644 --- a/maven-compat/src/test/java/org/apache/maven/project/inheritance/t10/ProjectInheritanceTest.java +++ b/maven-compat/src/test/java/org/apache/maven/project/inheritance/t10/ProjectInheritanceTest.java @@ -42,7 +42,7 @@ * * @author Patrick Schneider */ -public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { +class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { // ---------------------------------------------------------------------- // // p1 inherits from p0 @@ -55,7 +55,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { // ---------------------------------------------------------------------- @Test - public void testDependencyManagementOverridesTransitiveDependencyVersion() throws Exception { + void testDependencyManagementOverridesTransitiveDependencyVersion() throws Exception { File localRepo = getLocalRepositoryPath(); File pom0 = new File(localRepo, "p0/pom.xml"); diff --git a/maven-compat/src/test/java/org/apache/maven/project/inheritance/t11/ProjectInheritanceTest.java b/maven-compat/src/test/java/org/apache/maven/project/inheritance/t11/ProjectInheritanceTest.java index 0b1b0eea8d..34f08720eb 100644 --- a/maven-compat/src/test/java/org/apache/maven/project/inheritance/t11/ProjectInheritanceTest.java +++ b/maven-compat/src/test/java/org/apache/maven/project/inheritance/t11/ProjectInheritanceTest.java @@ -33,7 +33,7 @@ * @author Patrick Schneider * @see MNG-2919 */ -public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { +class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { // ---------------------------------------------------------------------- // // p1 inherits from p0 @@ -46,7 +46,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { // ---------------------------------------------------------------------- @Test - public void testDependencyManagementDoesNotOverrideScopeOfCurrentArtifact() throws Exception { + void testDependencyManagementDoesNotOverrideScopeOfCurrentArtifact() throws Exception { File localRepo = getLocalRepositoryPath(); File pom0 = new File(localRepo, "p0/pom.xml"); diff --git a/maven-compat/src/test/java/org/apache/maven/project/inheritance/t12/ProjectInheritanceTest.java b/maven-compat/src/test/java/org/apache/maven/project/inheritance/t12/ProjectInheritanceTest.java index 1629df2011..b5607de15d 100644 --- a/maven-compat/src/test/java/org/apache/maven/project/inheritance/t12/ProjectInheritanceTest.java +++ b/maven-compat/src/test/java/org/apache/maven/project/inheritance/t12/ProjectInheritanceTest.java @@ -33,7 +33,7 @@ * Verifies that plugin execution sections in the parent POM that have * inherit == false are not inherited to the child POM. */ -public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { +class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { // ---------------------------------------------------------------------- // // p1 inherits from p0 @@ -46,7 +46,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { // ---------------------------------------------------------------------- @Test - public void testFalsePluginExecutionInheritValue() throws Exception { + void testFalsePluginExecutionInheritValue() throws Exception { File localRepo = getLocalRepositoryPath(); File pom0 = new File(localRepo, "p0/pom.xml"); diff --git a/maven-compat/src/test/java/org/apache/maven/project/inheritance/t12scm/ProjectInheritanceTest.java b/maven-compat/src/test/java/org/apache/maven/project/inheritance/t12scm/ProjectInheritanceTest.java index 9c5c84aaa1..8b6e41b31b 100644 --- a/maven-compat/src/test/java/org/apache/maven/project/inheritance/t12scm/ProjectInheritanceTest.java +++ b/maven-compat/src/test/java/org/apache/maven/project/inheritance/t12scm/ProjectInheritanceTest.java @@ -31,7 +31,7 @@ * * @author jdcasey */ -public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { +class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { // ---------------------------------------------------------------------- // // p1 inherits from p0 @@ -44,7 +44,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { // ---------------------------------------------------------------------- @Test - public void testScmInfoCalculatedCorrectlyOnParentAndChildRead() throws Exception { + void testScmInfoCalculatedCorrectlyOnParentAndChildRead() throws Exception { File localRepo = getLocalRepositoryPath(); File pom0 = new File(localRepo, "p0/pom.xml"); @@ -74,7 +74,7 @@ public void testScmInfoCalculatedCorrectlyOnParentAndChildRead() throws Exceptio } @Test - public void testScmInfoCalculatedCorrectlyOnChildOnlyRead() throws Exception { + void testScmInfoCalculatedCorrectlyOnChildOnlyRead() throws Exception { File localRepo = getLocalRepositoryPath(); File pom1 = new File(localRepo, "p0/modules/p1/pom.xml"); diff --git a/maven-compat/src/test/java/org/apache/maven/project/path/DefaultPathTranslatorTest.java b/maven-compat/src/test/java/org/apache/maven/project/path/DefaultPathTranslatorTest.java index 4f95c428a9..4e4e822f75 100644 --- a/maven-compat/src/test/java/org/apache/maven/project/path/DefaultPathTranslatorTest.java +++ b/maven-compat/src/test/java/org/apache/maven/project/path/DefaultPathTranslatorTest.java @@ -25,10 +25,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals; @SuppressWarnings("deprecation") -public class DefaultPathTranslatorTest { +class DefaultPathTranslatorTest { @Test - public void testAlignToBasedirWhereBasedirExpressionIsTheCompleteValue() { + void testAlignToBasedirWhereBasedirExpressionIsTheCompleteValue() { File basedir = new File(System.getProperty("java.io.tmpdir"), "test").getAbsoluteFile(); String aligned = new DefaultPathTranslator().alignToBaseDirectory("${basedir}", basedir); @@ -37,7 +37,7 @@ public void testAlignToBasedirWhereBasedirExpressionIsTheCompleteValue() { } @Test - public void testAlignToBasedirWhereBasedirExpressionIsTheValuePrefix() { + void testAlignToBasedirWhereBasedirExpressionIsTheValuePrefix() { File basedir = new File(System.getProperty("java.io.tmpdir"), "test").getAbsoluteFile(); String aligned = new DefaultPathTranslator().alignToBaseDirectory("${basedir}/dir", basedir); @@ -46,7 +46,7 @@ public void testAlignToBasedirWhereBasedirExpressionIsTheValuePrefix() { } @Test - public void testUnalignToBasedirWherePathEqualsBasedir() { + void testUnalignToBasedirWherePathEqualsBasedir() { File basedir = new File(System.getProperty("java.io.tmpdir"), "test").getAbsoluteFile(); String unaligned = new DefaultPathTranslator().unalignFromBaseDirectory(basedir.getAbsolutePath(), basedir); diff --git a/maven-compat/src/test/java/org/apache/maven/repository/DefaultMirrorSelectorTest.java b/maven-compat/src/test/java/org/apache/maven/repository/DefaultMirrorSelectorTest.java index ff76421491..5efa70c409 100644 --- a/maven-compat/src/test/java/org/apache/maven/repository/DefaultMirrorSelectorTest.java +++ b/maven-compat/src/test/java/org/apache/maven/repository/DefaultMirrorSelectorTest.java @@ -24,9 +24,9 @@ import static org.junit.jupiter.api.Assertions.assertFalse; -public class DefaultMirrorSelectorTest { +class DefaultMirrorSelectorTest { @Test - public void testMirrorWithMirrorOfPatternContainingANegationIsNotSelected() { + void testMirrorWithMirrorOfPatternContainingANegationIsNotSelected() { ArtifactRepository repository = new DefaultArtifactRepository("snapshots.repo", "http://whatever", null); String pattern = "external:*, !snapshots.repo"; assertFalse(DefaultMirrorSelector.matchPattern(repository, pattern)); diff --git a/maven-compat/src/test/java/org/apache/maven/repository/LegacyRepositorySystemTest.java b/maven-compat/src/test/java/org/apache/maven/repository/LegacyRepositorySystemTest.java index 4c4e82bb23..2eda1b281e 100644 --- a/maven-compat/src/test/java/org/apache/maven/repository/LegacyRepositorySystemTest.java +++ b/maven-compat/src/test/java/org/apache/maven/repository/LegacyRepositorySystemTest.java @@ -55,7 +55,7 @@ * @author Benjamin Bentmann */ @PlexusTest -public class LegacyRepositorySystemTest { +class LegacyRepositorySystemTest { @Inject private RepositorySystem repositorySystem; @@ -89,7 +89,7 @@ protected ArtifactRepository getLocalRepository() throws Exception { } @Test - public void testThatASystemScopedDependencyIsNotResolvedFromRepositories() throws Exception { + void testThatASystemScopedDependencyIsNotResolvedFromRepositories() throws Exception { // // We should get a whole slew of dependencies resolving this artifact transitively // @@ -170,7 +170,7 @@ public void testThatASystemScopedDependencyIsNotResolvedFromRepositories() throw } @Test - public void testLocalRepositoryBasedir() throws Exception { + void testLocalRepositoryBasedir() throws Exception { File localRepoDir = new File("").getAbsoluteFile(); ArtifactRepository localRepo = repositorySystem.createLocalRepository(localRepoDir); diff --git a/maven-compat/src/test/java/org/apache/maven/repository/MirrorProcessorTest.java b/maven-compat/src/test/java/org/apache/maven/repository/MirrorProcessorTest.java index 0535e8faad..9b6c999bfb 100644 --- a/maven-compat/src/test/java/org/apache/maven/repository/MirrorProcessorTest.java +++ b/maven-compat/src/test/java/org/apache/maven/repository/MirrorProcessorTest.java @@ -36,7 +36,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; @PlexusTest -public class MirrorProcessorTest { +class MirrorProcessorTest { @Inject private DefaultMirrorSelector mirrorSelector; @@ -44,7 +44,7 @@ public class MirrorProcessorTest { private ArtifactRepositoryFactory repositorySystem; @Test - public void testExternalURL() { + void testExternalURL() { assertTrue(DefaultMirrorSelector.isExternalRepo(getRepo("foo", "http://somehost"))); assertTrue(DefaultMirrorSelector.isExternalRepo(getRepo("foo", "http://somehost:9090/somepath"))); assertTrue(DefaultMirrorSelector.isExternalRepo(getRepo("foo", "ftp://somehost"))); @@ -66,7 +66,7 @@ public void testExternalURL() { } @Test - public void testMirrorLookup() { + void testMirrorLookup() { Mirror mirrorA = newMirror("a", "a", "http://a"); Mirror mirrorB = newMirror("b", "b", "http://b"); @@ -80,7 +80,7 @@ public void testMirrorLookup() { } @Test - public void testMirrorWildcardLookup() { + void testMirrorWildcardLookup() { Mirror mirrorA = newMirror("a", "a", "http://a"); Mirror mirrorB = newMirror("b", "b", "http://b"); Mirror mirrorC = newMirror("c", "*", "http://wildcard"); @@ -95,7 +95,7 @@ public void testMirrorWildcardLookup() { } @Test - public void testMirrorStopOnFirstMatch() { + void testMirrorStopOnFirstMatch() { // exact matches win first Mirror mirrorA2 = newMirror("a2", "a,b", "http://a2"); Mirror mirrorA = newMirror("a", "a", "http://a"); @@ -123,7 +123,7 @@ public void testMirrorStopOnFirstMatch() { } @Test - public void testPatterns() { + void testPatterns() { assertTrue(DefaultMirrorSelector.matchPattern(getRepo("a"), "*")); assertTrue(DefaultMirrorSelector.matchPattern(getRepo("a"), "*,")); assertTrue(DefaultMirrorSelector.matchPattern(getRepo("a"), ",*,")); @@ -159,7 +159,7 @@ public void testPatterns() { } @Test - public void testPatternsWithExternal() { + void testPatternsWithExternal() { assertTrue(DefaultMirrorSelector.matchPattern(getRepo("a", "http://localhost"), "*")); assertFalse(DefaultMirrorSelector.matchPattern(getRepo("a", "http://localhost"), "external:*")); @@ -173,7 +173,7 @@ public void testPatternsWithExternal() { } @Test - public void testLayoutPattern() { + void testLayoutPattern() { assertTrue(DefaultMirrorSelector.matchesLayout("default", null)); assertTrue(DefaultMirrorSelector.matchesLayout("default", "")); assertTrue(DefaultMirrorSelector.matchesLayout("default", "*")); @@ -192,7 +192,7 @@ public void testLayoutPattern() { } @Test - public void testMirrorLayoutConsideredForMatching() { + void testMirrorLayoutConsideredForMatching() { ArtifactRepository repo = getRepo("a"); Mirror mirrorA = newMirror("a", "a", null, "http://a"); diff --git a/maven-compat/src/test/java/org/apache/maven/repository/legacy/DefaultUpdateCheckManagerTest.java b/maven-compat/src/test/java/org/apache/maven/repository/legacy/DefaultUpdateCheckManagerTest.java index 2fac20e5d8..78bc2814b9 100644 --- a/maven-compat/src/test/java/org/apache/maven/repository/legacy/DefaultUpdateCheckManagerTest.java +++ b/maven-compat/src/test/java/org/apache/maven/repository/legacy/DefaultUpdateCheckManagerTest.java @@ -39,7 +39,7 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; -public class DefaultUpdateCheckManagerTest extends AbstractArtifactComponentTestCase { +class DefaultUpdateCheckManagerTest extends AbstractArtifactComponentTestCase { @Inject private ArtifactFactory artifactFactory; @@ -60,7 +60,7 @@ public void setUp() throws Exception { } @Test - public void testArtifact() throws Exception { + void testArtifact() throws Exception { ArtifactRepository remoteRepository = remoteRepository(); ArtifactRepository localRepository = localRepository(); @@ -88,7 +88,7 @@ public void testArtifact() throws Exception { } @Test - public void testMissingArtifact() throws Exception { + void testMissingArtifact() throws Exception { ArtifactRepository remoteRepository = remoteRepository(); ArtifactRepository localRepository = localRepository(); @@ -113,7 +113,7 @@ public void testMissingArtifact() throws Exception { } @Test - public void testPom() throws Exception { + void testPom() throws Exception { ArtifactRepository remoteRepository = remoteRepository(); ArtifactRepository localRepository = localRepository(); @@ -141,7 +141,7 @@ public void testPom() throws Exception { } @Test - public void testMissingPom() throws Exception { + void testMissingPom() throws Exception { ArtifactRepository remoteRepository = remoteRepository(); ArtifactRepository localRepository = localRepository(); @@ -166,7 +166,7 @@ public void testMissingPom() throws Exception { } @Test - public void testMetadata() throws Exception { + void testMetadata() throws Exception { ArtifactRepository remoteRepository = remoteRepository(); ArtifactRepository localRepository = localRepository(); @@ -194,7 +194,7 @@ public void testMetadata() throws Exception { } @Test - public void testMissingMetadata() throws Exception { + void testMissingMetadata() throws Exception { ArtifactRepository remoteRepository = remoteRepository(); ArtifactRepository localRepository = localRepository(); @@ -220,7 +220,7 @@ public void testMissingMetadata() throws Exception { } @Test - public void testArtifactTouchFileName() throws Exception { + void testArtifactTouchFileName() throws Exception { ArtifactRepository localRepository = localRepository(); Artifact a = artifactFactory.createArtifactWithClassifier("groupId", "a", "0.0.1-SNAPSHOT", "jar", null); diff --git a/maven-compat/src/test/java/org/apache/maven/repository/legacy/DefaultWagonManagerTest.java b/maven-compat/src/test/java/org/apache/maven/repository/legacy/DefaultWagonManagerTest.java index 164b1739bf..87a94fad91 100644 --- a/maven-compat/src/test/java/org/apache/maven/repository/legacy/DefaultWagonManagerTest.java +++ b/maven-compat/src/test/java/org/apache/maven/repository/legacy/DefaultWagonManagerTest.java @@ -60,7 +60,7 @@ * @author Michal Maczka */ @PlexusTest -public class DefaultWagonManagerTest { +class DefaultWagonManagerTest { @Inject private WagonManager wagonManager; @@ -73,7 +73,7 @@ public class DefaultWagonManagerTest { private ArtifactRepositoryFactory artifactRepositoryFactory; @Test - public void testUnnecessaryRepositoryLookup() throws Exception { + void testUnnecessaryRepositoryLookup() throws Exception { Artifact artifact = createTestPomArtifact("target/test-data/get-missing-pom"); List repos = new ArrayList<>(); @@ -105,7 +105,7 @@ public void transferInitiated(TransferEvent transferEvent) { } @Test - public void testGetMissingJar() throws TransferFailedException, UnsupportedProtocolException, IOException { + void testGetMissingJar() throws TransferFailedException, UnsupportedProtocolException, IOException { Artifact artifact = createTestArtifact("target/test-data/get-missing-jar", "jar"); ArtifactRepository repo = createStringRepo(); @@ -116,7 +116,7 @@ public void testGetMissingJar() throws TransferFailedException, UnsupportedProto } @Test - public void testGetMissingJarForced() throws TransferFailedException, UnsupportedProtocolException, IOException { + void testGetMissingJarForced() throws TransferFailedException, UnsupportedProtocolException, IOException { Artifact artifact = createTestArtifact("target/test-data/get-missing-jar", "jar"); ArtifactRepository repo = createStringRepo(); @@ -127,7 +127,7 @@ public void testGetMissingJarForced() throws TransferFailedException, Unsupporte } @Test - public void testGetRemoteJar() + void testGetRemoteJar() throws TransferFailedException, ResourceDoesNotExistException, UnsupportedProtocolException, IOException { Artifact artifact = createTestArtifact("target/test-data/get-remote-jar", "jar"); @@ -198,7 +198,7 @@ private ArtifactRepository getRepo(String id) { } @Test - public void testDefaultWagonManager() throws Exception { + void testDefaultWagonManager() throws Exception { assertWagon("a"); assertWagon("b"); @@ -214,7 +214,7 @@ public void testDefaultWagonManager() throws Exception { * Check that transfer listeners are properly removed after getArtifact and putArtifact */ @Test - public void testWagonTransferListenerRemovedAfterGetArtifactAndPutArtifact() throws Exception { + void testWagonTransferListenerRemovedAfterGetArtifactAndPutArtifact() throws Exception { Artifact artifact = createTestArtifact("target/test-data/transfer-listener", "jar"); ArtifactRepository repo = createStringRepo(); StringWagon wagon = (StringWagon) wagonManager.getWagon("string"); @@ -248,7 +248,7 @@ public void testWagonTransferListenerRemovedAfterGetArtifactAndPutArtifact() thr */ @Disabled @Test - public void testChecksumVerification() throws Exception { + void testChecksumVerification() throws Exception { ArtifactRepositoryPolicy policy = new ArtifactRepositoryPolicy( true, ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS, ArtifactRepositoryPolicy.CHECKSUM_POLICY_FAIL); @@ -305,7 +305,7 @@ public void testChecksumVerification() throws Exception { } @Test - public void testPerLookupInstantiation() throws Exception { + void testPerLookupInstantiation() throws Exception { String protocol = "perlookup"; Wagon one = wagonManager.getWagon(protocol); diff --git a/maven-compat/src/test/java/org/apache/maven/repository/legacy/LegacyRepositorySystemTest.java b/maven-compat/src/test/java/org/apache/maven/repository/legacy/LegacyRepositorySystemTest.java index 6a60d4eb2d..6019dca7e5 100644 --- a/maven-compat/src/test/java/org/apache/maven/repository/legacy/LegacyRepositorySystemTest.java +++ b/maven-compat/src/test/java/org/apache/maven/repository/legacy/LegacyRepositorySystemTest.java @@ -39,19 +39,19 @@ * @author Benjamin Bentmann */ @PlexusTest -public class LegacyRepositorySystemTest { +class LegacyRepositorySystemTest { @Inject private RepositorySystem repositorySystem; @Test - public void testThatLocalRepositoryWithSpacesIsProperlyHandled() throws Exception { + void testThatLocalRepositoryWithSpacesIsProperlyHandled() throws Exception { File basedir = new File("target/spacy path").getAbsoluteFile(); ArtifactRepository repo = repositorySystem.createLocalRepository(basedir); assertEquals(basedir, new File(repo.getBasedir())); } @Test - public void testAuthenticationHandling() { + void testAuthenticationHandling() { Server server = new Server(); server.setId("repository"); server.setUsername("jason"); diff --git a/maven-compat/src/test/java/org/apache/maven/repository/legacy/resolver/DefaultArtifactCollectorTest.java b/maven-compat/src/test/java/org/apache/maven/repository/legacy/resolver/DefaultArtifactCollectorTest.java index 07d9c7608f..762518a81d 100644 --- a/maven-compat/src/test/java/org/apache/maven/repository/legacy/resolver/DefaultArtifactCollectorTest.java +++ b/maven-compat/src/test/java/org/apache/maven/repository/legacy/resolver/DefaultArtifactCollectorTest.java @@ -64,7 +64,7 @@ * @author Brett Porter */ @PlexusTest -public class DefaultArtifactCollectorTest { +class DefaultArtifactCollectorTest { @Inject private LegacyArtifactCollector artifactCollector; @@ -78,7 +78,7 @@ public class DefaultArtifactCollectorTest { private static final String GROUP_ID = "test"; @BeforeEach - public void setUp() throws Exception { + void setUp() throws Exception { source = new Source(); projectArtifact = createArtifactSpec("project", "1.0", null); @@ -86,7 +86,7 @@ public void setUp() throws Exception { @Test @Disabled("works, but we don't fail on cycles presently") - public void testCircularDependencyNotIncludingCurrentProject() + void testCircularDependencyNotIncludingCurrentProject() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec a = createArtifactSpec("a", "1.0"); ArtifactSpec b = a.addDependency("b", "1.0"); @@ -99,7 +99,7 @@ public void testCircularDependencyNotIncludingCurrentProject() @Test @Disabled("works, but we don't fail on cycles presently") - public void testCircularDependencyIncludingCurrentProject() + void testCircularDependencyIncludingCurrentProject() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec a = createArtifactSpec("a", "1.0"); ArtifactSpec b = a.addDependency("b", "1.0"); @@ -111,7 +111,7 @@ public void testCircularDependencyIncludingCurrentProject() } @Test - public void testResolveWithFilter() throws ArtifactResolutionException, InvalidVersionSpecificationException { + void testResolveWithFilter() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec a = createArtifactSpec("a", "1.0"); ArtifactSpec b = a.addDependency("b", "1.0"); ArtifactSpec c = a.addDependency("c", "3.0"); @@ -131,7 +131,7 @@ public void testResolveWithFilter() throws ArtifactResolutionException, InvalidV } @Test - public void testResolveCorrectDependenciesWhenDifferentDependenciesOnNearest() + void testResolveCorrectDependenciesWhenDifferentDependenciesOnNearest() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec a = createArtifactSpec("a", "1.0"); ArtifactSpec b = a.addDependency("b", "1.0"); @@ -152,7 +152,7 @@ public void testResolveCorrectDependenciesWhenDifferentDependenciesOnNearest() @Test @Disabled - public void testResolveCorrectDependenciesWhenDifferentDependenciesOnNewest() + void testResolveCorrectDependenciesWhenDifferentDependenciesOnNewest() throws ArtifactResolutionException, InvalidVersionSpecificationException { // TODO use newest conflict resolver ArtifactSpec a = createArtifactSpec("a", "1.0"); @@ -174,7 +174,7 @@ public void testResolveCorrectDependenciesWhenDifferentDependenciesOnNewest() @Test @Disabled - public void testResolveCorrectDependenciesWhenDifferentDependenciesOnNewestVersionReplaced() + void testResolveCorrectDependenciesWhenDifferentDependenciesOnNewestVersionReplaced() throws ArtifactResolutionException, InvalidVersionSpecificationException { // TODO use newest conflict resolver ArtifactSpec a = createArtifactSpec("a", "1.0"); @@ -195,8 +195,7 @@ public void testResolveCorrectDependenciesWhenDifferentDependenciesOnNewestVersi } @Test - public void testResolveNearestNewestIsNearest() - throws ArtifactResolutionException, InvalidVersionSpecificationException { + void testResolveNearestNewestIsNearest() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec a = createArtifactSpec("a", "1.0"); ArtifactSpec b = a.addDependency("b", "1.0"); ArtifactSpec c = a.addDependency("c", "3.0"); @@ -212,8 +211,7 @@ public void testResolveNearestNewestIsNearest() } @Test - public void testResolveNearestOldestIsNearest() - throws ArtifactResolutionException, InvalidVersionSpecificationException { + void testResolveNearestOldestIsNearest() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec a = createArtifactSpec("a", "1.0"); ArtifactSpec b = a.addDependency("b", "1.0"); ArtifactSpec c = a.addDependency("c", "2.0"); @@ -229,8 +227,7 @@ public void testResolveNearestOldestIsNearest() } @Test - public void testResolveLocalNewestIsLocal() - throws ArtifactResolutionException, InvalidVersionSpecificationException { + void testResolveLocalNewestIsLocal() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec a = createArtifactSpec("a", "1.0"); a.addDependency("b", "2.0"); ArtifactSpec b = createArtifactSpec("b", "3.0"); @@ -241,8 +238,7 @@ public void testResolveLocalNewestIsLocal() } @Test - public void testResolveLocalOldestIsLocal() - throws ArtifactResolutionException, InvalidVersionSpecificationException { + void testResolveLocalOldestIsLocal() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec a = createArtifactSpec("a", "1.0"); a.addDependency("b", "3.0"); ArtifactSpec b = createArtifactSpec("b", "2.0"); @@ -253,7 +249,7 @@ public void testResolveLocalOldestIsLocal() } @Test - public void testResolveLocalWithNewerVersionButLesserScope() + void testResolveLocalWithNewerVersionButLesserScope() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec a = createArtifactSpec("commons-logging", "1.0"); a.addDependency("junit", "3.7"); @@ -267,7 +263,7 @@ public void testResolveLocalWithNewerVersionButLesserScope() } @Test - public void testResolveLocalWithNewerVersionButLesserScopeResolvedFirst() + void testResolveLocalWithNewerVersionButLesserScopeResolvedFirst() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec b = createArtifactSpec("junit", "3.8.1", Artifact.SCOPE_TEST); ArtifactSpec a = createArtifactSpec("commons-logging", "1.0"); @@ -281,8 +277,7 @@ public void testResolveLocalWithNewerVersionButLesserScopeResolvedFirst() } @Test - public void testResolveNearestWithRanges() - throws ArtifactResolutionException, InvalidVersionSpecificationException { + void testResolveNearestWithRanges() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec a = createArtifactSpec("a", "1.0"); ArtifactSpec b = a.addDependency("b", "1.0"); ArtifactSpec c = a.addDependency("c", "2.0"); @@ -298,8 +293,7 @@ public void testResolveNearestWithRanges() } @Test - public void testResolveRangeWithManagedVersion() - throws ArtifactResolutionException, InvalidVersionSpecificationException { + void testResolveRangeWithManagedVersion() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec a = createArtifactSpec("a", "1.0"); ArtifactSpec b = a.addDependency("b", "[1.0,3.0]"); @@ -312,7 +306,7 @@ public void testResolveRangeWithManagedVersion() } @Test - public void testCompatibleRanges() throws ArtifactResolutionException, InvalidVersionSpecificationException { + void testCompatibleRanges() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec a = createArtifactSpec("a", "1.0"); ArtifactSpec b = a.addDependency("b", "1.0"); a.addDependency("c", "[2.0,2.5]"); @@ -329,7 +323,7 @@ public void testCompatibleRanges() throws ArtifactResolutionException, InvalidVe } @Test - public void testIncompatibleRanges() throws ArtifactResolutionException, InvalidVersionSpecificationException { + void testIncompatibleRanges() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec a = createArtifactSpec("a", "1.0"); ArtifactSpec b = a.addDependency("b", "1.0"); a.addDependency("c", "[2.4,3.0]"); @@ -342,7 +336,7 @@ public void testIncompatibleRanges() throws ArtifactResolutionException, Invalid } @Test - public void testUnboundedRangeWhenVersionUnavailable() + void testUnboundedRangeWhenVersionUnavailable() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec a = createArtifactSpec("a", "1.0"); ArtifactSpec b = a.addDependency("b", "1.0"); @@ -355,8 +349,7 @@ public void testUnboundedRangeWhenVersionUnavailable() } @Test - public void testUnboundedRangeBelowLastRelease() - throws ArtifactResolutionException, InvalidVersionSpecificationException { + void testUnboundedRangeBelowLastRelease() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec a = createArtifactSpec("a", "1.0"); createArtifactSpec("c", "1.5"); ArtifactSpec c = createArtifactSpec("c", "2.0"); @@ -370,8 +363,7 @@ public void testUnboundedRangeBelowLastRelease() } @Test - public void testUnboundedRangeAboveLastRelease() - throws ArtifactResolutionException, InvalidVersionSpecificationException { + void testUnboundedRangeAboveLastRelease() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec a = createArtifactSpec("a", "1.0"); createArtifactSpec("c", "2.0"); a.addDependency("c", "[10.0,)"); @@ -382,7 +374,7 @@ public void testUnboundedRangeAboveLastRelease() } @Test - public void testResolveManagedVersion() throws ArtifactResolutionException, InvalidVersionSpecificationException { + void testResolveManagedVersion() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec a = createArtifactSpec("a", "1.0"); a.addDependency("b", "3.0", Artifact.SCOPE_RUNTIME); @@ -394,7 +386,7 @@ public void testResolveManagedVersion() throws ArtifactResolutionException, Inva } @Test - public void testCollectChangesVersionOfOriginatingArtifactIfInDependencyManagementHasDifferentVersion() + void testCollectChangesVersionOfOriginatingArtifactIfInDependencyManagementHasDifferentVersion() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec a = createArtifactSpec("a", "1.0"); @@ -411,7 +403,7 @@ public void testCollectChangesVersionOfOriginatingArtifactIfInDependencyManageme } @Test - public void testResolveCompileScopeOverTestScope() + void testResolveCompileScopeOverTestScope() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec a = createArtifactSpec("a", "1.0"); ArtifactSpec c = createArtifactSpec("c", "3.0", Artifact.SCOPE_TEST); @@ -429,7 +421,7 @@ public void testResolveCompileScopeOverTestScope() } @Test - public void testResolveRuntimeScopeOverTestScope() + void testResolveRuntimeScopeOverTestScope() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec a = createArtifactSpec("a", "1.0"); ArtifactSpec c = createArtifactSpec("c", "3.0", Artifact.SCOPE_TEST); @@ -447,7 +439,7 @@ public void testResolveRuntimeScopeOverTestScope() } @Test - public void testResolveCompileScopeOverRuntimeScope() + void testResolveCompileScopeOverRuntimeScope() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec root = createArtifactSpec("root", "1.0"); ArtifactSpec a = root.addDependency("a", "1.0"); @@ -467,7 +459,7 @@ public void testResolveCompileScopeOverRuntimeScope() } @Test - public void testResolveCompileScopeOverProvidedScope() + void testResolveCompileScopeOverProvidedScope() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec a = createArtifactSpec("a", "1.0"); ArtifactSpec c = createArtifactSpec("c", "3.0", Artifact.SCOPE_PROVIDED); @@ -485,7 +477,7 @@ public void testResolveCompileScopeOverProvidedScope() } @Test - public void testResolveRuntimeScopeOverProvidedScope() + void testResolveRuntimeScopeOverProvidedScope() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec a = createArtifactSpec("a", "1.0"); ArtifactSpec c = createArtifactSpec("c", "3.0", Artifact.SCOPE_PROVIDED); @@ -503,8 +495,7 @@ public void testResolveRuntimeScopeOverProvidedScope() } @Test - public void testProvidedScopeNotTransitive() - throws ArtifactResolutionException, InvalidVersionSpecificationException { + void testProvidedScopeNotTransitive() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec a = createArtifactSpec("a", "1.0", Artifact.SCOPE_PROVIDED); ArtifactSpec b = createArtifactSpec("b", "1.0"); b.addDependency("c", "3.0", Artifact.SCOPE_PROVIDED); @@ -514,7 +505,7 @@ public void testProvidedScopeNotTransitive() } @Test - public void testOptionalNotTransitive() throws ArtifactResolutionException, InvalidVersionSpecificationException { + void testOptionalNotTransitive() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec a = createArtifactSpec("a", "1.0"); ArtifactSpec b = createArtifactSpec("b", "1.0"); b.addDependency("c", "3.0", true); @@ -524,7 +515,7 @@ public void testOptionalNotTransitive() throws ArtifactResolutionException, Inva } @Test - public void testOptionalIncludedAtRoot() throws ArtifactResolutionException, InvalidVersionSpecificationException { + void testOptionalIncludedAtRoot() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec a = createArtifactSpec("a", "1.0"); ArtifactSpec b = createArtifactSpec("b", "1.0", true); @@ -534,7 +525,7 @@ public void testOptionalIncludedAtRoot() throws ArtifactResolutionException, Inv } @Test - public void testScopeUpdate() throws InvalidVersionSpecificationException, ArtifactResolutionException { + void testScopeUpdate() throws InvalidVersionSpecificationException, ArtifactResolutionException { /* farthest = compile */ checkScopeUpdate(Artifact.SCOPE_COMPILE, Artifact.SCOPE_COMPILE, Artifact.SCOPE_COMPILE); checkScopeUpdate(Artifact.SCOPE_COMPILE, Artifact.SCOPE_PROVIDED, Artifact.SCOPE_COMPILE); @@ -635,7 +626,7 @@ private void checkScopeUpdate(ArtifactSpec a, ArtifactSpec b, String expectedSco @Test @Disabled - public void testOptionalNotTransitiveButVersionIsInfluential() + void testOptionalNotTransitiveButVersionIsInfluential() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec a = createArtifactSpec("a", "1.0"); ArtifactSpec b = createArtifactSpec("b", "1.0"); @@ -656,7 +647,7 @@ public void testOptionalNotTransitiveButVersionIsInfluential() } @Test - public void testTestScopeNotTransitive() throws ArtifactResolutionException, InvalidVersionSpecificationException { + void testTestScopeNotTransitive() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec a = createArtifactSpec("a", "1.0", Artifact.SCOPE_TEST); ArtifactSpec b = createArtifactSpec("b", "1.0"); b.addDependency("c", "3.0", Artifact.SCOPE_TEST); @@ -666,7 +657,7 @@ public void testTestScopeNotTransitive() throws ArtifactResolutionException, Inv } @Test - public void testSnapshotNotIncluded() throws ArtifactResolutionException, InvalidVersionSpecificationException { + void testSnapshotNotIncluded() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec a = createArtifactSpec("a", "1.0"); a.addDependency("b", "[1.0,)"); createArtifactSpec("b", "1.0-SNAPSHOT"); @@ -684,7 +675,7 @@ public void testSnapshotNotIncluded() throws ArtifactResolutionException, Invali @Test @Disabled("that one does not work") - public void testOverConstrainedVersionException() + void testOverConstrainedVersionException() throws ArtifactResolutionException, InvalidVersionSpecificationException { ArtifactSpec a = createArtifactSpec("a", "1.0"); a.addDependency("b", "[1.0, 2.0)"); diff --git a/maven-compat/src/test/java/org/apache/maven/repository/legacy/resolver/conflict/FarthestConflictResolverTest.java b/maven-compat/src/test/java/org/apache/maven/repository/legacy/resolver/conflict/FarthestConflictResolverTest.java index 8c18f437f3..f699de5425 100644 --- a/maven-compat/src/test/java/org/apache/maven/repository/legacy/resolver/conflict/FarthestConflictResolverTest.java +++ b/maven-compat/src/test/java/org/apache/maven/repository/legacy/resolver/conflict/FarthestConflictResolverTest.java @@ -27,7 +27,7 @@ * @author Mark Hobson * @see FarthestConflictResolver */ -public class FarthestConflictResolverTest extends AbstractConflictResolverTest { +class FarthestConflictResolverTest extends AbstractConflictResolverTest { // constructors ----------------------------------------------------------- public FarthestConflictResolverTest() throws Exception { @@ -44,7 +44,7 @@ public FarthestConflictResolverTest() throws Exception { * */ @Test - public void testDepth() { + void testDepth() { ResolutionNode a1n = createResolutionNode(a1); ResolutionNode b1n = createResolutionNode(b1); ResolutionNode a2n = createResolutionNode(a2, b1n); @@ -60,7 +60,7 @@ public void testDepth() { * */ @Test - public void testDepthReversed() { + void testDepthReversed() { ResolutionNode b1n = createResolutionNode(b1); ResolutionNode a2n = createResolutionNode(a2, b1n); ResolutionNode a1n = createResolutionNode(a1); @@ -76,7 +76,7 @@ public void testDepthReversed() { * */ @Test - public void testEqual() { + void testEqual() { ResolutionNode a1n = createResolutionNode(a1); ResolutionNode a2n = createResolutionNode(a2); @@ -91,7 +91,7 @@ public void testEqual() { * */ @Test - public void testEqualReversed() { + void testEqualReversed() { ResolutionNode a2n = createResolutionNode(a2); ResolutionNode a1n = createResolutionNode(a1); diff --git a/maven-compat/src/test/java/org/apache/maven/repository/legacy/resolver/conflict/NearestConflictResolverTest.java b/maven-compat/src/test/java/org/apache/maven/repository/legacy/resolver/conflict/NearestConflictResolverTest.java index 7f9d0af8c9..cf09e3ac37 100644 --- a/maven-compat/src/test/java/org/apache/maven/repository/legacy/resolver/conflict/NearestConflictResolverTest.java +++ b/maven-compat/src/test/java/org/apache/maven/repository/legacy/resolver/conflict/NearestConflictResolverTest.java @@ -27,7 +27,7 @@ * @author Mark Hobson * @see NearestConflictResolver */ -public class NearestConflictResolverTest extends AbstractConflictResolverTest { +class NearestConflictResolverTest extends AbstractConflictResolverTest { // constructors ----------------------------------------------------------- public NearestConflictResolverTest() throws Exception { @@ -44,7 +44,7 @@ public NearestConflictResolverTest() throws Exception { * */ @Test - public void testDepth() { + void testDepth() { ResolutionNode a1n = createResolutionNode(a1); ResolutionNode b1n = createResolutionNode(b1); ResolutionNode a2n = createResolutionNode(a2, b1n); @@ -60,7 +60,7 @@ public void testDepth() { * */ @Test - public void testDepthReversed() { + void testDepthReversed() { ResolutionNode b1n = createResolutionNode(b1); ResolutionNode a2n = createResolutionNode(a2, b1n); ResolutionNode a1n = createResolutionNode(a1); @@ -76,7 +76,7 @@ public void testDepthReversed() { * */ @Test - public void testEqual() { + void testEqual() { ResolutionNode a1n = createResolutionNode(a1); ResolutionNode a2n = createResolutionNode(a2); @@ -91,7 +91,7 @@ public void testEqual() { * */ @Test - public void testEqualReversed() { + void testEqualReversed() { ResolutionNode a2n = createResolutionNode(a2); ResolutionNode a1n = createResolutionNode(a1); diff --git a/maven-compat/src/test/java/org/apache/maven/repository/legacy/resolver/conflict/NewestConflictResolverTest.java b/maven-compat/src/test/java/org/apache/maven/repository/legacy/resolver/conflict/NewestConflictResolverTest.java index bf1a6646c2..d7e16d5d25 100644 --- a/maven-compat/src/test/java/org/apache/maven/repository/legacy/resolver/conflict/NewestConflictResolverTest.java +++ b/maven-compat/src/test/java/org/apache/maven/repository/legacy/resolver/conflict/NewestConflictResolverTest.java @@ -27,7 +27,7 @@ * @author Mark Hobson * @see NewestConflictResolver */ -public class NewestConflictResolverTest extends AbstractConflictResolverTest { +class NewestConflictResolverTest extends AbstractConflictResolverTest { // constructors ----------------------------------------------------------- public NewestConflictResolverTest() throws Exception { @@ -44,7 +44,7 @@ public NewestConflictResolverTest() throws Exception { * */ @Test - public void testDepth() { + void testDepth() { ResolutionNode a1n = createResolutionNode(a1); ResolutionNode b1n = createResolutionNode(b1); ResolutionNode a2n = createResolutionNode(a2, b1n); @@ -60,7 +60,7 @@ public void testDepth() { * */ @Test - public void testDepthReversed() { + void testDepthReversed() { ResolutionNode b1n = createResolutionNode(b1); ResolutionNode a2n = createResolutionNode(a2, b1n); ResolutionNode a1n = createResolutionNode(a1); @@ -76,7 +76,7 @@ public void testDepthReversed() { * */ @Test - public void testEqual() { + void testEqual() { ResolutionNode a1n = createResolutionNode(a1); ResolutionNode a2n = createResolutionNode(a2); @@ -91,7 +91,7 @@ public void testEqual() { * */ @Test - public void testEqualReversed() { + void testEqualReversed() { ResolutionNode a2n = createResolutionNode(a2); ResolutionNode a1n = createResolutionNode(a1); diff --git a/maven-compat/src/test/java/org/apache/maven/repository/legacy/resolver/conflict/OldestConflictResolverTest.java b/maven-compat/src/test/java/org/apache/maven/repository/legacy/resolver/conflict/OldestConflictResolverTest.java index 77183f104c..7b8dfd3552 100644 --- a/maven-compat/src/test/java/org/apache/maven/repository/legacy/resolver/conflict/OldestConflictResolverTest.java +++ b/maven-compat/src/test/java/org/apache/maven/repository/legacy/resolver/conflict/OldestConflictResolverTest.java @@ -27,7 +27,7 @@ * @author Mark Hobson * @see OldestConflictResolver */ -public class OldestConflictResolverTest extends AbstractConflictResolverTest { +class OldestConflictResolverTest extends AbstractConflictResolverTest { // constructors ----------------------------------------------------------- public OldestConflictResolverTest() throws Exception { @@ -44,7 +44,7 @@ public OldestConflictResolverTest() throws Exception { * */ @Test - public void testDepth() { + void testDepth() { ResolutionNode a1n = createResolutionNode(a1); ResolutionNode b1n = createResolutionNode(b1); ResolutionNode a2n = createResolutionNode(a2, b1n); @@ -60,7 +60,7 @@ public void testDepth() { * */ @Test - public void testDepthReversed() { + void testDepthReversed() { ResolutionNode b1n = createResolutionNode(b1); ResolutionNode a2n = createResolutionNode(a2, b1n); ResolutionNode a1n = createResolutionNode(a1); @@ -76,7 +76,7 @@ public void testDepthReversed() { * */ @Test - public void testEqual() { + void testEqual() { ResolutionNode a1n = createResolutionNode(a1); ResolutionNode a2n = createResolutionNode(a2); @@ -91,7 +91,7 @@ public void testEqual() { * */ @Test - public void testEqualReversed() { + void testEqualReversed() { ResolutionNode a2n = createResolutionNode(a2); ResolutionNode a1n = createResolutionNode(a1); diff --git a/maven-compat/src/test/java/org/apache/maven/repository/metadata/DefaultClasspathTransformationTest.java b/maven-compat/src/test/java/org/apache/maven/repository/metadata/DefaultClasspathTransformationTest.java index 9c480d8fb1..0f7a25e24b 100644 --- a/maven-compat/src/test/java/org/apache/maven/repository/metadata/DefaultClasspathTransformationTest.java +++ b/maven-compat/src/test/java/org/apache/maven/repository/metadata/DefaultClasspathTransformationTest.java @@ -34,7 +34,7 @@ * */ @PlexusTest -public class DefaultClasspathTransformationTest { +class DefaultClasspathTransformationTest { @Inject ClasspathTransformation transform; @@ -44,9 +44,10 @@ public class DefaultClasspathTransformationTest { MetadataGraphVertex v2; MetadataGraphVertex v3; MetadataGraphVertex v4; + // ------------------------------------------------------------------------------------------ @BeforeEach - public void setUp() throws Exception { + void setUp() throws Exception { graph = new MetadataGraph(4, 3); /* * v2 @@ -72,9 +73,10 @@ public void setUp() throws Exception { graph.addEdge(v3, v4, new MetadataGraphEdge("1.1", true, ArtifactScopeEnum.runtime, null, 2, 2)); graph.addEdge(v3, v4, new MetadataGraphEdge("1.2", true, ArtifactScopeEnum.test, null, 2, 2)); } + // ------------------------------------------------------------------------------------------ @Test - public void testCompileClasspathTransform() throws Exception { + void testCompileClasspathTransform() throws Exception { ClasspathContainer res; res = transform.transform(graph, ArtifactScopeEnum.compile, false); @@ -83,9 +85,10 @@ public void testCompileClasspathTransform() throws Exception { assertNotNull(res.getClasspath(), "null classpath after compile transform"); assertEquals(3, res.getClasspath().size(), "compile classpath should have 3 entries"); } + // ------------------------------------------------------------------------------------------ @Test - public void testRuntimeClasspathTransform() throws Exception { + void testRuntimeClasspathTransform() throws Exception { ClasspathContainer res; res = transform.transform(graph, ArtifactScopeEnum.runtime, false); @@ -97,9 +100,10 @@ public void testRuntimeClasspathTransform() throws Exception { ArtifactMetadata md = res.getClasspath().get(3); assertEquals("1.1", md.getVersion(), "runtime artifact version should be 1.1"); } + // ------------------------------------------------------------------------------------------ @Test - public void testTestClasspathTransform() throws Exception { + void testTestClasspathTransform() throws Exception { ClasspathContainer res; res = transform.transform(graph, ArtifactScopeEnum.test, false); diff --git a/maven-compat/src/test/java/org/apache/maven/repository/metadata/DefaultGraphConflictResolutionPolicyTest.java b/maven-compat/src/test/java/org/apache/maven/repository/metadata/DefaultGraphConflictResolutionPolicyTest.java index 865669c4a0..251011f4b8 100644 --- a/maven-compat/src/test/java/org/apache/maven/repository/metadata/DefaultGraphConflictResolutionPolicyTest.java +++ b/maven-compat/src/test/java/org/apache/maven/repository/metadata/DefaultGraphConflictResolutionPolicyTest.java @@ -28,22 +28,24 @@ * @author Oleg Gusakov * */ -public class DefaultGraphConflictResolutionPolicyTest { +class DefaultGraphConflictResolutionPolicyTest { GraphConflictResolutionPolicy policy; MetadataGraphEdge e1; MetadataGraphEdge e2; MetadataGraphEdge e3; + // ------------------------------------------------------------------------------------------ @BeforeEach - public void setUp() throws Exception { + void setUp() throws Exception { policy = new DefaultGraphConflictResolutionPolicy(); e1 = new MetadataGraphEdge("1.1", true, null, null, 2, 1); e2 = new MetadataGraphEdge("1.2", true, null, null, 3, 2); e3 = new MetadataGraphEdge("1.2", true, null, null, 2, 3); } + // ------------------------------------------------------------------------------------------ @Test - public void testDefaultPolicy() throws Exception { + void testDefaultPolicy() throws Exception { MetadataGraphEdge res; res = policy.apply(e1, e2); diff --git a/maven-compat/src/test/java/org/apache/maven/repository/metadata/DefaultGraphConflictResolverTest.java b/maven-compat/src/test/java/org/apache/maven/repository/metadata/DefaultGraphConflictResolverTest.java index a4f3577f95..6eed57f3e5 100644 --- a/maven-compat/src/test/java/org/apache/maven/repository/metadata/DefaultGraphConflictResolverTest.java +++ b/maven-compat/src/test/java/org/apache/maven/repository/metadata/DefaultGraphConflictResolverTest.java @@ -34,7 +34,7 @@ * */ @PlexusTest -public class DefaultGraphConflictResolverTest { +class DefaultGraphConflictResolverTest { @Inject GraphConflictResolver resolver; @@ -44,9 +44,10 @@ public class DefaultGraphConflictResolverTest { MetadataGraphVertex v2; MetadataGraphVertex v3; MetadataGraphVertex v4; + // ------------------------------------------------------------------------------------------ @BeforeEach - public void setUp() throws Exception { + void setUp() throws Exception { /* * v2 * v1< @@ -72,9 +73,10 @@ public void setUp() throws Exception { graph.addEdge(v3, v4, new MetadataGraphEdge("1.1", true, ArtifactScopeEnum.runtime, null, 2, 1)); graph.addEdge(v3, v4, new MetadataGraphEdge("1.2", true, ArtifactScopeEnum.provided, null, 2, 2)); } + // ------------------------------------------------------------------------------------------ @Test - public void testCompileResolution() throws Exception { + void testCompileResolution() throws Exception { MetadataGraph res; res = resolver.resolveConflicts(graph, ArtifactScopeEnum.compile); @@ -113,9 +115,10 @@ public void testCompileResolution() throws Exception { res.getIncidentEdges(v4).get(0).getVersion(), "wrong edge v3-v4 in the resulting graph after resolver"); } + // ------------------------------------------------------------------------------------------ @Test - public void testRuntimeResolution() throws Exception { + void testRuntimeResolution() throws Exception { MetadataGraph res; res = resolver.resolveConflicts(graph, ArtifactScopeEnum.runtime); @@ -153,9 +156,10 @@ public void testRuntimeResolution() throws Exception { res.getIncidentEdges(v4).get(0).getVersion(), "wrong edge v3-v4 in the resulting graph after resolver"); } + // ------------------------------------------------------------------------------------------ @Test - public void testTestResolution() throws Exception { + void testTestResolution() throws Exception { MetadataGraph res; res = resolver.resolveConflicts(graph, ArtifactScopeEnum.test); diff --git a/maven-core/src/test/java/org/apache/maven/DefaultMavenTest.java b/maven-core/src/test/java/org/apache/maven/DefaultMavenTest.java index 97c2056295..cb57bdf901 100644 --- a/maven-core/src/test/java/org/apache/maven/DefaultMavenTest.java +++ b/maven-core/src/test/java/org/apache/maven/DefaultMavenTest.java @@ -41,7 +41,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -public class DefaultMavenTest extends AbstractCoreMavenComponentTestCase { +class DefaultMavenTest extends AbstractCoreMavenComponentTestCase { @Singleton @Named("WsrClassCatcher") private static final class WsrClassCatcher extends AbstractMavenLifecycleParticipant { @@ -62,7 +62,7 @@ protected String getProjectsDirectory() { } @Test - public void testEnsureResolverSessionHasMavenWorkspaceReader() throws Exception { + void testEnsureResolverSessionHasMavenWorkspaceReader() throws Exception { WsrClassCatcher wsrClassCatcher = (WsrClassCatcher) getContainer().lookup(AbstractMavenLifecycleParticipant.class, "WsrClassCatcher"); Maven maven = getContainer().lookup(Maven.class); @@ -77,7 +77,7 @@ public void testEnsureResolverSessionHasMavenWorkspaceReader() throws Exception } @Test - public void testThatErrorDuringProjectDependencyGraphCreationAreStored() throws Exception { + void testThatErrorDuringProjectDependencyGraphCreationAreStored() throws Exception { MavenExecutionRequest request = createMavenExecutionRequest(getProject("cyclic-reference")).setGoals(asList("validate")); @@ -87,7 +87,7 @@ public void testThatErrorDuringProjectDependencyGraphCreationAreStored() throws } @Test - public void testMavenProjectNoDuplicateArtifacts() throws Exception { + void testMavenProjectNoDuplicateArtifacts() throws Exception { MavenProjectHelper mavenProjectHelper = getContainer().lookup(MavenProjectHelper.class); MavenProject mavenProject = new MavenProject(); mavenProject.setArtifact(new DefaultArtifact("g", "a", "1.0", Artifact.SCOPE_TEST, "jar", "", null)); diff --git a/maven-core/src/test/java/org/apache/maven/MavenLifecycleParticipantTest.java b/maven-core/src/test/java/org/apache/maven/MavenLifecycleParticipantTest.java index 8d79489f56..b56822dda6 100644 --- a/maven-core/src/test/java/org/apache/maven/MavenLifecycleParticipantTest.java +++ b/maven-core/src/test/java/org/apache/maven/MavenLifecycleParticipantTest.java @@ -37,7 +37,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; -public class MavenLifecycleParticipantTest extends AbstractCoreMavenComponentTestCase { +class MavenLifecycleParticipantTest extends AbstractCoreMavenComponentTestCase { private static final String INJECTED_ARTIFACT_ID = "injected"; @@ -95,7 +95,7 @@ protected String getProjectsDirectory() { } @Test - public void testDependencyInjection() throws Exception { + void testDependencyInjection() throws Exception { PlexusContainer container = getContainer(); ComponentDescriptor cd = @@ -122,7 +122,7 @@ public void testDependencyInjection() throws Exception { } @Test - public void testReactorDependencyInjection() throws Exception { + void testReactorDependencyInjection() throws Exception { List reactorOrder = getReactorOrder("lifecycle-participant-reactor-dependency-injection", InjectReactorDependency.class); assertEquals(Arrays.asList("parent", "module-b", "module-a"), reactorOrder); diff --git a/maven-core/src/test/java/org/apache/maven/ProjectDependenciesResolverTest.java b/maven-core/src/test/java/org/apache/maven/ProjectDependenciesResolverTest.java index 81a648dfea..ceb2475bbc 100644 --- a/maven-core/src/test/java/org/apache/maven/ProjectDependenciesResolverTest.java +++ b/maven-core/src/test/java/org/apache/maven/ProjectDependenciesResolverTest.java @@ -36,7 +36,7 @@ import static org.hamcrest.Matchers.endsWith; import static org.junit.jupiter.api.Assertions.assertEquals; -public class ProjectDependenciesResolverTest extends AbstractCoreMavenComponentTestCase { +class ProjectDependenciesResolverTest extends AbstractCoreMavenComponentTestCase { @Inject private ProjectDependenciesResolver resolver; @@ -70,7 +70,7 @@ public void testExclusionsInDependencies() */ @Test - public void testSystemScopeDependencies() throws Exception { + void testSystemScopeDependencies() throws Exception { MavenSession session = createMavenSession(null); MavenProject project = session.getCurrentProject(); @@ -88,7 +88,7 @@ public void testSystemScopeDependencies() throws Exception { } @Test - public void testSystemScopeDependencyIsPresentInTheCompileClasspathElements() throws Exception { + void testSystemScopeDependencyIsPresentInTheCompileClasspathElements() throws Exception { File pom = getProject("it0063"); Properties eps = new Properties(); diff --git a/maven-core/src/test/java/org/apache/maven/artifact/handler/ArtifactHandlerTest.java b/maven-core/src/test/java/org/apache/maven/artifact/handler/ArtifactHandlerTest.java index f425184746..33d404519c 100644 --- a/maven-core/src/test/java/org/apache/maven/artifact/handler/ArtifactHandlerTest.java +++ b/maven-core/src/test/java/org/apache/maven/artifact/handler/ArtifactHandlerTest.java @@ -32,12 +32,12 @@ import static org.junit.jupiter.api.Assertions.assertEquals; @PlexusTest -public class ArtifactHandlerTest { +class ArtifactHandlerTest { @Inject PlexusContainer container; @Test - public void testAptConsistency() throws Exception { + void testAptConsistency() throws Exception { File apt = getTestFile("src/site/apt/artifact-handlers.apt"); List lines = Files.readAllLines(apt.toPath()); diff --git a/maven-core/src/test/java/org/apache/maven/artifact/resolver/filter/ExclusionArtifactFilterTest.java b/maven-core/src/test/java/org/apache/maven/artifact/resolver/filter/ExclusionArtifactFilterTest.java index 480e83bffb..bcb5bf1f83 100644 --- a/maven-core/src/test/java/org/apache/maven/artifact/resolver/filter/ExclusionArtifactFilterTest.java +++ b/maven-core/src/test/java/org/apache/maven/artifact/resolver/filter/ExclusionArtifactFilterTest.java @@ -31,18 +31,18 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -public class ExclusionArtifactFilterTest { +class ExclusionArtifactFilterTest { private Artifact artifact; @BeforeEach - public void setup() { + void setup() { artifact = mock(Artifact.class); when(artifact.getGroupId()).thenReturn("org.apache.maven"); when(artifact.getArtifactId()).thenReturn("maven-core"); } @Test - public void testExcludeExact() { + void testExcludeExact() { Exclusion exclusion = new Exclusion(); exclusion.setGroupId("org.apache.maven"); exclusion.setArtifactId("maven-core"); @@ -52,7 +52,7 @@ public void testExcludeExact() { } @Test - public void testExcludeNoMatch() { + void testExcludeNoMatch() { Exclusion exclusion = new Exclusion(); exclusion.setGroupId("org.apache.maven"); exclusion.setArtifactId("maven-model"); @@ -62,7 +62,7 @@ public void testExcludeNoMatch() { } @Test - public void testExcludeGroupIdWildcard() { + void testExcludeGroupIdWildcard() { Exclusion exclusion = new Exclusion(); exclusion.setGroupId("*"); exclusion.setArtifactId("maven-core"); @@ -72,7 +72,7 @@ public void testExcludeGroupIdWildcard() { } @Test - public void testExcludeGroupIdWildcardNoMatch() { + void testExcludeGroupIdWildcardNoMatch() { Exclusion exclusion = new Exclusion(); exclusion.setGroupId("*"); exclusion.setArtifactId("maven-compat"); @@ -82,7 +82,7 @@ public void testExcludeGroupIdWildcardNoMatch() { } @Test - public void testExcludeArtifactIdWildcard() { + void testExcludeArtifactIdWildcard() { Exclusion exclusion = new Exclusion(); exclusion.setGroupId("org.apache.maven"); exclusion.setArtifactId("*"); @@ -92,7 +92,7 @@ public void testExcludeArtifactIdWildcard() { } @Test - public void testExcludeArtifactIdWildcardNoMatch() { + void testExcludeArtifactIdWildcardNoMatch() { Exclusion exclusion = new Exclusion(); exclusion.setGroupId("org.apache.groovy"); exclusion.setArtifactId("*"); @@ -102,7 +102,7 @@ public void testExcludeArtifactIdWildcardNoMatch() { } @Test - public void testExcludeAllWildcard() { + void testExcludeAllWildcard() { Exclusion exclusion = new Exclusion(); exclusion.setGroupId("*"); exclusion.setArtifactId("*"); @@ -112,7 +112,7 @@ public void testExcludeAllWildcard() { } @Test - public void testMultipleExclusionsExcludeArtifactIdWildcard() { + void testMultipleExclusionsExcludeArtifactIdWildcard() { Exclusion exclusion1 = new Exclusion(); exclusion1.setGroupId("org.apache.groovy"); exclusion1.setArtifactId("*"); @@ -127,7 +127,7 @@ public void testMultipleExclusionsExcludeArtifactIdWildcard() { } @Test - public void testMultipleExclusionsExcludeGroupIdWildcard() { + void testMultipleExclusionsExcludeGroupIdWildcard() { Exclusion exclusion1 = new Exclusion(); exclusion1.setGroupId("*"); exclusion1.setArtifactId("maven-model"); diff --git a/maven-core/src/test/java/org/apache/maven/configuration/DefaultBeanConfiguratorPathTest.java b/maven-core/src/test/java/org/apache/maven/configuration/DefaultBeanConfiguratorPathTest.java index 905efd9ce1..1beeb43abb 100644 --- a/maven-core/src/test/java/org/apache/maven/configuration/DefaultBeanConfiguratorPathTest.java +++ b/maven-core/src/test/java/org/apache/maven/configuration/DefaultBeanConfiguratorPathTest.java @@ -37,17 +37,17 @@ /** * @author Benjamin Bentmann */ -public class DefaultBeanConfiguratorPathTest { +class DefaultBeanConfiguratorPathTest { private BeanConfigurator configurator; @BeforeEach - public void setUp() throws Exception { + void setUp() throws Exception { configurator = new DefaultBeanConfigurator(); } @AfterEach - public void tearDown() throws Exception { + void tearDown() throws Exception { configurator = null; } @@ -60,7 +60,7 @@ private Xpp3Dom toConfig(String xml) { } @Test - public void testMinimal() throws BeanConfigurationException { + void testMinimal() throws BeanConfigurationException { SomeBean bean = new SomeBean(); Xpp3Dom config = toConfig("test"); @@ -74,7 +74,7 @@ public void testMinimal() throws BeanConfigurationException { } @Test - public void testPreAndPostProcessing() throws BeanConfigurationException { + void testPreAndPostProcessing() throws BeanConfigurationException { SomeBean bean = new SomeBean(); Xpp3Dom config = toConfig("${test}"); @@ -98,7 +98,7 @@ public void testPreAndPostProcessing() throws BeanConfigurationException { } @Test - public void testChildConfigurationElement() throws BeanConfigurationException { + void testChildConfigurationElement() throws BeanConfigurationException { SomeBean bean = new SomeBean(); Xpp3Dom config = toConfig("test"); diff --git a/maven-core/src/test/java/org/apache/maven/configuration/DefaultBeanConfiguratorTest.java b/maven-core/src/test/java/org/apache/maven/configuration/DefaultBeanConfiguratorTest.java index a33a6f342f..abca92facf 100644 --- a/maven-core/src/test/java/org/apache/maven/configuration/DefaultBeanConfiguratorTest.java +++ b/maven-core/src/test/java/org/apache/maven/configuration/DefaultBeanConfiguratorTest.java @@ -35,17 +35,17 @@ /** * @author Benjamin Bentmann */ -public class DefaultBeanConfiguratorTest { +class DefaultBeanConfiguratorTest { private BeanConfigurator configurator; @BeforeEach - public void setUp() throws Exception { + void setUp() throws Exception { configurator = new DefaultBeanConfigurator(); } @AfterEach - public void tearDown() throws Exception { + void tearDown() throws Exception { configurator = null; } @@ -58,7 +58,7 @@ private Xpp3Dom toConfig(String xml) { } @Test - public void testMinimal() throws BeanConfigurationException { + void testMinimal() throws BeanConfigurationException { SomeBean bean = new SomeBean(); Xpp3Dom config = toConfig("test"); @@ -72,7 +72,7 @@ public void testMinimal() throws BeanConfigurationException { } @Test - public void testPreAndPostProcessing() throws BeanConfigurationException { + void testPreAndPostProcessing() throws BeanConfigurationException { SomeBean bean = new SomeBean(); Xpp3Dom config = toConfig("${test}"); @@ -96,7 +96,7 @@ public void testPreAndPostProcessing() throws BeanConfigurationException { } @Test - public void testChildConfigurationElement() throws BeanConfigurationException { + void testChildConfigurationElement() throws BeanConfigurationException { SomeBean bean = new SomeBean(); Xpp3Dom config = toConfig("test"); diff --git a/maven-core/src/test/java/org/apache/maven/exception/DefaultExceptionHandlerTest.java b/maven-core/src/test/java/org/apache/maven/exception/DefaultExceptionHandlerTest.java index a3b78ca9f5..e7e65b79c8 100644 --- a/maven-core/src/test/java/org/apache/maven/exception/DefaultExceptionHandlerTest.java +++ b/maven-core/src/test/java/org/apache/maven/exception/DefaultExceptionHandlerTest.java @@ -35,7 +35,7 @@ /** * @author Barrie Treloar */ -public class DefaultExceptionHandlerTest { +class DefaultExceptionHandlerTest { /** * Running Maven under JDK7 may cause connection issues because IPv6 is used by default. *

@@ -47,7 +47,7 @@ public class DefaultExceptionHandlerTest { *

*/ @Test - public void testJdk7ipv6() { + void testJdk7ipv6() { ConnectException connEx = new ConnectException("Connection refused: connect"); IOException ioEx = new IOException("Unable to establish loopback connection", connEx); MojoExecutionException mojoEx = @@ -61,7 +61,7 @@ public void testJdk7ipv6() { } @Test - public void testHandleExceptionAetherClassNotFound() { + void testHandleExceptionAetherClassNotFound() { Throwable cause2 = new NoClassDefFoundError("org/sonatype/aether/RepositorySystem"); Plugin plugin = new Plugin(); Exception cause = new PluginContainerException(plugin, null, null, cause2); @@ -79,7 +79,7 @@ public void testHandleExceptionAetherClassNotFound() { } @Test - public void testHandleExceptionNoClassDefFoundErrorNull() { + void testHandleExceptionNoClassDefFoundErrorNull() { Throwable cause2 = new NoClassDefFoundError(); Plugin plugin = new Plugin(); Exception cause = new PluginContainerException(plugin, null, null, cause2); diff --git a/maven-core/src/test/java/org/apache/maven/execution/DefaultBuildResumptionAnalyzerTest.java b/maven-core/src/test/java/org/apache/maven/execution/DefaultBuildResumptionAnalyzerTest.java index bfba1d6e4f..6ed0ecfb8b 100644 --- a/maven-core/src/test/java/org/apache/maven/execution/DefaultBuildResumptionAnalyzerTest.java +++ b/maven-core/src/test/java/org/apache/maven/execution/DefaultBuildResumptionAnalyzerTest.java @@ -31,18 +31,18 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; -public class DefaultBuildResumptionAnalyzerTest { +class DefaultBuildResumptionAnalyzerTest { private final DefaultBuildResumptionAnalyzer analyzer = new DefaultBuildResumptionAnalyzer(); private MavenExecutionResult executionResult; @BeforeEach - public void before() { + void before() { executionResult = new DefaultMavenExecutionResult(); } @Test - public void resumeFromGetsDetermined() { + void resumeFromGetsDetermined() { MavenProject projectA = createSucceededMavenProject("A"); MavenProject projectB = createFailedMavenProject("B"); executionResult.setTopologicallySortedProjects(asList(projectA, projectB)); @@ -54,7 +54,7 @@ public void resumeFromGetsDetermined() { } @Test - public void resumeFromIsIgnoredWhenFirstProjectFails() { + void resumeFromIsIgnoredWhenFirstProjectFails() { MavenProject projectA = createFailedMavenProject("A"); MavenProject projectB = createMavenProject("B"); executionResult.setTopologicallySortedProjects(asList(projectA, projectB)); @@ -65,7 +65,7 @@ public void resumeFromIsIgnoredWhenFirstProjectFails() { } @Test - public void projectsSucceedingAfterFailedProjectsAreExcluded() { + void projectsSucceedingAfterFailedProjectsAreExcluded() { MavenProject projectA = createSucceededMavenProject("A"); MavenProject projectB = createFailedMavenProject("B"); MavenProject projectC = createSucceededMavenProject("C"); @@ -78,7 +78,7 @@ public void projectsSucceedingAfterFailedProjectsAreExcluded() { } @Test - public void projectsDependingOnFailedProjectsAreNotExcluded() { + void projectsDependingOnFailedProjectsAreNotExcluded() { MavenProject projectA = createSucceededMavenProject("A"); MavenProject projectB = createFailedMavenProject("B"); MavenProject projectC = createSkippedMavenProject("C"); @@ -92,7 +92,7 @@ public void projectsDependingOnFailedProjectsAreNotExcluded() { } @Test - public void projectsFailingAfterAnotherFailedProjectAreNotExcluded() { + void projectsFailingAfterAnotherFailedProjectAreNotExcluded() { MavenProject projectA = createSucceededMavenProject("A"); MavenProject projectB = createFailedMavenProject("B"); MavenProject projectC = createSucceededMavenProject("C"); diff --git a/maven-core/src/test/java/org/apache/maven/execution/DefaultBuildResumptionDataRepositoryTest.java b/maven-core/src/test/java/org/apache/maven/execution/DefaultBuildResumptionDataRepositoryTest.java index e3be3c0cb6..dc7be6b3d4 100644 --- a/maven-core/src/test/java/org/apache/maven/execution/DefaultBuildResumptionDataRepositoryTest.java +++ b/maven-core/src/test/java/org/apache/maven/execution/DefaultBuildResumptionDataRepositoryTest.java @@ -32,11 +32,11 @@ import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.is; -public class DefaultBuildResumptionDataRepositoryTest { +class DefaultBuildResumptionDataRepositoryTest { private final DefaultBuildResumptionDataRepository repository = new DefaultBuildResumptionDataRepository(); @Test - public void resumeFromPropertyGetsApplied() { + void resumeFromPropertyGetsApplied() { MavenExecutionRequest request = new DefaultMavenExecutionRequest(); Properties properties = new Properties(); properties.setProperty("remainingProjects", ":module-a"); @@ -47,7 +47,7 @@ public void resumeFromPropertyGetsApplied() { } @Test - public void resumeFromPropertyDoesNotOverrideExistingRequestParameters() { + void resumeFromPropertyDoesNotOverrideExistingRequestParameters() { MavenExecutionRequest request = new DefaultMavenExecutionRequest(); request.setResumeFrom(":module-b"); Properties properties = new Properties(); @@ -59,7 +59,7 @@ public void resumeFromPropertyDoesNotOverrideExistingRequestParameters() { } @Test - public void projectsFromPropertyGetsAddedToExistingRequestParameters() { + void projectsFromPropertyGetsAddedToExistingRequestParameters() { MavenExecutionRequest request = new DefaultMavenExecutionRequest(); List selectedProjects = new ArrayList<>(); selectedProjects.add(":module-a"); @@ -75,7 +75,7 @@ public void projectsFromPropertyGetsAddedToExistingRequestParameters() { } @Test - public void selectedProjectsAreNotAddedWhenPropertyValueIsEmpty() { + void selectedProjectsAreNotAddedWhenPropertyValueIsEmpty() { MavenExecutionRequest request = new DefaultMavenExecutionRequest(); Properties properties = new Properties(); properties.setProperty("remainingProjects", ""); @@ -86,7 +86,7 @@ public void selectedProjectsAreNotAddedWhenPropertyValueIsEmpty() { } @Test - public void applyResumptionData_shouldLoadData() { + void applyResumptionData_shouldLoadData() { MavenExecutionRequest request = new DefaultMavenExecutionRequest(); Build build = new Build(); build.setDirectory("src/test/resources/org/apache/maven/execution/"); diff --git a/maven-core/src/test/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulatorTest.java b/maven-core/src/test/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulatorTest.java index 4bf14d409c..334029918b 100644 --- a/maven-core/src/test/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulatorTest.java +++ b/maven-core/src/test/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulatorTest.java @@ -32,12 +32,12 @@ import static org.junit.jupiter.api.Assertions.assertEquals; @PlexusTest -public class DefaultMavenExecutionRequestPopulatorTest { +class DefaultMavenExecutionRequestPopulatorTest { @Inject MavenExecutionRequestPopulator testee; @Test - public void testPluginRepositoryInjection() throws Exception { + void testPluginRepositoryInjection() throws Exception { MavenExecutionRequest request = new DefaultMavenExecutionRequest(); Repository r = new Repository(); diff --git a/maven-core/src/test/java/org/apache/maven/execution/DefaultMavenExecutionTest.java b/maven-core/src/test/java/org/apache/maven/execution/DefaultMavenExecutionTest.java index f58efc44d4..b0ebfeb9f9 100644 --- a/maven-core/src/test/java/org/apache/maven/execution/DefaultMavenExecutionTest.java +++ b/maven-core/src/test/java/org/apache/maven/execution/DefaultMavenExecutionTest.java @@ -32,9 +32,9 @@ /** * @author Benjamin Bentmann */ -public class DefaultMavenExecutionTest { +class DefaultMavenExecutionTest { @Test - public void testCopyDefault() { + void testCopyDefault() { MavenExecutionRequest original = new DefaultMavenExecutionRequest(); MavenExecutionRequest copy = DefaultMavenExecutionRequest.copy(original); assertNotNull(copy); @@ -42,7 +42,7 @@ public void testCopyDefault() { } @Test - public void testResultWithNullTopologicallySortedProjectsIsEmptyList() { + void testResultWithNullTopologicallySortedProjectsIsEmptyList() { MavenExecutionResult result = new DefaultMavenExecutionResult(); result.setTopologicallySortedProjects(null); List projects = result.getTopologicallySortedProjects(); diff --git a/maven-core/src/test/java/org/apache/maven/execution/scope/internal/MojoExecutionScopeTest.java b/maven-core/src/test/java/org/apache/maven/execution/scope/internal/MojoExecutionScopeTest.java index 27f3abb6a5..5e53789a47 100644 --- a/maven-core/src/test/java/org/apache/maven/execution/scope/internal/MojoExecutionScopeTest.java +++ b/maven-core/src/test/java/org/apache/maven/execution/scope/internal/MojoExecutionScopeTest.java @@ -30,9 +30,9 @@ import static org.junit.jupiter.api.Assertions.assertSame; import static org.junit.jupiter.api.Assertions.assertThrows; -public class MojoExecutionScopeTest { +class MojoExecutionScopeTest { @Test - public void testNestedEnter() throws Exception { + void testNestedEnter() throws Exception { MojoExecutionScope scope = new MojoExecutionScope(); scope.enter(); @@ -55,7 +55,7 @@ public void testNestedEnter() throws Exception { } @Test - public void testMultiKeyInstance() throws Exception { + void testMultiKeyInstance() throws Exception { MojoExecutionScope scope = new MojoExecutionScope(); scope.enter(); diff --git a/maven-core/src/test/java/org/apache/maven/graph/DefaultGraphBuilderTest.java b/maven-core/src/test/java/org/apache/maven/graph/DefaultGraphBuilderTest.java index 119e50cfcd..e23fb4b151 100644 --- a/maven-core/src/test/java/org/apache/maven/graph/DefaultGraphBuilderTest.java +++ b/maven-core/src/test/java/org/apache/maven/graph/DefaultGraphBuilderTest.java @@ -331,7 +331,7 @@ void testGetReactorProjects( } @BeforeEach - public void before() throws Exception { + void before() throws Exception { graphBuilder = new DefaultGraphBuilder( mock(BuildResumptionDataRepository.class), pomlessCollectionStrategy, diff --git a/maven-core/src/test/java/org/apache/maven/graph/DefaultProjectDependencyGraphTest.java b/maven-core/src/test/java/org/apache/maven/graph/DefaultProjectDependencyGraphTest.java index e132833968..c2bd1be97b 100644 --- a/maven-core/src/test/java/org/apache/maven/graph/DefaultProjectDependencyGraphTest.java +++ b/maven-core/src/test/java/org/apache/maven/graph/DefaultProjectDependencyGraphTest.java @@ -33,7 +33,7 @@ /** * @author Kristian Rosenvold */ -public class DefaultProjectDependencyGraphTest { +class DefaultProjectDependencyGraphTest { private final MavenProject aProject = createA(); @@ -49,7 +49,7 @@ public class DefaultProjectDependencyGraphTest { private final MavenProject transitiveOnly = createProject(Arrays.asList(toDependency(depender3)), "depender5"); @Test - public void testGetSortedProjects() throws DuplicateProjectException, CycleDetectedException { + void testGetSortedProjects() throws DuplicateProjectException, CycleDetectedException { ProjectDependencyGraph graph = new DefaultProjectDependencyGraph(Arrays.asList(depender1, aProject)); final List sortedProjects = graph.getSortedProjects(); assertEquals(aProject, sortedProjects.get(0)); @@ -57,7 +57,7 @@ public void testGetSortedProjects() throws DuplicateProjectException, CycleDetec } @Test - public void testVerifyExpectedParentStructure() throws CycleDetectedException, DuplicateProjectException { + void testVerifyExpectedParentStructure() throws CycleDetectedException, DuplicateProjectException { // This test verifies the baseline structure used in subsequent tests. If this fails, the rest will fail. ProjectDependencyGraph graph = threeProjectsDependingOnASingle(); final List sortedProjects = graph.getSortedProjects(); @@ -68,8 +68,7 @@ public void testVerifyExpectedParentStructure() throws CycleDetectedException, D } @Test - public void testVerifyThatDownstreamProjectsComeInSortedOrder() - throws CycleDetectedException, DuplicateProjectException { + void testVerifyThatDownstreamProjectsComeInSortedOrder() throws CycleDetectedException, DuplicateProjectException { final List downstreamProjects = threeProjectsDependingOnASingle().getDownstreamProjects(aProject, true); assertEquals(depender1, downstreamProjects.get(0)); @@ -78,7 +77,7 @@ public void testVerifyThatDownstreamProjectsComeInSortedOrder() } @Test - public void testTransitivesInOrder() throws CycleDetectedException, DuplicateProjectException { + void testTransitivesInOrder() throws CycleDetectedException, DuplicateProjectException { final ProjectDependencyGraph graph = new DefaultProjectDependencyGraph(Arrays.asList(depender1, depender4, depender2, depender3, aProject)); @@ -90,7 +89,7 @@ public void testTransitivesInOrder() throws CycleDetectedException, DuplicatePro } @Test - public void testNonTransitivesInOrder() throws CycleDetectedException, DuplicateProjectException { + void testNonTransitivesInOrder() throws CycleDetectedException, DuplicateProjectException { final ProjectDependencyGraph graph = new DefaultProjectDependencyGraph(Arrays.asList(depender1, depender4, depender2, depender3, aProject)); @@ -102,7 +101,7 @@ public void testNonTransitivesInOrder() throws CycleDetectedException, Duplicate } @Test - public void testWithTransitiveOnly() throws CycleDetectedException, DuplicateProjectException { + void testWithTransitiveOnly() throws CycleDetectedException, DuplicateProjectException { final ProjectDependencyGraph graph = new DefaultProjectDependencyGraph( Arrays.asList(depender1, transitiveOnly, depender2, depender3, aProject)); @@ -114,7 +113,7 @@ public void testWithTransitiveOnly() throws CycleDetectedException, DuplicatePro } @Test - public void testWithMissingTransitiveOnly() throws CycleDetectedException, DuplicateProjectException { + void testWithMissingTransitiveOnly() throws CycleDetectedException, DuplicateProjectException { final ProjectDependencyGraph graph = new DefaultProjectDependencyGraph( Arrays.asList(depender1, transitiveOnly, depender2, depender3, aProject)); @@ -125,7 +124,7 @@ public void testWithMissingTransitiveOnly() throws CycleDetectedException, Dupli } @Test - public void testGetUpstreamProjects() throws CycleDetectedException, DuplicateProjectException { + void testGetUpstreamProjects() throws CycleDetectedException, DuplicateProjectException { ProjectDependencyGraph graph = threeProjectsDependingOnASingle(); final List downstreamProjects = graph.getUpstreamProjects(depender1, true); assertEquals(aProject, downstreamProjects.get(0)); diff --git a/maven-core/src/test/java/org/apache/maven/internal/MultilineMessageHelperTest.java b/maven-core/src/test/java/org/apache/maven/internal/MultilineMessageHelperTest.java index 7b922a8438..819b9e8fb9 100644 --- a/maven-core/src/test/java/org/apache/maven/internal/MultilineMessageHelperTest.java +++ b/maven-core/src/test/java/org/apache/maven/internal/MultilineMessageHelperTest.java @@ -25,10 +25,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals; -public class MultilineMessageHelperTest { +class MultilineMessageHelperTest { @Test - public void testBuilderCommon() { + void testBuilderCommon() { List msgs = new ArrayList<>(); msgs.add("*****************************************************************"); msgs.add("* Your build is requesting parallel execution, but project *"); @@ -51,7 +51,7 @@ public void testBuilderCommon() { } @Test - public void testMojoExecutor() { + void testMojoExecutor() { List msgs = new ArrayList<>(); msgs.add("*****************************************************************"); msgs.add("* An aggregator Mojo is already executing in parallel build, *"); diff --git a/maven-core/src/test/java/org/apache/maven/internal/aether/ReverseTreeRepositoryListenerTest.java b/maven-core/src/test/java/org/apache/maven/internal/aether/ReverseTreeRepositoryListenerTest.java index 6d151dfdc1..8e7210b979 100644 --- a/maven-core/src/test/java/org/apache/maven/internal/aether/ReverseTreeRepositoryListenerTest.java +++ b/maven-core/src/test/java/org/apache/maven/internal/aether/ReverseTreeRepositoryListenerTest.java @@ -37,9 +37,9 @@ /** * UT for {@link ReverseTreeRepositoryListener}. */ -public class ReverseTreeRepositoryListenerTest { +class ReverseTreeRepositoryListenerTest { @Test - public void isLocalRepositoryArtifactTest() { + void isLocalRepositoryArtifactTest() { File baseDir = new File("local/repository"); LocalRepository localRepository = new LocalRepository(baseDir); RepositorySystemSession session = mock(RepositorySystemSession.class); @@ -60,7 +60,7 @@ public void isLocalRepositoryArtifactTest() { } @Test - public void isMissingArtifactTest() { + void isMissingArtifactTest() { File baseDir = new File("local/repository"); LocalRepository localRepository = new LocalRepository(baseDir); RepositorySystemSession session = mock(RepositorySystemSession.class); @@ -75,7 +75,7 @@ public void isMissingArtifactTest() { } @Test - public void lookupCollectStepDataTest() { + void lookupCollectStepDataTest() { RequestTrace doesNotHaveIt = RequestTrace.newChild(null, "foo").newChild("bar").newChild("baz"); assertThat(ReverseTreeRepositoryListener.lookupCollectStepData(doesNotHaveIt), nullValue()); diff --git a/maven-core/src/test/java/org/apache/maven/internal/impl/PropertiesAsMapTest.java b/maven-core/src/test/java/org/apache/maven/internal/impl/PropertiesAsMapTest.java index 2a0003d8c0..1d7036f70a 100644 --- a/maven-core/src/test/java/org/apache/maven/internal/impl/PropertiesAsMapTest.java +++ b/maven-core/src/test/java/org/apache/maven/internal/impl/PropertiesAsMapTest.java @@ -32,10 +32,10 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; -public class PropertiesAsMapTest { +class PropertiesAsMapTest { @Test - public void testPropertiesAsMap() { + void testPropertiesAsMap() { Properties props = new Properties(); props.setProperty("foo1", "bar1"); props.setProperty("foo2", "bar2"); diff --git a/maven-core/src/test/java/org/apache/maven/internal/impl/TestApi.java b/maven-core/src/test/java/org/apache/maven/internal/impl/TestApi.java index 121a9a59c4..7117ae588e 100644 --- a/maven-core/src/test/java/org/apache/maven/internal/impl/TestApi.java +++ b/maven-core/src/test/java/org/apache/maven/internal/impl/TestApi.java @@ -55,7 +55,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; @PlexusTest -public class TestApi { +class TestApi { Session session; diff --git a/maven-core/src/test/java/org/apache/maven/internal/transformation/ConsumerPomArtifactTransformerTest.java b/maven-core/src/test/java/org/apache/maven/internal/transformation/ConsumerPomArtifactTransformerTest.java index 64f95422bb..c9d46f93f9 100644 --- a/maven-core/src/test/java/org/apache/maven/internal/transformation/ConsumerPomArtifactTransformerTest.java +++ b/maven-core/src/test/java/org/apache/maven/internal/transformation/ConsumerPomArtifactTransformerTest.java @@ -28,9 +28,9 @@ import org.junit.jupiter.api.Test; import org.xmlunit.assertj.XmlAssert; -public class ConsumerPomArtifactTransformerTest { +class ConsumerPomArtifactTransformerTest { @Test - public void transform() throws Exception { + void transform() throws Exception { Path beforePomFile = Paths.get("src/test/resources/projects/transform/before.pom").toAbsolutePath(); Path afterPomFile = diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultLifecyclesTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultLifecyclesTest.java index 16f3cb26c5..312524cbdf 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultLifecyclesTest.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultLifecyclesTest.java @@ -43,47 +43,47 @@ * @author Kristian Rosenvold */ @PlexusTest -public class DefaultLifecyclesTest { +class DefaultLifecyclesTest { @Inject private DefaultLifecycles defaultLifeCycles; @Test - public void testDefaultLifecycles() { + void testDefaultLifecycles() { final List lifecycles = defaultLifeCycles.getLifeCycles(); assertThat(lifecycles, hasSize(4)); assertThat(DefaultLifecycles.STANDARD_LIFECYCLES, arrayWithSize(4)); } @Test - public void testDefaultLifecycle() { + void testDefaultLifecycle() { final Lifecycle lifecycle = getLifeCycleById("default"); assertThat(lifecycle.getId(), is("default")); assertThat(lifecycle.getPhases(), hasSize(23)); } @Test - public void testCleanLifecycle() { + void testCleanLifecycle() { final Lifecycle lifecycle = getLifeCycleById("clean"); assertThat(lifecycle.getId(), is("clean")); assertThat(lifecycle.getPhases(), hasSize(3)); } @Test - public void testSiteLifecycle() { + void testSiteLifecycle() { final Lifecycle lifecycle = getLifeCycleById("site"); assertThat(lifecycle.getId(), is("site")); assertThat(lifecycle.getPhases(), hasSize(4)); } @Test - public void testWrapperLifecycle() { + void testWrapperLifecycle() { final Lifecycle lifecycle = getLifeCycleById("wrapper"); assertThat(lifecycle.getId(), is("wrapper")); assertThat(lifecycle.getPhases(), hasSize(1)); } @Test - public void testCustomLifecycle() throws ComponentLookupException { + void testCustomLifecycle() throws ComponentLookupException { List myLifecycles = new ArrayList<>(); Lifecycle myLifecycle = new Lifecycle("etl", Arrays.asList("extract", "transform", "load"), Collections.emptyMap()); diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorSubModulesTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorSubModulesTest.java index 1758cd740d..6bf394aac7 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorSubModulesTest.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorSubModulesTest.java @@ -36,7 +36,7 @@ * * @author Kristian Rosenvold */ -public class LifecycleExecutorSubModulesTest extends AbstractCoreMavenComponentTestCase { +class LifecycleExecutorSubModulesTest extends AbstractCoreMavenComponentTestCase { @Inject private DefaultLifecycles defaultLifeCycles; @@ -66,7 +66,7 @@ protected String getProjectsDirectory() { } @Test - public void testCreation() throws Exception { + void testCreation() throws Exception { assertNotNull(defaultLifeCycles); assertNotNull(mojoExecutor); assertNotNull(lifeCycleBuilder); diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorTest.java index 18b5078020..2c742b4c87 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorTest.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorTest.java @@ -56,7 +56,7 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; -public class LifecycleExecutorTest extends AbstractCoreMavenComponentTestCase { +class LifecycleExecutorTest extends AbstractCoreMavenComponentTestCase { @Inject private DefaultLifecycleExecutor lifecycleExecutor; @@ -78,7 +78,7 @@ protected String getProjectsDirectory() { // ----------------------------------------------------------------------------------------------- @Test - public void testCalculationOfBuildPlanWithIndividualTaskWherePluginIsSpecifiedInThePom() throws Exception { + void testCalculationOfBuildPlanWithIndividualTaskWherePluginIsSpecifiedInThePom() throws Exception { // We are doing something like "mvn resources:resources" where no version is specified but this // project we are working on has the version specified in the POM so the version should come from there. File pom = getProject("project-basic"); @@ -100,7 +100,7 @@ public void testCalculationOfBuildPlanWithIndividualTaskWherePluginIsSpecifiedIn } @Test - public void testCalculationOfBuildPlanWithIndividualTaskOfTheCleanLifecycle() throws Exception { + void testCalculationOfBuildPlanWithIndividualTaskOfTheCleanLifecycle() throws Exception { // We are doing something like "mvn clean:clean" where no version is specified but this // project we are working on has the version specified in the POM so the version should come from there. File pom = getProject("project-basic"); @@ -122,7 +122,7 @@ public void testCalculationOfBuildPlanWithIndividualTaskOfTheCleanLifecycle() th } @Test - public void testCalculationOfBuildPlanWithIndividualTaskOfTheCleanCleanGoal() throws Exception { + void testCalculationOfBuildPlanWithIndividualTaskOfTheCleanCleanGoal() throws Exception { // We are doing something like "mvn clean:clean" where no version is specified but this // project we are working on has the version specified in the POM so the version should come from there. File pom = getProject("project-basic"); @@ -258,7 +258,7 @@ public void testCalculationOfBuildPlanWithMultipleExecutionsOfModello() throws E } @Test - public void testLifecycleQueryingUsingADefaultLifecyclePhase() throws Exception { + void testLifecycleQueryingUsingADefaultLifecyclePhase() throws Exception { File pom = getProject("project-with-additional-lifecycle-elements"); MavenSession session = createMavenSession(pom); assertEquals( @@ -297,14 +297,14 @@ public void testLifecycleQueryingUsingADefaultLifecyclePhase() throws Exception } @Test - public void testLifecyclePluginsRetrievalForDefaultLifecycle() throws Exception { + void testLifecyclePluginsRetrievalForDefaultLifecycle() throws Exception { List plugins = new ArrayList<>(lifecycleExecutor.getPluginsBoundByDefaultToAllLifecycles("jar")); assertThat(plugins.toString(), plugins, hasSize(9)); } @Test - public void testPluginConfigurationCreation() throws Exception { + void testPluginConfigurationCreation() throws Exception { File pom = getProject("project-with-additional-lifecycle-elements"); MavenSession session = createMavenSession(pom); MojoDescriptor mojoDescriptor = mojoDescriptorCreator.getMojoDescriptor( @@ -328,7 +328,7 @@ MavenExecutionPlan calculateExecutionPlan(MavenSession session, String... tasks) } @Test - public void testInvalidGoalName() throws Exception { + void testInvalidGoalName() throws Exception { File pom = getProject("project-basic"); MavenSession session = createMavenSession(pom); MojoNotFoundException e = assertThrows( @@ -346,7 +346,7 @@ public void testInvalidGoalName() throws Exception { } @Test - public void testPluginPrefixRetrieval() throws Exception { + void testPluginPrefixRetrieval() throws Exception { File pom = getProject("project-basic"); MavenSession session = createMavenSession(pom); Plugin plugin = mojoDescriptorCreator.findPluginForPrefix("resources", session); @@ -357,7 +357,7 @@ public void testPluginPrefixRetrieval() throws Exception { // Prefixes @Test - public void testFindingPluginPrefixForCleanClean() throws Exception { + void testFindingPluginPrefixForCleanClean() throws Exception { File pom = getProject("project-basic"); MavenSession session = createMavenSession(pom); Plugin plugin = mojoDescriptorCreator.findPluginForPrefix("clean", session); @@ -365,7 +365,7 @@ public void testFindingPluginPrefixForCleanClean() throws Exception { } @Test - public void testSetupMojoExecution() throws Exception { + void testSetupMojoExecution() throws Exception { File pom = getProject("mojo-configuration"); MavenSession session = createMavenSession(pom); @@ -385,7 +385,7 @@ public void testSetupMojoExecution() throws Exception { } @Test - public void testExecutionListeners() throws Exception { + void testExecutionListeners() throws Exception { final File pom = getProject("project-basic"); final MavenSession session = createMavenSession(pom); session.setProjectDependencyGraph(new ProjectDependencyGraph() { diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/MavenExecutionPlanTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/MavenExecutionPlanTest.java index 28c15f6ada..33c2ceb0e5 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/MavenExecutionPlanTest.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/MavenExecutionPlanTest.java @@ -32,10 +32,10 @@ /** * @author Kristian Rosenvold */ -public class MavenExecutionPlanTest { +class MavenExecutionPlanTest { @Test - public void testFindLastInPhase() throws Exception { + void testFindLastInPhase() throws Exception { MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExecutionPlan(); ExecutionPlanItem expected = plan.findLastInPhase("package"); @@ -45,7 +45,7 @@ public void testFindLastInPhase() throws Exception { } @Test - public void testThreadSafeMojos() throws Exception { + void testThreadSafeMojos() throws Exception { MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExecutionPlan(); final Set unSafePlugins = plan.getNonThreadSafePlugins(); // There is only a single threadsafe plugin here... @@ -53,7 +53,7 @@ public void testThreadSafeMojos() throws Exception { } @Test - public void testFindLastWhenFirst() throws Exception { + void testFindLastWhenFirst() throws Exception { MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExecutionPlan(); ExecutionPlanItem beerPhase = plan.findLastInPhase( @@ -62,7 +62,7 @@ public void testFindLastWhenFirst() throws Exception { } @Test - public void testFindLastInPhaseMisc() throws Exception { + void testFindLastInPhaseMisc() throws Exception { MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExecutionPlan(); assertNull(plan.findLastInPhase("pacXkage")); diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/BuildListCalculatorTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/BuildListCalculatorTest.java index e08ae48abf..8f45138ef0 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/BuildListCalculatorTest.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/BuildListCalculatorTest.java @@ -29,10 +29,10 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertSame; -public class BuildListCalculatorTest { +class BuildListCalculatorTest { @Test - public void testCalculateProjectBuilds() throws Exception { + void testCalculateProjectBuilds() throws Exception { LifecycleTaskSegmentCalculator lifecycleTaskSegmentCalculator = getTaskSegmentCalculator(); BuildListCalculator buildListCalculator = new BuildListCalculator(); final MavenSession session = ProjectDependencyGraphStub.getMavenSession(); diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/ConcurrencyDependencyGraphTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/ConcurrencyDependencyGraphTest.java index 899505a92a..fb24e23889 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/ConcurrencyDependencyGraphTest.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/ConcurrencyDependencyGraphTest.java @@ -48,9 +48,9 @@ /** * @author Kristian Rosenvold */ -public class ConcurrencyDependencyGraphTest { +class ConcurrencyDependencyGraphTest { @Test - public void testConcurrencyGraphPrimaryVersion() + void testConcurrencyGraphPrimaryVersion() throws InvalidPluginDescriptorException, PluginVersionResolutionException, PluginDescriptorParsingException, NoPluginFoundForPrefixException, MojoNotFoundException, PluginNotFoundException, PluginResolutionException, LifecyclePhaseNotFoundException, LifecycleNotFoundException { @@ -80,7 +80,7 @@ public void testConcurrencyGraphPrimaryVersion() } @Test - public void testConcurrencyGraphDifferentCompletionOrder() + void testConcurrencyGraphDifferentCompletionOrder() throws InvalidPluginDescriptorException, PluginVersionResolutionException, PluginDescriptorParsingException, NoPluginFoundForPrefixException, MojoNotFoundException, PluginNotFoundException, PluginResolutionException, LifecyclePhaseNotFoundException, LifecycleNotFoundException { diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleDependencyResolverTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleDependencyResolverTest.java index d696e0f18a..3ff43bc2d2 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleDependencyResolverTest.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleDependencyResolverTest.java @@ -36,7 +36,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; -public class LifecycleDependencyResolverTest extends AbstractCoreMavenComponentTestCase { +class LifecycleDependencyResolverTest extends AbstractCoreMavenComponentTestCase { @Inject private LifecycleDependencyResolver resolver; @@ -46,7 +46,7 @@ protected String getProjectsDirectory() { } @Test - public void testCachedReactorProjectDependencies() throws Exception { + void testCachedReactorProjectDependencies() throws Exception { MavenSession session = createMavenSession( new File("src/test/projects/lifecycle-dependency-resolver/pom.xml"), new Properties(), true); Collection scopesToCollect = null; diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleExecutionPlanCalculatorTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleExecutionPlanCalculatorTest.java index 8b7a64cb97..f104878111 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleExecutionPlanCalculatorTest.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleExecutionPlanCalculatorTest.java @@ -34,10 +34,10 @@ /** * @author Kristian Rosenvold */ -public class LifecycleExecutionPlanCalculatorTest extends AbstractCoreMavenComponentTestCase { +class LifecycleExecutionPlanCalculatorTest extends AbstractCoreMavenComponentTestCase { @Test - public void testCalculateExecutionPlanWithGoalTasks() throws Exception { + void testCalculateExecutionPlanWithGoalTasks() throws Exception { MojoDescriptorCreator mojoDescriptorCreator = createMojoDescriptorCreator(); LifecycleExecutionPlanCalculator lifecycleExecutionPlanCalculator = createExecutionPlaceCalculator(mojoDescriptorCreator); diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilderTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilderTest.java index c162463f66..8d018ac61b 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilderTest.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilderTest.java @@ -44,12 +44,12 @@ import static org.junit.jupiter.api.Assertions.assertNull; @PlexusTest -public class LifecycleModuleBuilderTest { +class LifecycleModuleBuilderTest { @Inject PlexusContainer container; @Test - public void testCurrentProject() throws Exception { + void testCurrentProject() throws Exception { List currentProjects = new ArrayList<>(); MojoExecutorStub mojoExecutor = new MojoExecutorStub() { @Override diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleTaskSegmentCalculatorImplTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleTaskSegmentCalculatorImplTest.java index 6270aeaab8..637f9883cc 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleTaskSegmentCalculatorImplTest.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleTaskSegmentCalculatorImplTest.java @@ -31,9 +31,9 @@ /** * @author Kristian Rosenvold */ -public class LifecycleTaskSegmentCalculatorImplTest { +class LifecycleTaskSegmentCalculatorImplTest { @Test - public void testCalculateProjectBuilds() throws Exception { + void testCalculateProjectBuilds() throws Exception { LifecycleTaskSegmentCalculator lifecycleTaskSegmentCalculator = getTaskSegmentCalculator(); BuildListCalculator buildListCalculator = new BuildListCalculator(); final MavenSession session = ProjectDependencyGraphStub.getMavenSession(); diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/PhaseRecorderTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/PhaseRecorderTest.java index b402c5f1e3..4d84a41f8a 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/PhaseRecorderTest.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/PhaseRecorderTest.java @@ -32,9 +32,9 @@ /** * @author Kristian Rosenvold */ -public class PhaseRecorderTest { +class PhaseRecorderTest { @Test - public void testObserveExecution() throws Exception { + void testObserveExecution() throws Exception { PhaseRecorder phaseRecorder = new PhaseRecorder(ProjectDependencyGraphStub.A); MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExecutionPlan(); final List executions = plan.getMojoExecutions(); diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/ProjectBuildListTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/ProjectBuildListTest.java index 64d44c7bad..8ffb5b38ec 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/ProjectBuildListTest.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/ProjectBuildListTest.java @@ -30,9 +30,9 @@ /** * @author Kristian Rosenvold */ -public class ProjectBuildListTest { +class ProjectBuildListTest { @Test - public void testGetByTaskSegment() throws Exception { + void testGetByTaskSegment() throws Exception { final MavenSession session = ProjectDependencyGraphStub.getMavenSession(); ProjectBuildList projectBuildList = ProjectDependencyGraphStub.getProjectBuildList(session); TaskSegment taskSegment = projectBuildList.get(0).getTaskSegment(); diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/builder/BuilderCommonTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/builder/BuilderCommonTest.java index f6546e5309..08e177b821 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/builder/BuilderCommonTest.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/builder/BuilderCommonTest.java @@ -37,11 +37,11 @@ /** * @author Kristian Rosenvold */ -public class BuilderCommonTest { +class BuilderCommonTest { private Logger logger = mock(Logger.class); @Test - public void testResolveBuildPlan() throws Exception { + void testResolveBuildPlan() throws Exception { MavenSession original = ProjectDependencyGraphStub.getMavenSession(); final TaskSegment taskSegment1 = new TaskSegment(false); @@ -56,7 +56,7 @@ public void testResolveBuildPlan() throws Exception { } @Test - public void testDefaultBindingPluginsWarning() throws Exception { + void testDefaultBindingPluginsWarning() throws Exception { MavenSession original = ProjectDependencyGraphStub.getMavenSession(); final TaskSegment taskSegment1 = new TaskSegment(false); @@ -80,13 +80,13 @@ public void testDefaultBindingPluginsWarning() throws Exception { } @Test - public void testHandleBuildError() throws Exception {} + void testHandleBuildError() throws Exception {} @Test - public void testAttachToThread() throws Exception {} + void testAttachToThread() throws Exception {} @Test - public void testGetKey() throws Exception {} + void testGetKey() throws Exception {} public BuilderCommon getBuilderCommon(Logger logger) { final LifecycleDebugLogger debugLogger = new LifecycleDebugLogger(); diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ConcurrencyDependencyGraphTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ConcurrencyDependencyGraphTest.java index a1d3b770c3..6cfc7fb943 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ConcurrencyDependencyGraphTest.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ConcurrencyDependencyGraphTest.java @@ -29,10 +29,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals; -public class ConcurrencyDependencyGraphTest { +class ConcurrencyDependencyGraphTest { @Test - public void testGraph() throws Exception { + void testGraph() throws Exception { ProjectBuildList projectBuildList = ProjectDependencyGraphStub.getProjectBuildList(ProjectDependencyGraphStub.getMavenSession()); diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ThreadOutputMuxerTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ThreadOutputMuxerTest.java index 7406ed1614..764bd40e26 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ThreadOutputMuxerTest.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ThreadOutputMuxerTest.java @@ -51,7 +51,7 @@ /** * @author Kristian Rosenvold */ -public class ThreadOutputMuxerTest { +class ThreadOutputMuxerTest { final String paid = "Paid"; @@ -60,7 +60,7 @@ public class ThreadOutputMuxerTest { final String full = "Full"; @Test - public void testSingleThreaded() throws Exception { + void testSingleThreaded() throws Exception { ProjectBuildList src = getProjectBuildList(); ProjectBuildList projectBuildList = new ProjectBuildList(Arrays.asList(src.get(0), src.get(1), src.get(2))); @@ -86,7 +86,7 @@ public void testSingleThreaded() throws Exception { } @Test - public void testMultiThreaded() throws Exception { + void testMultiThreaded() throws Exception { ProjectBuildList projectBuildList = getProjectBuildList(); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependencyGraphStubTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependencyGraphStubTest.java index 40b4ffd591..b568107c6d 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependencyGraphStubTest.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependencyGraphStubTest.java @@ -31,31 +31,31 @@ * * @author Kristian Rosenvold */ -public class ProjectDependencyGraphStubTest { +class ProjectDependencyGraphStubTest { ProjectDependencyGraphStub stub = new ProjectDependencyGraphStub(); @Test - public void testADependencies() { + void testADependencies() { final List mavenProjects = stub.getUpstreamProjects(ProjectDependencyGraphStub.A, false); assertEquals(0, mavenProjects.size()); } @Test - public void testBDependencies() { + void testBDependencies() { final List bProjects = stub.getUpstreamProjects(ProjectDependencyGraphStub.B, false); assertEquals(1, bProjects.size()); assertTrue(bProjects.contains(ProjectDependencyGraphStub.A)); } @Test - public void testCDependencies() { + void testCDependencies() { final List cProjects = stub.getUpstreamProjects(ProjectDependencyGraphStub.C, false); assertEquals(1, cProjects.size()); assertTrue(cProjects.contains(ProjectDependencyGraphStub.A)); } @Test - public void testXDependencies() { + void testXDependencies() { final List cProjects = stub.getUpstreamProjects(ProjectDependencyGraphStub.X, false); assertEquals(2, cProjects.size()); assertTrue(cProjects.contains(ProjectDependencyGraphStub.C)); diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/mapping/LifecyclePhaseTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/mapping/LifecyclePhaseTest.java index ff2c7eca53..5331432890 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/mapping/LifecyclePhaseTest.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/mapping/LifecyclePhaseTest.java @@ -30,9 +30,9 @@ /** * @author atanasenko */ -public class LifecyclePhaseTest { +class LifecyclePhaseTest { @Test - public void testToString() { + void testToString() { LifecyclePhase phase = new LifecyclePhase(); assertEquals("", phase.toString()); @@ -48,7 +48,7 @@ public void testToString() { } @Test - public void testSet() { + void testSet() { LifecyclePhase phase = new LifecyclePhase(); assertNull(phase.getMojos()); diff --git a/maven-core/src/test/java/org/apache/maven/plugin/PluginManagerTest.java b/maven-core/src/test/java/org/apache/maven/plugin/PluginManagerTest.java index ef54bb72d3..7020e40d25 100644 --- a/maven-core/src/test/java/org/apache/maven/plugin/PluginManagerTest.java +++ b/maven-core/src/test/java/org/apache/maven/plugin/PluginManagerTest.java @@ -39,7 +39,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.fail; -public class PluginManagerTest extends AbstractCoreMavenComponentTestCase { +class PluginManagerTest extends AbstractCoreMavenComponentTestCase { @Inject private DefaultBuildPluginManager pluginManager; @@ -48,7 +48,7 @@ protected String getProjectsDirectory() { } @Test - public void testPluginLoading() throws Exception { + void testPluginLoading() throws Exception { MavenSession session = createMavenSession(null); Plugin plugin = new Plugin(); plugin.setGroupId("org.apache.maven.its.plugins"); @@ -60,7 +60,7 @@ public void testPluginLoading() throws Exception { } @Test - public void testMojoDescriptorRetrieval() throws Exception { + void testMojoDescriptorRetrieval() throws Exception { MavenSession session = createMavenSession(null); String goal = "it"; Plugin plugin = new Plugin(); @@ -97,7 +97,7 @@ public void testMojoDescriptorRetrieval() throws Exception { // the plugin manager provides. @Test - public void testRemoteResourcesPlugin() throws Exception { + void testRemoteResourcesPlugin() throws Exception { // TODO turn an equivalent back on when the RR plugin is released. /* @@ -147,7 +147,7 @@ public void testSurefirePlugin() throws Exception { } @Test - public void testMojoConfigurationIsMergedCorrectly() throws Exception {} + void testMojoConfigurationIsMergedCorrectly() throws Exception {} /** * The case where the user wants to specify an alternate version of the underlying tool. Common case @@ -155,28 +155,28 @@ public void testMojoConfigurationIsMergedCorrectly() throws Exception {} * to use a specific version. We need to make sure the version that they specify takes precedence. */ @Test - public void testMojoWhereInternallyStatedDependencyIsOverriddenByProject() throws Exception {} + void testMojoWhereInternallyStatedDependencyIsOverriddenByProject() throws Exception {} /** * The case where you have a plugin in the current build that you want to be used on projects in * the current build. */ @Test - public void testMojoThatIsPresentInTheCurrentBuild() throws Exception {} + void testMojoThatIsPresentInTheCurrentBuild() throws Exception {} /** * This is the case where the Mojo wants to execute on every project and then do something at the end * with the results of each project. */ @Test - public void testAggregatorMojo() throws Exception {} + void testAggregatorMojo() throws Exception {} /** * This is the case where a Mojo needs the lifecycle run to a certain phase before it can do * anything useful. */ @Test - public void testMojoThatRequiresExecutionToAGivenPhaseBeforeExecutingItself() throws Exception {} + void testMojoThatRequiresExecutionToAGivenPhaseBeforeExecutingItself() throws Exception {} // test that mojo which does not require dependency resolution trigger no downloading of dependencies @@ -185,7 +185,7 @@ public void testMojoThatRequiresExecutionToAGivenPhaseBeforeExecutingItself() th // test a build where projects use different versions of the same plugin @Test - public void testThatPluginDependencyThatHasSystemScopeIsResolved() throws Exception { + void testThatPluginDependencyThatHasSystemScopeIsResolved() throws Exception { MavenSession session = createMavenSession(getProject("project-contributing-system-scope-plugin-dep")); MavenProject project = session.getCurrentProject(); Plugin plugin = project.getPlugin("org.apache.maven.its.plugins:maven-it-plugin"); @@ -225,7 +225,7 @@ protected void assertPluginDescriptor( } @Test - public void testPluginRealmCache() throws Exception { + void testPluginRealmCache() throws Exception { RepositoryRequest repositoryRequest = new DefaultRepositoryRequest(); repositoryRequest.setLocalRepository(getLocalRepository()); repositoryRequest.setRemoteRepositories(getPluginArtifactRepositories()); @@ -264,7 +264,7 @@ public void testPluginRealmCache() throws Exception { } @Test - public void testBuildExtensionsPluginLoading() throws Exception { + void testBuildExtensionsPluginLoading() throws Exception { RepositoryRequest repositoryRequest = new DefaultRepositoryRequest(); repositoryRequest.setLocalRepository(getLocalRepository()); repositoryRequest.setRemoteRepositories(getPluginArtifactRepositories()); diff --git a/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExceptionTest.java b/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExceptionTest.java index 5336f7642c..64975cfb2e 100644 --- a/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExceptionTest.java +++ b/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExceptionTest.java @@ -33,12 +33,12 @@ * @author Robert Scholte * */ -public class PluginParameterExceptionTest { +class PluginParameterExceptionTest { private final String LS = System.lineSeparator(); @Test - public void testMissingRequiredStringArrayTypeParameter() { + void testMissingRequiredStringArrayTypeParameter() { MojoDescriptor mojoDescriptor = new MojoDescriptor(); mojoDescriptor.setGoal("goal"); PluginDescriptor pluginDescriptor = new PluginDescriptor(); @@ -70,7 +70,7 @@ public void testMissingRequiredStringArrayTypeParameter() { } @Test - public void testMissingRequiredCollectionTypeParameter() { + void testMissingRequiredCollectionTypeParameter() { MojoDescriptor mojoDescriptor = new MojoDescriptor(); mojoDescriptor.setGoal("goal"); PluginDescriptor pluginDescriptor = new PluginDescriptor(); @@ -102,7 +102,7 @@ public void testMissingRequiredCollectionTypeParameter() { } @Test - public void testMissingRequiredMapTypeParameter() { + void testMissingRequiredMapTypeParameter() { MojoDescriptor mojoDescriptor = new MojoDescriptor(); mojoDescriptor.setGoal("goal"); PluginDescriptor pluginDescriptor = new PluginDescriptor(); @@ -134,7 +134,7 @@ public void testMissingRequiredMapTypeParameter() { } @Test - public void testMissingRequiredPropertiesTypeParameter() { + void testMissingRequiredPropertiesTypeParameter() { MojoDescriptor mojoDescriptor = new MojoDescriptor(); mojoDescriptor.setGoal("goal"); PluginDescriptor pluginDescriptor = new PluginDescriptor(); diff --git a/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorTest.java b/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorTest.java index 921331baac..39db5828af 100644 --- a/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorTest.java +++ b/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorTest.java @@ -58,14 +58,14 @@ /** * @author Jason van Zyl */ -public class PluginParameterExpressionEvaluatorTest extends AbstractCoreMavenComponentTestCase { +class PluginParameterExpressionEvaluatorTest extends AbstractCoreMavenComponentTestCase { private static final String FS = File.separator; @Inject private RepositorySystem factory; @Test - public void testPluginDescriptorExpressionReference() throws Exception { + void testPluginDescriptorExpressionReference() throws Exception { MojoExecution exec = newMojoExecution(); MavenSession session = newMavenSession(); @@ -81,7 +81,7 @@ public void testPluginDescriptorExpressionReference() throws Exception { } @Test - public void testPluginArtifactsExpressionReference() throws Exception { + void testPluginArtifactsExpressionReference() throws Exception { MojoExecution exec = newMojoExecution(); Artifact depArtifact = createArtifact("group", "artifact", "1"); @@ -105,7 +105,7 @@ public void testPluginArtifactsExpressionReference() throws Exception { } @Test - public void testPluginArtifactMapExpressionReference() throws Exception { + void testPluginArtifactMapExpressionReference() throws Exception { MojoExecution exec = newMojoExecution(); Artifact depArtifact = createArtifact("group", "artifact", "1"); @@ -132,7 +132,7 @@ public void testPluginArtifactMapExpressionReference() throws Exception { } @Test - public void testPluginArtifactIdExpressionReference() throws Exception { + void testPluginArtifactIdExpressionReference() throws Exception { MojoExecution exec = newMojoExecution(); MavenSession session = newMavenSession(); @@ -148,7 +148,7 @@ public void testPluginArtifactIdExpressionReference() throws Exception { } @Test - public void testValueExtractionWithAPomValueContainingAPath() throws Exception { + void testValueExtractionWithAPomValueContainingAPath() throws Exception { String expected = getTestFile("target/test-classes/target/classes").getCanonicalPath(); Build build = new Build(); @@ -169,7 +169,7 @@ public void testValueExtractionWithAPomValueContainingAPath() throws Exception { } @Test - public void testEscapedVariablePassthrough() throws Exception { + void testEscapedVariablePassthrough() throws Exception { String var = "${var}"; Model model = new Model(); @@ -185,7 +185,7 @@ public void testEscapedVariablePassthrough() throws Exception { } @Test - public void testEscapedVariablePassthroughInLargerExpression() throws Exception { + void testEscapedVariablePassthroughInLargerExpression() throws Exception { String var = "${var}"; String key = var + " with version: ${project.version}"; @@ -202,7 +202,7 @@ public void testEscapedVariablePassthroughInLargerExpression() throws Exception } @Test - public void testMultipleSubExpressionsInLargerExpression() throws Exception { + void testMultipleSubExpressionsInLargerExpression() throws Exception { String key = "${project.artifactId} with version: ${project.version}"; Model model = new Model(); @@ -219,7 +219,7 @@ public void testMultipleSubExpressionsInLargerExpression() throws Exception { } @Test - public void testMissingPOMPropertyRefInLargerExpression() throws Exception { + void testMissingPOMPropertyRefInLargerExpression() throws Exception { String expr = "/path/to/someproject-${baseVersion}"; MavenProject project = new MavenProject(new Model()); @@ -232,7 +232,7 @@ public void testMissingPOMPropertyRefInLargerExpression() throws Exception { } @Test - public void testPOMPropertyExtractionWithMissingProject_WithDotNotation() throws Exception { + void testPOMPropertyExtractionWithMissingProject_WithDotNotation() throws Exception { String key = "m2.name"; String checkValue = "value"; @@ -252,7 +252,7 @@ public void testPOMPropertyExtractionWithMissingProject_WithDotNotation() throws } @Test - public void testBasedirExtractionWithMissingProject() throws Exception { + void testBasedirExtractionWithMissingProject() throws Exception { ExpressionEvaluator ee = createExpressionEvaluator(null, null, new Properties()); Object value = ee.evaluate("${basedir}"); @@ -261,7 +261,7 @@ public void testBasedirExtractionWithMissingProject() throws Exception { } @Test - public void testValueExtractionFromSystemPropertiesWithMissingProject() throws Exception { + void testValueExtractionFromSystemPropertiesWithMissingProject() throws Exception { String sysprop = "PPEET_sysprop1"; Properties executionProperties = new Properties(); @@ -278,7 +278,7 @@ public void testValueExtractionFromSystemPropertiesWithMissingProject() throws E } @Test - public void testValueExtractionFromSystemPropertiesWithMissingProject_WithDotNotation() throws Exception { + void testValueExtractionFromSystemPropertiesWithMissingProject_WithDotNotation() throws Exception { String sysprop = "PPEET.sysprop2"; Properties executionProperties = new Properties(); @@ -308,7 +308,7 @@ private static MavenSession createSession(PlexusContainer container, ArtifactRep } @Test - public void testLocalRepositoryExtraction() throws Exception { + void testLocalRepositoryExtraction() throws Exception { ExpressionEvaluator expressionEvaluator = createExpressionEvaluator(createDefaultProject(), null, new Properties()); Object value = expressionEvaluator.evaluate("${localRepository}"); @@ -317,7 +317,7 @@ public void testLocalRepositoryExtraction() throws Exception { } @Test - public void testTwoExpressions() throws Exception { + void testTwoExpressions() throws Exception { Build build = new Build(); build.setDirectory("expected-directory"); build.setFinalName("expected-finalName"); @@ -334,7 +334,7 @@ public void testTwoExpressions() throws Exception { } @Test - public void testShouldExtractPluginArtifacts() throws Exception { + void testShouldExtractPluginArtifacts() throws Exception { PluginDescriptor pd = new PluginDescriptor(); Artifact artifact = createArtifact("testGroup", "testArtifact", "1.0"); diff --git a/maven-core/src/test/java/org/apache/maven/plugin/internal/DefaultLegacySupportTest.java b/maven-core/src/test/java/org/apache/maven/plugin/internal/DefaultLegacySupportTest.java index 63d14acfc2..83c72b4e79 100644 --- a/maven-core/src/test/java/org/apache/maven/plugin/internal/DefaultLegacySupportTest.java +++ b/maven-core/src/test/java/org/apache/maven/plugin/internal/DefaultLegacySupportTest.java @@ -30,12 +30,12 @@ /** * @author Kristian Rosenvold */ -public class DefaultLegacySupportTest { +class DefaultLegacySupportTest { final CountDownLatch latch = new CountDownLatch(1); final DefaultLegacySupport defaultLegacySupport = new DefaultLegacySupport(); @Test - public void testSetSession() throws Exception { + void testSetSession() throws Exception { MavenExecutionRequest mavenExecutionRequest = new DefaultMavenExecutionRequest(); MavenSession m1 = new MavenSession(null, null, mavenExecutionRequest, null); diff --git a/maven-core/src/test/java/org/apache/maven/plugin/internal/MavenPluginValidatorTest.java b/maven-core/src/test/java/org/apache/maven/plugin/internal/MavenPluginValidatorTest.java index 5d48791109..8633db8dcf 100644 --- a/maven-core/src/test/java/org/apache/maven/plugin/internal/MavenPluginValidatorTest.java +++ b/maven-core/src/test/java/org/apache/maven/plugin/internal/MavenPluginValidatorTest.java @@ -36,7 +36,7 @@ /** * @author Michael Simacek */ -public class MavenPluginValidatorTest extends AbstractCoreMavenComponentTestCase { +class MavenPluginValidatorTest extends AbstractCoreMavenComponentTestCase { @Inject private MavenPluginValidator mavenPluginValidator; @@ -45,7 +45,7 @@ protected String getProjectsDirectory() { } @Test - public void testValidate() { + void testValidate() { Artifact plugin = new DefaultArtifact( "org.apache.maven.its.plugins", "maven-it-plugin", @@ -64,7 +64,7 @@ public void testValidate() { } @Test - public void testInvalidGroupId() { + void testInvalidGroupId() { Artifact plugin = new DefaultArtifact( "org.apache.maven.its.plugins", "maven-it-plugin", @@ -83,7 +83,7 @@ public void testInvalidGroupId() { } @Test - public void testInvalidArtifactId() { + void testInvalidArtifactId() { Artifact plugin = new DefaultArtifact( "org.apache.maven.its.plugins", "maven-it-plugin", @@ -102,7 +102,7 @@ public void testInvalidArtifactId() { } @Test - public void testInvalidVersion() { + void testInvalidVersion() { Artifact plugin = new DefaultArtifact( "org.apache.maven.its.plugins", "maven-it-plugin", diff --git a/maven-core/src/test/java/org/apache/maven/project/DefaultMavenProjectBuilderTest.java b/maven-core/src/test/java/org/apache/maven/project/DefaultMavenProjectBuilderTest.java index 44e60be68e..78b5dd042e 100644 --- a/maven-core/src/test/java/org/apache/maven/project/DefaultMavenProjectBuilderTest.java +++ b/maven-core/src/test/java/org/apache/maven/project/DefaultMavenProjectBuilderTest.java @@ -45,7 +45,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.fail; -public class DefaultMavenProjectBuilderTest extends AbstractMavenProjectTestCase { +class DefaultMavenProjectBuilderTest extends AbstractMavenProjectTestCase { @TempDir File localRepoDir; @@ -73,7 +73,7 @@ protected MavenProject getProject(Artifact pom, boolean allowStub) throws Except * @throws Exception in case of issue */ @Test - public void testBuildFromMiddlePom() throws Exception { + void testBuildFromMiddlePom() throws Exception { File f1 = getTestFile("src/test/resources/projects/grandchild-check/child/pom.xml"); File f2 = getTestFile("src/test/resources/projects/grandchild-check/child/grandchild/pom.xml"); @@ -86,7 +86,7 @@ public void testBuildFromMiddlePom() throws Exception { @Disabled("Maven 4 does not allow duplicate plugin declarations") @Test - public void testDuplicatePluginDefinitionsMerged() throws Exception { + void testDuplicatePluginDefinitionsMerged() throws Exception { File f1 = getTestFile("src/test/resources/projects/duplicate-plugins-merged-pom.xml"); MavenProject project = getProject(f1); @@ -97,7 +97,7 @@ public void testDuplicatePluginDefinitionsMerged() throws Exception { } @Test - public void testFutureModelVersion() throws Exception { + void testFutureModelVersion() throws Exception { File f1 = getTestFile("src/test/resources/projects/future-model-version-pom.xml"); ProjectBuildingException e = assertThrows( @@ -106,7 +106,7 @@ public void testFutureModelVersion() throws Exception { } @Test - public void testPastModelVersion() throws Exception { + void testPastModelVersion() throws Exception { // a Maven 1.x pom will not even // update the resource if we stop supporting modelVersion 4.0.0 File f1 = getTestFile("src/test/resources/projects/past-model-version-pom.xml"); @@ -117,7 +117,7 @@ public void testPastModelVersion() throws Exception { } @Test - public void testFutureSchemaModelVersion() throws Exception { + void testFutureSchemaModelVersion() throws Exception { File f1 = getTestFile("src/test/resources/projects/future-schema-model-version-pom.xml"); ProjectBuildingException e = assertThrows( @@ -126,7 +126,7 @@ public void testFutureSchemaModelVersion() throws Exception { } @Test - public void testBuildStubModelForMissingRemotePom() throws Exception { + void testBuildStubModelForMissingRemotePom() throws Exception { Artifact pom = repositorySystem.createProjectArtifact("org.apache.maven.its", "missing", "0.1"); MavenProject project = getProject(pom, true); @@ -150,7 +150,7 @@ protected ArtifactRepository getLocalRepository() throws Exception { } @Test - public void testPartialResultUponBadDependencyDeclaration() throws Exception { + void testPartialResultUponBadDependencyDeclaration() throws Exception { File pomFile = getTestFile("src/test/resources/projects/bad-dependency.xml"); ProjectBuildingRequest request = newBuildingRequest(); @@ -177,7 +177,7 @@ public void testPartialResultUponBadDependencyDeclaration() throws Exception { * @throws Exception in case of issue */ @Test - public void testBuildValidParentVersionRangeLocally() throws Exception { + void testBuildValidParentVersionRangeLocally() throws Exception { File f1 = getTestFile("src/test/resources/projects/parent-version-range-local-valid/child/pom.xml"); final MavenProject childProject = getProject(f1); @@ -196,7 +196,7 @@ public void testBuildValidParentVersionRangeLocally() throws Exception { * @throws Exception in case of issue */ @Test - public void testBuildParentVersionRangeLocallyWithoutChildVersion() throws Exception { + void testBuildParentVersionRangeLocallyWithoutChildVersion() throws Exception { File f1 = getTestFile( "src/test/resources/projects/parent-version-range-local-child-without-version/child/pom.xml"); @@ -213,7 +213,7 @@ public void testBuildParentVersionRangeLocallyWithoutChildVersion() throws Excep * @throws Exception in case of issue */ @Test - public void testBuildParentVersionRangeLocallyWithChildProjectVersionExpression() throws Exception { + void testBuildParentVersionRangeLocallyWithChildProjectVersionExpression() throws Exception { File f1 = getTestFile( "src/test/resources/projects/parent-version-range-local-child-project-version-expression/child/pom.xml"); @@ -262,7 +262,7 @@ public void testBuildParentVersionRangeLocallyWithChildRevisionExpression() thro * @throws Exception in case of issue */ @Test - public void testBuildParentVersionRangeExternally() throws Exception { + void testBuildParentVersionRangeExternally() throws Exception { File f1 = getTestFile("src/test/resources/projects/parent-version-range-external-valid/pom.xml"); final MavenProject childProject = this.getProjectFromRemoteRepository(f1); @@ -281,7 +281,7 @@ public void testBuildParentVersionRangeExternally() throws Exception { * @throws Exception in case of issue */ @Test - public void testBuildParentVersionRangeExternallyWithoutChildVersion() throws Exception { + void testBuildParentVersionRangeExternallyWithoutChildVersion() throws Exception { File f1 = getTestFile("src/test/resources/projects/parent-version-range-external-child-without-version/pom.xml"); @@ -298,7 +298,7 @@ public void testBuildParentVersionRangeExternallyWithoutChildVersion() throws Ex * @throws Exception in case of issue */ @Test - public void testBuildParentVersionRangeExternallyWithChildProjectVersionExpression() throws Exception { + void testBuildParentVersionRangeExternallyWithChildProjectVersionExpression() throws Exception { File f1 = getTestFile( "src/test/resources/projects/parent-version-range-external-child-project-version-expression/pom.xml"); @@ -315,7 +315,7 @@ public void testBuildParentVersionRangeExternallyWithChildProjectVersionExpressi * @throws Exception in case of issue */ @Test - public void rereadPom_mng7063() throws Exception { + void rereadPom_mng7063() throws Exception { final Path pom = projectRoot.resolve("pom.xml"); final ProjectBuildingRequest buildingRequest = newBuildingRequest(); diff --git a/maven-core/src/test/java/org/apache/maven/project/ExtensionDescriptorBuilderTest.java b/maven-core/src/test/java/org/apache/maven/project/ExtensionDescriptorBuilderTest.java index 2d6b85c484..75bf0ed61d 100644 --- a/maven-core/src/test/java/org/apache/maven/project/ExtensionDescriptorBuilderTest.java +++ b/maven-core/src/test/java/org/apache/maven/project/ExtensionDescriptorBuilderTest.java @@ -38,17 +38,17 @@ * * @author Benjamin Bentmann */ -public class ExtensionDescriptorBuilderTest { +class ExtensionDescriptorBuilderTest { private ExtensionDescriptorBuilder builder; @BeforeEach - public void setUp() throws Exception { + void setUp() throws Exception { builder = new ExtensionDescriptorBuilder(); } @AfterEach - public void tearDown() throws Exception { + void tearDown() throws Exception { builder = null; } @@ -57,7 +57,7 @@ private InputStream toStream(String xml) { } @Test - public void testEmptyDescriptor() throws Exception { + void testEmptyDescriptor() throws Exception { String xml = ""; ExtensionDescriptor ed = builder.build(toStream(xml)); @@ -70,7 +70,7 @@ public void testEmptyDescriptor() throws Exception { } @Test - public void testCompleteDescriptor() throws Exception { + void testCompleteDescriptor() throws Exception { String xml = "" + "" + "" + "a" + "b" + "c" + "" + "" diff --git a/maven-core/src/test/java/org/apache/maven/project/MavenProjectTest.java b/maven-core/src/test/java/org/apache/maven/project/MavenProjectTest.java index 2a0b81b721..402fd3014f 100644 --- a/maven-core/src/test/java/org/apache/maven/project/MavenProjectTest.java +++ b/maven-core/src/test/java/org/apache/maven/project/MavenProjectTest.java @@ -35,10 +35,10 @@ import static org.junit.jupiter.api.Assertions.assertNotSame; import static org.junit.jupiter.api.Assertions.assertTrue; -public class MavenProjectTest extends AbstractMavenProjectTestCase { +class MavenProjectTest extends AbstractMavenProjectTestCase { @Test - public void testShouldInterpretChildPathAdjustmentBasedOnModulePaths() throws IOException { + void testShouldInterpretChildPathAdjustmentBasedOnModulePaths() throws IOException { Model parentModel = new Model(); parentModel.addModule("../child"); @@ -63,7 +63,7 @@ public void testShouldInterpretChildPathAdjustmentBasedOnModulePaths() throws IO } @Test - public void testIdentityProtoInheritance() { + void testIdentityProtoInheritance() { Parent parent = new Parent(); parent.setGroupId("test-group"); @@ -86,7 +86,7 @@ public void testIdentityProtoInheritance() { } @Test - public void testEmptyConstructor() { + void testEmptyConstructor() { MavenProject project = new MavenProject(); assertEquals( @@ -96,7 +96,7 @@ public void testEmptyConstructor() { } @Test - public void testClone() throws Exception { + void testClone() throws Exception { File f = getFileForClasspathResource("canonical-pom.xml"); MavenProject projectToClone = getProject(f); @@ -108,7 +108,7 @@ public void testClone() throws Exception { } @Test - public void testCloneWithDependencyManagement() throws Exception { + void testCloneWithDependencyManagement() throws Exception { File f = getFileForClasspathResource("dependencyManagement-pom.xml"); MavenProject projectToClone = getProjectWithDependencies(f); DependencyManagement dep = projectToClone.getDependencyManagement(); @@ -130,7 +130,7 @@ public void testCloneWithDependencyManagement() throws Exception { } @Test - public void testGetModulePathAdjustment() throws IOException { + void testGetModulePathAdjustment() throws IOException { Model moduleModel = new Model(); MavenProject module = new MavenProject(moduleModel); @@ -148,7 +148,7 @@ public void testGetModulePathAdjustment() throws IOException { } @Test - public void testCloneWithDistributionManagement() throws Exception { + void testCloneWithDistributionManagement() throws Exception { File f = getFileForClasspathResource("distributionManagement-pom.xml"); MavenProject projectToClone = getProject(f); @@ -159,7 +159,7 @@ public void testCloneWithDistributionManagement() throws Exception { } @Test - public void testCloneWithActiveProfile() throws Exception { + void testCloneWithActiveProfile() throws Exception { File f = getFileForClasspathResource("withActiveByDefaultProfile-pom.xml"); MavenProject projectToClone = getProject(f); @@ -180,7 +180,7 @@ public void testCloneWithActiveProfile() throws Exception { } @Test - public void testCloneWithBaseDir() throws Exception { + void testCloneWithBaseDir() throws Exception { File f = getFileForClasspathResource("canonical-pom.xml"); MavenProject projectToClone = getProject(f); projectToClone.setPomFile(new File(new File(f.getParentFile(), "target"), "flattened.xml")); @@ -191,7 +191,7 @@ public void testCloneWithBaseDir() throws Exception { } @Test - public void testUndefinedOutputDirectory() throws Exception { + void testUndefinedOutputDirectory() throws Exception { MavenProject p = new MavenProject(); assertNoNulls(p.getCompileClasspathElements()); assertNoNulls(p.getSystemClasspathElements()); @@ -200,7 +200,7 @@ public void testUndefinedOutputDirectory() throws Exception { } @Test - public void testAddDotFile() { + void testAddDotFile() { MavenProject project = new MavenProject(); File basedir = new File(System.getProperty("java.io.tmpdir")); diff --git a/maven-core/src/test/java/org/apache/maven/project/PomConstructionTest.java b/maven-core/src/test/java/org/apache/maven/project/PomConstructionTest.java index cf8ec17679..6ce0607e88 100644 --- a/maven-core/src/test/java/org/apache/maven/project/PomConstructionTest.java +++ b/maven-core/src/test/java/org/apache/maven/project/PomConstructionTest.java @@ -60,7 +60,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; @PlexusTest -public class PomConstructionTest { +class PomConstructionTest { private static String BASE_DIR = "src/test"; private static String BASE_POM_DIR = BASE_DIR + "/resources-project-builder"; @@ -76,7 +76,7 @@ public class PomConstructionTest { private File testDirectory; @BeforeEach - public void setUp() throws Exception { + void setUp() throws Exception { testDirectory = new File(getBasedir(), BASE_POM_DIR); new File(getBasedir(), BASE_MIXIN_DIR); } @@ -87,7 +87,7 @@ public void setUp() throws Exception { * @throws Exception in case of issue */ @Test - public void testEmptyUrl() throws Exception { + void testEmptyUrl() throws Exception { buildPom("empty-distMng-repo-url"); } @@ -98,7 +98,7 @@ public void testEmptyUrl() throws Exception { */ /* MNG-786*/ @Test - public void testProfileModules() throws Exception { + void testProfileModules() throws Exception { PomTestWrapper pom = buildPom("profile-module", "a"); assertEquals("test-prop", pom.getValue("properties[1]/b")); // verifies profile applied assertEquals(4, ((List) pom.getValue("modules")).size()); @@ -114,20 +114,20 @@ public void testProfileModules() throws Exception { * @throws Exception in case of issue */ @Test - public void testParentInheritance() throws Exception { + void testParentInheritance() throws Exception { buildPom("parent-inheritance/sub"); } /*MNG-3995*/ @Test - public void testExecutionConfigurationJoin() throws Exception { + void testExecutionConfigurationJoin() throws Exception { PomTestWrapper pom = buildPom("execution-configuration-join"); assertEquals(2, ((List) pom.getValue("build/plugins[1]/executions[1]/configuration[1]/fileset[1]")).size()); } /*MNG-3803*/ @Test - public void testPluginConfigProperties() throws Exception { + void testPluginConfigProperties() throws Exception { PomTestWrapper pom = buildPom("plugin-config-properties"); assertEquals( "my.property", pom.getValue("build/plugins[1]/configuration[1]/systemProperties[1]/property[1]/name")); @@ -135,7 +135,7 @@ public void testPluginConfigProperties() throws Exception { /*MNG-3900*/ @Test - public void testProfilePropertiesInterpolation() throws Exception { + void testProfilePropertiesInterpolation() throws Exception { PomTestWrapper pom = buildPom("profile-properties-interpolation", "interpolation-profile"); assertEquals("PASSED", pom.getValue("properties[1]/test")); assertEquals("PASSED", pom.getValue("properties[1]/property")); @@ -358,14 +358,14 @@ public void testDependencyScope() /*MNG- 4010*/ @Test - public void testDuplicateExclusionsDependency() throws Exception { + void testDuplicateExclusionsDependency() throws Exception { PomTestWrapper pom = buildPom("duplicate-exclusions-dependency/sub"); assertEquals(1, ((List) pom.getValue("dependencies[1]/exclusions")).size()); } /*MNG- 4008*/ @Test - public void testMultipleFilters() throws Exception { + void testMultipleFilters() throws Exception { PomTestWrapper pom = buildPom("multiple-filters"); assertEquals(4, ((List) pom.getValue("build/filters")).size()); } @@ -432,7 +432,7 @@ public void testValidationErrorUponNonUniqueDependencyManagementKeyInProfile() */ @Test - public void testDuplicateDependenciesCauseLastDeclarationToBePickedInLenientMode() throws Exception { + void testDuplicateDependenciesCauseLastDeclarationToBePickedInLenientMode() throws Exception { PomTestWrapper pom = buildPom("unique-dependency-key/deps", true, null, null); assertEquals(1, ((List) pom.getValue("dependencies")).size()); assertEquals("0.2", pom.getValue("dependencies[1]/version")); @@ -440,7 +440,7 @@ public void testDuplicateDependenciesCauseLastDeclarationToBePickedInLenientMode /* MNG-3567*/ @Test - public void testParentInterpolation() throws Exception { + void testParentInterpolation() throws Exception { PomTestWrapper pom = buildPom("parent-interpolation/sub"); pom = new PomTestWrapper(pom.getMavenProject().getParent()); assertEquals("1.3.0-SNAPSHOT", pom.getValue("build/plugins[1]/version")); @@ -462,14 +462,14 @@ public void testMaven() /* MNG-3567*/ @Test - public void testPluginManagementInherited() throws Exception { + void testPluginManagementInherited() throws Exception { PomTestWrapper pom = buildPom("pluginmanagement-inherited/sub"); assertEquals("1.0-alpha-21", pom.getValue("build/plugins[1]/version")); } /* MNG-2174*/ @Test - public void testPluginManagementDependencies() throws Exception { + void testPluginManagementDependencies() throws Exception { PomTestWrapper pom = buildPom("plugin-management-dependencies/sub", "test"); assertEquals("1.0-alpha-21", pom.getValue("build/plugins[1]/version")); assertEquals("1.0", pom.getValue("build/plugins[1]/dependencies[1]/version")); @@ -477,7 +477,7 @@ public void testPluginManagementDependencies() throws Exception { /* MNG-3877*/ @Test - public void testReportingInterpolation() throws Exception { + void testReportingInterpolation() throws Exception { PomTestWrapper pom = buildPom("reporting-interpolation"); assertEquals( createPath(Arrays.asList( @@ -492,14 +492,14 @@ public void testReportingInterpolation() throws Exception { } @Test - public void testPluginOrder() throws Exception { + void testPluginOrder() throws Exception { PomTestWrapper pom = buildPom("plugin-order"); assertEquals("plexus-component-metadata", pom.getValue("build/plugins[1]/artifactId")); assertEquals("maven-surefire-plugin", pom.getValue("build/plugins[2]/artifactId")); } @Test - public void testErroneousJoiningOfDifferentPluginsWithEqualDependencies() throws Exception { + void testErroneousJoiningOfDifferentPluginsWithEqualDependencies() throws Exception { PomTestWrapper pom = buildPom("equal-plugin-deps"); assertEquals("maven-it-plugin-a", pom.getValue("build/plugins[1]/artifactId")); assertEquals(1, ((List) pom.getValue("build/plugins[1]/dependencies")).size()); @@ -509,7 +509,7 @@ public void testErroneousJoiningOfDifferentPluginsWithEqualDependencies() throws /** MNG-3821 */ @Test - public void testErroneousJoiningOfDifferentPluginsWithEqualExecutionIds() throws Exception { + void testErroneousJoiningOfDifferentPluginsWithEqualExecutionIds() throws Exception { PomTestWrapper pom = buildPom("equal-plugin-exec-ids"); assertEquals("maven-it-plugin-a", pom.getValue("build/plugins[1]/artifactId")); assertEquals(1, ((List) pom.getValue("build/plugins[1]/executions")).size()); @@ -523,7 +523,7 @@ public void testErroneousJoiningOfDifferentPluginsWithEqualExecutionIds() throws /** MNG-3998 */ @Test - public void testExecutionConfiguration() throws Exception { + void testExecutionConfiguration() throws Exception { PomTestWrapper pom = buildPom("execution-configuration"); assertEquals(2, ((List) pom.getValue("build/plugins[1]/executions")).size()); assertEquals("src/main/mdo/nexus.xml", (pom.getValue("build/plugins[1]/executions[1]/configuration[1]/model"))); @@ -539,7 +539,7 @@ public void testPluginConfigDuplicate() } */ @Test - public void testSingleConfigurationInheritance() throws Exception { + void testSingleConfigurationInheritance() throws Exception { PomTestWrapper pom = buildPom("single-configuration-inheritance"); assertEquals(2, ((List) pom.getValue("build/plugins[1]/executions[1]/configuration[1]/rules")).size()); @@ -553,7 +553,7 @@ public void testSingleConfigurationInheritance() throws Exception { } @Test - public void testConfigWithPluginManagement() throws Exception { + void testConfigWithPluginManagement() throws Exception { PomTestWrapper pom = buildPom("config-with-plugin-mng"); assertEquals(2, ((List) pom.getValue("build/plugins[1]/executions")).size()); assertEquals( @@ -563,7 +563,7 @@ public void testConfigWithPluginManagement() throws Exception { /** MNG-3965 */ @Test - public void testExecutionConfigurationSubcollections() throws Exception { + void testExecutionConfigurationSubcollections() throws Exception { PomTestWrapper pom = buildPom("execution-configuration-subcollections"); assertEquals( 2, @@ -573,26 +573,26 @@ public void testExecutionConfigurationSubcollections() throws Exception { /** MNG-3985 */ @Test - public void testMultipleRepositories() throws Exception { + void testMultipleRepositories() throws Exception { PomTestWrapper pom = buildPom("multiple-repos/sub"); assertEquals(3, ((List) pom.getValue("repositories")).size()); } /** MNG-3965 */ @Test - public void testMultipleExecutionIds() throws Exception { + void testMultipleExecutionIds() throws Exception { PomTestWrapper pom = buildPom("dual-execution-ids/sub"); assertEquals(1, ((List) pom.getValue("build/plugins[1]/executions")).size()); } /** MNG-3997 */ @Test - public void testConsecutiveEmptyElements() throws Exception { + void testConsecutiveEmptyElements() throws Exception { buildPom("consecutive_empty_elements"); } @Test - public void testOrderOfGoalsFromPluginExecutionWithoutPluginManagement() throws Exception { + void testOrderOfGoalsFromPluginExecutionWithoutPluginManagement() throws Exception { PomTestWrapper pom = buildPom("plugin-exec-goals-order/wo-plugin-mgmt"); assertEquals(5, ((List) pom.getValue("build/plugins[1]/executions[1]/goals")).size()); assertEquals("b", pom.getValue("build/plugins[1]/executions[1]/goals[1]")); @@ -604,7 +604,7 @@ public void testOrderOfGoalsFromPluginExecutionWithoutPluginManagement() throws /* MNG-3886*/ @Test - public void testOrderOfGoalsFromPluginExecutionWithPluginManagement() throws Exception { + void testOrderOfGoalsFromPluginExecutionWithPluginManagement() throws Exception { PomTestWrapper pom = buildPom("plugin-exec-goals-order/w-plugin-mgmt"); assertEquals(5, ((List) pom.getValue("build/plugins[1]/executions[1]/goals")).size()); assertEquals("b", pom.getValue("build/plugins[1]/executions[1]/goals[1]")); @@ -615,7 +615,7 @@ public void testOrderOfGoalsFromPluginExecutionWithPluginManagement() throws Exc } @Test - public void testOrderOfPluginExecutionsWithoutPluginManagement() throws Exception { + void testOrderOfPluginExecutionsWithoutPluginManagement() throws Exception { PomTestWrapper pom = buildPom("plugin-exec-order/wo-plugin-mgmt"); assertEquals(5, ((List) pom.getValue("build/plugins[1]/executions")).size()); assertEquals("b", pom.getValue("build/plugins[1]/executions[1]/id")); @@ -627,7 +627,7 @@ public void testOrderOfPluginExecutionsWithoutPluginManagement() throws Exceptio /* MNG-3887 */ @Test - public void testOrderOfPluginExecutionsWithPluginManagement() throws Exception { + void testOrderOfPluginExecutionsWithPluginManagement() throws Exception { PomTestWrapper pom = buildPom("plugin-exec-order/w-plugin-mgmt"); assertEquals(5, ((List) pom.getValue("build/plugins[1]/executions")).size()); assertEquals("b", pom.getValue("build/plugins[1]/executions[1]/id")); @@ -638,27 +638,27 @@ public void testOrderOfPluginExecutionsWithPluginManagement() throws Exception { } @Test - public void testMergeOfPluginExecutionsWhenChildInheritsPluginVersion() throws Exception { + void testMergeOfPluginExecutionsWhenChildInheritsPluginVersion() throws Exception { PomTestWrapper pom = buildPom("plugin-exec-merging-wo-version/sub"); assertEquals(4, ((List) pom.getValue("build/plugins[1]/executions")).size()); } /* MNG-3943*/ @Test - public void testMergeOfPluginExecutionsWhenChildAndParentUseDifferentPluginVersions() throws Exception { + void testMergeOfPluginExecutionsWhenChildAndParentUseDifferentPluginVersions() throws Exception { PomTestWrapper pom = buildPom("plugin-exec-merging-version-insensitive/sub"); assertEquals(4, ((List) pom.getValue("build/plugins[1]/executions")).size()); } @Test - public void testInterpolationWithXmlMarkup() throws Exception { + void testInterpolationWithXmlMarkup() throws Exception { PomTestWrapper pom = buildPom("xml-markup-interpolation"); assertEquals("Tom&Jerry", pom.getValue("properties/xmlTest")); } /* MNG-3925 */ @Test - public void testOrderOfMergedPluginExecutionsWithoutPluginManagement() throws Exception { + void testOrderOfMergedPluginExecutionsWithoutPluginManagement() throws Exception { PomTestWrapper pom = buildPom("merged-plugin-exec-order/wo-plugin-mgmt/sub"); assertEquals(5, ((List) pom.getValue("build/plugins[1]/executions")).size()); assertEquals("parent-1", pom.getValue("build/plugins[1]/executions[1]/goals[1]")); @@ -669,7 +669,7 @@ public void testOrderOfMergedPluginExecutionsWithoutPluginManagement() throws Ex } @Test - public void testOrderOfMergedPluginExecutionsWithPluginManagement() throws Exception { + void testOrderOfMergedPluginExecutionsWithPluginManagement() throws Exception { PomTestWrapper pom = buildPom("merged-plugin-exec-order/w-plugin-mgmt/sub"); assertEquals(5, ((List) pom.getValue("build/plugins[1]/executions")).size()); assertEquals("parent-1", pom.getValue("build/plugins[1]/executions[1]/goals[1]")); @@ -681,7 +681,7 @@ public void testOrderOfMergedPluginExecutionsWithPluginManagement() throws Excep /* MNG-3984*/ @Test - public void testDifferentContainersWithSameId() throws Exception { + void testDifferentContainersWithSameId() throws Exception { PomTestWrapper pom = buildPom("join-different-containers-same-id"); assertEquals(1, ((List) pom.getValue("build/plugins[1]/executions[1]/goals")).size()); assertEquals( @@ -693,7 +693,7 @@ public void testDifferentContainersWithSameId() throws Exception { /* MNG-3937*/ @Test - public void testOrderOfMergedPluginExecutionGoalsWithoutPluginManagement() throws Exception { + void testOrderOfMergedPluginExecutionGoalsWithoutPluginManagement() throws Exception { PomTestWrapper pom = buildPom("merged-plugin-exec-goals-order/wo-plugin-mgmt/sub"); assertEquals(5, ((List) pom.getValue("build/plugins[1]/executions[1]/goals")).size()); @@ -705,7 +705,7 @@ public void testOrderOfMergedPluginExecutionGoalsWithoutPluginManagement() throw } @Test - public void testOrderOfMergedPluginExecutionGoalsWithPluginManagement() throws Exception { + void testOrderOfMergedPluginExecutionGoalsWithPluginManagement() throws Exception { PomTestWrapper pom = buildPom("merged-plugin-exec-goals-order/w-plugin-mgmt/sub"); assertEquals(5, ((List) pom.getValue("build/plugins[1]/executions[1]/goals")).size()); assertEquals("child-a", pom.getValue("build/plugins[1]/executions[1]/goals[1]")); @@ -717,7 +717,7 @@ public void testOrderOfMergedPluginExecutionGoalsWithPluginManagement() throws E /*MNG-3938*/ @Test - public void testOverridingOfInheritedPluginExecutionsWithoutPluginManagement() throws Exception { + void testOverridingOfInheritedPluginExecutionsWithoutPluginManagement() throws Exception { PomTestWrapper pom = buildPom("plugin-exec-merging/wo-plugin-mgmt/sub"); assertEquals(2, ((List) pom.getValue("build/plugins[1]/executions")).size()); assertEquals("child-default", pom.getValue("build/plugins[1]/executions[@id='default']/phase")); @@ -726,7 +726,7 @@ public void testOverridingOfInheritedPluginExecutionsWithoutPluginManagement() t /* MNG-3938 */ @Test - public void testOverridingOfInheritedPluginExecutionsWithPluginManagement() throws Exception { + void testOverridingOfInheritedPluginExecutionsWithPluginManagement() throws Exception { PomTestWrapper pom = buildPom("plugin-exec-merging/w-plugin-mgmt/sub"); assertEquals(2, ((List) pom.getValue("build/plugins[1]/executions")).size()); assertEquals("child-default", pom.getValue("build/plugins[1]/executions[@id='default']/phase")); @@ -735,7 +735,7 @@ public void testOverridingOfInheritedPluginExecutionsWithPluginManagement() thro /* MNG-3906*/ @Test - public void testOrderOfMergedPluginDependenciesWithoutPluginManagement() throws Exception { + void testOrderOfMergedPluginDependenciesWithoutPluginManagement() throws Exception { PomTestWrapper pom = buildPom("merged-plugin-class-path-order/wo-plugin-mgmt/sub"); assertEquals(5, ((List) pom.getValue("build/plugins[1]/dependencies")).size()); @@ -753,7 +753,7 @@ public void testOrderOfMergedPluginDependenciesWithoutPluginManagement() throws } @Test - public void testOrderOfMergedPluginDependenciesWithPluginManagement() throws Exception { + void testOrderOfMergedPluginDependenciesWithPluginManagement() throws Exception { PomTestWrapper pom = buildPom("merged-plugin-class-path-order/w-plugin-mgmt/sub"); assertEquals(5, ((List) pom.getValue("build/plugins[1]/dependencies")).size()); assertEquals("c", pom.getValue("build/plugins[1]/dependencies[1]/artifactId")); @@ -769,7 +769,7 @@ public void testOrderOfMergedPluginDependenciesWithPluginManagement() throws Exc } @Test - public void testInterpolationOfNestedBuildDirectories() throws Exception { + void testInterpolationOfNestedBuildDirectories() throws Exception { PomTestWrapper pom = buildPom("nested-build-dir-interpolation"); assertEquals( new File(pom.getBasedir(), "target/classes/dir0"), new File((String) pom.getValue("properties/dir0"))); @@ -779,7 +779,7 @@ public void testInterpolationOfNestedBuildDirectories() throws Exception { } @Test - public void testAppendArtifactIdOfChildToInheritedUrls() throws Exception { + void testAppendArtifactIdOfChildToInheritedUrls() throws Exception { PomTestWrapper pom = buildPom("url-inheritance/sub"); assertEquals("https://parent.url/child", pom.getValue("url")); assertEquals("https://parent.url/org", pom.getValue("organization/url")); @@ -797,7 +797,7 @@ public void testAppendArtifactIdOfChildToInheritedUrls() throws Exception { /* MNG-3846*/ @Test - public void testAppendArtifactIdOfParentAndChildToInheritedUrls() throws Exception { + void testAppendArtifactIdOfParentAndChildToInheritedUrls() throws Exception { PomTestWrapper pom = buildPom("url-inheritance/another-parent/sub"); assertEquals("https://parent.url/ap/child", pom.getValue("url")); assertEquals("https://parent.url/org", pom.getValue("organization/url")); @@ -814,7 +814,7 @@ public void testAppendArtifactIdOfParentAndChildToInheritedUrls() throws Excepti } @Test - public void testNonInheritedElementsInSubtreesOverriddenByChild() throws Exception { + void testNonInheritedElementsInSubtreesOverriddenByChild() throws Exception { PomTestWrapper pom = buildPom("limited-inheritance/child"); assertNull(pom.getValue("organization/url")); assertNull(pom.getValue("issueManagement/system")); @@ -835,7 +835,7 @@ public void testNonInheritedElementsInSubtreesOverriddenByChild() throws Excepti } @Test - public void testXmlTextCoalescing() throws Exception { + void testXmlTextCoalescing() throws Exception { PomTestWrapper pom = buildPom("xml-coalesce-text"); assertEquals("A Test Project Property", pom.getValue("properties/prop0")); assertEquals("That's a test!", pom.getValue("properties/prop1")); @@ -849,7 +849,7 @@ public void testXmlTextCoalescing() throws Exception { } @Test - public void testFullInterpolationOfNestedExpressions() throws Exception { + void testFullInterpolationOfNestedExpressions() throws Exception { PomTestWrapper pom = buildPom("full-interpolation"); for (int i = 0; i < 24; i++) { String index = ((i < 10) ? "0" : "") + i; @@ -858,7 +858,7 @@ public void testFullInterpolationOfNestedExpressions() throws Exception { } @Test - public void testInterpolationWithBasedirAlignedDirectories() throws Exception { + void testInterpolationWithBasedirAlignedDirectories() throws Exception { PomTestWrapper pom = buildPom("basedir-aligned-interpolation"); assertEquals( new File(pom.getBasedir(), "src/main/java"), @@ -885,7 +885,7 @@ public void testInterpolationWithBasedirAlignedDirectories() throws Exception { /* MNG-3944*/ @Test - public void testInterpolationOfBasedirInPomWithUnusualName() throws Exception { + void testInterpolationOfBasedirInPomWithUnusualName() throws Exception { PomTestWrapper pom = buildPom("basedir-interpolation/pom-with-unusual-name.xml"); assertEquals(pom.getBasedir(), new File(pom.getValue("properties/prop0").toString())); assertEquals(pom.getBasedir(), new File(pom.getValue("properties/prop1").toString())); @@ -893,13 +893,13 @@ public void testInterpolationOfBasedirInPomWithUnusualName() throws Exception { /* MNG-3979 */ @Test - public void testJoiningOfContainersWhenChildHasEmptyElements() throws Exception { + void testJoiningOfContainersWhenChildHasEmptyElements() throws Exception { PomTestWrapper pom = buildPom("id-container-joining-with-empty-elements/sub"); assertNotNull(pom); } @Test - public void testOrderOfPluginConfigurationElementsWithoutPluginManagement() throws Exception { + void testOrderOfPluginConfigurationElementsWithoutPluginManagement() throws Exception { PomTestWrapper pom = buildPom("plugin-config-order/wo-plugin-mgmt"); assertEquals("one", pom.getValue("build/plugins[1]/configuration/stringParams/stringParam[1]")); assertEquals("two", pom.getValue("build/plugins[1]/configuration/stringParams/stringParam[2]")); @@ -909,7 +909,7 @@ public void testOrderOfPluginConfigurationElementsWithoutPluginManagement() thro /* MNG-3827*/ @Test - public void testOrderOfPluginConfigurationElementsWithPluginManagement() throws Exception { + void testOrderOfPluginConfigurationElementsWithPluginManagement() throws Exception { PomTestWrapper pom = buildPom("plugin-config-order/w-plugin-mgmt"); assertEquals("one", pom.getValue("build/plugins[1]/configuration/stringParams/stringParam[1]")); assertEquals("two", pom.getValue("build/plugins[1]/configuration/stringParams/stringParam[2]")); @@ -918,7 +918,7 @@ public void testOrderOfPluginConfigurationElementsWithPluginManagement() throws } @Test - public void testOrderOfPluginExecutionConfigurationElementsWithoutPluginManagement() throws Exception { + void testOrderOfPluginExecutionConfigurationElementsWithoutPluginManagement() throws Exception { PomTestWrapper pom = buildPom("plugin-exec-config-order/wo-plugin-mgmt"); String prefix = "build/plugins[1]/executions[1]/configuration/"; assertEquals("one", pom.getValue(prefix + "stringParams/stringParam[1]")); @@ -931,7 +931,7 @@ public void testOrderOfPluginExecutionConfigurationElementsWithoutPluginManageme /* MNG-3864*/ @Test - public void testOrderOfPluginExecutionConfigurationElementsWithPluginManagement() throws Exception { + void testOrderOfPluginExecutionConfigurationElementsWithPluginManagement() throws Exception { PomTestWrapper pom = buildPom("plugin-exec-config-order/w-plugin-mgmt"); String prefix = "build/plugins[1]/executions[1]/configuration/"; assertEquals("one", pom.getValue(prefix + "stringParams/stringParam[1]")); @@ -944,7 +944,7 @@ public void testOrderOfPluginExecutionConfigurationElementsWithPluginManagement( /* MNG-3836*/ @Test - public void testMergeOfInheritedPluginConfiguration() throws Exception { + void testMergeOfInheritedPluginConfiguration() throws Exception { PomTestWrapper pom = buildPom("plugin-config-merging/child"); String prefix = "build/plugins[1]/configuration/"; @@ -962,13 +962,13 @@ public void testMergeOfInheritedPluginConfiguration() throws Exception { /* MNG-2591 */ @Test - public void testAppendOfInheritedPluginConfigurationWithNoProfile() throws Exception { + void testAppendOfInheritedPluginConfigurationWithNoProfile() throws Exception { testAppendOfInheritedPluginConfiguration("no-profile"); } /* MNG-2591*/ @Test - public void testAppendOfInheritedPluginConfigurationWithActiveProfile() throws Exception { + void testAppendOfInheritedPluginConfigurationWithActiveProfile() throws Exception { testAppendOfInheritedPluginConfiguration("with-profile"); } @@ -997,7 +997,7 @@ private void testAppendOfInheritedPluginConfiguration(String test) throws Except /* MNG-4000 */ @Test - public void testMultiplePluginExecutionsWithAndWithoutIdsWithoutPluginManagement() throws Exception { + void testMultiplePluginExecutionsWithAndWithoutIdsWithoutPluginManagement() throws Exception { PomTestWrapper pom = buildPom("plugin-exec-w-and-wo-id/wo-plugin-mgmt"); assertEquals(2, ((List) pom.getValue("build/plugins[1]/executions")).size()); assertEquals("log-string", pom.getValue("build/plugins[1]/executions[1]/goals[1]")); @@ -1005,7 +1005,7 @@ public void testMultiplePluginExecutionsWithAndWithoutIdsWithoutPluginManagement } @Test - public void testMultiplePluginExecutionsWithAndWithoutIdsWithPluginManagement() throws Exception { + void testMultiplePluginExecutionsWithAndWithoutIdsWithPluginManagement() throws Exception { PomTestWrapper pom = buildPom("plugin-exec-w-and-wo-id/w-plugin-mgmt"); assertEquals(2, ((List) pom.getValue("build/plugins[1]/executions")).size()); assertEquals("log-string", pom.getValue("build/plugins[1]/executions[1]/goals[1]")); @@ -1013,7 +1013,7 @@ public void testMultiplePluginExecutionsWithAndWithoutIdsWithPluginManagement() } @Test - public void testDependencyOrderWithoutPluginManagement() throws Exception { + void testDependencyOrderWithoutPluginManagement() throws Exception { PomTestWrapper pom = buildPom("dependency-order/wo-plugin-mgmt"); assertEquals(4, ((List) pom.getValue("dependencies")).size()); assertEquals("a", pom.getValue("dependencies[1]/artifactId")); @@ -1023,7 +1023,7 @@ public void testDependencyOrderWithoutPluginManagement() throws Exception { } @Test - public void testDependencyOrderWithPluginManagement() throws Exception { + void testDependencyOrderWithPluginManagement() throws Exception { PomTestWrapper pom = buildPom("dependency-order/w-plugin-mgmt"); assertEquals(4, ((List) pom.getValue("dependencies")).size()); assertEquals("a", pom.getValue("dependencies[1]/artifactId")); @@ -1033,7 +1033,7 @@ public void testDependencyOrderWithPluginManagement() throws Exception { } @Test - public void testBuildDirectoriesUsePlatformSpecificFileSeparator() throws Exception { + void testBuildDirectoriesUsePlatformSpecificFileSeparator() throws Exception { PomTestWrapper pom = buildPom("platform-file-separator"); assertPathWithNormalizedFileSeparators(pom.getValue("build/directory")); assertPathWithNormalizedFileSeparators(pom.getValue("build/outputDirectory")); @@ -1048,7 +1048,7 @@ public void testBuildDirectoriesUsePlatformSpecificFileSeparator() throws Except /* MNG-4008 */ @Test - public void testMergedFilterOrder() throws Exception { + void testMergedFilterOrder() throws Exception { PomTestWrapper pom = buildPom("merged-filter-order/sub"); assertEquals(7, ((List) pom.getValue("build/filters")).size()); @@ -1063,7 +1063,7 @@ public void testMergedFilterOrder() throws Exception { /** MNG-4027*/ @Test - public void testProfileInjectedDependencies() throws Exception { + void testProfileInjectedDependencies() throws Exception { PomTestWrapper pom = buildPom("profile-injected-dependencies"); assertEquals(4, ((List) pom.getValue("dependencies")).size()); assertEquals("a", pom.getValue("dependencies[1]/artifactId")); @@ -1074,13 +1074,13 @@ public void testProfileInjectedDependencies() throws Exception { /** IT-0021*/ @Test - public void testProfileDependenciesMultipleProfiles() throws Exception { + void testProfileDependenciesMultipleProfiles() throws Exception { PomTestWrapper pom = buildPom("profile-dependencies-multiple-profiles", "profile-1", "profile-2"); assertEquals(2, ((List) pom.getValue("dependencies")).size()); } @Test - public void testDependencyInheritance() throws Exception { + void testDependencyInheritance() throws Exception { PomTestWrapper pom = buildPom("dependency-inheritance/sub"); assertEquals(1, ((List) pom.getValue("dependencies")).size()); assertEquals("4.13.1", pom.getValue("dependencies[1]/version")); @@ -1088,7 +1088,7 @@ public void testDependencyInheritance() throws Exception { /** MNG-4034 */ @Test - public void testManagedProfileDependency() throws Exception { + void testManagedProfileDependency() throws Exception { PomTestWrapper pom = this.buildPom("managed-profile-dependency/sub", "maven-core-it"); assertEquals(1, ((List) pom.getValue("dependencies")).size()); assertEquals("org.apache.maven.its", pom.getValue("dependencies[1]/groupId")); @@ -1101,21 +1101,21 @@ public void testManagedProfileDependency() throws Exception { /** MNG-4040 */ @Test - public void testProfileModuleInheritance() throws Exception { + void testProfileModuleInheritance() throws Exception { PomTestWrapper pom = this.buildPom("profile-module-inheritance/sub", "dist"); assertEquals(0, ((List) pom.getValue("modules")).size()); } /** MNG-3621 */ @Test - public void testUncPath() throws Exception { + void testUncPath() throws Exception { PomTestWrapper pom = this.buildPom("unc-path/sub"); assertEquals("file:////host/site/test-child", pom.getValue("distributionManagement/site/url")); } /** MNG-2006 */ @Test - public void testUrlAppendWithChildPathAdjustment() throws Exception { + void testUrlAppendWithChildPathAdjustment() throws Exception { PomTestWrapper pom = this.buildPom("url-append/child"); assertEquals("https://project.url/child", pom.getValue("url")); assertEquals("https://viewvc.project.url/child", pom.getValue("scm/url")); @@ -1126,20 +1126,20 @@ public void testUrlAppendWithChildPathAdjustment() throws Exception { /** MNG-0479 */ @Test - public void testRepoInheritance() throws Exception { + void testRepoInheritance() throws Exception { PomTestWrapper pom = this.buildPom("repo-inheritance"); assertEquals(1, ((List) pom.getValue("repositories")).size()); assertEquals("it0043", pom.getValue("repositories[1]/name")); } @Test - public void testEmptyScm() throws Exception { + void testEmptyScm() throws Exception { PomTestWrapper pom = this.buildPom("empty-scm"); assertNull(pom.getValue("scm")); } @Test - public void testPluginConfigurationUsingAttributesWithoutPluginManagement() throws Exception { + void testPluginConfigurationUsingAttributesWithoutPluginManagement() throws Exception { PomTestWrapper pom = buildPom("plugin-config-attributes/wo-plugin-mgmt"); assertEquals("src", pom.getValue("build/plugins[1]/configuration/domParam/copy/@todir")); assertEquals("true", pom.getValue("build/plugins[1]/configuration/domParam/copy/@overwrite")); @@ -1150,7 +1150,7 @@ public void testPluginConfigurationUsingAttributesWithoutPluginManagement() thro /** MNG-4053*/ @Test - public void testPluginConfigurationUsingAttributesWithPluginManagement() throws Exception { + void testPluginConfigurationUsingAttributesWithPluginManagement() throws Exception { PomTestWrapper pom = buildPom("plugin-config-attributes/w-plugin-mgmt"); assertEquals("src", pom.getValue("build/plugins[1]/configuration/domParam/copy/@todir")); assertEquals("true", pom.getValue("build/plugins[1]/configuration/domParam/copy/@overwrite")); @@ -1160,7 +1160,7 @@ public void testPluginConfigurationUsingAttributesWithPluginManagement() throws } @Test - public void testPluginConfigurationUsingAttributesWithPluginManagementAndProfile() throws Exception { + void testPluginConfigurationUsingAttributesWithPluginManagementAndProfile() throws Exception { PomTestWrapper pom = buildPom("plugin-config-attributes/w-profile", "maven-core-it"); assertEquals("src", pom.getValue("build/plugins[1]/configuration/domParam/copy/@todir")); assertEquals("true", pom.getValue("build/plugins[1]/configuration/domParam/copy/@overwrite")); @@ -1170,7 +1170,7 @@ public void testPluginConfigurationUsingAttributesWithPluginManagementAndProfile } @Test - public void testPomEncoding() throws Exception { + void testPomEncoding() throws Exception { PomTestWrapper pom = buildPom("pom-encoding/utf-8"); assertEquals("TEST-CHARS: \u00DF\u0131\u03A3\u042F\u05D0\u20AC", pom.getValue("description")); pom = buildPom("pom-encoding/latin-1"); @@ -1179,14 +1179,14 @@ public void testPomEncoding() throws Exception { /* MNG-4070 */ @Test - public void testXmlWhitespaceHandling() throws Exception { + void testXmlWhitespaceHandling() throws Exception { PomTestWrapper pom = buildPom("xml-whitespace/sub"); assertEquals("org.apache.maven.its.mng4070", pom.getValue("groupId")); } /* MNG-3760*/ @Test - public void testInterpolationOfBaseUri() throws Exception { + void testInterpolationOfBaseUri() throws Exception { PomTestWrapper pom = buildPom("baseuri-interpolation/pom.xml"); assertNotEquals( pom.getBasedir().toURI().toString(), @@ -1195,7 +1195,7 @@ public void testInterpolationOfBaseUri() throws Exception { /* MNG-6386 */ @Test - public void testInterpolationOfRfc3986BaseUri() throws Exception { + void testInterpolationOfRfc3986BaseUri() throws Exception { PomTestWrapper pom = buildPom("baseuri-interpolation/pom.xml"); String prop1 = pom.getValue("properties/prop1").toString(); assertEquals(pom.getBasedir().toPath().toUri().toASCIIString(), prop1); @@ -1204,7 +1204,7 @@ public void testInterpolationOfRfc3986BaseUri() throws Exception { /* MNG-3811*/ @Test - public void testReportingPluginConfig() throws Exception { + void testReportingPluginConfig() throws Exception { PomTestWrapper pom = buildPom("reporting-plugin-config/sub"); assertEquals(3, ((List) pom.getValue("reporting/plugins[1]/configuration/stringParams")).size()); @@ -1217,28 +1217,28 @@ public void testReportingPluginConfig() throws Exception { } @Test - public void testPropertiesNoDuplication() throws Exception { + void testPropertiesNoDuplication() throws Exception { PomTestWrapper pom = buildPom("properties-no-duplication/sub"); assertEquals(1, ((Properties) pom.getValue("properties")).size()); assertEquals("child", pom.getValue("properties/pomProfile")); } @Test - public void testPomInheritance() throws Exception { + void testPomInheritance() throws Exception { PomTestWrapper pom = buildPom("pom-inheritance/sub"); assertEquals("parent-description", pom.getValue("description")); assertEquals("jar", pom.getValue("packaging")); } @Test - public void testCompleteModelWithoutParent() throws Exception { + void testCompleteModelWithoutParent() throws Exception { PomTestWrapper pom = buildPom("complete-model/wo-parent"); testCompleteModel(pom); } @Test - public void testCompleteModelWithParent() throws Exception { + void testCompleteModelWithParent() throws Exception { PomTestWrapper pom = buildPom("complete-model/w-parent/sub"); testCompleteModel(pom); @@ -1450,13 +1450,13 @@ private void testCompleteModel(PomTestWrapper pom) throws Exception { /* MNG-2309*/ @Test - public void testProfileInjectionOrder() throws Exception { + void testProfileInjectionOrder() throws Exception { PomTestWrapper pom = buildPom("profile-injection-order", "pom-a", "pom-b", "pom-e", "pom-c", "pom-d"); assertEquals("e", pom.getValue("properties[1]/pomProperty")); } @Test - public void testPropertiesInheritance() throws Exception { + void testPropertiesInheritance() throws Exception { PomTestWrapper pom = buildPom("properties-inheritance/sub"); assertEquals("parent-property", pom.getValue("properties/parentProperty")); assertEquals("child-property", pom.getValue("properties/childProperty")); @@ -1465,7 +1465,7 @@ public void testPropertiesInheritance() throws Exception { /* MNG-4102*/ @Test - public void testInheritedPropertiesInterpolatedWithValuesFromChildWithoutProfiles() throws Exception { + void testInheritedPropertiesInterpolatedWithValuesFromChildWithoutProfiles() throws Exception { PomTestWrapper pom = buildPom("inherited-properties-interpolation/no-profile/sub"); assertEquals("CHILD", pom.getValue("properties/overridden")); @@ -1474,7 +1474,7 @@ public void testInheritedPropertiesInterpolatedWithValuesFromChildWithoutProfile /* MNG-4102 */ @Test - public void testInheritedPropertiesInterpolatedWithValuesFromChildWithActiveProfiles() throws Exception { + void testInheritedPropertiesInterpolatedWithValuesFromChildWithActiveProfiles() throws Exception { PomTestWrapper pom = buildPom("inherited-properties-interpolation/active-profile/sub"); assertEquals(1, pom.getMavenProject().getModel().getProfiles().size()); @@ -1486,7 +1486,7 @@ public void testInheritedPropertiesInterpolatedWithValuesFromChildWithActiveProf /* MNG-3545 */ @Test - public void testProfileDefaultActivation() throws Exception { + void testProfileDefaultActivation() throws Exception { PomTestWrapper pom = buildPom("profile-default-deactivation", "profile4"); assertEquals(1, pom.getMavenProject().getActiveProfiles().size()); assertEquals(1, ((List) pom.getValue("build/plugins")).size()); @@ -1495,7 +1495,7 @@ public void testProfileDefaultActivation() throws Exception { /* MNG-1995 */ @Test - public void testBooleanInterpolation() throws Exception { + void testBooleanInterpolation() throws Exception { PomTestWrapper pom = buildPom("boolean-interpolation"); assertEquals(true, pom.getValue("repositories[1]/releases/enabled")); assertEquals(true, pom.getValue("build/resources[1]/filtering")); @@ -1503,7 +1503,7 @@ public void testBooleanInterpolation() throws Exception { /* MNG-3899 */ @Test - public void testBuildExtensionInheritance() throws Exception { + void testBuildExtensionInheritance() throws Exception { PomTestWrapper pom = buildPom("build-extension-inheritance/sub"); assertEquals(3, ((List) pom.getValue("build/extensions")).size()); assertEquals("b", pom.getValue("build/extensions[1]/artifactId")); @@ -1514,7 +1514,7 @@ public void testBuildExtensionInheritance() throws Exception { /*MNG-1957*/ @Test - public void testJdkActivation() throws Exception { + void testJdkActivation() throws Exception { Properties props = new Properties(); props.put("java.version", "1.5.0_15"); @@ -1527,14 +1527,14 @@ public void testJdkActivation() throws Exception { /* MNG-2174 */ @Test - public void testProfilePluginMngDependencies() throws Exception { + void testProfilePluginMngDependencies() throws Exception { PomTestWrapper pom = buildPom("profile-plugin-mng-dependencies/sub", "maven-core-it"); assertEquals("a", pom.getValue("build/plugins[1]/dependencies[1]/artifactId")); } /** MNG-4116 */ @Test - public void testPercentEncodedUrlsMustNotBeDecoded() throws Exception { + void testPercentEncodedUrlsMustNotBeDecoded() throws Exception { PomTestWrapper pom = this.buildPom("url-no-decoding"); assertEquals("https://maven.apache.org/spacy%20path", pom.getValue("url")); assertEquals("https://svn.apache.org/viewvc/spacy%20path", pom.getValue("scm/url")); @@ -1552,7 +1552,7 @@ public void testPercentEncodedUrlsMustNotBeDecoded() throws Exception { } @Test - public void testPluginManagementInheritance() throws Exception { + void testPluginManagementInheritance() throws Exception { PomTestWrapper pom = this.buildPom("plugin-management-inheritance"); assertEquals( "0.1-stub-SNAPSHOT", @@ -1560,39 +1560,39 @@ public void testPluginManagementInheritance() throws Exception { } @Test - public void testProfilePlugins() throws Exception { + void testProfilePlugins() throws Exception { PomTestWrapper pom = this.buildPom("profile-plugins", "standard"); assertEquals(2, ((List) pom.getValue("build/plugins")).size()); assertEquals("maven-assembly2-plugin", pom.getValue("build/plugins[2]/artifactId")); } @Test - public void testPluginInheritanceSimple() throws Exception { + void testPluginInheritanceSimple() throws Exception { PomTestWrapper pom = this.buildPom("plugin-inheritance-simple/sub"); assertEquals(2, ((List) pom.getValue("build/plugins")).size()); } @Test - public void testPluginManagementDuplicate() throws Exception { + void testPluginManagementDuplicate() throws Exception { PomTestWrapper pom = this.buildPom("plugin-management-duplicate/sub"); assertEquals(7, ((List) pom.getValue("build/pluginManagement/plugins")).size()); } @Test - public void testDistributionManagement() throws Exception { + void testDistributionManagement() throws Exception { PomTestWrapper pom = this.buildPom("distribution-management"); assertEquals("legacy", pom.getValue("distributionManagement/repository/layout")); } @Test - public void testDependencyScopeInheritance() throws Exception { + void testDependencyScopeInheritance() throws Exception { PomTestWrapper pom = buildPom("dependency-scope-inheritance/sub"); String scope = (String) pom.getValue("dependencies[1]/scope"); assertEquals("compile", scope); } @Test - public void testDependencyScope() throws Exception { + void testDependencyScope() throws Exception { buildPom("dependency-scope/sub"); } @@ -1602,7 +1602,7 @@ public void testDependencyManagementWithInterpolation() throws Exception { } @Test - public void testInterpolationWithSystemProperty() throws Exception { + void testInterpolationWithSystemProperty() throws Exception { Properties sysProps = new Properties(); sysProps.setProperty("system.property", "PASSED"); PomTestWrapper pom = buildPom("system-property-interpolation", sysProps, null); @@ -1611,7 +1611,7 @@ public void testInterpolationWithSystemProperty() throws Exception { /* MNG-4129 */ @Test - public void testPluginExecutionInheritanceWhenChildDoesNotDeclarePlugin() throws Exception { + void testPluginExecutionInheritanceWhenChildDoesNotDeclarePlugin() throws Exception { PomTestWrapper pom = buildPom("plugin-exec-inheritance/wo-merge"); @SuppressWarnings("unchecked") List executions = (List) pom.getValue( @@ -1621,7 +1621,7 @@ public void testPluginExecutionInheritanceWhenChildDoesNotDeclarePlugin() throws } @Test - public void testPluginExecutionInheritanceWhenChildDoesDeclarePluginAsWell() throws Exception { + void testPluginExecutionInheritanceWhenChildDoesDeclarePluginAsWell() throws Exception { PomTestWrapper pom = buildPom("plugin-exec-inheritance/w-merge"); @SuppressWarnings("unchecked") List executions = (List) pom.getValue( @@ -1632,7 +1632,7 @@ public void testPluginExecutionInheritanceWhenChildDoesDeclarePluginAsWell() thr /* MNG-4193 */ @Test - public void testValidationErrorUponNonUniqueArtifactRepositoryId() throws Exception { + void testValidationErrorUponNonUniqueArtifactRepositoryId() throws Exception { assertThrows( ProjectBuildingException.class, () -> buildPom("unique-repo-id/artifact-repo"), @@ -1641,7 +1641,7 @@ public void testValidationErrorUponNonUniqueArtifactRepositoryId() throws Except /* MNG-4193 */ @Test - public void testValidationErrorUponNonUniquePluginRepositoryId() throws Exception { + void testValidationErrorUponNonUniquePluginRepositoryId() throws Exception { assertThrows( ProjectBuildingException.class, () -> buildPom("unique-repo-id/plugin-repo"), @@ -1650,7 +1650,7 @@ public void testValidationErrorUponNonUniquePluginRepositoryId() throws Exceptio /* MNG-4193 */ @Test - public void testValidationErrorUponNonUniqueArtifactRepositoryIdInProfile() throws Exception { + void testValidationErrorUponNonUniqueArtifactRepositoryIdInProfile() throws Exception { assertThrows( ProjectBuildingException.class, () -> buildPom("unique-repo-id/artifact-repo-in-profile"), @@ -1659,7 +1659,7 @@ public void testValidationErrorUponNonUniqueArtifactRepositoryIdInProfile() thro /* MNG-4193 */ @Test - public void testValidationErrorUponNonUniquePluginRepositoryIdInProfile() throws Exception { + void testValidationErrorUponNonUniquePluginRepositoryIdInProfile() throws Exception { assertThrows( ProjectBuildingException.class, () -> buildPom("unique-repo-id/plugin-repo-in-profile"), @@ -1668,13 +1668,13 @@ public void testValidationErrorUponNonUniquePluginRepositoryIdInProfile() throws /** MNG-3843 */ @Test - public void testPrerequisitesAreNotInherited() throws Exception { + void testPrerequisitesAreNotInherited() throws Exception { PomTestWrapper pom = buildPom("prerequisites-inheritance/child"); assertSame(null, pom.getValue("prerequisites")); } @Test - public void testLicensesAreInheritedButNotAggregated() throws Exception { + void testLicensesAreInheritedButNotAggregated() throws Exception { PomTestWrapper pom = buildPom("licenses-inheritance/child-2"); assertEquals(1, ((List) pom.getValue("licenses")).size()); assertEquals("child-license", pom.getValue("licenses[1]/name")); @@ -1682,28 +1682,28 @@ public void testLicensesAreInheritedButNotAggregated() throws Exception { } @Test - public void testDevelopersAreInheritedButNotAggregated() throws Exception { + void testDevelopersAreInheritedButNotAggregated() throws Exception { PomTestWrapper pom = buildPom("developers-inheritance/child-2"); assertEquals(1, ((List) pom.getValue("developers")).size()); assertEquals("child-developer", pom.getValue("developers[1]/name")); } @Test - public void testContributorsAreInheritedButNotAggregated() throws Exception { + void testContributorsAreInheritedButNotAggregated() throws Exception { PomTestWrapper pom = buildPom("contributors-inheritance/child-2"); assertEquals(1, ((List) pom.getValue("contributors")).size()); assertEquals("child-contributor", pom.getValue("contributors[1]/name")); } @Test - public void testMailingListsAreInheritedButNotAggregated() throws Exception { + void testMailingListsAreInheritedButNotAggregated() throws Exception { PomTestWrapper pom = buildPom("mailing-lists-inheritance/child-2"); assertEquals(1, ((List) pom.getValue("mailingLists")).size()); assertEquals("child-mailing-list", pom.getValue("mailingLists[1]/name")); } @Test - public void testPluginInheritanceOrder() throws Exception { + void testPluginInheritanceOrder() throws Exception { PomTestWrapper pom = buildPom("plugin-inheritance-order/child"); assertEquals("maven-it-plugin-log-file", pom.getValue("build/plugins[1]/artifactId")); @@ -1716,7 +1716,7 @@ public void testPluginInheritanceOrder() throws Exception { } @Test - public void testCliPropsDominateProjectPropsDuringInterpolation() throws Exception { + void testCliPropsDominateProjectPropsDuringInterpolation() throws Exception { Properties props = new Properties(); props.setProperty("testProperty", "PASSED"); PomTestWrapper pom = buildPom("interpolation-cli-wins", null, props); @@ -1725,7 +1725,7 @@ public void testCliPropsDominateProjectPropsDuringInterpolation() throws Excepti } @Test - public void testParentPomPackagingMustBePom() throws Exception { + void testParentPomPackagingMustBePom() throws Exception { assertThrows( ProjectBuildingException.class, () -> buildPom("parent-pom-packaging/sub"), @@ -1734,7 +1734,7 @@ public void testParentPomPackagingMustBePom() throws Exception { /** MNG-522, MNG-3018 */ @Test - public void testManagedPluginConfigurationAppliesToImplicitPluginsIntroducedByPackaging() throws Exception { + void testManagedPluginConfigurationAppliesToImplicitPluginsIntroducedByPackaging() throws Exception { PomTestWrapper pom = buildPom("plugin-management-for-implicit-plugin/child"); assertEquals( "passed.txt", @@ -1745,7 +1745,7 @@ public void testManagedPluginConfigurationAppliesToImplicitPluginsIntroducedByPa } @Test - public void testDefaultPluginsExecutionContributedByPackagingExecuteBeforeUserDefinedExecutions() throws Exception { + void testDefaultPluginsExecutionContributedByPackagingExecuteBeforeUserDefinedExecutions() throws Exception { PomTestWrapper pom = buildPom("plugin-exec-order-and-default-exec"); @SuppressWarnings("unchecked") List executions = @@ -1759,7 +1759,7 @@ public void testDefaultPluginsExecutionContributedByPackagingExecuteBeforeUserDe } @Test - public void testPluginDeclarationsRetainPomOrderAfterInjectionOfDefaultPlugins() throws Exception { + void testPluginDeclarationsRetainPomOrderAfterInjectionOfDefaultPlugins() throws Exception { PomTestWrapper pom = buildPom("plugin-exec-order-with-lifecycle"); @SuppressWarnings("unchecked") List plugins = (List) pom.getValue("build/plugins"); @@ -1780,7 +1780,7 @@ public void testPluginDeclarationsRetainPomOrderAfterInjectionOfDefaultPlugins() /** MNG-4415 */ @Test - public void testPluginOrderAfterMergingWithInheritedPlugins() throws Exception { + void testPluginOrderAfterMergingWithInheritedPlugins() throws Exception { PomTestWrapper pom = buildPom("plugin-inheritance-merge-order/sub"); List expected = new ArrayList<>(); @@ -1807,7 +1807,7 @@ public void testPluginOrderAfterMergingWithInheritedPlugins() throws Exception { /** MNG-4416 */ @Test - public void testPluginOrderAfterMergingWithInjectedPlugins() throws Exception { + void testPluginOrderAfterMergingWithInjectedPlugins() throws Exception { PomTestWrapper pom = buildPom("plugin-injection-merge-order"); List expected = new ArrayList<>(); @@ -1833,7 +1833,7 @@ public void testPluginOrderAfterMergingWithInjectedPlugins() throws Exception { } @Test - public void testProjectArtifactIdIsNotInheritedButMandatory() throws Exception { + void testProjectArtifactIdIsNotInheritedButMandatory() throws Exception { assertThrows( ProjectBuildingException.class, () -> buildPom("artifact-id-inheritance/child"), diff --git a/maven-core/src/test/java/org/apache/maven/project/ProjectBuilderTest.java b/maven-core/src/test/java/org/apache/maven/project/ProjectBuilderTest.java index e431b5cc3f..2edf9a6887 100644 --- a/maven-core/src/test/java/org/apache/maven/project/ProjectBuilderTest.java +++ b/maven-core/src/test/java/org/apache/maven/project/ProjectBuilderTest.java @@ -55,14 +55,14 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; -public class ProjectBuilderTest extends AbstractCoreMavenComponentTestCase { +class ProjectBuilderTest extends AbstractCoreMavenComponentTestCase { @Override protected String getProjectsDirectory() { return "src/test/projects/project-builder"; } @Test - public void testSystemScopeDependencyIsPresentInTheCompileClasspathElements() throws Exception { + void testSystemScopeDependencyIsPresentInTheCompileClasspathElements() throws Exception { File pom = getProject("it0063"); Properties eps = new Properties(); @@ -78,7 +78,7 @@ public void testSystemScopeDependencyIsPresentInTheCompileClasspathElements() th } @Test - public void testBuildFromModelSource() throws Exception { + void testBuildFromModelSource() throws Exception { File pomFile = new File("src/test/resources/projects/modelsource/module01/pom.xml"); MavenSession mavenSession = createMavenSession(pomFile); ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest(); @@ -92,7 +92,7 @@ public void testBuildFromModelSource() throws Exception { } @Test - public void testVersionlessManagedDependency() throws Exception { + void testVersionlessManagedDependency() throws Exception { File pomFile = new File("src/test/resources/projects/versionless-managed-dependency.xml"); MavenSession mavenSession = createMavenSession(null); ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest(); @@ -109,7 +109,7 @@ public void testVersionlessManagedDependency() throws Exception { } @Test - public void testResolveDependencies() throws Exception { + void testResolveDependencies() throws Exception { File pomFile = new File("src/test/resources/projects/basic-resolveDependencies.xml"); MavenSession mavenSession = createMavenSession(null); ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest(); @@ -143,7 +143,7 @@ public void run() { } @Test - public void testDontResolveDependencies() throws Exception { + void testDontResolveDependencies() throws Exception { File pomFile = new File("src/test/resources/projects/basic-resolveDependencies.xml"); MavenSession mavenSession = createMavenSession(null); ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest(); @@ -165,7 +165,7 @@ public void testDontResolveDependencies() throws Exception { } @Test - public void testReadModifiedPoms(@TempDir Path tempDir) throws Exception { + void testReadModifiedPoms(@TempDir Path tempDir) throws Exception { // TODO a similar test should be created to test the dependency management (basically all usages // of DefaultModelBuilder.getCache() are affected by MNG-6530 @@ -191,7 +191,7 @@ public void testReadModifiedPoms(@TempDir Path tempDir) throws Exception { } @Test - public void testReadErroneousMavenProjectContainsReference() throws Exception { + void testReadErroneousMavenProjectContainsReference() throws Exception { File pomFile = new File("src/test/resources/projects/artifactMissingVersion.xml").getAbsoluteFile(); MavenSession mavenSession = createMavenSession(null); ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest(); @@ -223,7 +223,7 @@ public void testReadErroneousMavenProjectContainsReference() throws Exception { } @Test - public void testReadInvalidPom() throws Exception { + void testReadInvalidPom() throws Exception { File pomFile = new File("src/test/resources/projects/badPom.xml").getAbsoluteFile(); MavenSession mavenSession = createMavenSession(null); ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest(); @@ -249,7 +249,7 @@ public void testReadInvalidPom() throws Exception { } @Test - public void testReadParentAndChildWithRegularVersionSetParentFile() throws Exception { + void testReadParentAndChildWithRegularVersionSetParentFile() throws Exception { List toRead = new ArrayList<>(2); File parentPom = getProject("MNG-6723"); toRead.add(parentPom); @@ -302,7 +302,7 @@ private void assertResultShowNoError(List results) { } @Test - public void testBuildProperties() throws Exception { + void testBuildProperties() throws Exception { File file = new File(getProject("MNG-6716").getParentFile(), "project/pom.xml"); MavenSession mavenSession = createMavenSession(null); ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest(); @@ -318,7 +318,7 @@ public void testBuildProperties() throws Exception { } @Test - public void testPropertyInPluginManagementGroupId() throws Exception { + void testPropertyInPluginManagementGroupId() throws Exception { File pom = getProject("MNG-6983"); MavenSession session = createMavenSession(pom); @@ -330,7 +330,7 @@ public void testPropertyInPluginManagementGroupId() throws Exception { } @Test - public void testBuildFromModelSourceResolvesBasedir() throws Exception { + void testBuildFromModelSourceResolvesBasedir() throws Exception { File pomFile = new File("src/test/resources/projects/modelsourcebasedir/pom.xml"); MavenSession mavenSession = createMavenSession(null); ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest(); @@ -353,7 +353,7 @@ public void testBuildFromModelSourceResolvesBasedir() throws Exception { } @Test - public void testLocationTrackingResolution() throws Exception { + void testLocationTrackingResolution() throws Exception { File pom = getProject("MNG-7648"); MavenSession session = createMavenSession(pom); diff --git a/maven-core/src/test/java/org/apache/maven/project/ProjectModelResolverTest.java b/maven-core/src/test/java/org/apache/maven/project/ProjectModelResolverTest.java index 2fa07153f8..b7352b9306 100644 --- a/maven-core/src/test/java/org/apache/maven/project/ProjectModelResolverTest.java +++ b/maven-core/src/test/java/org/apache/maven/project/ProjectModelResolverTest.java @@ -48,7 +48,7 @@ * @author Christian Schulte * @since 3.5.0 */ -public class ProjectModelResolverTest extends AbstractMavenProjectTestCase { +class ProjectModelResolverTest extends AbstractMavenProjectTestCase { /** * Creates a new {@code ProjectModelResolverTest} instance. @@ -58,7 +58,7 @@ public ProjectModelResolverTest() { } @Test - public void testResolveParentThrowsUnresolvableModelExceptionWhenNotFound() throws Exception { + void testResolveParentThrowsUnresolvableModelExceptionWhenNotFound() throws Exception { final Parent parent = new Parent(); parent.setGroupId("org.apache"); parent.setArtifactId("apache"); @@ -73,7 +73,7 @@ public void testResolveParentThrowsUnresolvableModelExceptionWhenNotFound() thro } @Test - public void testResolveParentThrowsUnresolvableModelExceptionWhenNoMatchingVersionFound() throws Exception { + void testResolveParentThrowsUnresolvableModelExceptionWhenNoMatchingVersionFound() throws Exception { final Parent parent = new Parent(); parent.setGroupId("org.apache"); parent.setArtifactId("apache"); @@ -87,7 +87,7 @@ public void testResolveParentThrowsUnresolvableModelExceptionWhenNoMatchingVersi } @Test - public void testResolveParentThrowsUnresolvableModelExceptionWhenUsingRangesWithoutUpperBound() throws Exception { + void testResolveParentThrowsUnresolvableModelExceptionWhenUsingRangesWithoutUpperBound() throws Exception { final Parent parent = new Parent(); parent.setGroupId("org.apache"); parent.setArtifactId("apache"); @@ -101,7 +101,7 @@ public void testResolveParentThrowsUnresolvableModelExceptionWhenUsingRangesWith } @Test - public void testResolveParentSuccessfullyResolvesExistingParentWithoutRange() throws Exception { + void testResolveParentSuccessfullyResolvesExistingParentWithoutRange() throws Exception { final Parent parent = new Parent(); parent.setGroupId("org.apache"); parent.setArtifactId("apache"); @@ -112,7 +112,7 @@ public void testResolveParentSuccessfullyResolvesExistingParentWithoutRange() th } @Test - public void testResolveParentSuccessfullyResolvesExistingParentUsingHighestVersion() throws Exception { + void testResolveParentSuccessfullyResolvesExistingParentUsingHighestVersion() throws Exception { final Parent parent = new Parent(); parent.setGroupId("org.apache"); parent.setArtifactId("apache"); @@ -124,7 +124,7 @@ public void testResolveParentSuccessfullyResolvesExistingParentUsingHighestVersi } @Test - public void testResolveDependencyThrowsUnresolvableModelExceptionWhenNotFound() throws Exception { + void testResolveDependencyThrowsUnresolvableModelExceptionWhenNotFound() throws Exception { final Dependency dependency = new Dependency(); dependency.setGroupId("org.apache"); dependency.setArtifactId("apache"); @@ -139,7 +139,7 @@ public void testResolveDependencyThrowsUnresolvableModelExceptionWhenNotFound() } @Test - public void testResolveDependencyThrowsUnresolvableModelExceptionWhenNoMatchingVersionFound() throws Exception { + void testResolveDependencyThrowsUnresolvableModelExceptionWhenNoMatchingVersionFound() throws Exception { final Dependency dependency = new Dependency(); dependency.setGroupId("org.apache"); dependency.setArtifactId("apache"); @@ -153,8 +153,7 @@ public void testResolveDependencyThrowsUnresolvableModelExceptionWhenNoMatchingV } @Test - public void testResolveDependencyThrowsUnresolvableModelExceptionWhenUsingRangesWithoutUpperBound() - throws Exception { + void testResolveDependencyThrowsUnresolvableModelExceptionWhenUsingRangesWithoutUpperBound() throws Exception { final Dependency dependency = new Dependency(); dependency.setGroupId("org.apache"); dependency.setArtifactId("apache"); @@ -168,7 +167,7 @@ public void testResolveDependencyThrowsUnresolvableModelExceptionWhenUsingRanges } @Test - public void testResolveDependencySuccessfullyResolvesExistingDependencyWithoutRange() throws Exception { + void testResolveDependencySuccessfullyResolvesExistingDependencyWithoutRange() throws Exception { final Dependency dependency = new Dependency(); dependency.setGroupId("org.apache"); dependency.setArtifactId("apache"); @@ -179,7 +178,7 @@ public void testResolveDependencySuccessfullyResolvesExistingDependencyWithoutRa } @Test - public void testResolveDependencySuccessfullyResolvesExistingDependencyUsingHighestVersion() throws Exception { + void testResolveDependencySuccessfullyResolvesExistingDependencyUsingHighestVersion() throws Exception { final Dependency dependency = new Dependency(); dependency.setGroupId("org.apache"); dependency.setArtifactId("apache"); diff --git a/maven-core/src/test/java/org/apache/maven/project/ProjectSorterTest.java b/maven-core/src/test/java/org/apache/maven/project/ProjectSorterTest.java index f2aa691228..dc4288ef4a 100644 --- a/maven-core/src/test/java/org/apache/maven/project/ProjectSorterTest.java +++ b/maven-core/src/test/java/org/apache/maven/project/ProjectSorterTest.java @@ -41,7 +41,7 @@ * * @author Brett Porter */ -public class ProjectSorterTest { +class ProjectSorterTest { private Parent createParent(MavenProject project) { return createParent(project.getGroupId(), project.getArtifactId(), project.getVersion()); } @@ -96,7 +96,7 @@ private static MavenProject createProject(String groupId, String artifactId, Str } @Test - public void testShouldNotFailWhenPluginDepReferencesCurrentProject() throws Exception { + void testShouldNotFailWhenPluginDepReferencesCurrentProject() throws Exception { MavenProject project = createProject("group", "artifact", "1.0"); Build build = project.getModel().getBuild(); @@ -113,7 +113,7 @@ public void testShouldNotFailWhenPluginDepReferencesCurrentProject() throws Exce } @Test - public void testShouldNotFailWhenManagedPluginDepReferencesCurrentProject() throws Exception { + void testShouldNotFailWhenManagedPluginDepReferencesCurrentProject() throws Exception { MavenProject project = createProject("group", "artifact", "1.0"); Build build = project.getModel().getBuild(); @@ -134,7 +134,7 @@ public void testShouldNotFailWhenManagedPluginDepReferencesCurrentProject() thro } @Test - public void testShouldNotFailWhenProjectReferencesNonExistentProject() throws Exception { + void testShouldNotFailWhenProjectReferencesNonExistentProject() throws Exception { MavenProject project = createProject("group", "artifact", "1.0"); Build build = project.getModel().getBuild(); @@ -147,7 +147,7 @@ public void testShouldNotFailWhenProjectReferencesNonExistentProject() throws Ex } @Test - public void testMatchingArtifactIdsDifferentGroupIds() throws Exception { + void testMatchingArtifactIdsDifferentGroupIds() throws Exception { List projects = new ArrayList<>(); MavenProject project1 = createProject("groupId1", "artifactId", "1.0"); projects.add(project1); @@ -162,7 +162,7 @@ public void testMatchingArtifactIdsDifferentGroupIds() throws Exception { } @Test - public void testMatchingGroupIdsDifferentArtifactIds() throws Exception { + void testMatchingGroupIdsDifferentArtifactIds() throws Exception { List projects = new ArrayList<>(); MavenProject project1 = createProject("groupId", "artifactId1", "1.0"); projects.add(project1); @@ -177,7 +177,7 @@ public void testMatchingGroupIdsDifferentArtifactIds() throws Exception { } @Test - public void testMatchingIdsAndVersions() throws Exception { + void testMatchingIdsAndVersions() throws Exception { List projects = new ArrayList<>(); MavenProject project1 = createProject("groupId", "artifactId", "1.0"); projects.add(project1); @@ -191,7 +191,7 @@ public void testMatchingIdsAndVersions() throws Exception { } @Test - public void testMatchingIdsAndDifferentVersions() throws Exception { + void testMatchingIdsAndDifferentVersions() throws Exception { List projects = new ArrayList<>(); MavenProject project1 = createProject("groupId", "artifactId", "1.0"); projects.add(project1); @@ -204,7 +204,7 @@ public void testMatchingIdsAndDifferentVersions() throws Exception { } @Test - public void testPluginDependenciesInfluenceSorting() throws Exception { + void testPluginDependenciesInfluenceSorting() throws Exception { List projects = new ArrayList<>(); MavenProject parentProject = createProject("groupId", "parent", "1.0"); @@ -248,7 +248,7 @@ public void testPluginDependenciesInfluenceSorting() throws Exception { } @Test - public void testPluginDependenciesInfluenceSorting_DeclarationInParent() throws Exception { + void testPluginDependenciesInfluenceSorting_DeclarationInParent() throws Exception { List projects = new ArrayList<>(); MavenProject parentProject = createProject("groupId", "parent-declarer", "1.0"); @@ -282,7 +282,7 @@ public void testPluginDependenciesInfluenceSorting_DeclarationInParent() throws } @Test - public void testPluginVersionsAreConsidered() throws Exception { + void testPluginVersionsAreConsidered() throws Exception { List projects = new ArrayList<>(); MavenProject pluginProjectA = createProject("group", "plugin-a", "2.0-SNAPSHOT"); @@ -300,7 +300,7 @@ public void testPluginVersionsAreConsidered() throws Exception { } @Test - public void testDependencyPrecedesProjectThatUsesSpecificDependencyVersion() throws Exception { + void testDependencyPrecedesProjectThatUsesSpecificDependencyVersion() throws Exception { List projects = new ArrayList<>(); MavenProject usingProject = createProject("group", "project", "1.0"); @@ -317,7 +317,7 @@ public void testDependencyPrecedesProjectThatUsesSpecificDependencyVersion() thr } @Test - public void testDependencyPrecedesProjectThatUsesUnresolvedDependencyVersion() throws Exception { + void testDependencyPrecedesProjectThatUsesUnresolvedDependencyVersion() throws Exception { List projects = new ArrayList<>(); MavenProject usingProject = createProject("group", "project", "1.0"); diff --git a/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultMavenMetadataCacheTest.java b/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultMavenMetadataCacheTest.java index 1b19115f56..7eb20096f4 100644 --- a/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultMavenMetadataCacheTest.java +++ b/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultMavenMetadataCacheTest.java @@ -37,16 +37,16 @@ /** * @author Igor Fedorenko */ -public class DefaultMavenMetadataCacheTest { +class DefaultMavenMetadataCacheTest { private RepositorySystem repositorySystem; @BeforeEach - public void setUp() { + void setUp() { repositorySystem = new TestRepositorySystem(); } @Test - public void testCacheKey() throws Exception { + void testCacheKey() throws Exception { Artifact a1 = repositorySystem.createArtifact("testGroup", "testArtifact", "1.2.3", "jar"); @SuppressWarnings("deprecation") ArtifactRepository lr1 = new DelegatingLocalArtifactRepository(repositorySystem.createDefaultLocalRepository()); diff --git a/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultProjectArtifactsCacheTest.java b/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultProjectArtifactsCacheTest.java index ba33437be9..575d106d80 100644 --- a/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultProjectArtifactsCacheTest.java +++ b/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultProjectArtifactsCacheTest.java @@ -28,17 +28,17 @@ import static org.junit.jupiter.api.Assertions.assertArrayEquals; -public class DefaultProjectArtifactsCacheTest { +class DefaultProjectArtifactsCacheTest { private ProjectArtifactsCache cache; @BeforeEach - public void setUp() throws Exception { + void setUp() throws Exception { cache = new DefaultProjectArtifactsCache(); } @Test - public void testProjectDependencyOrder() throws Exception { + void testProjectDependencyOrder() throws Exception { ProjectArtifactsCache.Key project1 = new ProjectArtifactsCache.Key() {}; Set artifacts = new LinkedHashSet<>(4); diff --git a/maven-core/src/test/java/org/apache/maven/project/artifact/MavenMetadataSourceTest.java b/maven-core/src/test/java/org/apache/maven/project/artifact/MavenMetadataSourceTest.java index f3561fd427..d22cb83d2e 100644 --- a/maven-core/src/test/java/org/apache/maven/project/artifact/MavenMetadataSourceTest.java +++ b/maven-core/src/test/java/org/apache/maven/project/artifact/MavenMetadataSourceTest.java @@ -27,7 +27,7 @@ import org.junit.jupiter.api.Test; @PlexusTest -public class MavenMetadataSourceTest { +class MavenMetadataSourceTest { @Inject private RepositorySystem repositorySystem; @@ -36,7 +36,7 @@ public class MavenMetadataSourceTest { @Test @Disabled - public void testShouldNotCarryExclusionsOverFromDependencyToDependency() throws Exception { + void testShouldNotCarryExclusionsOverFromDependencyToDependency() throws Exception { /* Dependency dep1 = new Dependency(); dep1.setGroupId( "test" ); @@ -84,7 +84,7 @@ public void testShouldNotCarryExclusionsOverFromDependencyToDependency() throws @Test @Disabled("TODO restore these if it makes sense") - public void testShouldUseCompileScopeIfDependencyScopeEmpty() throws Exception { + void testShouldUseCompileScopeIfDependencyScopeEmpty() throws Exception { /* String groupId = "org.apache.maven"; String artifactId = "maven-model"; @@ -122,7 +122,7 @@ public void testShouldUseCompileScopeIfDependencyScopeEmpty() throws Exception { @Test @Disabled - public void testShouldUseInjectedTestScopeFromDependencyManagement() throws Exception { + void testShouldUseInjectedTestScopeFromDependencyManagement() throws Exception { /* String groupId = "org.apache.maven"; String artifactId = "maven-model"; diff --git a/maven-core/src/test/java/org/apache/maven/project/canonical/CanonicalProjectBuilderTest.java b/maven-core/src/test/java/org/apache/maven/project/canonical/CanonicalProjectBuilderTest.java index 6c6a4a70b4..3326f70450 100644 --- a/maven-core/src/test/java/org/apache/maven/project/canonical/CanonicalProjectBuilderTest.java +++ b/maven-core/src/test/java/org/apache/maven/project/canonical/CanonicalProjectBuilderTest.java @@ -34,9 +34,9 @@ /** * @author Jason van Zyl */ -public class CanonicalProjectBuilderTest extends AbstractMavenProjectTestCase { +class CanonicalProjectBuilderTest extends AbstractMavenProjectTestCase { @Test - public void testProjectBuilder() throws Exception { + void testProjectBuilder() throws Exception { File f = getFileForClasspathResource("canonical-pom.xml"); MavenProject project = getProject(f); diff --git a/maven-core/src/test/java/org/apache/maven/rtinfo/internal/DefaultRuntimeInformationTest.java b/maven-core/src/test/java/org/apache/maven/rtinfo/internal/DefaultRuntimeInformationTest.java index aee43d68e4..7a969889b4 100644 --- a/maven-core/src/test/java/org/apache/maven/rtinfo/internal/DefaultRuntimeInformationTest.java +++ b/maven-core/src/test/java/org/apache/maven/rtinfo/internal/DefaultRuntimeInformationTest.java @@ -30,19 +30,19 @@ import static org.junit.jupiter.api.Assertions.assertTrue; @PlexusTest -public class DefaultRuntimeInformationTest { +class DefaultRuntimeInformationTest { @Inject RuntimeInformation rtInfo; @Test - public void testGetMavenVersion() { + void testGetMavenVersion() { String mavenVersion = rtInfo.getMavenVersion(); assertNotNull(mavenVersion); assertTrue(mavenVersion.length() > 0); } @Test - public void testIsMavenVersion() { + void testIsMavenVersion() { assertTrue(rtInfo.isMavenVersion("2.0")); assertFalse(rtInfo.isMavenVersion("9.9")); diff --git a/maven-core/src/test/java/org/apache/maven/settings/PomConstructionWithSettingsTest.java b/maven-core/src/test/java/org/apache/maven/settings/PomConstructionWithSettingsTest.java index 24ded5cb2d..eb6c21f0f6 100644 --- a/maven-core/src/test/java/org/apache/maven/settings/PomConstructionWithSettingsTest.java +++ b/maven-core/src/test/java/org/apache/maven/settings/PomConstructionWithSettingsTest.java @@ -46,7 +46,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; @PlexusTest -public class PomConstructionWithSettingsTest { +class PomConstructionWithSettingsTest { private static final String BASE_DIR = "src/test"; private static final String BASE_POM_DIR = BASE_DIR + "/resources-settings"; @@ -60,12 +60,12 @@ public class PomConstructionWithSettingsTest { private File testDirectory; @BeforeEach - public void setUp() throws Exception { + void setUp() throws Exception { testDirectory = new File(getBasedir(), BASE_POM_DIR); } @Test - public void testSettingsNoPom() throws Exception { + void testSettingsNoPom() throws Exception { PomTestWrapper pom = buildPom("settings-no-pom"); assertEquals("local-profile-prop-value", pom.getValue("properties/local-profile-prop")); } @@ -74,7 +74,7 @@ public void testSettingsNoPom() throws Exception { * MNG-4107 */ @Test - public void testPomAndSettingsInterpolation() throws Exception { + void testPomAndSettingsInterpolation() throws Exception { PomTestWrapper pom = buildPom("test-pom-and-settings-interpolation"); assertEquals("applied", pom.getValue("properties/settingsProfile")); assertEquals("applied", pom.getValue("properties/pomProfile")); @@ -86,7 +86,7 @@ public void testPomAndSettingsInterpolation() throws Exception { * MNG-4107 */ @Test - public void testRepositories() throws Exception { + void testRepositories() throws Exception { PomTestWrapper pom = buildPom("repositories"); assertEquals("maven-core-it-0", pom.getValue("repositories[1]/id")); } diff --git a/maven-core/src/test/java/org/apache/maven/settings/SettingsUtilsTest.java b/maven-core/src/test/java/org/apache/maven/settings/SettingsUtilsTest.java index d4d2ad9b54..1e7250f4a4 100644 --- a/maven-core/src/test/java/org/apache/maven/settings/SettingsUtilsTest.java +++ b/maven-core/src/test/java/org/apache/maven/settings/SettingsUtilsTest.java @@ -37,10 +37,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; -public class SettingsUtilsTest { +class SettingsUtilsTest { @Test - public void testShouldAppendRecessivePluginGroupIds() { + void testShouldAppendRecessivePluginGroupIds() { Settings dominant = Settings.newBuilder() .pluginGroups(Arrays.asList("org.apache.maven.plugins", "org.codehaus.modello")) .build(); @@ -61,7 +61,7 @@ public void testShouldAppendRecessivePluginGroupIds() { } @Test - public void testRoundTripProfiles() { + void testRoundTripProfiles() { Random entropy = new Random(); ActivationFile af = ActivationFile.newBuilder() .exists("exists" + Long.toHexString(entropy.nextLong())) diff --git a/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivateTest.java b/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivateTest.java index fe98061302..4c255a37a4 100644 --- a/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivateTest.java +++ b/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivateTest.java @@ -41,7 +41,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -public class DefaultToolchainManagerPrivateTest { +class DefaultToolchainManagerPrivateTest { // Mocks to inject into toolchainManager @Mock private Logger logger; @@ -56,7 +56,7 @@ public class DefaultToolchainManagerPrivateTest { private ToolchainFactory toolchainFactory_rareType; @BeforeEach - public void setUp() { + void setUp() { MockitoAnnotations.initMocks(this); @@ -67,7 +67,7 @@ public void setUp() { } @Test - public void testToolchainsForAvailableType() throws Exception { + void testToolchainsForAvailableType() throws Exception { // prepare MavenSession session = mock(MavenSession.class); MavenExecutionRequest req = new DefaultMavenExecutionRequest(); @@ -87,7 +87,7 @@ public void testToolchainsForAvailableType() throws Exception { } @Test - public void testToolchainsForUnknownType() throws Exception { + void testToolchainsForUnknownType() throws Exception { // prepare MavenSession session = mock(MavenSession.class); MavenExecutionRequest req = new DefaultMavenExecutionRequest(); @@ -107,7 +107,7 @@ public void testToolchainsForUnknownType() throws Exception { } @Test - public void testToolchainsForConfiguredType() throws Exception { + void testToolchainsForConfiguredType() throws Exception { // prepare MavenSession session = mock(MavenSession.class); MavenExecutionRequest req = new DefaultMavenExecutionRequest(); @@ -137,7 +137,7 @@ public void testToolchainsForConfiguredType() throws Exception { } @Test - public void testMisconfiguredToolchain() throws Exception { + void testMisconfiguredToolchain() throws Exception { // prepare MavenSession session = mock(MavenSession.class); MavenExecutionRequest req = new DefaultMavenExecutionRequest(); diff --git a/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerTest.java b/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerTest.java index 9bb2568fc9..e8b189ecad 100644 --- a/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerTest.java +++ b/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerTest.java @@ -42,7 +42,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -public class DefaultToolchainManagerTest { +class DefaultToolchainManagerTest { // Mocks to inject into toolchainManager @Mock private Logger logger; @@ -57,7 +57,7 @@ public class DefaultToolchainManagerTest { private ToolchainFactory toolchainFactory_rareType; @BeforeEach - public void onSetup() throws Exception { + void onSetup() throws Exception { MockitoAnnotations.initMocks(this); Map factories = new HashMap<>(); @@ -67,7 +67,7 @@ public void onSetup() throws Exception { } @Test - public void testNoModels() { + void testNoModels() { MavenSession session = mock(MavenSession.class); MavenExecutionRequest executionRequest = new DefaultMavenExecutionRequest(); when(session.getRequest()).thenReturn(executionRequest); @@ -78,7 +78,7 @@ public void testNoModels() { } @Test - public void testModelNoFactory() { + void testModelNoFactory() { MavenSession session = mock(MavenSession.class); MavenExecutionRequest executionRequest = new DefaultMavenExecutionRequest(); Map> toolchainModels = new HashMap<>(); @@ -93,7 +93,7 @@ public void testModelNoFactory() { } @Test - public void testModelAndFactory() { + void testModelAndFactory() { MavenSession session = mock(MavenSession.class); MavenExecutionRequest executionRequest = new DefaultMavenExecutionRequest(); Map> toolchainModels = new HashMap<>(); @@ -108,7 +108,7 @@ public void testModelAndFactory() { } @Test - public void testModelsAndFactory() { + void testModelsAndFactory() { MavenSession session = mock(MavenSession.class); MavenExecutionRequest executionRequest = new DefaultMavenExecutionRequest(); Map> toolchainModels = new HashMap<>(); @@ -123,7 +123,7 @@ public void testModelsAndFactory() { } @Test - public void testRequirements() throws Exception { + void testRequirements() throws Exception { MavenSession session = mock(MavenSession.class); MavenExecutionRequest executionRequest = new DefaultMavenExecutionRequest(); Map> toolchainModels = new HashMap<>(); diff --git a/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainTest.java b/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainTest.java index a9b18114de..faffb3c75d 100644 --- a/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainTest.java +++ b/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainTest.java @@ -34,11 +34,11 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; -public class DefaultToolchainTest { +class DefaultToolchainTest { private final Logger logger = mock(Logger.class); @BeforeEach - public void setUp() throws Exception { + void setUp() throws Exception { MockitoAnnotations.initMocks(this); } @@ -61,14 +61,14 @@ public String findTool(String toolName) { } @Test - public void testGetModel() { + void testGetModel() { ToolchainModel model = new ToolchainModel(); DefaultToolchain toolchain = newDefaultToolchain(model); assertEquals(model, toolchain.getModel()); } @Test - public void testGetType() { + void testGetType() { ToolchainModel model = new ToolchainModel(); DefaultToolchain toolchain = newDefaultToolchain(model, "TYPE"); assertEquals("TYPE", toolchain.getType()); @@ -79,14 +79,14 @@ public void testGetType() { } @Test - public void testGetLogger() { + void testGetLogger() { ToolchainModel model = new ToolchainModel(); DefaultToolchain toolchain = newDefaultToolchain(model); assertEquals(logger, toolchain.getLog()); } @Test - public void testMissingRequirementProperty() { + void testMissingRequirementProperty() { ToolchainModel model = new ToolchainModel(); model.setType("TYPE"); DefaultToolchain toolchain = newDefaultToolchain(model); @@ -96,7 +96,7 @@ public void testMissingRequirementProperty() { } @Test - public void testNonMatchingRequirementProperty() { + void testNonMatchingRequirementProperty() { ToolchainModel model = new ToolchainModel(); model.setType("TYPE"); DefaultToolchain toolchain = newDefaultToolchain(model); @@ -107,7 +107,7 @@ public void testNonMatchingRequirementProperty() { } @Test - public void testEquals() { + void testEquals() { ToolchainModel tm1 = new ToolchainModel(); tm1.setType("jdk"); tm1.addProvide("version", "1.5"); diff --git a/maven-core/src/test/java/org/apache/maven/toolchain/RequirementMatcherFactoryTest.java b/maven-core/src/test/java/org/apache/maven/toolchain/RequirementMatcherFactoryTest.java index 6b9cc2d800..6baf58b733 100644 --- a/maven-core/src/test/java/org/apache/maven/toolchain/RequirementMatcherFactoryTest.java +++ b/maven-core/src/test/java/org/apache/maven/toolchain/RequirementMatcherFactoryTest.java @@ -28,13 +28,13 @@ * * @author mkleint */ -public class RequirementMatcherFactoryTest { +class RequirementMatcherFactoryTest { /** * Test of createExactMatcher method, of class RequirementMatcherFactory. */ @Test - public void testCreateExactMatcher() { + void testCreateExactMatcher() { RequirementMatcher matcher; matcher = RequirementMatcherFactory.createExactMatcher("foo"); assertFalse(matcher.matches("bar")); @@ -47,7 +47,7 @@ public void testCreateExactMatcher() { * Test of createVersionMatcher method, of class RequirementMatcherFactory. */ @Test - public void testCreateVersionMatcher() { + void testCreateVersionMatcher() { RequirementMatcher matcher; matcher = RequirementMatcherFactory.createVersionMatcher("1.5.2"); assertFalse(matcher.matches("1.5")); diff --git a/maven-embedder/src/test/java/org/apache/maven/cli/CLIManagerDocumentationTest.java b/maven-embedder/src/test/java/org/apache/maven/cli/CLIManagerDocumentationTest.java index 19a1efa2b2..2397f1fa0a 100644 --- a/maven-embedder/src/test/java/org/apache/maven/cli/CLIManagerDocumentationTest.java +++ b/maven-embedder/src/test/java/org/apache/maven/cli/CLIManagerDocumentationTest.java @@ -34,7 +34,7 @@ * Pseudo test to generate documentation fragment about supported CLI options. TODO such documentation generation code * should not be necessary as unit test but should be run during site generation (Velocity? Doxia macro?) */ -public class CLIManagerDocumentationTest { +class CLIManagerDocumentationTest { private static final String LS = System.lineSeparator(); private static class OptionComparator implements Comparator