From 7392ef5c3b35e88c762d42d7775354e7dbdd893e Mon Sep 17 00:00:00 2001 From: Juul Hobert Date: Tue, 17 Oct 2023 19:23:40 +0200 Subject: [PATCH] Disable other tests --- .../maven/it/MavenIT0008SimplePluginTest.java | 54 --- .../it/MavenIT0009GoalConfigurationTest.java | 55 --- ...IT0010DependencyClosureResolutionTest.java | 63 --- ...aultVersionByDependencyManagementTest.java | 56 --- .../it/MavenIT0012PomInterpolationTest.java | 50 --- .../MavenIT0018DependencyManagementTest.java | 54 --- ...IT0019PluginVersionMgmtBySuperPomTest.java | 48 --- .../maven/it/MavenIT0021PomProfileTest.java | 57 --- .../it/MavenIT0023SettingsProfileTest.java | 53 --- ...MavenIT0024MultipleGoalExecutionsTest.java | 57 --- ...0025MultipleExecutionLevelConfigsTest.java | 57 --- ...venIT0030DepPomDepMgmtInheritanceTest.java | 51 --- .../it/MavenIT0032MavenPrerequisiteTest.java | 47 --- ...avenIT0037AlternatePomFileSameDirTest.java | 59 --- ...T0038AlternatePomFileDifferentDirTest.java | 59 --- ...T0040PackagingFromPluginExtensionTest.java | 57 --- ...41ArtifactTypeFromPluginExtensionTest.java | 59 --- .../it/MavenIT0051ReleaseProfileTest.java | 53 --- .../it/MavenIT0052ReleaseProfileTest.java | 53 --- ...MavenIT0056MultipleGoalExecutionsTest.java | 52 --- .../MavenIT0063SystemScopeDependencyTest.java | 57 --- .../MavenIT0064MojoConfigViaSettersTest.java | 52 --- ...071PluginConfigWithDottedPropertyTest.java | 57 --- ...72InterpolationWithDottedPropertyTest.java | 59 --- .../MavenIT0085TransitiveSystemScopeTest.java | 60 --- .../maven/it/MavenIT0086PluginRealmTest.java | 70 ---- ...87PluginRealmWithProjectLevelDepsTest.java | 70 ---- .../MavenIT0090EnvVarInterpolationTest.java | 54 --- .../it/MavenIT0108SnapshotUpdateTest.java | 248 ----------- ...rAuthzAvailableToWagonMgrInPluginTest.java | 56 --- .../it/MavenIT0130CleanLifecycleTest.java | 55 --- .../it/MavenIT0131SiteLifecycleTest.java | 56 --- .../maven/it/MavenIT0132PomLifecycleTest.java | 59 --- .../maven/it/MavenIT0133JarLifecycleTest.java | 62 --- .../maven/it/MavenIT0134WarLifecycleTest.java | 62 --- .../maven/it/MavenIT0135EjbLifecycleTest.java | 62 --- .../maven/it/MavenIT0136RarLifecycleTest.java | 62 --- .../maven/it/MavenIT0137EarLifecycleTest.java | 59 --- .../it/MavenIT0138PluginLifecycleTest.java | 67 --- ...139InterpolationWithProjectPrefixTest.java | 90 ---- ...nIT0140InterpolationWithPomPrefixTest.java | 92 ----- ...MavenIT0142DirectDependencyScopesTest.java | 118 ------ ...nIT0143TransitiveDependencyScopesTest.java | 262 ------------ ...avenIT0144LifecycleExecutionOrderTest.java | 103 ----- .../MavenIT0146InstallerSnapshotNaming.java | 136 ------ .../it/MavenIT0199CyclicImportScopeTest.java | 59 --- .../apache/maven/it/MavenITBootstrapTest.java | 61 --- ...enITmng0095ReactorFailureBehaviorTest.java | 130 ------ .../MavenITmng0187CollectedProjectsTest.java | 91 ---- ...enITmng0249ResolveDepsFromReactorTest.java | 69 ---- ...ReactorExecWhenProjectIndependentTest.java | 57 --- ...mng0294MergeGlobalAndUserSettingsTest.java | 62 --- ...enITmng0377PluginLookupFromPrefixTest.java | 62 --- ...nITmng0449PluginVersionResolutionTest.java | 111 ----- ...g0461TolerateMissingDependencyPomTest.java | 62 --- .../it/MavenITmng0469ReportConfigTest.java | 86 ---- .../it/MavenITmng0471CustomLifecycleTest.java | 59 --- ...MavenITmng0479OverrideCentralRepoTest.java | 192 --------- ...0496IgnoreUnknownPluginParametersTest.java | 56 --- .../it/MavenITmng0505VersionRangeTest.java | 70 ---- .../MavenITmng0507ArtifactRelocationTest.java | 67 --- ...Tmng0522InheritedPluginMgmtConfigTest.java | 57 --- ...nITmng0553SettingsAuthzEncryptionTest.java | 223 ---------- ...venITmng0557UserSettingsCliOptionTest.java | 58 --- ...enITmng0612NewestConflictResolverTest.java | 65 --- .../it/MavenITmng0666IgnoreLegacyPomTest.java | 65 --- ...avenITmng0674PluginParameterAliasTest.java | 86 ---- .../it/MavenITmng0680ParentBasedirTest.java | 63 --- ...nITmng0761MissingSnapshotDistRepoTest.java | 59 --- .../it/MavenITmng0768OfflineModeTest.java | 175 -------- ...73SettingsProfileReactorPollutionTest.java | 55 --- ...ITmng0781PluginConfigVsExecConfigTest.java | 58 --- ...MavenITmng0786ProfileAwareReactorTest.java | 60 --- ...Tmng0814ExplicitProfileActivationTest.java | 60 --- ...avenITmng0818WarDepsNotTransitiveTest.java | 63 --- .../MavenITmng0820ConflictResolutionTest.java | 66 --- .../MavenITmng0823MojoContextPassingTest.java | 57 --- ...Tmng0828PluginConfigValuesInDebugTest.java | 116 ------ ...enITmng0836PluginParentResolutionTest.java | 73 ---- ...UserPropertyOverridesDefaultValueTest.java | 61 --- ...avenITmng0866EvaluateDefaultValueTest.java | 63 --- ...ng0870ReactorAwarePluginDiscoveryTest.java | 62 --- .../MavenITmng0947OptionalDependencyTest.java | 79 ---- ...InjectionViaProjectLevelPluginDepTest.java | 61 --- ...mng0985NonExecutedPluginMgmtGoalsTest.java | 56 --- ...mng1021EqualAttachmentBuildNumberTest.java | 90 ---- .../MavenITmng1052PluginMgmtConfigTest.java | 57 --- ...enITmng1073AggregatorForksReactorTest.java | 89 ---- ...nITmng1088ReactorPluginResolutionTest.java | 64 --- ...ITmng1142VersionRangeIntersectionTest.java | 81 ---- ...avenITmng1144MultipleDefaultGoalsTest.java | 56 --- ...nITmng1233WarDepWithProvidedScopeTest.java | 75 ---- .../MavenITmng1323AntrunDependenciesTest.java | 82 ---- .../it/MavenITmng1349ChecksumFormatsTest.java | 76 ---- .../MavenITmng1412DependenciesOrderTest.java | 90 ---- ...enITmng1415QuotedSystemPropertiesTest.java | 58 --- ...mng1491ReactorArtifactIdCollisionTest.java | 57 --- ...Tmng1493NonStandardModulePomNamesTest.java | 58 --- .../it/MavenITmng1701DuplicatePluginTest.java | 78 ---- ...ITmng1703PluginMgmtDepInheritanceTest.java | 71 ---- ...cedMetadataUpdateDuringDeploymentTest.java | 81 ---- ...ValidationErrorIncludesLineNumberTest.java | 77 ---- ...nITmng1895ScopeConflictResolutionTest.java | 235 ----------- ...1957JdkActivationWithVersionRangeTest.java | 64 --- ...mng1992SystemPropOverridesPomPropTest.java | 62 --- ...95InterpolateBooleanModelElementsTest.java | 67 --- ...g2006ChildPathAwareUrlInheritanceTest.java | 67 --- ...estJarDependenciesBrokenInReactorTest.java | 84 ---- ...lateWithSettingsProfilePropertiesTest.java | 56 --- ...mng2054PluginExecutionInheritanceTest.java | 60 --- ...enITmng2068ReactorRelativeParentsTest.java | 96 ----- ...ersionRangeSatisfiedFromWrongRepoTest.java | 62 --- ...mng2103PluginExecutionInheritanceTest.java | 63 --- ...enITmng2123VersionRangeDependencyTest.java | 57 --- ...4PomInterpolationWithParentValuesTest.java | 56 --- ...g2130ParentLookupFromReactorCacheTest.java | 52 --- ...avenITmng2135PluginBuildInReactorTest.java | 58 --- ...enITmng2136ActiveByDefaultProfileTest.java | 71 ---- ...ReactorAwareDepResolutionWhenForkTest.java | 58 --- ...4PluginDepsManagedByParentProfileTest.java | 65 --- .../MavenITmng2196ParentResolutionTest.java | 67 --- .../MavenITmng2199ParentVersionRangeTest.java | 255 ------------ ...Tmng2201PluginConfigInterpolationTest.java | 71 ---- ...2OutputDirectoryReactorResolutionTest.java | 62 --- .../MavenITmng2228ComponentInjectionTest.java | 63 --- ...mng2234ActiveProfilesFromSettingsTest.java | 58 --- .../it/MavenITmng2254PomEncodingTest.java | 65 --- ...ofileActivationBySettingsPropertyTest.java | 87 ---- ...277AggregatorAndResolutionPluginsTest.java | 50 --- .../it/MavenITmng2305MultipleProxiesTest.java | 168 -------- ...venITmng2309ProfileInjectionOrderTest.java | 74 ---- ...venITmng2318LocalParentResolutionTest.java | 53 --- ...nITmng2339BadProjectInterpolationTest.java | 88 ---- ...MavenITmng2362DeployedPomEncodingTest.java | 92 ----- ...Tmng2363BasedirAwareFileActivatorTest.java | 72 ---- .../it/MavenITmng2387InactiveProxyTest.java | 130 ------ .../MavenITmng2432PluginPrefixOrderTest.java | 64 --- ...pedDependencyVersionInterpolationTest.java | 89 ---- .../it/MavenITmng2562Timestamp322Test.java | 113 ----- .../it/MavenITmng2576MakeLikeReactorTest.java | 289 ------------- ...ITmng2577SettingsXmlInterpolationTest.java | 89 ---- ...mng2591MergeInheritedPluginConfigTest.java | 93 ----- ...enITmng2605BogusProfileActivationTest.java | 64 --- ...68UsePluginDependenciesForSortingTest.java | 52 --- .../MavenITmng2690MojoLoadingErrorsTest.java | 157 ------- .../it/MavenITmng2693SitePluginRealmTest.java | 68 --- ...enITmng2695OfflinePluginSnapshotsTest.java | 83 ---- ...Tmng2720SiblingClasspathArtifactsTest.java | 94 ----- ...738ProfileIdCollidesWithCliOptionTest.java | 58 --- ...mng2739RequiredRepositoryElementsTest.java | 102 ----- ...ginMetadataResolutionErrorMessageTest.java | 94 ----- ...avenITmng2744checksumVerificationTest.java | 63 --- ...mng2749ExtensionAvailableToPluginTest.java | 66 --- ...2771PomExtensionComponentOverrideTest.java | 65 --- ...MavenITmng2790LastUpdatedMetadataTest.java | 110 ----- .../it/MavenITmng2820PomCommentsTest.java | 78 ---- ...ArtifactHandlerAndCustomLifecycleTest.java | 56 --- ...43PluginConfigPropertiesInjectionTest.java | 59 --- ...leActivationByEnvironmentVariableTest.java | 59 --- ...avenITmng2861RelocationsAndRangesTest.java | 59 --- .../it/MavenITmng2865MirrorWildcardTest.java | 94 ----- ...71PrePackageSubartifactResolutionTest.java | 62 --- ...MavenITmng2892HideCorePlexusUtilsTest.java | 67 --- ...nITmng2921ActiveAttachedArtifactsTest.java | 96 ----- .../MavenITmng2926PluginPrefixOrderTest.java | 87 ---- ...ITmng2972OverridePluginDependencyTest.java | 101 ----- ...nITmng2994SnapshotRangeRepositoryTest.java | 56 --- ...actorFailureBehaviorMultithreadedTest.java | 200 --------- .../it/MavenITmng3012CoreClassImportTest.java | 63 --- ...ng3023ReactorDependencyResolutionTest.java | 148 ------- ...nITmng3038TransitiveDepManVersionTest.java | 73 ---- ...ng3043BestEffortReactorResolutionTest.java | 172 -------- .../MavenITmng3052DepRepoAggregationTest.java | 70 ---- ...SnapshotsExcludedFromVersionRangeTest.java | 67 --- ...Tmng3099SettingsProfilesWithNoPomTest.java | 63 --- .../MavenITmng3118TestClassPathOrderTest.java | 59 --- ...mng3122ActiveProfilesNoDuplicatesTest.java | 69 ---- ...rmalizationNotBeforeInterpolationTest.java | 81 ---- ...seCachedMetadataOfBlacklistedRepoTest.java | 80 ---- .../it/MavenITmng3183LoggingToFileTest.java | 76 ---- ...enITmng3203DefaultLifecycleExecIdTest.java | 54 --- ...mng3208ProfileAwareReactorSortingTest.java | 60 --- ...venITmng3217InterPluginDependencyTest.java | 64 --- .../it/MavenITmng3220ImportScopeTest.java | 93 ----- ...3259DepsDroppedInMultiModuleBuildTest.java | 62 --- ...mng3268MultipleHyphenPCommandLineTest.java | 59 --- .../MavenITmng3284UsingCachedPluginsTest.java | 81 ---- .../it/MavenITmng3288SystemScopeDirTest.java | 57 --- ...ng3297DependenciesNotLeakedToMojoTest.java | 63 --- .../MavenITmng3314OfflineSnapshotsTest.java | 77 ---- ...nITmng3331ModulePathNormalizationTest.java | 85 ---- ...ng3355TranslatedPathInterpolationTest.java | 51 --- ...Tmng3372DirectInvocationOfPluginsTest.java | 82 ---- ...Tmng3379ParallelArtifactDownloadsTest.java | 129 ------ ...Tmng3380ManagedRelocatedTransdepsTest.java | 80 ---- ...Tmng3394POMPluginVersionDominanceTest.java | 75 ---- ...anagementForOverConstrainedRangesTest.java | 78 ---- .../MavenITmng3401CLIDefaultExecIdTest.java | 84 ---- ...enITmng3415JunkRepositoryMetadataTest.java | 291 ------------- ...Tmng3422ActiveComponentCollectionTest.java | 60 --- ...taUpdatedFromDeploymentRepositoryTest.java | 82 ---- .../it/MavenITmng3461MirrorMatchingTest.java | 164 -------- ...ecksumVerificationOfDependencyPomTest.java | 76 ---- .../it/MavenITmng3475BaseAlignedDirTest.java | 87 ---- ...7DependencyResolutionErrorMessageTest.java | 68 --- ...mng3482DependencyPomInterpolationTest.java | 58 --- ...enITmng3485OverrideWagonExtensionTest.java | 51 --- .../it/MavenITmng3498ForkToOtherMojoTest.java | 65 --- .../it/MavenITmng3503Xpp3ShadingTest.java | 66 --- ...ng3506ArtifactHandlersFromPluginsTest.java | 96 ----- .../it/MavenITmng3529QuotedCliArgTest.java | 60 --- ...Tmng3535SelfReferentialPropertiesTest.java | 73 ---- ...venITmng3536AppendedAbsolutePathsTest.java | 56 --- ...MavenITmng3545ProfileDeactivationTest.java | 201 --------- ...decimalOctalPluginParameterConfigTest.java | 59 --- ...Tmng3581PluginUsesWagonDependencyTest.java | 55 --- ...ng3586SystemScopePluginDependencyTest.java | 87 ---- ...ITmng3599useHttpProxyForWebDAVMk2Test.java | 213 ---------- ...enITmng3600DeploymentModeDefaultsTest.java | 96 ----- ...ITmng3607ClassLoadersUseValidUrlsTest.java | 64 --- .../MavenITmng3621UNCInheritedPathsTest.java | 59 --- ...ITmng3641ProfileActivationWarningTest.java | 135 ------ .../MavenITmng3642DynamicResourcesTest.java | 86 ---- .../it/MavenITmng3645POMSyntaxErrorTest.java | 66 --- .../it/MavenITmng3652UserAgentHeaderTest.java | 300 -------------- ...g3667ResolveDepsWithBadPomVersionTest.java | 65 --- ...ng3671PluginLevelDepInterpolationTest.java | 65 --- ...Tmng3679PluginExecIdInterpolationTest.java | 53 --- ...avenITmng3680InvalidDependencyPOMTest.java | 63 --- ...avenITmng3684BuildPluginParameterTest.java | 64 --- ...avenITmng3693PomFileBasedirChangeTest.java | 71 ---- ...nITmng3694ReactorProjectsDynamismTest.java | 58 --- .../MavenITmng3701ImplicitProfileIdTest.java | 57 --- ...ExecutionProjectWithRelativePathsTest.java | 87 ---- ...venITmng3710PollutedClonedPluginsTest.java | 93 ----- ...MavenITmng3714ToolchainsCliOptionTest.java | 82 ---- .../MavenITmng3716AggregatorForkingTest.java | 61 --- ...avenITmng3719PomExecutionOrderingTest.java | 77 ---- ...venITmng3723ConcreteParentProjectTest.java | 66 --- ...avenITmng3724ExecutionProjectSyncTest.java | 61 --- ...avenITmng3729MultiForkAggregatorsTest.java | 75 ---- .../it/MavenITmng3732ActiveProfilesTest.java | 98 ----- ...740SelfReferentialReactorProjectsTest.java | 61 --- ...MavenITmng3746POMPropertyOverrideTest.java | 90 ---- ...enITmng3747PrefixedPathExpressionTest.java | 58 --- .../it/MavenITmng3748BadSettingsXmlTest.java | 85 ---- ...nITmng3766ToolchainsFromExtensionTest.java | 61 --- ...ng3769ExclusionRelocatedTransdepsTest.java | 68 --- ...775ConflictResolutionBacktrackingTest.java | 95 ----- ...ITmng3796ClassImportInconsistencyTest.java | 61 --- ...mng3805ExtensionClassPathOrderingTest.java | 70 ---- ...7PluginConfigExpressionEvaluationTest.java | 75 ---- ...Tmng3808ReportInheritanceOrderingTest.java | 63 --- ...avenITmng3810BadProfileActivationTest.java | 54 --- ...ingPluginConfigurationInheritanceTest.java | 64 --- ...nITmng3813PluginClassPathOrderingTest.java | 79 ---- .../MavenITmng3814BogusProjectCycleTest.java | 58 --- .../MavenITmng3821EqualPluginExecIdsTest.java | 56 --- ...ng3822BasedirAlignedInterpolationTest.java | 73 ---- .../it/MavenITmng3827PluginConfigTest.java | 104 ----- .../MavenITmng3831PomInterpolationTest.java | 92 ----- ...3833PomInterpolationDataFlowChainTest.java | 64 --- ...nITmng3836PluginConfigInheritanceTest.java | 76 ---- .../it/MavenITmng3838EqualPluginDepsTest.java | 53 --- ...enITmng3839PomParsingCoalesceTextTest.java | 66 --- .../it/MavenITmng3843PomInheritanceTest.java | 302 -------------- ...venITmng3845LimitedPomInheritanceTest.java | 80 ---- ...ng3846PomInheritanceUrlAdjustmentTest.java | 104 ----- ...PluginConfigWithHeterogeneousListTest.java | 68 --- ...ITmng3853ProfileInjectedDistReposTest.java | 65 --- .../MavenITmng3863AutoPluginGroupIdTest.java | 61 --- ...MavenITmng3864PerExecPluginConfigTest.java | 104 ----- ...nITmng3866PluginConfigInheritanceTest.java | 60 --- ...72ProfileActivationInRelocatedPomTest.java | 64 --- ...enITmng3873MultipleExecutionGoalsTest.java | 79 ---- ...MavenITmng3877BasedirAlignedModelTest.java | 93 ----- ...MavenITmng3886ExecutionGoalsOrderTest.java | 76 ---- ...avenITmng3887PluginExecutionOrderTest.java | 76 ---- ...90TransitiveDependencyScopeUpdateTest.java | 67 --- .../MavenITmng3892ReleaseDeploymentTest.java | 93 ----- ...avenITmng3899ExtensionInheritanceTest.java | 69 ---- ...900ProfilePropertiesInterpolationTest.java | 62 --- ...ng3904NestedBuildDirInterpolationTest.java | 65 --- ...3906MergedPluginClassPathOrderingTest.java | 83 ---- ...mng3916PluginExecutionInheritanceTest.java | 65 --- ...enITmng3924XmlMarkupInterpolationTest.java | 61 --- ...mng3925MergedPluginExecutionOrderTest.java | 79 ---- ...g3927PluginDefaultExecutionConfigTest.java | 59 --- ...mng3937MergedPluginExecutionGoalsTest.java | 78 ---- ...venITmng3938MergePluginExecutionsTest.java | 83 ---- ...MavenITmng3940EnvVarInterpolationTest.java | 72 ---- ...ionProjectRestrictedToForkingMojoTest.java | 60 --- ...mng3943PluginExecutionInheritanceTest.java | 65 --- ...avenITmng3944BasedirInterpolationTest.java | 63 --- ...g3947PluginDefaultExecutionConfigTest.java | 59 --- ...8ParentResolutionFromProfileReposTest.java | 60 --- .../it/MavenITmng3951AbsolutePathsTest.java | 85 ---- ...nITmng3953AuthenticatedDeploymentTest.java | 158 ------- .../MavenITmng3955EffectiveSettingsTest.java | 67 --- ...3970DepResolutionFromProfileReposTest.java | 82 ---- .../it/MavenITmng3974MirrorOrderingTest.java | 62 --- .../it/MavenITmng3979ElementJoinTest.java | 57 --- ...3PluginResolutionFromProfileReposTest.java | 86 ---- ...avenITmng3991ValidDependencyScopeTest.java | 61 --- ...venITmng3998PluginExecutionConfigTest.java | 64 --- ...venITmng4000MultiPluginExecutionsTest.java | 84 ---- ...MavenITmng4005UniqueDependencyKeyTest.java | 110 ----- ...venITmng4007PlatformFileSeparatorTest.java | 93 ----- .../MavenITmng4008MergedFilterOrderTest.java | 68 --- ...venITmng4009InheritProfileEffectsTest.java | 61 --- ...4016PrefixedPropertyInterpolationTest.java | 63 --- ...4022IdempotentPluginConfigMergingTest.java | 65 --- ...4023ParentProfileOneTimeInjectionTest.java | 63 --- ...ITmng4026ReactorDependenciesOrderTest.java | 69 ---- ...ITmng4034ManagedProfileDependencyTest.java | 65 --- ...6ParentResolutionFromSettingsRepoTest.java | 59 --- ...enITmng4040ProfileInjectedModulesTest.java | 54 --- ...4048VersionRangeReactorResolutionTest.java | 59 --- ...nITmng4052ReactorAwareImportScopeTest.java | 56 --- ...enITmng4053PluginConfigAttributesTest.java | 93 ----- ...fierBasedDepResolutionFromReactorTest.java | 89 ---- ...MavenITmng4068AuthenticatedMirrorTest.java | 135 ------ .../MavenITmng4070WhitespaceTrimmingTest.java | 63 --- ...avenITmng4072InactiveProfileReposTest.java | 64 --- ...venITmng4087PercentEncodedFileUrlTest.java | 59 --- ...MavenITmng4091BadPluginDescriptorTest.java | 85 ---- ...102InheritedPropertyInterpolationTest.java | 79 ---- ...6InterpolationUsesDominantProfileTest.java | 78 ---- ...polationUsesDominantProfileSourceTest.java | 75 ---- ...avenITmng4112MavenVersionPropertyTest.java | 60 --- .../it/MavenITmng4116UndecodedUrlsTest.java | 78 ---- ...mng4129PluginExecutionInheritanceTest.java | 70 ---- .../it/MavenITmng4150VersionRangeTest.java | 66 --- .../MavenITmng4162ReportingMigrationTest.java | 87 ---- .../MavenITmng4166HideCoreCommonsCliTest.java | 65 --- .../MavenITmng4172EmptyDependencySetTest.java | 59 --- ...nITmng4180PerDependencyExclusionsTest.java | 72 ---- ...venITmng4189UniqueVersionSnapshotTest.java | 92 ----- .../MavenITmng4190MirrorRepoMergingTest.java | 84 ---- .../it/MavenITmng4193UniqueRepoIdTest.java | 60 --- ...avenITmng4196ExclusionOnPluginDepTest.java | 65 --- ...ITmng4199CompileMeetsRuntimeScopeTest.java | 105 ----- ...4203TransitiveDependencyExclusionTest.java | 73 ---- .../it/MavenITmng4207PluginWithLog4JTest.java | 57 --- ...olationPrefersCliOverProjectPropsTest.java | 59 --- ...Tmng4214MirroredParentSearchReposTest.java | 62 --- ...avenITmng4231SnapshotUpdatePolicyTest.java | 119 ------ ...olutionForManuallyCreatedArtifactTest.java | 64 --- ...ng4235HttpAuthDeploymentChecksumsTest.java | 210 ---------- ...4238ArtifactHandlerExtensionUsageTest.java | 72 ---- ...g4262MakeLikeReactorDottedPath370Test.java | 88 ---- ...Tmng4262MakeLikeReactorDottedPathTest.java | 88 ---- ...269BadReactorResolutionFromOutDirTest.java | 66 --- ...270ArtifactHandlersFromPluginDepsTest.java | 74 ---- ...estrictedCoreRealmAccessForPluginTest.java | 69 ---- ...avenITmng4274PluginRealmArtifactsTest.java | 67 --- .../MavenITmng4275RelocationWarningTest.java | 79 ---- ...mng4276WrongTransitivePlexusUtilsTest.java | 65 --- ...MavenITmng4281PreferLocalSnapshotTest.java | 77 ---- .../MavenITmng4283ParentPomPackagingTest.java | 59 --- ...enITmng4291MojoRequiresOnlineModeTest.java | 85 ---- ...enITmng4292EnumTypeMojoParametersTest.java | 59 --- ...93RequiresCompilePlusRuntimeScopeTest.java | 75 ---- ...mng4304ProjectDependencyArtifactsTest.java | 60 --- .../MavenITmng4305LocalRepoBasedirTest.java | 62 --- ...rictChecksumValidationForMetadataTest.java | 65 --- ...luginParameterExpressionInjectionTest.java | 63 --- ...g4314DirectInvocationOfAggregatorTest.java | 62 --- ...inVersionResolutionFromMultiReposTest.java | 61 --- ...avenITmng4318ProjectExecutionRootTest.java | 77 ---- ...9PluginExecutionGoalInterpolationTest.java | 56 --- ...Tmng4320AggregatorAndDependenciesTest.java | 72 ---- ...nITmng4321CliUsesPluginMgmtConfigTest.java | 58 --- ...ocalSnapshotSuppressesRemoteCheckTest.java | 175 -------- ...udeForkingMojoFromForkedLifecycleTest.java | 60 --- ...imitiveMojoParameterConfigurationTest.java | 66 --- ...avenITmng4331DependencyCollectionTest.java | 95 ----- ...ng4332DefaultPluginExecutionOrderTest.java | 61 --- ...MavenITmng4335SettingsOfflineModeTest.java | 64 --- .../it/MavenITmng4338OptionalMojosTest.java | 55 --- ...avenITmng4341PluginExecutionOrderTest.java | 60 --- ...pendentMojoParameterDefaultValuesTest.java | 62 --- ...mng4343MissingReleaseUpdatePolicyTest.java | 248 ----------- ...ng4344ManagedPluginExecutionOrderTest.java | 61 --- ...ng4345DefaultPluginExecutionOrderTest.java | 61 --- ...47ImportScopeWithSettingsProfilesTest.java | 66 --- ...4348NoUnnecessaryRepositoryAccessTest.java | 111 ----- ...49RelocatedArtifactWithInvalidPomTest.java | 64 --- ...350LifecycleMappingExecutionOrderTest.java | 61 --- ...inDependencyResolutionFromPomRepoTest.java | 70 ---- ...tensionAutomaticVersionResolutionTest.java | 58 --- ...dlessRelookupFromActiveCollectionTest.java | 62 --- ...ifecycleMappingDiscoveryInReactorTest.java | 67 --- ...lyReachableParentOutsideOfReactorTest.java | 62 --- .../it/MavenITmng4360WebDavSupportTest.java | 138 ------- ...4361ForceDependencySnapshotUpdateTest.java | 85 ---- ...namicAdditionOfDependencyArtifactTest.java | 65 --- ...Tmng4365XmlMarkupInAttributeValueTest.java | 53 --- ...mng4367LayoutAwareMirrorSelectionTest.java | 126 ------ ...68TimestampAwareArtifactInstallerTest.java | 156 ------- ...eSystemPathInterpolatedWithEnvVarTest.java | 64 --- ...ng4381ExtensionSingletonComponentTest.java | 62 --- ...enITmng4383ValidDependencyVersionTest.java | 60 --- ...ycleMappingFromExtensionInReactorTest.java | 66 --- .../it/MavenITmng4386DebugLoggingTest.java | 69 ---- .../it/MavenITmng4387QuietLoggingTest.java | 69 ---- ...g4393ParseExternalParenPomLenientTest.java | 58 --- ...enITmng4396AntBased20xMojoSupportTest.java | 57 --- .../it/MavenITmng4400RepositoryOrderTest.java | 88 ---- ...ng4401RepositoryOrderForParentPomTest.java | 62 --- ...avenITmng4402DuplicateChildModuleTest.java | 61 --- ...ng4403LenientDependencyPomParsingTest.java | 73 ---- .../it/MavenITmng4404UniqueProfileIdTest.java | 60 --- .../MavenITmng4405ValidPluginVersionTest.java | 60 --- ...nITmng4408NonExistentSettingsFileTest.java | 86 ---- .../maven/it/MavenITmng4410UsageHelpTest.java | 57 --- .../it/MavenITmng4411VersionInfoTest.java | 55 --- ...MavenITmng4412OfflineModeInPluginTest.java | 95 ----- ...Tmng4413MirroringOfDependencyRepoTest.java | 118 ------ ...avenITmng4415InheritedPluginOrderTest.java | 84 ---- ...6PluginOrderAfterProfileInjectionTest.java | 84 ---- ...ecatedPomInterpolationExpressionsTest.java | 83 ---- ...PluginExecutionPhaseInterpolationTest.java | 56 --- ...DataFromPluginParameterExpressionTest.java | 60 --- .../MavenITmng4428FollowHttpRedirectTest.java | 207 ---------- ...29CompRequirementOnNonDefaultImplTest.java | 58 --- ...g4430DistributionManagementStatusTest.java | 61 --- ...Tmng4433ForceParentSnapshotUpdateTest.java | 79 ---- ...ITmng4436SingletonComponentLookupTest.java | 63 --- ...0StubModelForMissingDependencyPomTest.java | 70 ---- ...esolutionOfSnapshotWithClassifierTest.java | 94 ----- ...PluginVersionFromLifecycleMappingTest.java | 57 --- ...4459InMemorySettingsKeptEncryptedTest.java | 64 --- ...venITmng4461ArtifactUploadMonitorTest.java | 57 --- ...pendencyManagementImportVersionRanges.java | 99 ----- ...4PlatformIndependentFileSeparatorTest.java | 72 ---- ...ginPrefixFromLocalCacheOfDownRepoTest.java | 84 ---- ...thenticatedDeploymentToCustomRepoTest.java | 149 ------- ...470AuthenticatedDeploymentToProxyTest.java | 222 ---------- ...ng4474PerLookupWagonInstantiationTest.java | 62 --- ...Tmng4482ForcePluginSnapshotUpdateTest.java | 89 ---- ...88ValidateExternalParenPomLenientTest.java | 58 --- ...ITmng4489MirroringOfExtensionRepoTest.java | 119 ------ ...avenITmng4498IgnoreBrokenMetadataTest.java | 62 --- ...500NoUpdateOfTimestampedSnapshotsTest.java | 129 ------ ...ailUponMissingDependencyParentPomTest.java | 64 --- ...mng4526MavenProjectArtifactsScopeTest.java | 77 ---- ...cludeWagonsFromMavenCoreArtifactsTest.java | 63 --- ...g4536RequiresNoProjectForkingMojoTest.java | 59 --- ...tiveComponentCollectionThreadSafeTest.java | 59 --- ...oreArtifactFilterConsidersGroupIdTest.java | 63 --- ...Tmng4554PluginPrefixMappingUpdateTest.java | 298 ------------- ...g4555MetaversionResolutionOfflineTest.java | 107 ----- ...venITmng4561MirroringOfPluginRepoTest.java | 120 ------ ...65MultiConditionProfileActivationTest.java | 70 ---- ...odelVersionSurroundedByWhitespaceTest.java | 53 --- ...PluginDepUsedForCliInvocInReactorTest.java | 68 --- ...solutionFromVersionlessPluginMgmtTest.java | 62 --- ...tedPomUsesSystemAndUserPropertiesTest.java | 68 --- ...0DependencyOptionalFlagManagementTest.java | 87 ---- ...15ValidateRequiredPluginParameterTest.java | 157 ------- ...ng4618AggregatorBuiltAfterModulesTest.java | 59 --- ...ingsXmlInterpolationWithXmlMarkupTest.java | 73 ---- ...lidationErrorUponMissingSystemDepTest.java | 54 --- ...33DualCompilerExecutionsWeaveModeTest.java | 78 ---- ...ictPomParsingRejectsMisplacedTextTest.java | 60 --- ...654ArtifactHandlerForMainArtifactTest.java | 62 --- ...avenITmng4660OutdatedPackagedArtifact.java | 167 -------- .../it/MavenITmng4660ResumeFromTest.java | 105 ----- .../it/MavenITmng4666CoreRealmImportTest.java | 107 ----- ...77DisabledPluginConfigInheritanceTest.java | 67 --- ...enITmng4679SnapshotUpdateInPluginTest.java | 85 ---- ...ng4684DistMgmtOverriddenByProfileTest.java | 74 ---- ...0InterdependentConflictResolutionTest.java | 101 ----- ...96MavenProjectDependencyArtifactsTest.java | 72 ---- ...ependencyManagementExclusionMergeTest.java | 69 ---- ...ITmng4721OptionalPluginDependencyTest.java | 63 --- ...rrorProxyAuthUsedByProjectBuilderTest.java | 120 ------ ...MavenITmng4745PluginVersionUpdateTest.java | 167 -------- ...venITmng4747JavaAgentUsedByPluginTest.java | 64 --- ...edMavenProjectDependencyArtifactsTest.java | 70 ---- ...etchRemoteMetadataForVersionRangeTest.java | 72 ---- ...ng4761PluginLevelDependencyScopesTest.java | 64 --- ...enITmng4765LocalPomProjectBuilderTest.java | 59 --- ...768NearestMatchConflictResolutionTest.java | 102 ----- ...ResolutionDoesntTouchDisabledRepoTest.java | 107 ----- ...ResolutionDoesntTouchDisabledRepoTest.java | 108 ----- ...kedReactorPluginVersionResolutionTest.java | 84 ---- ...DepsWithVersionRangeFromLocalRepoTest.java | 61 --- ...g4781DeploymentToNexusStagingRepoTest.java | 131 ------ ...ransitiveResolutionInForkedThreadTest.java | 64 --- ...enITmng4786AntBased21xMojoSupportTest.java | 59 --- ...4788InstallationToCustomLocalRepoTest.java | 58 --- ...4789ScopeInheritanceMeetsConflictTest.java | 75 ---- ...tBuilderResolvesRemotePomArtifactTest.java | 67 --- ...InReactorProjectForkedByLifecycleTest.java | 63 --- ...mng4800NearestWinsVsScopeWideningTest.java | 88 ---- ...ng4811CustomComponentConfiguratorTest.java | 57 --- ...lutionOfDependenciesDuringReactorTest.java | 69 ---- ...enITmng4829ChecksumFailureWarningTest.java | 76 ---- ...entProjectResolvedFromRemoteReposTest.java | 63 --- .../MavenITmng4840MavenPrerequisiteTest.java | 88 ---- ...42ParentResolutionOfDependencyPomTest.java | 91 ---- ...rResolutionAttachedWithExclusionsTest.java | 62 --- ...Tmng4874UpdateLatestPluginVersionTest.java | 60 --- ...venITmng4877DeployUsingPrivateKeyTest.java | 63 --- ...lUponOverconstrainedVersionRangesTest.java | 63 --- ...0MakeLikeReactorConsidersVersionsTest.java | 93 ----- ...ITmng4891RobustSnapshotResolutionTest.java | 68 --- ...PluginDepWithNonRelocatedMavenApiTest.java | 61 --- ...erPropertyVsDependencyPomPropertyTest.java | 66 --- ...LifecycleMappingWithSameGoalTwiceTest.java | 59 --- ...ontainerLookupRealmDuringMojoExecTest.java | 61 --- .../maven/it/MavenITmng4936EventSpyTest.java | 72 ---- ...Tmng4952MetadataReleaseInfoUpdateTest.java | 74 ---- ...55LocalVsRemoteSnapshotResolutionTest.java | 72 ---- ...venITmng4960MakeLikeReactorResumeTest.java | 97 ----- ...mng4963ParentResolutionFromMirrorTest.java | 60 --- ...nITmng4966AbnormalUrlPreservationTest.java | 63 --- ...ExtensionVisibleToPluginInReactorTest.java | 64 --- ...ofileInjectedPluginExecutionOrderTest.java | 61 --- ...87TimestampBasedSnapshotSelectionTest.java | 64 --- .../it/MavenITmng4991NonProxyHostsTest.java | 110 ----- ...4992MapStylePropertiesParamConfigTest.java | 57 --- ...g5000ChildPathAwareUrlInheritanceTest.java | 65 --- ...onRangeDependencyParentResolutionTest.java | 67 --- .../MavenITmng5009AggregationCycleTest.java | 57 --- ...CollectionArrayFromUserPropertiesTest.java | 75 ---- ...012CollectionVsArrayParamCoercionTest.java | 59 --- ...ConfigureParamBeanFromScalarValueTest.java | 57 --- ...sedCompLookupFromChildPluginRealmTest.java | 60 --- ...nITmng5064SuppressSnapshotUpdatesTest.java | 129 ------ ...AtDependencyWithImpliedClassifierTest.java | 66 --- ...gatorDepResolutionModuleExtensionTest.java | 63 --- ...137ReactorResolutionInForkedBuildTest.java | 65 --- .../maven/it/MavenITmng5175WagonHttpTest.java | 126 ------ ...MavenITmng5206PlexusLifecycleHonoured.java | 63 --- .../MavenITmng5208EventSpyParallelTest.java | 61 --- .../it/MavenITmng5214DontMapWsdlToJar.java | 73 ---- .../it/MavenITmng5222MojoDeprecatedTest.java | 264 ------------ .../it/MavenITmng5224InjectedSettings.java | 154 ------- ...nITmng5230MakeReactorWithExcludesTest.java | 287 ------------- ...SettingsProfilesRepositoriesOrderTest.java | 233 ----------- .../MavenITmng5338FileOptionToDirectory.java | 60 --- .../maven/it/MavenITmng5382Jsr330Plugin.java | 70 ---- ...venITmng5387ArtifactReplacementPlugin.java | 56 --- ...89LifecycleParticipantAfterSessionEnd.java | 55 --- ...418FileProjectPropertiesActivatorTest.java | 61 --- ...gacyStringSearchModelInterpolatorTest.java | 52 --- ...enITmng5452MavenBuildTimestampUTCTest.java | 53 --- .../it/MavenITmng5482AetherNotFoundTest.java | 98 ----- .../it/MavenITmng5503ZipInReactorTest.java | 59 --- .../MavenITmng5530MojoExecutionScopeTest.java | 115 ------ ...venITmng5557ProperlyRestrictedReactor.java | 64 --- ...luginRelocationLosesConfigurationTest.java | 59 --- ...nITmng5572ReactorPluginExtensionsTest.java | 72 ---- .../it/MavenITmng5576CdFriendlyVersions.java | 103 ----- .../it/MavenITmng5578SessionScopeTest.java | 131 ------ ...avenITmng5581LifecycleMappingDelegate.java | 90 ---- .../it/MavenITmng5591WorkspaceReader.java | 62 --- ...endencyManagementImportExclusionsTest.java | 75 ---- ...ITmng5608ProfileActivationWarningTest.java | 79 ---- ...ITmng5639ImportScopePomResolutionTest.java | 54 --- ...40LifecycleParticipantAfterSessionEnd.java | 195 --------- .../it/MavenITmng5659ProjectSettingsTest.java | 73 ---- ...663NestedImportScopePomResolutionTest.java | 61 --- .../maven/it/MavenITmng5669ReadPomsOnce.java | 133 ------ .../it/MavenITmng5716ToolchainsTypeTest.java | 71 ---- ...Tmng5742BuildExtensionClassloaderTest.java | 58 --- ...53CustomMojoExecutionConfiguratorTest.java | 66 --- .../it/MavenITmng5760ResumeFeatureTest.java | 253 ------------ .../it/MavenITmng5768CliExecutionIdTest.java | 46 --- .../it/MavenITmng5771CoreExtensionsTest.java | 159 ------- ...nITmng5774ConfigurationProcessorsTest.java | 78 ---- ...venITmng5783PluginDependencyFiltering.java | 63 --- ...venITmng5805PkgTypeMojoConfiguration2.java | 45 -- .../it/MavenITmng5840ParentVersionRanges.java | 61 --- ...nITmng5840RelativePathReactorMatching.java | 46 --- ...ITmng5868NoDuplicateAttachedArtifacts.java | 122 ------ .../maven/it/MavenITmng5889FindBasedir.java | 108 ----- ...ng5895CIFriendlyUsageWithPropertyTest.java | 86 ---- ...ltimoduleWithEARFailsToResolveWARTest.java | 53 --- ...ostInTranstiveManagedDependenciesTest.java | 58 --- ...enITmng5958LifecyclePhaseBinaryCompat.java | 60 --- ...ng5965ParallelBuildMultipliesWorkTest.java | 85 ---- .../MavenITmng6057CheckReactorOrderTest.java | 104 ----- .../it/MavenITmng6065FailOnSeverityTest.java | 78 ---- ...avenITmng6071GetResourceWithCustomPom.java | 53 --- .../it/MavenITmng6084Jsr250PluginTest.java | 67 --- .../it/MavenITmng6090CIFriendlyTest.java | 102 ----- .../it/MavenITmng6118SubmoduleInvocation.java | 123 ------ ...xecutionConfigurationInterferenceTest.java | 77 ---- ...nITmng6173GetAllProjectsInReactorTest.java | 82 ---- ...6173GetProjectsAndDependencyGraphTest.java | 66 --- ...ITmng6189SiteReportPluginsWarningTest.java | 50 --- ...mng6210CoreExtensionsCustomScopesTest.java | 54 --- .../maven/it/MavenITmng6223FindBasedir.java | 109 ----- ...Tmng6240PluginExtensionAetherProvider.java | 78 ---- .../it/MavenITmng6255FixConcatLines.java | 95 ----- ...g6256SpecialCharsAlternatePOMLocation.java | 81 ---- ...enITmng6326CoreExtensionsNotFoundTest.java | 56 --- .../maven/it/MavenITmng6330RelativePath.java | 53 --- .../it/MavenITmng6386BaseUriPropertyTest.java | 99 ----- .../it/MavenITmng6391PrintVersionTest.java | 165 -------- ...enITmng6401ProxyPortInterpolationTest.java | 60 --- .../MavenITmng6506PackageAnnotationTest.java | 52 --- ...ITmng6511OptionalProjectSelectionTest.java | 125 ------ ...nITmng6558ToolchainsBuildingEventTest.java | 66 --- .../it/MavenITmng6562WarnDefaultBindings.java | 130 ------ ...AnnotationShouldNotReExecuteGoalsTest.java | 94 ----- ...6609ProfileActivationForPackagingTest.java | 63 --- .../maven/it/MavenITmng6656BuildConsumer.java | 125 ------ .../maven/it/MavenITmng6720FailFastTest.java | 68 --- ...Tmng6754TimestampInMultimoduleProject.java | 391 ------------------ ...9TransitiveDependencyRepositoriesTest.java | 73 ---- ...72NestedImportScopeRepositoryOverride.java | 88 ---- .../maven/it/MavenITmng6957BuildConsumer.java | 139 ------- ...Tmng6972AllowAccessToGraphPackageTest.java | 68 --- ...1ProjectListShouldIncludeChildrenTest.java | 84 ---- .../maven/it/MavenITmng7038RootdirTest.java | 227 ---------- ...g7045DropUselessAndOutdatedCdiApiTest.java | 47 --- ...Tmng7051OptionalProfileActivationTest.java | 143 ------- .../MavenITmng7110ExtensionClassloader.java | 68 --- ...ITmng7112ProjectsWithNonRecursiveTest.java | 81 ---- ...ITmng7128BlockExternalHttpReactorTest.java | 62 --- .../MavenITmng7160ExtensionClassloader.java | 71 ---- .../it/MavenITmng7228LeakyModelTest.java | 77 ---- ...ITmng7244IgnorePomPrefixInExpressions.java | 56 --- ...fecycleActivatedInSpecifiedModuleTest.java | 53 --- ...venITmng7335MissingJarInParallelBuild.java | 45 -- .../MavenITmng7349RelocationWarningTest.java | 67 --- .../MavenITmng7353CliGoalInvocationTest.java | 102 ----- .../maven/it/MavenITmng7360BuildConsumer.java | 50 --- ...enITmng7390SelectModuleOutsideCwdTest.java | 134 ------ ...ng7404IgnorePrefixlessExpressionsTest.java | 56 --- ...encyOfOptionalProjectsAndProfilesTest.java | 70 ---- ...7464ReadOnlyMojoParametersWarningTest.java | 141 ------- ...g7468UnsupportedPluginsParametersTest.java | 183 -------- .../MavenITmng7470ResolverTransportTest.java | 118 ------ .../it/MavenITmng7474SessionScopeTest.java | 50 --- .../maven/it/MavenITmng7487DeadlockTest.java | 55 --- ...04NotWarnUnsupportedReportPluginsTest.java | 63 --- ...ng7529VersionRangeRepositorySelection.java | 57 --- .../MavenITmng7566JavaPrerequisiteTest.java | 88 ---- .../apache/maven/it/MavenITmng7587Jsr330.java | 66 --- ...venITmng7606DependencyImportScopeTest.java | 54 --- .../it/MavenITmng7629SubtreeBuildTest.java | 59 --- .../it/MavenITmng7679SingleMojoNoPomTest.java | 58 --- .../it/MavenITmng7697PomWithEmojiTest.java | 53 --- .../maven/it/MavenITmng7716BuildDeadlock.java | 66 --- .../MavenITmng7737ProfileActivationTest.java | 96 ----- ...onsumerBuildShouldCleanUpOldFilesTest.java | 76 ---- ...ITmng7819FileLockingWithSnapshotsTest.java | 105 ----- ...avenITmng7836AlternativePomSyntaxTest.java | 75 ---- ...mng7891ConfigurationForExtensionsTest.java | 81 ---- 655 files changed, 53420 deletions(-) delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0008SimplePluginTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0009GoalConfigurationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0010DependencyClosureResolutionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0011DefaultVersionByDependencyManagementTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0012PomInterpolationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0018DependencyManagementTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0019PluginVersionMgmtBySuperPomTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0021PomProfileTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0023SettingsProfileTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0024MultipleGoalExecutionsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0025MultipleExecutionLevelConfigsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0030DepPomDepMgmtInheritanceTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0032MavenPrerequisiteTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0037AlternatePomFileSameDirTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0038AlternatePomFileDifferentDirTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0040PackagingFromPluginExtensionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0041ArtifactTypeFromPluginExtensionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0051ReleaseProfileTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0052ReleaseProfileTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0056MultipleGoalExecutionsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0063SystemScopeDependencyTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0064MojoConfigViaSettersTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0071PluginConfigWithDottedPropertyTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0072InterpolationWithDottedPropertyTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0085TransitiveSystemScopeTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0086PluginRealmTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0087PluginRealmWithProjectLevelDepsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0090EnvVarInterpolationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0108SnapshotUpdateTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0113ServerAuthzAvailableToWagonMgrInPluginTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0130CleanLifecycleTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0131SiteLifecycleTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0132PomLifecycleTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0133JarLifecycleTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0134WarLifecycleTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0135EjbLifecycleTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0136RarLifecycleTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0137EarLifecycleTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0138PluginLifecycleTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0139InterpolationWithProjectPrefixTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0140InterpolationWithPomPrefixTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0142DirectDependencyScopesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0143TransitiveDependencyScopesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0144LifecycleExecutionOrderTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0146InstallerSnapshotNaming.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenIT0199CyclicImportScopeTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITBootstrapTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0095ReactorFailureBehaviorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0187CollectedProjectsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0249ResolveDepsFromReactorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0282NonReactorExecWhenProjectIndependentTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0294MergeGlobalAndUserSettingsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0377PluginLookupFromPrefixTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0449PluginVersionResolutionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0461TolerateMissingDependencyPomTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0469ReportConfigTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0471CustomLifecycleTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0479OverrideCentralRepoTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0496IgnoreUnknownPluginParametersTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0505VersionRangeTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0507ArtifactRelocationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0522InheritedPluginMgmtConfigTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0553SettingsAuthzEncryptionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0557UserSettingsCliOptionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0612NewestConflictResolverTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0666IgnoreLegacyPomTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0674PluginParameterAliasTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0680ParentBasedirTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0761MissingSnapshotDistRepoTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0768OfflineModeTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0773SettingsProfileReactorPollutionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0781PluginConfigVsExecConfigTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0786ProfileAwareReactorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0814ExplicitProfileActivationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0818WarDepsNotTransitiveTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0820ConflictResolutionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0823MojoContextPassingTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0828PluginConfigValuesInDebugTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0836PluginParentResolutionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0848UserPropertyOverridesDefaultValueTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0866EvaluateDefaultValueTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0870ReactorAwarePluginDiscoveryTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0947OptionalDependencyTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0956ComponentInjectionViaProjectLevelPluginDepTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0985NonExecutedPluginMgmtGoalsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1021EqualAttachmentBuildNumberTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1052PluginMgmtConfigTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1073AggregatorForksReactorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1088ReactorPluginResolutionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1142VersionRangeIntersectionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1144MultipleDefaultGoalsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1233WarDepWithProvidedScopeTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1323AntrunDependenciesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1349ChecksumFormatsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1412DependenciesOrderTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1415QuotedSystemPropertiesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1491ReactorArtifactIdCollisionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1493NonStandardModulePomNamesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1701DuplicatePluginTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1703PluginMgmtDepInheritanceTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1751ForcedMetadataUpdateDuringDeploymentTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1803PomValidationErrorIncludesLineNumberTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1895ScopeConflictResolutionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1957JdkActivationWithVersionRangeTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1992SystemPropOverridesPomPropTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1995InterpolateBooleanModelElementsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2006ChildPathAwareUrlInheritanceTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2045testJarDependenciesBrokenInReactorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2052InterpolateWithSettingsProfilePropertiesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2054PluginExecutionInheritanceTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2068ReactorRelativeParentsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2098VersionRangeSatisfiedFromWrongRepoTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2103PluginExecutionInheritanceTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2123VersionRangeDependencyTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2124PomInterpolationWithParentValuesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2130ParentLookupFromReactorCacheTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2135PluginBuildInReactorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2136ActiveByDefaultProfileTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2140ReactorAwareDepResolutionWhenForkTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2174PluginDepsManagedByParentProfileTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2196ParentResolutionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2199ParentVersionRangeTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2201PluginConfigInterpolationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2222OutputDirectoryReactorResolutionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2228ComponentInjectionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2234ActiveProfilesFromSettingsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2254PomEncodingTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2276ProfileActivationBySettingsPropertyTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2277AggregatorAndResolutionPluginsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2305MultipleProxiesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2309ProfileInjectionOrderTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2318LocalParentResolutionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2339BadProjectInterpolationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2362DeployedPomEncodingTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2363BasedirAwareFileActivatorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2387InactiveProxyTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2432PluginPrefixOrderTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2486TimestampedDependencyVersionInterpolationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2562Timestamp322Test.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2576MakeLikeReactorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2577SettingsXmlInterpolationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2591MergeInheritedPluginConfigTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2605BogusProfileActivationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2668UsePluginDependenciesForSortingTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2690MojoLoadingErrorsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2693SitePluginRealmTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2695OfflinePluginSnapshotsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2720SiblingClasspathArtifactsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2738ProfileIdCollidesWithCliOptionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2739RequiredRepositoryElementsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2741PluginMetadataResolutionErrorMessageTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2744checksumVerificationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2749ExtensionAvailableToPluginTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2771PomExtensionComponentOverrideTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2790LastUpdatedMetadataTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2820PomCommentsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2831CustomArtifactHandlerAndCustomLifecycleTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2843PluginConfigPropertiesInjectionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2848ProfileActivationByEnvironmentVariableTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2861RelocationsAndRangesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2865MirrorWildcardTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2871PrePackageSubartifactResolutionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2892HideCorePlexusUtilsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2921ActiveAttachedArtifactsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2926PluginPrefixOrderTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2972OverridePluginDependencyTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2994SnapshotRangeRepositoryTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3004ReactorFailureBehaviorMultithreadedTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3012CoreClassImportTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3023ReactorDependencyResolutionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3038TransitiveDepManVersionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3043BestEffortReactorResolutionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3052DepRepoAggregationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3092SnapshotsExcludedFromVersionRangeTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3099SettingsProfilesWithNoPomTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3118TestClassPathOrderTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3122ActiveProfilesNoDuplicatesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3133UrlNormalizationNotBeforeInterpolationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3139UseCachedMetadataOfBlacklistedRepoTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3183LoggingToFileTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3203DefaultLifecycleExecIdTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3208ProfileAwareReactorSortingTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3217InterPluginDependencyTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3220ImportScopeTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3259DepsDroppedInMultiModuleBuildTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3268MultipleHyphenPCommandLineTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3284UsingCachedPluginsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3288SystemScopeDirTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3297DependenciesNotLeakedToMojoTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3314OfflineSnapshotsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3331ModulePathNormalizationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3355TranslatedPathInterpolationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3372DirectInvocationOfPluginsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3379ParallelArtifactDownloadsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3380ManagedRelocatedTransdepsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3394POMPluginVersionDominanceTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3396DependencyManagementForOverConstrainedRangesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3401CLIDefaultExecIdTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3415JunkRepositoryMetadataTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3422ActiveComponentCollectionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3441MetadataUpdatedFromDeploymentRepositoryTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3461MirrorMatchingTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3470StrictChecksumVerificationOfDependencyPomTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3475BaseAlignedDirTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3477DependencyResolutionErrorMessageTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3482DependencyPomInterpolationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3485OverrideWagonExtensionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3498ForkToOtherMojoTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3503Xpp3ShadingTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3506ArtifactHandlersFromPluginsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3529QuotedCliArgTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3535SelfReferentialPropertiesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3536AppendedAbsolutePathsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3545ProfileDeactivationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3575HexadecimalOctalPluginParameterConfigTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3581PluginUsesWagonDependencyTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3586SystemScopePluginDependencyTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3599useHttpProxyForWebDAVMk2Test.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3600DeploymentModeDefaultsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3607ClassLoadersUseValidUrlsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3621UNCInheritedPathsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3641ProfileActivationWarningTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3642DynamicResourcesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3645POMSyntaxErrorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3652UserAgentHeaderTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3667ResolveDepsWithBadPomVersionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3671PluginLevelDepInterpolationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3679PluginExecIdInterpolationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3680InvalidDependencyPOMTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3684BuildPluginParameterTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3693PomFileBasedirChangeTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3694ReactorProjectsDynamismTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3701ImplicitProfileIdTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3703ExecutionProjectWithRelativePathsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3710PollutedClonedPluginsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3714ToolchainsCliOptionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3716AggregatorForkingTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3719PomExecutionOrderingTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3723ConcreteParentProjectTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3724ExecutionProjectSyncTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3729MultiForkAggregatorsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3732ActiveProfilesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3740SelfReferentialReactorProjectsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3746POMPropertyOverrideTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3747PrefixedPathExpressionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3748BadSettingsXmlTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3766ToolchainsFromExtensionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3769ExclusionRelocatedTransdepsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3775ConflictResolutionBacktrackingTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3796ClassImportInconsistencyTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3805ExtensionClassPathOrderingTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3807PluginConfigExpressionEvaluationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3808ReportInheritanceOrderingTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3810BadProfileActivationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3811ReportingPluginConfigurationInheritanceTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3813PluginClassPathOrderingTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3814BogusProjectCycleTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3821EqualPluginExecIdsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3822BasedirAlignedInterpolationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3827PluginConfigTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3831PomInterpolationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3833PomInterpolationDataFlowChainTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3836PluginConfigInheritanceTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3838EqualPluginDepsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3839PomParsingCoalesceTextTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3843PomInheritanceTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3845LimitedPomInheritanceTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3846PomInheritanceUrlAdjustmentTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3852PluginConfigWithHeterogeneousListTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3853ProfileInjectedDistReposTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3863AutoPluginGroupIdTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3864PerExecPluginConfigTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3866PluginConfigInheritanceTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3872ProfileActivationInRelocatedPomTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3873MultipleExecutionGoalsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3877BasedirAlignedModelTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3886ExecutionGoalsOrderTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3887PluginExecutionOrderTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3890TransitiveDependencyScopeUpdateTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3892ReleaseDeploymentTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3899ExtensionInheritanceTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3900ProfilePropertiesInterpolationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3904NestedBuildDirInterpolationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3906MergedPluginClassPathOrderingTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3916PluginExecutionInheritanceTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3924XmlMarkupInterpolationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3925MergedPluginExecutionOrderTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3927PluginDefaultExecutionConfigTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3937MergedPluginExecutionGoalsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3938MergePluginExecutionsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3940EnvVarInterpolationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3941ExecutionProjectRestrictedToForkingMojoTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3943PluginExecutionInheritanceTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3944BasedirInterpolationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3947PluginDefaultExecutionConfigTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3948ParentResolutionFromProfileReposTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3951AbsolutePathsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3953AuthenticatedDeploymentTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3955EffectiveSettingsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3970DepResolutionFromProfileReposTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3974MirrorOrderingTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3979ElementJoinTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3983PluginResolutionFromProfileReposTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3991ValidDependencyScopeTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3998PluginExecutionConfigTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4000MultiPluginExecutionsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4005UniqueDependencyKeyTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4007PlatformFileSeparatorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4008MergedFilterOrderTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4009InheritProfileEffectsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4016PrefixedPropertyInterpolationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4022IdempotentPluginConfigMergingTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4023ParentProfileOneTimeInjectionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4026ReactorDependenciesOrderTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4034ManagedProfileDependencyTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4036ParentResolutionFromSettingsRepoTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4040ProfileInjectedModulesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4048VersionRangeReactorResolutionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4052ReactorAwareImportScopeTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4053PluginConfigAttributesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4056ClassifierBasedDepResolutionFromReactorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4068AuthenticatedMirrorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4070WhitespaceTrimmingTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4072InactiveProfileReposTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4087PercentEncodedFileUrlTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4091BadPluginDescriptorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4102InheritedPropertyInterpolationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4106InterpolationUsesDominantProfileTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4107InterpolationUsesDominantProfileSourceTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4112MavenVersionPropertyTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4116UndecodedUrlsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4129PluginExecutionInheritanceTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4150VersionRangeTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4162ReportingMigrationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4166HideCoreCommonsCliTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4172EmptyDependencySetTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4180PerDependencyExclusionsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4189UniqueVersionSnapshotTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4190MirrorRepoMergingTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4193UniqueRepoIdTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4196ExclusionOnPluginDepTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4199CompileMeetsRuntimeScopeTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4203TransitiveDependencyExclusionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4207PluginWithLog4JTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4208InterpolationPrefersCliOverProjectPropsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4214MirroredParentSearchReposTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4231SnapshotUpdatePolicyTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4233ReactorResolutionForManuallyCreatedArtifactTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4235HttpAuthDeploymentChecksumsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4238ArtifactHandlerExtensionUsageTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4262MakeLikeReactorDottedPath370Test.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4262MakeLikeReactorDottedPathTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4269BadReactorResolutionFromOutDirTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4270ArtifactHandlersFromPluginDepsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4273RestrictedCoreRealmAccessForPluginTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4274PluginRealmArtifactsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4275RelocationWarningTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4276WrongTransitivePlexusUtilsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4281PreferLocalSnapshotTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4283ParentPomPackagingTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4291MojoRequiresOnlineModeTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4292EnumTypeMojoParametersTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4293RequiresCompilePlusRuntimeScopeTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4304ProjectDependencyArtifactsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4305LocalRepoBasedirTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4309StrictChecksumValidationForMetadataTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4312TypeAwarePluginParameterExpressionInjectionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4314DirectInvocationOfAggregatorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4317PluginVersionResolutionFromMultiReposTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4318ProjectExecutionRootTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4319PluginExecutionGoalInterpolationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4320AggregatorAndDependenciesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4321CliUsesPluginMgmtConfigTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4326LocalSnapshotSuppressesRemoteCheckTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4327ExcludeForkingMojoFromForkedLifecycleTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4328PrimitiveMojoParameterConfigurationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4331DependencyCollectionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4332DefaultPluginExecutionOrderTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4335SettingsOfflineModeTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4338OptionalMojosTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4341PluginExecutionOrderTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4342IndependentMojoParameterDefaultValuesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4343MissingReleaseUpdatePolicyTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4344ManagedPluginExecutionOrderTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4345DefaultPluginExecutionOrderTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4347ImportScopeWithSettingsProfilesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4348NoUnnecessaryRepositoryAccessTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4349RelocatedArtifactWithInvalidPomTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4350LifecycleMappingExecutionOrderTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4353PluginDependencyResolutionFromPomRepoTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4355ExtensionAutomaticVersionResolutionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4356NoNeedlessRelookupFromActiveCollectionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4357LifecycleMappingDiscoveryInReactorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4359LocallyReachableParentOutsideOfReactorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4360WebDavSupportTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4361ForceDependencySnapshotUpdateTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4363DynamicAdditionOfDependencyArtifactTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4365XmlMarkupInAttributeValueTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4367LayoutAwareMirrorSelectionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4368TimestampAwareArtifactInstallerTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4379TransitiveSystemPathInterpolatedWithEnvVarTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4381ExtensionSingletonComponentTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4383ValidDependencyVersionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4385LifecycleMappingFromExtensionInReactorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4386DebugLoggingTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4387QuietLoggingTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4393ParseExternalParenPomLenientTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4396AntBased20xMojoSupportTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4400RepositoryOrderTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4401RepositoryOrderForParentPomTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4402DuplicateChildModuleTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4403LenientDependencyPomParsingTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4404UniqueProfileIdTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4405ValidPluginVersionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4408NonExistentSettingsFileTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4410UsageHelpTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4411VersionInfoTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4412OfflineModeInPluginTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4413MirroringOfDependencyRepoTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4415InheritedPluginOrderTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4416PluginOrderAfterProfileInjectionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4421DeprecatedPomInterpolationExpressionsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4422PluginExecutionPhaseInterpolationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4423SessionDataFromPluginParameterExpressionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4428FollowHttpRedirectTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4429CompRequirementOnNonDefaultImplTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4430DistributionManagementStatusTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4433ForceParentSnapshotUpdateTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4436SingletonComponentLookupTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4450StubModelForMissingDependencyPomTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4452ResolutionOfSnapshotWithClassifierTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4453PluginVersionFromLifecycleMappingTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4459InMemorySettingsKeptEncryptedTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4461ArtifactUploadMonitorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4463DependencyManagementImportVersionRanges.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4464PlatformIndependentFileSeparatorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4465PluginPrefixFromLocalCacheOfDownRepoTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4469AuthenticatedDeploymentToCustomRepoTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4470AuthenticatedDeploymentToProxyTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4474PerLookupWagonInstantiationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4482ForcePluginSnapshotUpdateTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4488ValidateExternalParenPomLenientTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4489MirroringOfExtensionRepoTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4498IgnoreBrokenMetadataTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4500NoUpdateOfTimestampedSnapshotsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4522FailUponMissingDependencyParentPomTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4526MavenProjectArtifactsScopeTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4528ExcludeWagonsFromMavenCoreArtifactsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4536RequiresNoProjectForkingMojoTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4544ActiveComponentCollectionThreadSafeTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4553CoreArtifactFilterConsidersGroupIdTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4554PluginPrefixMappingUpdateTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4555MetaversionResolutionOfflineTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4561MirroringOfPluginRepoTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4565MultiConditionProfileActivationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4572ModelVersionSurroundedByWhitespaceTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4580ProjectLevelPluginDepUsedForCliInvocInReactorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4586PluginPrefixResolutionFromVersionlessPluginMgmtTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4590ImportedPomUsesSystemAndUserPropertiesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4600DependencyOptionalFlagManagementTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4615ValidateRequiredPluginParameterTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4618AggregatorBuiltAfterModulesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4625SettingsXmlInterpolationWithXmlMarkupTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4629NoPomValidationErrorUponMissingSystemDepTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4633DualCompilerExecutionsWeaveModeTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4644StrictPomParsingRejectsMisplacedTextTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4654ArtifactHandlerForMainArtifactTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4666CoreRealmImportTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4677DisabledPluginConfigInheritanceTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4679SnapshotUpdateInPluginTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4684DistMgmtOverriddenByProfileTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4690InterdependentConflictResolutionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4696MavenProjectDependencyArtifactsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4720DependencyManagementExclusionMergeTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4721OptionalPluginDependencyTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4729MirrorProxyAuthUsedByProjectBuilderTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4745PluginVersionUpdateTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4747JavaAgentUsedByPluginTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4750ResolvedMavenProjectDependencyArtifactsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4755FetchRemoteMetadataForVersionRangeTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4761PluginLevelDependencyScopesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4765LocalPomProjectBuilderTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4768NearestMatchConflictResolutionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4771PluginPrefixResolutionDoesntTouchDisabledRepoTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4772PluginVersionResolutionDoesntTouchDisabledRepoTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4776ForkedReactorPluginVersionResolutionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4779MultipleDepsWithVersionRangeFromLocalRepoTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4781DeploymentToNexusStagingRepoTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4785TransitiveResolutionInForkedThreadTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4786AntBased21xMojoSupportTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4788InstallationToCustomLocalRepoTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4789ScopeInheritanceMeetsConflictTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4791ProjectBuilderResolvesRemotePomArtifactTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4795DepResolutionInReactorProjectForkedByLifecycleTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4800NearestWinsVsScopeWideningTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4811CustomComponentConfiguratorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4814ReResolutionOfDependenciesDuringReactorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4829ChecksumFailureWarningTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4834ParentProjectResolvedFromRemoteReposTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4840MavenPrerequisiteTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4842ParentResolutionOfDependencyPomTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4872ReactorResolutionAttachedWithExclusionsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4874UpdateLatestPluginVersionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4877DeployUsingPrivateKeyTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4883FailUponOverconstrainedVersionRangesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4890MakeLikeReactorConsidersVersionsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4891RobustSnapshotResolutionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4895PluginDepWithNonRelocatedMavenApiTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4913UserPropertyVsDependencyPomPropertyTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4919LifecycleMappingWithSameGoalTwiceTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4925ContainerLookupRealmDuringMojoExecTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4936EventSpyTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4952MetadataReleaseInfoUpdateTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4955LocalVsRemoteSnapshotResolutionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4960MakeLikeReactorResumeTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4963ParentResolutionFromMirrorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4966AbnormalUrlPreservationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4973ExtensionVisibleToPluginInReactorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4975ProfileInjectedPluginExecutionOrderTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4987TimestampBasedSnapshotSelectionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4991NonProxyHostsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4992MapStylePropertiesParamConfigTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5000ChildPathAwareUrlInheritanceTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5006VersionRangeDependencyParentResolutionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5009AggregationCycleTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5011ConfigureCollectionArrayFromUserPropertiesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5012CollectionVsArrayParamCoercionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5013ConfigureParamBeanFromScalarValueTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5019StringBasedCompLookupFromChildPluginRealmTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5064SuppressSnapshotUpdatesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5096ExclusionAtDependencyWithImpliedClassifierTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5135AggregatorDepResolutionModuleExtensionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5137ReactorResolutionInForkedBuildTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5175WagonHttpTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5206PlexusLifecycleHonoured.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5208EventSpyParallelTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5214DontMapWsdlToJar.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5222MojoDeprecatedTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5224InjectedSettings.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5230MakeReactorWithExcludesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5280SettingsProfilesRepositoriesOrderTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5338FileOptionToDirectory.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5382Jsr330Plugin.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5387ArtifactReplacementPlugin.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5389LifecycleParticipantAfterSessionEnd.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5418FileProjectPropertiesActivatorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5445LegacyStringSearchModelInterpolatorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5452MavenBuildTimestampUTCTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5482AetherNotFoundTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5503ZipInReactorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5530MojoExecutionScopeTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5557ProperlyRestrictedReactor.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5561PluginRelocationLosesConfigurationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5572ReactorPluginExtensionsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5576CdFriendlyVersions.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5578SessionScopeTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5581LifecycleMappingDelegate.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5591WorkspaceReader.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5600DependencyManagementImportExclusionsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5608ProfileActivationWarningTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5639ImportScopePomResolutionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5640LifecycleParticipantAfterSessionEnd.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5659ProjectSettingsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5663NestedImportScopePomResolutionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5669ReadPomsOnce.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5716ToolchainsTypeTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5742BuildExtensionClassloaderTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5753CustomMojoExecutionConfiguratorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5760ResumeFeatureTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5768CliExecutionIdTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5771CoreExtensionsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5774ConfigurationProcessorsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5783PluginDependencyFiltering.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5805PkgTypeMojoConfiguration2.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5840ParentVersionRanges.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5840RelativePathReactorMatching.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5868NoDuplicateAttachedArtifacts.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5889FindBasedir.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5895CIFriendlyUsageWithPropertyTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5898BuildMultimoduleWithEARFailsToResolveWARTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5935OptionalLostInTranstiveManagedDependenciesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5958LifecyclePhaseBinaryCompat.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5965ParallelBuildMultipliesWorkTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6057CheckReactorOrderTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6065FailOnSeverityTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6071GetResourceWithCustomPom.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6084Jsr250PluginTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6090CIFriendlyTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6118SubmoduleInvocation.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6127PluginExecutionConfigurationInterferenceTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6173GetAllProjectsInReactorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6173GetProjectsAndDependencyGraphTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6189SiteReportPluginsWarningTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6210CoreExtensionsCustomScopesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6223FindBasedir.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6240PluginExtensionAetherProvider.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6255FixConcatLines.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6256SpecialCharsAlternatePOMLocation.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6326CoreExtensionsNotFoundTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6330RelativePath.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6386BaseUriPropertyTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6391PrintVersionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6401ProxyPortInterpolationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6506PackageAnnotationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6511OptionalProjectSelectionTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6558ToolchainsBuildingEventTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6562WarnDefaultBindings.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6566ExecuteAnnotationShouldNotReExecuteGoalsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6609ProfileActivationForPackagingTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6656BuildConsumer.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6720FailFastTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6754TimestampInMultimoduleProject.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6759TransitiveDependencyRepositoriesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6772NestedImportScopeRepositoryOverride.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6957BuildConsumer.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6972AllowAccessToGraphPackageTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6981ProjectListShouldIncludeChildrenTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7038RootdirTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7045DropUselessAndOutdatedCdiApiTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7051OptionalProfileActivationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7110ExtensionClassloader.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7112ProjectsWithNonRecursiveTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7128BlockExternalHttpReactorTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7160ExtensionClassloader.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7228LeakyModelTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7244IgnorePomPrefixInExpressions.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7310LifecycleActivatedInSpecifiedModuleTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7335MissingJarInParallelBuild.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7349RelocationWarningTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7353CliGoalInvocationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7360BuildConsumer.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7390SelectModuleOutsideCwdTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7404IgnorePrefixlessExpressionsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7443ConsistencyOfOptionalProjectsAndProfilesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7464ReadOnlyMojoParametersWarningTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7468UnsupportedPluginsParametersTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7470ResolverTransportTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7474SessionScopeTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7487DeadlockTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7504NotWarnUnsupportedReportPluginsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7529VersionRangeRepositorySelection.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7566JavaPrerequisiteTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7587Jsr330.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7606DependencyImportScopeTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7629SubtreeBuildTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7679SingleMojoNoPomTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7697PomWithEmojiTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7716BuildDeadlock.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7737ProfileActivationTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7740ConsumerBuildShouldCleanUpOldFilesTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7819FileLockingWithSnapshotsTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7836AlternativePomSyntaxTest.java delete mode 100644 core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7891ConfigurationForExtensionsTest.java diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0008SimplePluginTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0008SimplePluginTest.java deleted file mode 100644 index 740339a53..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0008SimplePluginTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenIT0008SimplePluginTest extends AbstractMavenIntegrationTestCase { - - public MavenIT0008SimplePluginTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Simple goal decoration where a plugin binds to a phase and the plugin must - * be downloaded from a remote repository before it can be executed. This - * test also checks to make sure that mojo parameters are aligned to the - * project basedir when their type is "java.io.File". - * - * @throws Exception in case of failure - */ - @Test - public void testit0008() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0008"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifact("org.apache.maven.its.plugins", "maven-it-plugin-touch", "1.0", "maven-plugin"); - verifier.addCliArgument("process-sources"); - verifier.execute(); - verifier.verifyFilePresent("target/touch.txt"); - verifier.verifyFilePresent("target/test-basedir-alignment/touch.txt"); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0009GoalConfigurationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0009GoalConfigurationTest.java deleted file mode 100644 index 3ad8bb2ea..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0009GoalConfigurationTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenIT0009GoalConfigurationTest extends AbstractMavenIntegrationTestCase { - - public MavenIT0009GoalConfigurationTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test plugin configuration and goal configuration that overrides what the - * mojo has specified. - * - * @throws Exception in case of failure - */ - @Test - public void testit0009() throws Exception { - - boolean supportSpaceInXml = matchesVersionRange("[3.1.0,)"); - - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0009"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyFilePresent(supportSpaceInXml ? "target/ pluginItem " : "target/pluginItem"); - verifier.verifyFilePresent("target/goalItem"); - verifier.verifyFileNotPresent("target/bad-item"); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0010DependencyClosureResolutionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0010DependencyClosureResolutionTest.java deleted file mode 100644 index a59b04316..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0010DependencyClosureResolutionTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenIT0010DependencyClosureResolutionTest extends AbstractMavenIntegrationTestCase { - public MavenIT0010DependencyClosureResolutionTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Since the artifact resolution does not use the project builder, we must - * ensure that the full hierarchy of all dependencies is resolved. This - * includes the dependencies of the parent-pom's of dependencies. - * - * @throws Exception in case of failure - */ - @Test - public void testit0010() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0010"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.it0010"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.it0010", "a", "0.1", "jar"); - verifier.verifyArtifactPresent("org.apache.maven.its.it0010", "b", "0.2", "jar"); - verifier.verifyArtifactPresent("org.apache.maven.its.it0010", "parent", "1.0", "pom"); - - List artifacts = verifier.loadLines("target/compile.txt", "UTF-8"); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.it0010:a:jar:0.1")); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.it0010:b:jar:0.2")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0011DefaultVersionByDependencyManagementTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0011DefaultVersionByDependencyManagementTest.java deleted file mode 100644 index e3338a5b4..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0011DefaultVersionByDependencyManagementTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenIT0011DefaultVersionByDependencyManagementTest extends AbstractMavenIntegrationTestCase { - public MavenIT0011DefaultVersionByDependencyManagementTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test specification of dependency versions via <dependencyManagement/>. - * - * @throws Exception in case of failure - */ - @Test - public void testit0011() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0011"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.it0011"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List artifacts = verifier.loadLines("target/compile.txt", "UTF-8"); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.it0011:a:jar:0.1")); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.it0011:b:jar:0.2")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0012PomInterpolationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0012PomInterpolationTest.java deleted file mode 100644 index 5d8766650..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0012PomInterpolationTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenIT0012PomInterpolationTest extends AbstractMavenIntegrationTestCase { - public MavenIT0012PomInterpolationTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test simple POM interpolation - * - * @throws Exception in case of failure - */ - @Test - public void testit0012() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0012"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("child-project/target"); - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-touch:touch"); - verifier.execute(); - verifier.verifyFilePresent("target/touch-3.8.1.txt"); - verifier.verifyFilePresent("child-project/target/child-touch-3.0.3.txt"); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0018DependencyManagementTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0018DependencyManagementTest.java deleted file mode 100644 index e34002d68..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0018DependencyManagementTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenIT0018DependencyManagementTest extends AbstractMavenIntegrationTestCase { - public MavenIT0018DependencyManagementTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Ensure that managed dependencies for dependency POMs are calculated - * correctly when resolved. Removes managed-dep-1.0.3 and checks it is - * redownloaded upon resolution of direct-dep. - * - * @throws Exception in case of failure - */ - @Test - public void testit0018() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0018"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.it0018"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument( - "org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution:2.1-SNAPSHOT:compile"); - verifier.execute(); - verifier.verifyArtifactPresent("org.apache.maven.its.it0018", "managed-dep", "1.0.3", "jar"); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0019PluginVersionMgmtBySuperPomTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0019PluginVersionMgmtBySuperPomTest.java deleted file mode 100644 index 4367cdad6..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0019PluginVersionMgmtBySuperPomTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenIT0019PluginVersionMgmtBySuperPomTest extends AbstractMavenIntegrationTestCase { - public MavenIT0019PluginVersionMgmtBySuperPomTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that a version is managed by pluginManagement in the super POM - * - * @throws Exception in case of failure - */ - @Test - public void testit0019() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0019"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("process-resources"); - verifier.execute(); - verifier.verifyFilePresent("target/classes/test.txt"); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0021PomProfileTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0021PomProfileTest.java deleted file mode 100644 index 74e63084f..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0021PomProfileTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenIT0021PomProfileTest extends AbstractMavenIntegrationTestCase { - public MavenIT0021PomProfileTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test pom-level profile inclusion (this one is activated by system - * property). - * - * @throws Exception in case of failure - */ - @Test - public void testit0021() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0021"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.it0021"); - verifier.getSystemProperties().setProperty("includeProfile", "true"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("-Pprofile-2"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.it0021", "a", "0.1", "jar"); - verifier.verifyArtifactPresent("org.apache.maven.its.it0021", "b", "0.1", "jar"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0023SettingsProfileTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0023SettingsProfileTest.java deleted file mode 100644 index 72e59e2b8..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0023SettingsProfileTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenIT0023SettingsProfileTest extends AbstractMavenIntegrationTestCase { - public MavenIT0023SettingsProfileTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test profile inclusion from settings.xml (this one is activated by an id - * in the activeProfiles section). - * - * @throws Exception in case of failure - */ - @Test - public void testit0023() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0023"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-touch:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/test.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0024MultipleGoalExecutionsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0024MultipleGoalExecutionsTest.java deleted file mode 100644 index 76f68d175..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0024MultipleGoalExecutionsTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-172. - * - * @author John Casey - * - */ -public class MavenIT0024MultipleGoalExecutionsTest extends AbstractMavenIntegrationTestCase { - public MavenIT0024MultipleGoalExecutionsTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test usage of <executions/> inside a plugin rather than <goals/> - * that are directly inside the plugin. - * - * @throws Exception in case of failure - */ - @Test - public void testit0024() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0024"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("initialize"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/plugin-exec-configuration.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0025MultipleExecutionLevelConfigsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0025MultipleExecutionLevelConfigsTest.java deleted file mode 100644 index 61dd1145a..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0025MultipleExecutionLevelConfigsTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-172. - * - * @author John Casey - * - */ -public class MavenIT0025MultipleExecutionLevelConfigsTest extends AbstractMavenIntegrationTestCase { - public MavenIT0025MultipleExecutionLevelConfigsTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test multiple goal executions with different execution-level configs. - * - * @throws Exception in case of failure - */ - @Test - public void testit0025() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0025"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/test.txt"); - verifier.verifyFilePresent("target/test2.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0030DepPomDepMgmtInheritanceTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0030DepPomDepMgmtInheritanceTest.java deleted file mode 100644 index aa7b04ebf..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0030DepPomDepMgmtInheritanceTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenIT0030DepPomDepMgmtInheritanceTest extends AbstractMavenIntegrationTestCase { - public MavenIT0030DepPomDepMgmtInheritanceTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test for injection of dependencyManagement through parents of - * dependency poms. - * - * @throws Exception in case of failure - */ - @Test - public void testit0030() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0030"); - Verifier verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - verifier.deleteArtifact("org.apache.maven.it", "maven-it-it0030", "1.0-SNAPSHOT", "jar"); - verifier.deleteArtifact("org.apache.maven.it", "maven-it-it0030-child-hierarchy", "1.0-SNAPSHOT", "jar"); - verifier.deleteArtifact("org.apache.maven.it", "maven-it-it0030-child-project1", "1.0-SNAPSHOT", "jar"); - verifier.deleteArtifact("org.apache.maven.it", "maven-it-it0030-child-project2", "1.0-SNAPSHOT", "jar"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyFilePresent("child-hierarchy/project2/target/classes/org/apache/maven/it0001/Person.class"); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0032MavenPrerequisiteTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0032MavenPrerequisiteTest.java deleted file mode 100644 index 928193b33..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0032MavenPrerequisiteTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenIT0032MavenPrerequisiteTest extends AbstractMavenIntegrationTestCase { - public MavenIT0032MavenPrerequisiteTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Tests that a specified Maven version requirement that is lower doesn't cause any problems - * - * @throws Exception in case of failure - */ - @Test - public void testit0032() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0032"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("initialize"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0037AlternatePomFileSameDirTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0037AlternatePomFileSameDirTest.java deleted file mode 100644 index 59b512e21..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0037AlternatePomFileSameDirTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-607. - * - * @author John Casey - * - */ -public class MavenIT0037AlternatePomFileSameDirTest extends AbstractMavenIntegrationTestCase { - public MavenIT0037AlternatePomFileSameDirTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test building with alternate pom file using '-f' - * - * @throws Exception in case of failure - */ - @Test - public void testit0037() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0037"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-f"); - verifier.addCliArgument("pom2.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/passed.log"); - verifier.verifyFileNotPresent("target/failed.log"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0038AlternatePomFileDifferentDirTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0038AlternatePomFileDifferentDirTest.java deleted file mode 100644 index cddb8c3a4..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0038AlternatePomFileDifferentDirTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-607. - * - * @author John Casey - * - */ -public class MavenIT0038AlternatePomFileDifferentDirTest extends AbstractMavenIntegrationTestCase { - public MavenIT0038AlternatePomFileDifferentDirTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test building project from outside the project directory using '-f' option. - * - * @throws Exception in case of failure - */ - @Test - public void testit0038() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0038"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("project/target"); - verifier.addCliArgument("-f"); - verifier.addCliArgument("project/pom2.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("project/target/passed.log"); - verifier.verifyFileNotPresent("target/failed.log"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0040PackagingFromPluginExtensionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0040PackagingFromPluginExtensionTest.java deleted file mode 100644 index 3a5588320..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0040PackagingFromPluginExtensionTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-598. - * - * @author Brett Porter - * - */ -public class MavenIT0040PackagingFromPluginExtensionTest extends AbstractMavenIntegrationTestCase { - - public MavenIT0040PackagingFromPluginExtensionTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test the use of a packaging from a plugin - * - * @throws Exception in case of failure - */ - @Test - public void testit0040() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0040"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("package"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/maven-it-it0040-1.0-it.jar"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0041ArtifactTypeFromPluginExtensionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0041ArtifactTypeFromPluginExtensionTest.java deleted file mode 100644 index 0943b03bf..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0041ArtifactTypeFromPluginExtensionTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-598. - * - * @author Brett Porter - * - */ -public class MavenIT0041ArtifactTypeFromPluginExtensionTest extends AbstractMavenIntegrationTestCase { - public MavenIT0041ArtifactTypeFromPluginExtensionTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test the use of a new type from a plugin - * - * @throws Exception in case of failure - */ - @Test - public void testit0041() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0041"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven", "maven-core-it-support", "1.2"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven", "maven-core-it-support", "1.2", "coreit-artifact"); - verifier.verifyArtifactPresent("org.apache.maven", "maven-core-it-support", "1.2", "pom"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0051ReleaseProfileTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0051ReleaseProfileTest.java deleted file mode 100644 index c6f51ce40..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0051ReleaseProfileTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenIT0051ReleaseProfileTest extends AbstractMavenIntegrationTestCase { - - public MavenIT0051ReleaseProfileTest() { - super("(2.0.2,4.0.0-alpha-1)"); - } - - /** - * Test source attachment when -DperformRelease=true is specified. - * - * @throws Exception in case of failure - */ - @Test - public void testit0051() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0051"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-DperformRelease=true"); - verifier.addCliArgument("package"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/source-jar.txt"); - verifier.verifyFilePresent("target/javadoc-jar.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0052ReleaseProfileTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0052ReleaseProfileTest.java deleted file mode 100644 index 135e02b03..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0052ReleaseProfileTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenIT0052ReleaseProfileTest extends AbstractMavenIntegrationTestCase { - public MavenIT0052ReleaseProfileTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that source attachment doesn't take place when - * -DperformRelease=true is missing. - * - * @throws Exception in case of failure - */ - @Test - public void testit0052() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0052"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("package"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/jar-jar.txt"); - verifier.verifyFileNotPresent("target/source-jar.txt"); - verifier.verifyFileNotPresent("target/javadoc-jar.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0056MultipleGoalExecutionsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0056MultipleGoalExecutionsTest.java deleted file mode 100644 index 1911a5d88..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0056MultipleGoalExecutionsTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenIT0056MultipleGoalExecutionsTest extends AbstractMavenIntegrationTestCase { - public MavenIT0056MultipleGoalExecutionsTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that multiple executions of a goal with different - * parameter values will succeed. - * - * @throws Exception in case of failure - */ - @Test - public void testit0056() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0056"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("initialize"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/first-exec.txt"); - verifier.verifyFilePresent("target/second-exec.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0063SystemScopeDependencyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0063SystemScopeDependencyTest.java deleted file mode 100644 index 1f60680f3..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0063SystemScopeDependencyTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenIT0063SystemScopeDependencyTest extends AbstractMavenIntegrationTestCase { - public MavenIT0063SystemScopeDependencyTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test the use of a system scoped dependency to a (fake) tools.jar. - * - * @throws Exception in case of failure - */ - @Test - public void testit0063() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0063"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.getSystemProperties().setProperty("jre.home", new File(testDir, "jdk/jre").getPath()); - verifier.addCliArgument( - "org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution:2.1-SNAPSHOT:compile"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List lines = verifier.loadLines("target/compile.txt", "UTF-8"); - assertEquals(2, lines.size()); - assertEquals( - new File(testDir, "jdk/lib/tools.jar").getCanonicalFile(), - new File((String) lines.get(1)).getCanonicalFile()); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0064MojoConfigViaSettersTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0064MojoConfigViaSettersTest.java deleted file mode 100644 index 500313c42..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0064MojoConfigViaSettersTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenIT0064MojoConfigViaSettersTest extends AbstractMavenIntegrationTestCase { - public MavenIT0064MojoConfigViaSettersTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test the use of a mojo that uses setters instead of private fields - * for the population of configuration values. - * - * @throws Exception in case of failure - */ - @Test - public void testit0064() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0064"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-setter:setter-touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/fooValue"); - verifier.verifyFilePresent("target/barValue.baz"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0071PluginConfigWithDottedPropertyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0071PluginConfigWithDottedPropertyTest.java deleted file mode 100644 index 68d1e9744..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0071PluginConfigWithDottedPropertyTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-885. - * - * @author John Casey - * - */ -public class MavenIT0071PluginConfigWithDottedPropertyTest extends AbstractMavenIntegrationTestCase { - public MavenIT0071PluginConfigWithDottedPropertyTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verifies that dotted property references work within plugin - * configurations. - * - * @throws Exception in case of failure - */ - @Test - public void testit0071() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0071"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-touch:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/foo2"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0072InterpolationWithDottedPropertyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0072InterpolationWithDottedPropertyTest.java deleted file mode 100644 index fb47fcaef..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0072InterpolationWithDottedPropertyTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-885. - * - * @author John Casey - * - */ -public class MavenIT0072InterpolationWithDottedPropertyTest extends AbstractMavenIntegrationTestCase { - public MavenIT0072InterpolationWithDottedPropertyTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verifies that property references with dotted notation work within - * POM interpolation. - * - * @throws Exception in case of failure - */ - @Test - public void testit0072() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0072"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - assertEquals("1.0-SNAPSHOT", props.getProperty("project.version")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0085TransitiveSystemScopeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0085TransitiveSystemScopeTest.java deleted file mode 100644 index 6f7d0825b..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0085TransitiveSystemScopeTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Collection; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenIT0085TransitiveSystemScopeTest extends AbstractMavenIntegrationTestCase { - public MavenIT0085TransitiveSystemScopeTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that system-scoped dependencies get resolved with system scope - * when they are resolved transitively via another (non-system) - * dependency. Inherited scope should not apply in the case of - * system-scoped dependencies, no matter where they are. - * - * @throws Exception in case of failure - */ - @Test - public void testit0085() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0085"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.it0085"); - verifier.getSystemProperties().setProperty("test.home", testDir.getAbsolutePath()); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Collection lines = verifier.loadLines("target/test.txt", "UTF-8"); - assertTrue(lines.toString(), lines.contains("system.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0086PluginRealmTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0086PluginRealmTest.java deleted file mode 100644 index a09d92556..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0086PluginRealmTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-1898. - * - * @author John Casey - * - */ -public class MavenIT0086PluginRealmTest extends AbstractMavenIntegrationTestCase { - - public MavenIT0086PluginRealmTest() { - super("(2.0.2,)"); - } - - /** - * Verify that a plugin dependency class/resource can be loaded from both the plugin classloader and the - * context classloader available to the plugin. - * - * @throws Exception in case of failure - */ - @Test - public void testit0086() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0086"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties pclProps = verifier.loadProperties("target/pcl.properties"); - assertNotNull(pclProps.getProperty("org.apache.maven.plugin.coreit.ClassA")); - assertNotNull(pclProps.getProperty("org.apache.maven.plugin.coreit.ClassB")); - assertNotNull(pclProps.getProperty("org.apache.maven.plugin.coreit.SomeClass")); - assertNotNull(pclProps.getProperty("org/apache/maven/plugin/coreit/a.properties")); - assertEquals("1", pclProps.getProperty("org/apache/maven/plugin/coreit/a.properties.count")); - assertNotNull(pclProps.getProperty("org/apache/maven/plugin/coreit/b.properties")); - assertEquals("1", pclProps.getProperty("org/apache/maven/plugin/coreit/b.properties.count")); - assertNotNull(pclProps.getProperty("org/apache/maven/plugin/coreit/it.properties")); - assertEquals("2", pclProps.getProperty("org/apache/maven/plugin/coreit/it.properties.count")); - - Properties tcclProps = verifier.loadProperties("target/tccl.properties"); - assertEquals(pclProps, tcclProps); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0087PluginRealmWithProjectLevelDepsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0087PluginRealmWithProjectLevelDepsTest.java deleted file mode 100644 index f0fb91129..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0087PluginRealmWithProjectLevelDepsTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-1898. - * - * @author John Casey - * - */ -public class MavenIT0087PluginRealmWithProjectLevelDepsTest extends AbstractMavenIntegrationTestCase { - - public MavenIT0087PluginRealmWithProjectLevelDepsTest() { - super("(2.0.2,)"); - } - - /** - * Verify that a project-level plugin dependency class/resource can be loaded from both the plugin classloader - * and the context classloader available to the plugin. - * - * @throws Exception in case of failure - */ - @Test - public void testit0087() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0087"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.it0087"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties pclProps = verifier.loadProperties("target/pcl.properties"); - assertNotNull(pclProps.getProperty("org.apache.maven.plugin.coreit.ClassA")); - assertNotNull(pclProps.getProperty("org.apache.maven.plugin.coreit.ClassB")); - assertNotNull(pclProps.getProperty("org.apache.maven.its.it0087.IT0087")); - assertNotNull(pclProps.getProperty("src/main/java/org/apache/maven/its/it0087/IT0087.java")); - assertEquals("1", pclProps.getProperty("src/main/java/org/apache/maven/its/it0087/IT0087.java.count")); - - Properties tcclProps = verifier.loadProperties("target/tccl.properties"); - assertEquals(pclProps, tcclProps); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0090EnvVarInterpolationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0090EnvVarInterpolationTest.java deleted file mode 100644 index 78d661059..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0090EnvVarInterpolationTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenIT0090EnvVarInterpolationTest extends AbstractMavenIntegrationTestCase { - public MavenIT0090EnvVarInterpolationTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that ensures that envars are interpolated correctly into plugin - * configurations. - * - * @throws Exception in case of failure - */ - @Test - public void testit0090() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0090"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.setEnvironmentVariable("MAVEN_TEST_ENVAR", "MAVEN_TEST_ENVAR_VALUE"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/env.properties"); - assertEquals("MAVEN_TEST_ENVAR_VALUE", props.getProperty("stringParam")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0108SnapshotUpdateTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0108SnapshotUpdateTest.java deleted file mode 100644 index aaacc4763..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0108SnapshotUpdateTest.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.Locale; - -import org.apache.maven.shared.utils.io.FileUtils; -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * Downloads a snapshot dependency that was deployed with uniqueVersion = false, and checks it can be - * updated. See MNG-1908. - */ -@Disabled("flaky test, see MNG-3137") -public class MavenIT0108SnapshotUpdateTest extends AbstractMavenIntegrationTestCase { - public MavenIT0108SnapshotUpdateTest() { - super(ALL_MAVEN_VERSIONS); - } - - private Verifier verifier; - - private File artifact; - - private File repository; - - private File localRepoFile; - - private static final int TIME_OFFSET = 50000; - - @BeforeEach - protected void setUp() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0108"); - verifier = newVerifier(testDir.getAbsolutePath()); - localRepoFile = getLocalRepoFile(verifier); - deleteLocalArtifact(verifier, localRepoFile); - - repository = new File(testDir, "repository"); - recreateRemoteRepository(repository); - - // create artifact in repository (TODO: into verifier) - artifact = new File( - repository, - "org/apache/maven/maven-core-it-support/1.0-SNAPSHOT/maven-core-it-support-1.0-SNAPSHOT.jar"); - artifact.getParentFile().mkdirs(); - FileUtils.fileWrite(artifact.getAbsolutePath(), "originalArtifact"); - - verifier.verifyArtifactNotPresent("org.apache.maven", "maven-core-it-support", "1.0-SNAPSHOT", "jar"); - } - - @Test - public void testSnapshotUpdated() throws Exception { - verifier.addCliArgument("package"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - verifyArtifactContent("originalArtifact"); - - // set in the past to ensure it is downloaded - localRepoFile.setLastModified(System.currentTimeMillis() - TIME_OFFSET); - - FileUtils.fileWrite(artifact.getAbsolutePath(), "updatedArtifact"); - - verifier.addCliArgument("package"); - verifier.execute(); - - verifyArtifactContent("updatedArtifact"); - - verifier.verifyErrorFreeLog(); - } - - @Test - public void testSnapshotUpdatedWithMetadata() throws Exception { - File metadata = new File(repository, "org/apache/maven/maven-core-it-support/1.0-SNAPSHOT/maven-metadata.xml"); - FileUtils.fileWrite( - metadata.getAbsolutePath(), constructMetadata("1", System.currentTimeMillis() - TIME_OFFSET, true)); - - verifier.addCliArgument("package"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - verifyArtifactContent("originalArtifact"); - - FileUtils.fileWrite(artifact.getAbsolutePath(), "updatedArtifact"); - metadata = new File(repository, "org/apache/maven/maven-core-it-support/1.0-SNAPSHOT/maven-metadata.xml"); - FileUtils.fileWrite(metadata.getAbsolutePath(), constructMetadata("2", System.currentTimeMillis(), true)); - - verifier.addCliArgument("package"); - verifier.execute(); - - verifyArtifactContent("updatedArtifact"); - - verifier.verifyErrorFreeLog(); - } - - @Test - public void testSnapshotUpdatedWithLocalMetadata() throws Exception { - File localMetadata = getMetadataFile("org/apache/maven", "maven-core-it-support", "1.0-SNAPSHOT"); - - FileUtils.deleteDirectory(localMetadata.getParentFile()); - assertFalse(localMetadata.getParentFile().exists()); - localMetadata.getParentFile().mkdirs(); - - File metadata = new File(repository, "org/apache/maven/maven-core-it-support/1.0-SNAPSHOT/maven-metadata.xml"); - FileUtils.fileWrite( - metadata.getAbsolutePath(), constructMetadata("1", System.currentTimeMillis() - TIME_OFFSET, true)); - - verifier.addCliArgument("package"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - verifyArtifactContent("originalArtifact"); - assertFalse(localMetadata.exists()); - - FileUtils.fileWrite(localRepoFile.getAbsolutePath(), "localArtifact"); - FileUtils.fileWrite( - localMetadata.getAbsolutePath(), - constructLocalMetadata("org.apache.maven", "maven-core-it-support", System.currentTimeMillis(), true)); - // update the remote file, but we shouldn't be looking - artifact.setLastModified(System.currentTimeMillis()); - - verifier.addCliArgument("package"); - verifier.execute(); - - verifyArtifactContent("localArtifact"); - - verifier.verifyErrorFreeLog(); - - Calendar cal = Calendar.getInstance(); - cal.add(Calendar.YEAR, -1); - FileUtils.fileWrite( - localMetadata.getAbsolutePath(), - constructLocalMetadata("org.apache.maven", "maven-core-it-support", cal.getTimeInMillis(), true)); - FileUtils.fileWrite( - metadata.getAbsolutePath(), constructMetadata("2", System.currentTimeMillis() - 2000, true)); - artifact.setLastModified(System.currentTimeMillis()); - - verifier.addCliArgument("package"); - verifier.execute(); - - verifyArtifactContent("originalArtifact"); - - verifier.verifyErrorFreeLog(); - } - - @Test - public void testSnapshotUpdatedWithMetadataUsingFileTimestamp() throws Exception { - File metadata = new File(repository, "org/apache/maven/maven-core-it-support/1.0-SNAPSHOT/maven-metadata.xml"); - FileUtils.fileWrite( - metadata.getAbsolutePath(), constructMetadata("1", System.currentTimeMillis() - TIME_OFFSET, false)); - metadata.setLastModified(System.currentTimeMillis() - TIME_OFFSET); - - verifier.addCliArgument("package"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - verifyArtifactContent("originalArtifact"); - - FileUtils.fileWrite(artifact.getAbsolutePath(), "updatedArtifact"); - metadata = new File(repository, "org/apache/maven/maven-core-it-support/1.0-SNAPSHOT/maven-metadata.xml"); - FileUtils.fileWrite(metadata.getAbsolutePath(), constructMetadata("2", System.currentTimeMillis(), false)); - - verifier.addCliArgument("package"); - verifier.execute(); - - verifyArtifactContent("updatedArtifact"); - - verifier.verifyErrorFreeLog(); - } - - private File getMetadataFile(String groupId, String artifactId, String version) { - return new File(verifier.getArtifactMetadataPath(groupId, artifactId, version, "maven-metadata-local.xml")); - } - - private void verifyArtifactContent(String s) throws IOException, VerificationException { - verifier.verifyArtifactPresent("org.apache.maven", "maven-core-it-support", "1.0-SNAPSHOT", "jar"); - verifier.verifyArtifactContent("org.apache.maven", "maven-core-it-support", "1.0-SNAPSHOT", "jar", s); - } - - private static File deleteLocalArtifact(Verifier verifier, File localRepoFile) throws IOException { - verifier.deleteArtifact("org.apache.maven", "maven-core-it-support", "1.0-SNAPSHOT", "jar"); - // this is to delete metadata - TODO: incorporate into deleteArtifact in verifier - FileUtils.deleteDirectory(localRepoFile.getParentFile()); - return localRepoFile; - } - - private static File getLocalRepoFile(Verifier verifier) { - return new File(verifier.getArtifactPath("org.apache.maven", "maven-core-it-support", "1.0-SNAPSHOT", "jar")); - } - - private static void recreateRemoteRepository(File repository) throws IOException { - // create a repository (TODO: into verifier) - FileUtils.deleteDirectory(repository); - assertFalse(repository.exists()); - repository.mkdirs(); - } - - private String constructMetadata(String buildNumber, long timestamp, boolean writeLastUpdated) { - String ts = new SimpleDateFormat("yyyyMMddHHmmss", Locale.US).format(new Date(timestamp)); - - return "\n" + "org.apache.maven\n" - + "maven-core-it-support\n" - + "1.0-SNAPSHOT\n" + "\n" - + "\n" + "" + buildNumber + "\n" + "\n" - + (writeLastUpdated ? "" + ts + "\n" : "") - + "\n" + ""; - } - - private String constructLocalMetadata(String groupId, String artifactId, long timestamp, boolean writeLastUpdated) { - String ts = new SimpleDateFormat("yyyyMMddHHmmss", Locale.US).format(new Date(timestamp)); - - return "\n" + " " + groupId + "\n" - + " " - + artifactId + "\n" + " 1.0-SNAPSHOT\n" + " \n" - + " \n" + " true\n" + " \n" - + (writeLastUpdated ? " " + ts + "\n" : "") - + " \n" + ""; - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0113ServerAuthzAvailableToWagonMgrInPluginTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0113ServerAuthzAvailableToWagonMgrInPluginTest.java deleted file mode 100644 index 63d8218b7..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0113ServerAuthzAvailableToWagonMgrInPluginTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenIT0113ServerAuthzAvailableToWagonMgrInPluginTest extends AbstractMavenIntegrationTestCase { - public MavenIT0113ServerAuthzAvailableToWagonMgrInPluginTest() { - super("[2.0,3.0-alpha-1),[3.0-alpha-7,)"); - } - - /** - * Test that the auth infos given in the settings.xml are pushed into the wagon manager and are available - * to other components/plugins. - * - * @throws Exception in case of failure - */ - @Test - public void testit0113() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0113"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/auth.properties"); - assertEquals("testuser", props.getProperty("test.username")); - assertEquals("testtest", props.getProperty("test.password")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0130CleanLifecycleTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0130CleanLifecycleTest.java deleted file mode 100644 index 8f49ff0d0..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0130CleanLifecycleTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * - * @author Benjamin Bentmann - * - */ -public class MavenIT0130CleanLifecycleTest extends AbstractMavenIntegrationTestCase { - - public MavenIT0130CleanLifecycleTest() { - super("[2.0.0,)"); - } - - /** - * Test default binding of goals for "clean" lifecycle. - * - * @throws Exception in case of failure - */ - @Test - public void testit0130() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0130"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.deleteDirectory("target"); - verifier.setAutoclean(false); - verifier.addCliArgument("clean"); - verifier.execute(); - verifier.verifyFilePresent("target/clean-clean.txt"); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0131SiteLifecycleTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0131SiteLifecycleTest.java deleted file mode 100644 index b9a5ebc22..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0131SiteLifecycleTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * - * @author Benjamin Bentmann - * - */ -public class MavenIT0131SiteLifecycleTest extends AbstractMavenIntegrationTestCase { - - public MavenIT0131SiteLifecycleTest() { - super("[2.0.0,)"); - } - - /** - * Test default binding of goals for "site" lifecycle. - * - * @throws Exception in case of failure - */ - @Test - public void testit0131() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0131"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.deleteDirectory("target"); - verifier.setAutoclean(false); - verifier.addCliArgument("site-deploy"); - verifier.execute(); - verifier.verifyFilePresent("target/site-site.txt"); - verifier.verifyFilePresent("target/site-deploy.txt"); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0132PomLifecycleTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0132PomLifecycleTest.java deleted file mode 100644 index 6ad27808a..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0132PomLifecycleTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * - * @author Benjamin Bentmann - * - */ -public class MavenIT0132PomLifecycleTest extends AbstractMavenIntegrationTestCase { - - public MavenIT0132PomLifecycleTest() { - super("[2.0.0,)"); - } - - /** - * Test default binding of goals for "pom" lifecycle. - * - * @throws Exception in case of failure - */ - @Test - public void testit0132() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0132"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.deleteDirectory("target"); - verifier.setAutoclean(false); - verifier.addCliArgument("deploy"); - verifier.execute(); - if (matchesVersionRange("(2.0.1,3.0-alpha-1)")) { - verifier.verifyFilePresent("target/site-attach-descriptor.txt"); - } - verifier.verifyFilePresent("target/install-install.txt"); - verifier.verifyFilePresent("target/deploy-deploy.txt"); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0133JarLifecycleTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0133JarLifecycleTest.java deleted file mode 100644 index c2156f118..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0133JarLifecycleTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * - * @author Benjamin Bentmann - * - */ -public class MavenIT0133JarLifecycleTest extends AbstractMavenIntegrationTestCase { - - public MavenIT0133JarLifecycleTest() { - super("[2.0.0,)"); - } - - /** - * Test default binding of goals for "jar" lifecycle. - * - * @throws Exception in case of failure - */ - @Test - public void testit0133() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0133"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.deleteDirectory("target"); - verifier.setAutoclean(false); - verifier.addCliArgument("deploy"); - verifier.execute(); - verifier.verifyFilePresent("target/resources-resources.txt"); - verifier.verifyFilePresent("target/compiler-compile.txt"); - verifier.verifyFilePresent("target/resources-test-resources.txt"); - verifier.verifyFilePresent("target/compiler-test-compile.txt"); - verifier.verifyFilePresent("target/surefire-test.txt"); - verifier.verifyFilePresent("target/jar-jar.txt"); - verifier.verifyFilePresent("target/install-install.txt"); - verifier.verifyFilePresent("target/deploy-deploy.txt"); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0134WarLifecycleTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0134WarLifecycleTest.java deleted file mode 100644 index f2b877a72..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0134WarLifecycleTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * - * @author Benjamin Bentmann - * - */ -public class MavenIT0134WarLifecycleTest extends AbstractMavenIntegrationTestCase { - - public MavenIT0134WarLifecycleTest() { - super("[2.0.0,)"); - } - - /** - * Test default binding of goals for "war" lifecycle. - * - * @throws Exception in case of failure - */ - @Test - public void testit0134() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0134"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.deleteDirectory("target"); - verifier.setAutoclean(false); - verifier.addCliArgument("deploy"); - verifier.execute(); - verifier.verifyFilePresent("target/resources-resources.txt"); - verifier.verifyFilePresent("target/compiler-compile.txt"); - verifier.verifyFilePresent("target/resources-test-resources.txt"); - verifier.verifyFilePresent("target/compiler-test-compile.txt"); - verifier.verifyFilePresent("target/surefire-test.txt"); - verifier.verifyFilePresent("target/war-war.txt"); - verifier.verifyFilePresent("target/install-install.txt"); - verifier.verifyFilePresent("target/deploy-deploy.txt"); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0135EjbLifecycleTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0135EjbLifecycleTest.java deleted file mode 100644 index 2ee41efee..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0135EjbLifecycleTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * - * @author Benjamin Bentmann - * - */ -public class MavenIT0135EjbLifecycleTest extends AbstractMavenIntegrationTestCase { - - public MavenIT0135EjbLifecycleTest() { - super("[2.0.0,)"); - } - - /** - * Test default binding of goals for "ejb" lifecycle. - * - * @throws Exception in case of failure - */ - @Test - public void testit0135() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0135"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.deleteDirectory("target"); - verifier.setAutoclean(false); - verifier.addCliArgument("deploy"); - verifier.execute(); - verifier.verifyFilePresent("target/resources-resources.txt"); - verifier.verifyFilePresent("target/compiler-compile.txt"); - verifier.verifyFilePresent("target/resources-test-resources.txt"); - verifier.verifyFilePresent("target/compiler-test-compile.txt"); - verifier.verifyFilePresent("target/surefire-test.txt"); - verifier.verifyFilePresent("target/ejb-ejb.txt"); - verifier.verifyFilePresent("target/install-install.txt"); - verifier.verifyFilePresent("target/deploy-deploy.txt"); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0136RarLifecycleTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0136RarLifecycleTest.java deleted file mode 100644 index 95ecf5b6e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0136RarLifecycleTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * - * @author Benjamin Bentmann - * - */ -public class MavenIT0136RarLifecycleTest extends AbstractMavenIntegrationTestCase { - - public MavenIT0136RarLifecycleTest() { - super("[2.0.0,)"); - } - - /** - * Test default binding of goals for "rar" lifecycle. - * - * @throws Exception in case of failure - */ - @Test - public void testit0136() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0136"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.deleteDirectory("target"); - verifier.setAutoclean(false); - verifier.addCliArgument("deploy"); - verifier.execute(); - verifier.verifyFilePresent("target/resources-resources.txt"); - verifier.verifyFilePresent("target/compiler-compile.txt"); - verifier.verifyFilePresent("target/resources-test-resources.txt"); - verifier.verifyFilePresent("target/compiler-test-compile.txt"); - verifier.verifyFilePresent("target/surefire-test.txt"); - verifier.verifyFilePresent("target/rar-rar.txt"); - verifier.verifyFilePresent("target/install-install.txt"); - verifier.verifyFilePresent("target/deploy-deploy.txt"); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0137EarLifecycleTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0137EarLifecycleTest.java deleted file mode 100644 index 422466f7e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0137EarLifecycleTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * - * @author Benjamin Bentmann - * - */ -public class MavenIT0137EarLifecycleTest extends AbstractMavenIntegrationTestCase { - - public MavenIT0137EarLifecycleTest() { - super("[2.0.0,)"); - } - - /** - * Test default binding of goals for "ear" lifecycle. - * - * @throws Exception in case of failure - */ - @Test - public void testit0137() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0137"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.deleteDirectory("target"); - verifier.setAutoclean(false); - verifier.addCliArgument("deploy"); - verifier.execute(); - verifier.verifyFilePresent("target/ear-generate-application-xml.txt"); - verifier.verifyFilePresent("target/resources-resources.txt"); - verifier.verifyFilePresent("target/ear-ear.txt"); - verifier.verifyFilePresent("target/install-install.txt"); - verifier.verifyFilePresent("target/deploy-deploy.txt"); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0138PluginLifecycleTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0138PluginLifecycleTest.java deleted file mode 100644 index 395e137cb..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0138PluginLifecycleTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * - * @author Benjamin Bentmann - * - */ -public class MavenIT0138PluginLifecycleTest extends AbstractMavenIntegrationTestCase { - - public MavenIT0138PluginLifecycleTest() { - super("[2.0.0,)"); - } - - /** - * Test default binding of goals for "maven-plugin" lifecycle. - * - * @throws Exception in case of failure - */ - @Test - public void testit0138() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0138"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.deleteDirectory("target"); - verifier.setAutoclean(false); - verifier.addCliArgument("deploy"); - verifier.execute(); - verifier.verifyFilePresent("target/plugin-descriptor.txt"); - verifier.verifyFilePresent("target/resources-resources.txt"); - verifier.verifyFilePresent("target/compiler-compile.txt"); - verifier.verifyFilePresent("target/resources-test-resources.txt"); - verifier.verifyFilePresent("target/compiler-test-compile.txt"); - verifier.verifyFilePresent("target/surefire-test.txt"); - verifier.verifyFilePresent("target/jar-jar.txt"); - verifier.verifyFilePresent("target/plugin-add-plugin-artifact-metadata.txt"); - verifier.verifyFilePresent("target/install-install.txt"); - if (matchesVersionRange("(,2.2.0)")) { - verifier.verifyFilePresent("target/plugin-update-registry.txt"); - } - verifier.verifyFilePresent("target/deploy-deploy.txt"); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0139InterpolationWithProjectPrefixTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0139InterpolationWithProjectPrefixTest.java deleted file mode 100644 index 5c82e4391..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0139InterpolationWithProjectPrefixTest.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * - * @author Benjamin Bentmann - * - */ -public class MavenIT0139InterpolationWithProjectPrefixTest extends AbstractMavenIntegrationTestCase { - public MavenIT0139InterpolationWithProjectPrefixTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that expressions of the form ${project.*} resolve correctly to POM values. - * - * @throws Exception in case of failure - */ - @Test - public void testit0139() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0139"); - File child = new File(testDir, "child"); - - Verifier verifier = newVerifier(child.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("initialize"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/interpolated.properties"); - String prefix = "project.properties."; - - assertEquals(child.getCanonicalFile(), new File(props.getProperty(prefix + "projectDir")).getCanonicalFile()); - - assertEquals("org.apache.maven.its.it0139.child", props.getProperty(prefix + "projectGroupId")); - assertEquals("child", props.getProperty(prefix + "projectArtifactId")); - assertEquals("2.0-alpha-1", props.getProperty(prefix + "projectVersion")); - assertEquals("jar", props.getProperty(prefix + "projectPackaging")); - - assertEquals("child-name", props.getProperty(prefix + "projectName")); - assertEquals("child-desc", props.getProperty(prefix + "projectDesc")); - assertEquals("http://child.org/", props.getProperty(prefix + "projectUrl")); - assertEquals("2008", props.getProperty(prefix + "projectYear")); - assertEquals("child-org-name", props.getProperty(prefix + "projectOrgName")); - - assertEquals("2.0.0", props.getProperty(prefix + "projectPrereqMvn")); - assertEquals("http://scm.org/", props.getProperty(prefix + "projectScmUrl")); - assertEquals("http://issue.org/", props.getProperty(prefix + "projectIssueUrl")); - assertEquals("http://ci.org/", props.getProperty(prefix + "projectCiUrl")); - assertEquals("child-dist-repo", props.getProperty(prefix + "projectDistRepoName")); - - assertEquals("org.apache.maven.its.it0139", props.getProperty(prefix + "parentGroupId")); - assertEquals("parent", props.getProperty(prefix + "parentArtifactId")); - assertEquals("1.0", props.getProperty(prefix + "parentVersion")); - - /* - * NOTE: We intentionally do not check whether the build paths have been basedir aligned, that's another - * story... - */ - if (matchesVersionRange("(2.0.8,)")) { - assertTrue(props.getProperty(prefix + "projectBuildOut").endsWith("bin")); - } - assertTrue(props.getProperty(prefix + "projectSiteOut").endsWith("doc")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0140InterpolationWithPomPrefixTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0140InterpolationWithPomPrefixTest.java deleted file mode 100644 index a8d50e14b..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0140InterpolationWithPomPrefixTest.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * MNG-7244 removes the deprecation of - * pom.X. - * See {@link MavenITmng7244IgnorePomPrefixInExpressions}. - * - * @author Benjamin Bentmann - */ -public class MavenIT0140InterpolationWithPomPrefixTest extends AbstractMavenIntegrationTestCase { - public MavenIT0140InterpolationWithPomPrefixTest() { - super("[2.0,4.0.0-alpha-1)"); - } - - /** - * Test that expressions of the form ${pom.*} resolve correctly to POM values. - * - * @throws Exception in case of failure - */ - @Test - public void testit0140() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0140"); - File child = new File(testDir, "child"); - - Verifier verifier = newVerifier(child.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("initialize"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/interpolated.properties"); - String prefix = "project.properties."; - - assertEquals(child.getCanonicalFile(), new File(props.getProperty(prefix + "projectDir")).getCanonicalFile()); - - assertEquals("org.apache.maven.its.it0140.child", props.getProperty(prefix + "projectGroupId")); - assertEquals("child", props.getProperty(prefix + "projectArtifactId")); - assertEquals("2.0-alpha-1", props.getProperty(prefix + "projectVersion")); - assertEquals("jar", props.getProperty(prefix + "projectPackaging")); - - assertEquals("child-name", props.getProperty(prefix + "projectName")); - assertEquals("child-desc", props.getProperty(prefix + "projectDesc")); - assertEquals("http://child.org/", props.getProperty(prefix + "projectUrl")); - assertEquals("2008", props.getProperty(prefix + "projectYear")); - assertEquals("child-org-name", props.getProperty(prefix + "projectOrgName")); - - assertEquals("2.0.0", props.getProperty(prefix + "projectPrereqMvn")); - assertEquals("http://scm.org/", props.getProperty(prefix + "projectScmUrl")); - assertEquals("http://issue.org/", props.getProperty(prefix + "projectIssueUrl")); - assertEquals("http://ci.org/", props.getProperty(prefix + "projectCiUrl")); - assertEquals("child-dist-repo", props.getProperty(prefix + "projectDistRepoName")); - - assertEquals("org.apache.maven.its.it0140", props.getProperty(prefix + "parentGroupId")); - assertEquals("parent", props.getProperty(prefix + "parentArtifactId")); - assertEquals("1.0", props.getProperty(prefix + "parentVersion")); - - /* - * NOTE: We intentionally do not check whether the build paths have been basedir aligned, that's another - * story... - */ - if (matchesVersionRange("(2.0.8,)")) { - assertTrue(props.getProperty(prefix + "projectBuildOut").endsWith("bin")); - } - assertTrue(props.getProperty(prefix + "projectSiteOut").endsWith("doc")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0142DirectDependencyScopesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0142DirectDependencyScopesTest.java deleted file mode 100644 index fc2d56fdd..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0142DirectDependencyScopesTest.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * - * @author Benjamin Bentmann - * - */ -public class MavenIT0142DirectDependencyScopesTest extends AbstractMavenIntegrationTestCase { - - /* - * NOTE: Class path ordering is another issue (MNG-1412), so we merely check set containment here. - */ - - public MavenIT0142DirectDependencyScopesTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that the different scopes of direct dependencies end up on the right class paths. - * - * @throws Exception in case of failure - */ - @Test - public void testit0142() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0142"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.it0142"); - verifier.filterFile("pom-template.xml", "pom.xml", "UTF-8"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List compileArtifacts = verifier.loadLines("target/compile-artifacts.txt", "UTF-8"); - assertTrue( - compileArtifacts.toString(), compileArtifacts.contains("org.apache.maven.its.it0142:system:jar:0.1")); - assertTrue( - compileArtifacts.toString(), compileArtifacts.contains("org.apache.maven.its.it0142:provided:jar:0.1")); - assertTrue( - compileArtifacts.toString(), compileArtifacts.contains("org.apache.maven.its.it0142:compile:jar:0.1")); - assertEquals(3, compileArtifacts.size()); - - List compileClassPath = verifier.loadLines("target/compile-cp.txt", "UTF-8"); - assertTrue(compileClassPath.toString(), compileClassPath.contains("classes")); - assertTrue(compileClassPath.toString(), compileClassPath.contains("system-0.1.jar")); - assertTrue(compileClassPath.toString(), compileClassPath.contains("provided-0.1.jar")); - assertTrue(compileClassPath.toString(), compileClassPath.contains("compile-0.1.jar")); - assertEquals(4, compileClassPath.size()); - - List runtimeArtifacts = verifier.loadLines("target/runtime-artifacts.txt", "UTF-8"); - assertTrue( - runtimeArtifacts.toString(), runtimeArtifacts.contains("org.apache.maven.its.it0142:compile:jar:0.1")); - assertTrue( - runtimeArtifacts.toString(), runtimeArtifacts.contains("org.apache.maven.its.it0142:runtime:jar:0.1")); - assertTrue( - runtimeArtifacts.toString(), - runtimeArtifacts.contains("org.apache.maven.its.it0142:runtime:jar:retro:0.1")); - assertEquals(3, runtimeArtifacts.size()); - - List runtimeClassPath = verifier.loadLines("target/runtime-cp.txt", "UTF-8"); - assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("classes")); - assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("compile-0.1.jar")); - assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("runtime-0.1.jar")); - assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("runtime-0.1-retro.jar")); - assertEquals(4, runtimeClassPath.size()); - - List testArtifacts = verifier.loadLines("target/test-artifacts.txt", "UTF-8"); - assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0142:system:jar:0.1")); - assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0142:provided:jar:0.1")); - assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0142:compile:jar:0.1")); - assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0142:runtime:jar:0.1")); - assertTrue( - testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0142:runtime:jar:retro:0.1")); - assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0142:test:jar:0.1")); - assertEquals(6, testArtifacts.size()); - - List testClassPath = verifier.loadLines("target/test-cp.txt", "UTF-8"); - assertTrue(testClassPath.toString(), testClassPath.contains("classes")); - assertTrue(testClassPath.toString(), testClassPath.contains("test-classes")); - assertTrue(testClassPath.toString(), testClassPath.contains("system-0.1.jar")); - assertTrue(testClassPath.toString(), testClassPath.contains("provided-0.1.jar")); - assertTrue(testClassPath.toString(), testClassPath.contains("compile-0.1.jar")); - assertTrue(testClassPath.toString(), testClassPath.contains("runtime-0.1.jar")); - assertTrue(testClassPath.toString(), testClassPath.contains("runtime-0.1-retro.jar")); - assertTrue(testClassPath.toString(), testClassPath.contains("test-0.1.jar")); - assertEquals(8, testClassPath.size()); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0143TransitiveDependencyScopesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0143TransitiveDependencyScopesTest.java deleted file mode 100644 index 7b1aebc2c..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0143TransitiveDependencyScopesTest.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; -import java.util.Map; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * - * @author Benjamin Bentmann - * - */ -public class MavenIT0143TransitiveDependencyScopesTest extends AbstractMavenIntegrationTestCase { - - /* - * NOTE: Class path ordering is another issue (MNG-1412), so we merely check set containment here. - */ - - public MavenIT0143TransitiveDependencyScopesTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that the different scopes of transitive dependencies end up on the right class paths when mediated from - * a compile-scope dependency. - * - * @throws Exception in case of failure - */ - @Test - public void testitCompileScope() throws Exception { - Verifier verifier = run("compile"); - String targetDir = "target-compile"; - - /* - * NOTE: Transitive compile dependencies end up in compile scope to support the case of a class in the direct - * dependency that extends a class from the transitive dependency, i.e. - * project imports A from direct dependency and A extends B from transitive dependency. - */ - List compileArtifacts = verifier.loadLines(targetDir + "/compile-artifacts.txt", "UTF-8"); - assertTrue( - compileArtifacts.toString(), compileArtifacts.contains("org.apache.maven.its.it0143:direct:jar:0.1")); - assertTrue( - compileArtifacts.toString(), compileArtifacts.contains("org.apache.maven.its.it0143:compile:jar:0.1")); - assertEquals(2, compileArtifacts.size()); - - List compileClassPath = verifier.loadLines(targetDir + "/compile-cp.txt", "UTF-8"); - assertTrue(compileClassPath.toString(), compileClassPath.contains("classes")); - assertTrue(compileClassPath.toString(), compileClassPath.contains("direct-0.1.jar")); - assertTrue(compileClassPath.toString(), compileClassPath.contains("compile-0.1.jar")); - assertEquals(3, compileClassPath.size()); - - List runtimeArtifacts = verifier.loadLines(targetDir + "/runtime-artifacts.txt", "UTF-8"); - assertTrue( - runtimeArtifacts.toString(), runtimeArtifacts.contains("org.apache.maven.its.it0143:direct:jar:0.1")); - assertTrue( - runtimeArtifacts.toString(), runtimeArtifacts.contains("org.apache.maven.its.it0143:compile:jar:0.1")); - assertTrue( - runtimeArtifacts.toString(), runtimeArtifacts.contains("org.apache.maven.its.it0143:runtime:jar:0.1")); - assertEquals(3, runtimeArtifacts.size()); - - List runtimeClassPath = verifier.loadLines(targetDir + "/runtime-cp.txt", "UTF-8"); - assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("classes")); - assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("direct-0.1.jar")); - assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("compile-0.1.jar")); - assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("runtime-0.1.jar")); - assertEquals(4, runtimeClassPath.size()); - - List testArtifacts = verifier.loadLines(targetDir + "/test-artifacts.txt", "UTF-8"); - assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0143:direct:jar:0.1")); - assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0143:compile:jar:0.1")); - assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0143:runtime:jar:0.1")); - assertEquals(3, testArtifacts.size()); - - List testClassPath = verifier.loadLines(targetDir + "/test-cp.txt", "UTF-8"); - assertTrue(testClassPath.toString(), testClassPath.contains("classes")); - assertTrue(testClassPath.toString(), testClassPath.contains("test-classes")); - assertTrue(testClassPath.toString(), testClassPath.contains("direct-0.1.jar")); - assertTrue(testClassPath.toString(), testClassPath.contains("compile-0.1.jar")); - assertTrue(testClassPath.toString(), testClassPath.contains("runtime-0.1.jar")); - assertEquals(5, testClassPath.size()); - } - - /** - * Test that the different scopes of transitive dependencies end up on the right class paths when mediated from - * a provided-scope dependency. - * - * @throws Exception in case of failure - */ - @Test - public void testitProvidedScope() throws Exception { - Verifier verifier = run("provided"); - String targetDir = "target-provided"; - - List compileArtifacts = verifier.loadLines(targetDir + "/compile-artifacts.txt", "UTF-8"); - assertTrue( - compileArtifacts.toString(), compileArtifacts.contains("org.apache.maven.its.it0143:direct:jar:0.1")); - assertTrue( - compileArtifacts.toString(), compileArtifacts.contains("org.apache.maven.its.it0143:compile:jar:0.1")); - assertTrue( - compileArtifacts.toString(), compileArtifacts.contains("org.apache.maven.its.it0143:runtime:jar:0.1")); - assertEquals(3, compileArtifacts.size()); - - List compileClassPath = verifier.loadLines(targetDir + "/compile-cp.txt", "UTF-8"); - assertTrue(compileClassPath.toString(), compileClassPath.contains("classes")); - assertTrue(compileClassPath.toString(), compileClassPath.contains("direct-0.1.jar")); - assertTrue(compileClassPath.toString(), compileClassPath.contains("compile-0.1.jar")); - assertTrue(compileClassPath.toString(), compileClassPath.contains("runtime-0.1.jar")); - assertEquals(4, compileClassPath.size()); - - List runtimeArtifacts = verifier.loadLines(targetDir + "/runtime-artifacts.txt", "UTF-8"); - assertEquals(0, runtimeArtifacts.size()); - - List runtimeClassPath = verifier.loadLines(targetDir + "/runtime-cp.txt", "UTF-8"); - assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("classes")); - assertEquals(1, runtimeClassPath.size()); - - List testArtifacts = verifier.loadLines(targetDir + "/test-artifacts.txt", "UTF-8"); - assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0143:direct:jar:0.1")); - assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0143:compile:jar:0.1")); - assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0143:runtime:jar:0.1")); - assertEquals(3, testArtifacts.size()); - - List testClassPath = verifier.loadLines(targetDir + "/test-cp.txt", "UTF-8"); - assertTrue(testClassPath.toString(), testClassPath.contains("classes")); - assertTrue(testClassPath.toString(), testClassPath.contains("test-classes")); - assertTrue(testClassPath.toString(), testClassPath.contains("direct-0.1.jar")); - assertTrue(testClassPath.toString(), testClassPath.contains("compile-0.1.jar")); - assertTrue(testClassPath.toString(), testClassPath.contains("runtime-0.1.jar")); - assertEquals(5, testClassPath.size()); - } - - /** - * Test that the different scopes of transitive dependencies end up on the right class paths when mediated from - * a runtime-scope dependency. - * - * @throws Exception in case of failure - */ - @Test - public void testitRuntimeScope() throws Exception { - Verifier verifier = run("runtime"); - String targetDir = "target-runtime"; - - List compileArtifacts = verifier.loadLines(targetDir + "/compile-artifacts.txt", "UTF-8"); - assertEquals(0, compileArtifacts.size()); - - List compileClassPath = verifier.loadLines(targetDir + "/compile-cp.txt", "UTF-8"); - assertTrue(compileClassPath.toString(), compileClassPath.contains("classes")); - assertEquals(1, compileClassPath.size()); - - List runtimeArtifacts = verifier.loadLines(targetDir + "/runtime-artifacts.txt", "UTF-8"); - assertTrue( - runtimeArtifacts.toString(), runtimeArtifacts.contains("org.apache.maven.its.it0143:direct:jar:0.1")); - assertTrue( - runtimeArtifacts.toString(), runtimeArtifacts.contains("org.apache.maven.its.it0143:compile:jar:0.1")); - assertTrue( - runtimeArtifacts.toString(), runtimeArtifacts.contains("org.apache.maven.its.it0143:runtime:jar:0.1")); - assertEquals(3, runtimeArtifacts.size()); - - List runtimeClassPath = verifier.loadLines(targetDir + "/runtime-cp.txt", "UTF-8"); - assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("classes")); - assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("direct-0.1.jar")); - assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("compile-0.1.jar")); - assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("runtime-0.1.jar")); - assertEquals(4, runtimeClassPath.size()); - - List testArtifacts = verifier.loadLines(targetDir + "/test-artifacts.txt", "UTF-8"); - assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0143:direct:jar:0.1")); - assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0143:compile:jar:0.1")); - assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0143:runtime:jar:0.1")); - assertEquals(3, testArtifacts.size()); - - List testClassPath = verifier.loadLines(targetDir + "/test-cp.txt", "UTF-8"); - assertTrue(testClassPath.toString(), testClassPath.contains("classes")); - assertTrue(testClassPath.toString(), testClassPath.contains("test-classes")); - assertTrue(testClassPath.toString(), testClassPath.contains("direct-0.1.jar")); - assertTrue(testClassPath.toString(), testClassPath.contains("compile-0.1.jar")); - assertTrue(testClassPath.toString(), testClassPath.contains("runtime-0.1.jar")); - assertEquals(5, testClassPath.size()); - } - - /** - * Test that the different scopes of transitive dependencies end up on the right class paths when mediated from - * a test-scope dependency. - * - * @throws Exception in case of failure - */ - @Test - public void testitTestScope() throws Exception { - Verifier verifier = run("test"); - String targetDir = "target-test"; - - List compileArtifacts = verifier.loadLines(targetDir + "/compile-artifacts.txt", "UTF-8"); - assertEquals(0, compileArtifacts.size()); - - List compileClassPath = verifier.loadLines(targetDir + "/compile-cp.txt", "UTF-8"); - assertTrue(compileClassPath.toString(), compileClassPath.contains("classes")); - assertEquals(1, compileClassPath.size()); - - List runtimeArtifacts = verifier.loadLines(targetDir + "/runtime-artifacts.txt", "UTF-8"); - assertEquals(0, runtimeArtifacts.size()); - - List runtimeClassPath = verifier.loadLines(targetDir + "/runtime-cp.txt", "UTF-8"); - assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("classes")); - assertEquals(1, runtimeClassPath.size()); - - List testArtifacts = verifier.loadLines(targetDir + "/test-artifacts.txt", "UTF-8"); - assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0143:direct:jar:0.1")); - assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0143:compile:jar:0.1")); - assertTrue(testArtifacts.toString(), testArtifacts.contains("org.apache.maven.its.it0143:runtime:jar:0.1")); - assertEquals(3, testArtifacts.size()); - - List testClassPath = verifier.loadLines(targetDir + "/test-cp.txt", "UTF-8"); - assertTrue(testClassPath.toString(), testClassPath.contains("classes")); - assertTrue(testClassPath.toString(), testClassPath.contains("test-classes")); - assertTrue(testClassPath.toString(), testClassPath.contains("direct-0.1.jar")); - assertTrue(testClassPath.toString(), testClassPath.contains("compile-0.1.jar")); - assertTrue(testClassPath.toString(), testClassPath.contains("runtime-0.1.jar")); - assertEquals(5, testClassPath.size()); - } - - private Verifier run(String scope) throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0143"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target-" + scope); - verifier.deleteArtifacts("org.apache.maven.its.it0143"); - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@scope@", scope); - verifier.filterFile("pom-template.xml", "pom.xml", "UTF-8", filterProps); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.setLogFileName("log-" + scope + ".txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - return verifier; - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0144LifecycleExecutionOrderTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0144LifecycleExecutionOrderTest.java deleted file mode 100644 index 340f45ae6..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0144LifecycleExecutionOrderTest.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * @author Benjamin Bentmann - * - */ -public class MavenIT0144LifecycleExecutionOrderTest extends AbstractMavenIntegrationTestCase { - - public MavenIT0144LifecycleExecutionOrderTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that the lifecycle phases execute in proper order. - * - * @throws Exception in case of failure - */ - @Test - public void testit0144() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0144"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.deleteDirectory("target"); - verifier.setAutoclean(false); - verifier.addCliArguments("post-clean", "deploy", "site-deploy"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List expected = new ArrayList<>(); - - expected.add("pre-clean"); - expected.add("clean"); - expected.add("post-clean"); - - expected.add("validate"); - expected.add("initialize"); - expected.add("generate-sources"); - expected.add("process-sources"); - expected.add("generate-resources"); - expected.add("process-resources"); - expected.add("compile"); - expected.add("process-classes"); - expected.add("generate-test-sources"); - expected.add("process-test-sources"); - expected.add("generate-test-resources"); - expected.add("process-test-resources"); - expected.add("test-compile"); - if (matchesVersionRange("(2.0.4,)")) { - // MNG-1508 - expected.add("process-test-classes"); - } - expected.add("test"); - if (matchesVersionRange("(2.1.0-M1,)")) { - // MNG-2097 - expected.add("prepare-package"); - } - expected.add("package"); - if (matchesVersionRange("(2.0.1,)")) { - expected.add("pre-integration-test"); - } - expected.add("integration-test"); - if (matchesVersionRange("(2.0.1,)")) { - expected.add("post-integration-test"); - } - expected.add("verify"); - expected.add("install"); - expected.add("deploy"); - - expected.add("pre-site"); - expected.add("site"); - expected.add("post-site"); - expected.add("site-deploy"); - - List phases = verifier.loadLines("target/phases.log", "UTF-8"); - assertEquals(expected, phases); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0146InstallerSnapshotNaming.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0146InstallerSnapshotNaming.java deleted file mode 100644 index 26b97beb0..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0146InstallerSnapshotNaming.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.IOException; -import java.net.InetAddress; -import java.util.Map; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.server.Handler; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.DefaultHandler; -import org.eclipse.jetty.server.handler.HandlerList; -import org.eclipse.jetty.server.handler.ResourceHandler; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -public class MavenIT0146InstallerSnapshotNaming extends AbstractMavenIntegrationTestCase { - private Server server; - - private int port; - - private final File testDir; - - public MavenIT0146InstallerSnapshotNaming() throws IOException { - super("(2.0.2,)"); - testDir = ResourceExtractor.simpleExtractResources(getClass(), "/it0146"); - } - - @BeforeEach - protected void setUp() throws Exception { - ResourceHandler resourceHandler = new ResourceHandler(); - resourceHandler.setResourceBase(new File(testDir, "repo").getAbsolutePath()); - HandlerList handlers = new HandlerList(); - handlers.setHandlers(new Handler[] {resourceHandler, new DefaultHandler()}); - - server = new Server(0); - server.setHandler(handlers); - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + port); - } - - @AfterEach - protected void tearDown() throws Exception { - if (server != null) { - server.stop(); - server.join(); - } - } - - @Test - public void testitRemoteDownloadTimestampedName() throws Exception { - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - - Map properties = verifier.newDefaultFilterMap(); - properties.put("@host@", InetAddress.getLoopbackAddress().getCanonicalHostName()); - properties.put("@port@", Integer.toString(port)); - - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", properties); - - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - - verifier.deleteArtifacts("org.apache.maven.its.it0146"); - - verifier.addCliArgument("-X"); - - verifier.deleteDirectory("target"); - - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/appassembler/repo/dep-0.1-20110726.105319-1.jar"); - } - - @Test - public void testitNonTimestampedNameWithInstalledSNAPSHOT() throws Exception { - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.deleteArtifacts("org.apache.maven.its.it0146"); - verifier.addCliArgument("-f"); - verifier.addCliArgument("project/pom.xml"); - verifier.deleteDirectory("project/target"); - verifier.setLogFileName("log2.txt"); - - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(testDir.getAbsolutePath()); - - Map properties = verifier.newDefaultFilterMap(); - properties.put("@host@", InetAddress.getLoopbackAddress().getCanonicalHostName()); - properties.put("@port@", Integer.toString(port)); - - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", properties); - - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.setLogFileName("log3.txt"); - - verifier.addCliArgument("-X"); - - verifier.deleteDirectory("target"); - - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/appassembler/repo/dep-0.1-SNAPSHOT.jar"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0199CyclicImportScopeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0199CyclicImportScopeTest.java deleted file mode 100644 index 6021b676f..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0199CyclicImportScopeTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenIT0199CyclicImportScopeTest extends AbstractMavenIntegrationTestCase { - - public MavenIT0199CyclicImportScopeTest() { - super(ALL_MAVEN_VERSIONS); - } - - @Test - public void testit0199() throws Exception { - // v1: parent not using BOM; explicit dep from componentB → componentA - // v2: BOM introduced; componentB → componentA picks up implicit version 1 from main@v1 - // v3: components now inheriting indirectly from an older version of the BOM that includes them; componentB → - // componentA version overridden - for (int i = 1; i <= 3; i++) { - build("v" + i + "/parent", null); - build("v" + i + "/componentA", "target/componentA-" + i + ".jar"); - build("v" + i + "/componentB", "target/componentB-" + i + ".jar"); - build("v" + i + "/main", "bundle/target/bundle-" + i + ".jar"); - } - } - - private void build(String module, String expectedArtifact) throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/cyclic-import-scope"); - Verifier verifier = newVerifier(new File(testDir.getAbsolutePath(), module).getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("install"); - verifier.execute(); - if (expectedArtifact != null) { - verifier.verifyFilePresent(expectedArtifact); - } - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITBootstrapTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITBootstrapTest.java deleted file mode 100644 index 2e30525b6..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITBootstrapTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * Core IT Bootstrapping: downloads from central repository every dependency (artifacts, plugins) required to let - * ITs run without downloading anything later. - * - * @author Benjamin Bentmann - * - */ -public class MavenITBootstrapTest extends AbstractMavenIntegrationTestCase { - public MavenITBootstrapTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Bootstraps the integration tests by downloading required artifacts from central repository. - * - * @throws Exception in case of failure - */ - @Test - public void testBootstrap() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/bootstrap"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - verifier.setAutoclean(false); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("-Dbootstrap=" - + getClass().getResource("/bootstrap.txt").toURI().getPath()); - - // bootstrap plugin is bound to this phase, do not go further - // important: maven-plugin packaging will fail at package phase, as there is no Mojo present! - verifier.addCliArgument("process-resources"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0095ReactorFailureBehaviorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0095ReactorFailureBehaviorTest.java deleted file mode 100644 index 716513642..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0095ReactorFailureBehaviorTest.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-95. - * - * @author John Casey - * - */ -public class MavenITmng0095ReactorFailureBehaviorTest extends AbstractMavenIntegrationTestCase { - public MavenITmng0095ReactorFailureBehaviorTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test fail-fast reactor behavior. Forces an exception to be thrown in - * the first module and checks that the second & third module is not built and the overall build fails, too. - * - * @throws Exception in case of failure - */ - @Test - public void testitFailFast() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0095"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("subproject1/target"); - verifier.deleteDirectory("subproject2/target"); - verifier.deleteDirectory("subproject3/target"); - verifier.addCliArgument("--fail-fast"); - verifier.setLogFileName("log-ff.txt"); - try { - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-touch:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } catch (VerificationException e) { - // expected - } - - verifier.verifyFilePresent("target/touch.txt"); - verifier.verifyFileNotPresent("subproject1/target/touch.txt"); - verifier.verifyFileNotPresent("subproject2/target/touch.txt"); - verifier.verifyFileNotPresent("subproject3/target/touch.txt"); - } - - /** - * Test fail-never reactor behavior. Forces an exception to be thrown in - * the first module, but checks that the second & third module is built and the overall build succeeds. - * - * @throws Exception in case of failure - */ - @Test - public void testitFailNever() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0095"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("subproject1/target"); - verifier.deleteDirectory("subproject2/target"); - verifier.deleteDirectory("subproject3/target"); - verifier.addCliArgument("--fail-never"); - verifier.setLogFileName("log-fn.txt"); - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-touch:touch"); - verifier.execute(); - - verifier.verifyFilePresent("target/touch.txt"); - verifier.verifyFileNotPresent("subproject1/target/touch.txt"); - verifier.verifyFilePresent("subproject2/target/touch.txt"); - verifier.verifyFilePresent("subproject3/target/touch.txt"); - } - - /** - * Test fail-at-end reactor behavior. Forces an exception to be thrown in - * the first module and checks that the second module is still built but the overall build finally fails - * and the third module (which depends on the failed module) is skipped. - * - * @throws Exception in case of failure - */ - @Test - public void testitFailAtEnd() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0095"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("subproject1/target"); - verifier.deleteDirectory("subproject2/target"); - verifier.deleteDirectory("subproject3/target"); - verifier.addCliArgument("--fail-at-end"); - verifier.setLogFileName("log-fae.txt"); - try { - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-touch:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } catch (VerificationException e) { - // expected - } - - verifier.verifyFilePresent("target/touch.txt"); - verifier.verifyFileNotPresent("subproject1/target/touch.txt"); - verifier.verifyFilePresent("subproject2/target/touch.txt"); - verifier.verifyFileNotPresent("subproject3/target/touch.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0187CollectedProjectsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0187CollectedProjectsTest.java deleted file mode 100644 index b579e9294..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0187CollectedProjectsTest.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-187. - * - * @author Benjamin Bentmann - */ -public class MavenITmng0187CollectedProjectsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng0187CollectedProjectsTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that MavenProject.getCollectedProjects() provides access to the direct and indirect modules - * of the current project. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0187"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("sub-1/target"); - verifier.deleteDirectory("sub-1/sub-2/target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props; - - props = verifier.loadProperties("target/project.properties"); - assertEquals("2", props.getProperty("project.collectedProjects.size")); - assertEquals(Arrays.asList(new String[] {"sub-1", "sub-2"}), getProjects(props)); - - props = verifier.loadProperties("sub-1/target/project.properties"); - assertEquals("1", props.getProperty("project.collectedProjects.size")); - assertEquals(Arrays.asList(new String[] {"sub-2"}), getProjects(props)); - - props = verifier.loadProperties("sub-1/sub-2/target/project.properties"); - assertEquals("0", props.getProperty("project.collectedProjects.size")); - assertEquals(Arrays.asList(new String[] {}), getProjects(props)); - } - - private List getProjects(Properties props) { - List projects = new ArrayList<>(); - - for (Object o : props.keySet()) { - String key = o.toString(); - if (key.startsWith("project.collectedProjects.") && !key.endsWith(".size")) { - projects.add(props.getProperty(key)); - } - } - - Collections.sort(projects); - - return projects; - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0249ResolveDepsFromReactorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0249ResolveDepsFromReactorTest.java deleted file mode 100644 index edbc5b841..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0249ResolveDepsFromReactorTest.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-249. - * - * @author Brett Porter - * - */ -public class MavenITmng0249ResolveDepsFromReactorTest extends AbstractMavenIntegrationTestCase { - public MavenITmng0249ResolveDepsFromReactorTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that the reactor can establish the artifact location of known projects for dependencies. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG0249() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0249"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List ccp = verifier.loadLines("test-component-c/target/compile.txt", "UTF-8"); - assertTrue(ccp.toString(), ccp.contains("test-component-c/classes")); - assertTrue(ccp.toString(), ccp.contains("test-component-b/classes")); - assertTrue(ccp.toString(), ccp.contains("test-component-a/classes")); - - List rcp = verifier.loadLines("test-component-c/target/runtime.txt", "UTF-8"); - assertTrue(rcp.toString(), rcp.contains("test-component-c/classes")); - assertTrue(rcp.toString(), rcp.contains("test-component-b/classes")); - assertTrue(rcp.toString(), rcp.contains("test-component-a/classes")); - - List tcp = verifier.loadLines("test-component-c/target/test.txt", "UTF-8"); - assertTrue(tcp.toString(), tcp.contains("test-component-c/classes")); - assertTrue(tcp.toString(), tcp.contains("test-component-b/classes")); - assertTrue(tcp.toString(), tcp.contains("test-component-a/classes")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0282NonReactorExecWhenProjectIndependentTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0282NonReactorExecWhenProjectIndependentTest.java deleted file mode 100644 index 9f02ad1c6..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0282NonReactorExecWhenProjectIndependentTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-282. - * - * @author John Casey - * - */ -public class MavenITmng0282NonReactorExecWhenProjectIndependentTest extends AbstractMavenIntegrationTestCase { - public MavenITmng0282NonReactorExecWhenProjectIndependentTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test non-reactor behavior when plugin declares "@requiresProject false" - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG282() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0282"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("subproject/target"); - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-no-project:light-touch"); - verifier.execute(); - verifier.verifyFilePresent("target/touch.txt"); - verifier.verifyFileNotPresent("subproject/target/touch.txt"); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0294MergeGlobalAndUserSettingsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0294MergeGlobalAndUserSettingsTest.java deleted file mode 100644 index 3ec17fbd9..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0294MergeGlobalAndUserSettingsTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-294. - * - * @author John Casey - * - */ -public class MavenITmng0294MergeGlobalAndUserSettingsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng0294MergeGlobalAndUserSettingsTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test merging of global- and user-level settings.xml files. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG294() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0294"); - - Verifier verifier = new Verifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("user-settings.xml"); - // dedicated CLI option only available since MNG-3914 - verifier.addCliArgument("--global-settings"); - verifier.addCliArgument("global-settings.xml"); - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-touch:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/test.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0377PluginLookupFromPrefixTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0377PluginLookupFromPrefixTest.java deleted file mode 100644 index 49538bf47..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0377PluginLookupFromPrefixTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-377. - * - * @author John Casey - * - */ -public class MavenITmng0377PluginLookupFromPrefixTest extends AbstractMavenIntegrationTestCase { - public MavenITmng0377PluginLookupFromPrefixTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test usage of plugins.xml mapping file on the repository to resolve plugin artifactId from its prefix using the - * pluginGroups in the provided settings.xml. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG377() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0377"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng0377"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("-Dtouch.outputFile=target/file.txt"); - verifier.addCliArgument("itprefix:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/file.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0449PluginVersionResolutionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0449PluginVersionResolutionTest.java deleted file mode 100644 index 797fbbb8a..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0449PluginVersionResolutionTest.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-449. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng0449PluginVersionResolutionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng0449PluginVersionResolutionTest() { - super("[2.0,)"); - } - - /** - * Verify that versions for plugins are automatically resolved if not given in the POM by checking first LATEST and - * then RELEASE in the repo metadata when the plugin is invoked from the lifecycle. - * - * @throws Exception in case of failure - */ - @Test - public void testitLifecycleInvocation() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0449"); - testDir = new File(testDir, "lifecycle"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - try { - verifier.deleteArtifacts("org.apache.maven.its.mng0449"); - } catch (Exception e) { - // when we run Maven embedded, the plugin class realm locks the artifacts so we can't delete them - } - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("../settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // Maven 3.x prefers RELEASE over LATEST (see MNG-4206) - if (matchesVersionRange("(,3.0-alpha-3)")) { - verifier.verifyFileNotPresent("target/touch-release.txt"); - verifier.verifyFilePresent("target/touch-snapshot.txt"); - } else { - verifier.verifyFilePresent("target/touch-release.txt"); - verifier.verifyFileNotPresent("target/touch-snapshot.txt"); - } - verifier.verifyFilePresent("target/package.txt"); - } - - /** - * Verify that versions for plugins are automatically resolved if not given in the POM by checking LATEST and - * RELEASE in the repo metadata when the plugin is invoked directly from the command line. - * - * @throws Exception in case of failure - */ - @Test - public void testitCliInvocation() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0449"); - testDir = new File(testDir, "direct"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - try { - verifier.deleteArtifacts("org.apache.maven.its.mng0449"); - } catch (Exception e) { - // when we run Maven embedded, the plugin class realm locks the artifacts so we can't delete them - } - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("../settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("org.apache.maven.its.mng0449:maven-it-plugin-a:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // Maven 3.x prefers RELEASE over LATEST (see MNG-4206) - if (matchesVersionRange("(,3.0-alpha-3)")) { - verifier.verifyFileNotPresent("target/touch-release.txt"); - verifier.verifyFilePresent("target/touch-snapshot.txt"); - } else { - verifier.verifyFilePresent("target/touch-release.txt"); - verifier.verifyFileNotPresent("target/touch-snapshot.txt"); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0461TolerateMissingDependencyPomTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0461TolerateMissingDependencyPomTest.java deleted file mode 100644 index f8dbeb33c..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0461TolerateMissingDependencyPomTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-461. - * - * @author Benjamin Bentmann - */ -public class MavenITmng0461TolerateMissingDependencyPomTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng0461TolerateMissingDependencyPomTest() { - super("[2.0.3,3.0-alpha-1),[3.0-alpha-2,)"); - } - - /** - * Verify that dependency resolution only warns in case of missing dependency POMs but does not fail. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0461"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng0461"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List classpath = verifier.loadLines("target/classpath.txt", "UTF-8"); - assertTrue(classpath.toString(), classpath.contains("dep-0.1.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0469ReportConfigTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0469ReportConfigTest.java deleted file mode 100644 index 023083e31..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0469ReportConfigTest.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-469. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng0469ReportConfigTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng0469ReportConfigTest() { - super("[2.0.0,)"); - } - - /** - * Test that {@code } configuration dominates {@code } configuration for build goals. - * - * @throws Exception in case of failure - */ - @Test - public void testitBuildConfigDominantDuringBuild() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0469/test1"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.deleteDirectory("target"); - verifier.setAutoclean(false); - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-configuration:2.1-SNAPSHOT:config"); - verifier.execute(); - verifier.verifyFilePresent("target/build.txt"); - verifier.verifyFileNotPresent("target/reporting.txt"); - verifier.verifyErrorFreeLog(); - } - - /** - * Test that {@code } configuration does not affect report goals. - * - * @throws Exception in case of failure - */ - @Test - public void testitBuildConfigIrrelevantForReports() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0469/test2"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - verifier.deleteDirectory("target"); - verifier.setAutoclean(false); - if (matchesVersionRange("(,3.0-alpha-1)")) { - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-site:2.1-SNAPSHOT:generate"); - verifier.execute(); - verifier.verifyFilePresent("target/site/info.properties"); - } else { - verifier.addCliArgument("validate"); - verifier.execute(); - Properties props = verifier.loadProperties("target/config.properties"); - assertEquals("maven-it-plugin-site", props.getProperty("project.reporting.plugins.0.artifactId")); - assertNotEquals( - "fail.properties", - props.getProperty("project.reporting.plugins.0.configuration.children.infoFile.0.value")); - } - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0471CustomLifecycleTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0471CustomLifecycleTest.java deleted file mode 100644 index 5deef8815..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0471CustomLifecycleTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-471. - * - * @author Brett Porter - * - */ -public class MavenITmng0471CustomLifecycleTest extends AbstractMavenIntegrationTestCase { - public MavenITmng0471CustomLifecycleTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test @execute with a custom lifecycle, including configuration - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG471() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0471"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArguments( - "org.apache.maven.its.plugins:maven-it-plugin-fork:fork", - "org.apache.maven.its.plugins:maven-it-plugin-fork:fork-goal"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/forked/touch.txt"); - verifier.verifyFilePresent("target/forked2/touch.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0479OverrideCentralRepoTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0479OverrideCentralRepoTest.java deleted file mode 100644 index 256c9c4ad..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0479OverrideCentralRepoTest.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-479. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng0479OverrideCentralRepoTest extends AbstractMavenIntegrationTestCase { - public MavenITmng0479OverrideCentralRepoTest() { - super("[2.0.3,3.0-alpha-1),[3.0-beta-3,)"); - } - - /** - * Verify that using the same repo id allows to override "central". This test checks the effective model. - * - * @throws Exception in case of failure - */ - @Test - public void testitModel() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0479"); - - // Phase 1: Ensure the test plugin is downloaded before the test cuts off access to central - File child1 = new File(testDir, "setup"); - Verifier verifier = newVerifier(child1.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-expression:2.1-SNAPSHOT:eval"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // Phase 2: Now run the test - File child2 = new File(testDir, "test"); - verifier = newVerifier(child2.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-expression:2.1-SNAPSHOT:eval"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/expression.properties"); - Properties props = verifier.loadProperties("target/expression.properties"); - - int count = Integer.parseInt(props.getProperty("project.repositories", "0")); - assertTrue(count > 0); - for (int i = 0; i < count; i++) { - String key = "project.repositories." + i; - if ("central".equals(props.getProperty(key + ".id"))) { - assertEquals("mng-0479", props.getProperty(key + ".name")); - assertTrue(props.getProperty(key + ".url").endsWith("/target/mng-0479")); - - assertEquals("false", props.getProperty(key + ".releases.enabled")); - assertEquals("ignore", props.getProperty(key + ".releases.checksumPolicy")); - assertEquals("always", props.getProperty(key + ".releases.updatePolicy")); - - assertEquals("true", props.getProperty(key + ".snapshots.enabled")); - assertEquals("fail", props.getProperty(key + ".snapshots.checksumPolicy")); - assertEquals("never", props.getProperty(key + ".snapshots.updatePolicy")); - } - } - - count = Integer.parseInt(props.getProperty("project.pluginRepositories", "0")); - for (int i = 0; i < count; i++) { - String key = "project.pluginRepositories." + i; - if ("central".equals(props.getProperty(key + ".id"))) { - assertEquals("mng-0479", props.getProperty(key + ".name")); - assertTrue(props.getProperty(key + ".url").endsWith("/target/mng-0479")); - - assertEquals("false", props.getProperty(key + ".releases.enabled")); - assertEquals("ignore", props.getProperty(key + ".releases.checksumPolicy")); - assertEquals("always", props.getProperty(key + ".releases.updatePolicy")); - - assertEquals("true", props.getProperty(key + ".snapshots.enabled")); - assertEquals("fail", props.getProperty(key + ".snapshots.checksumPolicy")); - assertEquals("never", props.getProperty(key + ".snapshots.updatePolicy")); - } - } - } - - /** - * Verify that using the same repo id allows to override "central". This test checks the actual repo access. - * - * @throws Exception in case of failure - */ - @Test - public void testitResolution() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0479"); - - Verifier verifier = newVerifier(new File(testDir, "test-1").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng0479"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch.txt"); - verifier.verifyArtifactPresent("org.apache.maven.its.mng0479", "parent", "0.1-SNAPSHOT", "pom"); - verifier.verifyArtifactPresent("org.apache.maven.its.mng0479", "a", "0.1-SNAPSHOT", "jar"); - verifier.verifyArtifactPresent("org.apache.maven.its.mng0479", "a", "0.1-SNAPSHOT", "pom"); - verifier.verifyArtifactPresent("org.apache.maven.its.mng0479", "a-parent", "0.1-SNAPSHOT", "pom"); - verifier.verifyArtifactPresent("org.apache.maven.its.mng0479", "b", "0.1-SNAPSHOT", "jar"); - verifier.verifyArtifactPresent("org.apache.maven.its.mng0479", "b", "0.1-SNAPSHOT", "pom"); - - verifier = newVerifier(new File(testDir, "test-2").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Build should have failed to resolve parent POM"); - } catch (VerificationException e) { - // expected - } - - verifier.verifyArtifactNotPresent("org.apache.maven.its.mng0479", "parent", "0.1", "pom"); - - verifier = newVerifier(new File(testDir, "test-3").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - try { - verifier.addCliArgument("org.apache.maven.its.mng0479:maven-mng0479-plugin:0.1-SNAPSHOT:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Build should have failed to resolve direct dependency"); - } catch (VerificationException e) { - // expected - } - - verifier.verifyArtifactNotPresent("org.apache.maven.its.mng0479", "a", "0.1", "jar"); - verifier.verifyArtifactNotPresent("org.apache.maven.its.mng0479", "a", "0.1", "pom"); - - verifier = newVerifier(new File(testDir, "test-4").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - try { - verifier.addCliArgument("org.apache.maven.its.mng0479:maven-mng0479-plugin:0.1-SNAPSHOT:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Build should have failed to resolve transitive dependency"); - } catch (VerificationException e) { - // expected - } - - verifier.verifyArtifactNotPresent("org.apache.maven.its.mng0479", "b", "0.1", "jar"); - verifier.verifyArtifactNotPresent("org.apache.maven.its.mng0479", "b", "0.1", "pom"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0496IgnoreUnknownPluginParametersTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0496IgnoreUnknownPluginParametersTest.java deleted file mode 100644 index 9b156f3e0..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0496IgnoreUnknownPluginParametersTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-496. - * - * @author John Casey - * - */ -public class MavenITmng0496IgnoreUnknownPluginParametersTest extends AbstractMavenIntegrationTestCase { - public MavenITmng0496IgnoreUnknownPluginParametersTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that unused configuration parameters from the POM don't cause the - * mojo to fail...they will show up as warnings in the -X output instead. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG496() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0496"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-log-file:2.1-SNAPSHOT:reset"); - verifier.execute(); - verifier.verifyFilePresent("target/file.txt"); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0505VersionRangeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0505VersionRangeTest.java deleted file mode 100644 index 676633f5f..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0505VersionRangeTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Collection; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-505. - * - * @author Brett Porter - * - */ -public class MavenITmng0505VersionRangeTest extends AbstractMavenIntegrationTestCase { - /** - * Oleg 2009.04.30: the same functionality but simpler - no multiple ranges - syntax - * is tested in MNG-4150 - */ - public MavenITmng0505VersionRangeTest() { - super("(,3.0-alpha-1),[3.0-alpha-3,)"); - } - - /** - * Test version range support. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG505() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0505"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng0505"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Collection artifacts = verifier.loadLines("target/artifacts.txt", "UTF-8"); - assertEquals(4, artifacts.size()); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng0505:a:jar:1.1")); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng0505:b:jar:1.0")); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng0505:c:jar:3.8")); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng0505:d:jar:2.1.1")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0507ArtifactRelocationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0507ArtifactRelocationTest.java deleted file mode 100644 index f5d626548..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0507ArtifactRelocationTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-507. - * - * @author Brett Porter - * - */ -public class MavenITmng0507ArtifactRelocationTest extends AbstractMavenIntegrationTestCase { - public MavenITmng0507ArtifactRelocationTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test artifact relocation. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG507() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0507"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven", "maven-core-it-support", "1.1"); - verifier.deleteArtifacts("org.apache.maven", "maven-core-it-support-old-location", "1.1"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven", "maven-core-it-support", "1.1", "jar"); - verifier.verifyArtifactPresent("org.apache.maven", "maven-core-it-support", "1.1", "pom"); - verifier.verifyArtifactPresent("org.apache.maven", "maven-core-it-support-old-location", "1.1", "pom"); - verifier.verifyArtifactNotPresent("org.apache.maven", "maven-core-it-support-old-location", "1.1", "jar"); - - List artifacts = verifier.loadLines("target/artifacts.txt", "UTF-8"); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven:maven-core-it-support:jar:1.1")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0522InheritedPluginMgmtConfigTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0522InheritedPluginMgmtConfigTest.java deleted file mode 100644 index 096c46291..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0522InheritedPluginMgmtConfigTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-522. - * - * @author John Casey - * - */ -public class MavenITmng0522InheritedPluginMgmtConfigTest extends AbstractMavenIntegrationTestCase { - public MavenITmng0522InheritedPluginMgmtConfigTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test for injection of inherited plugin management into plugin configuration. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG522() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0522"); - - Verifier verifier = newVerifier(new File(testDir, "child-project").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("process-resources"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/plugin-mngt-config-1.txt"); - verifier.verifyFilePresent("target/plugin-mngt-config-2.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0553SettingsAuthzEncryptionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0553SettingsAuthzEncryptionTest.java deleted file mode 100644 index b360619d4..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0553SettingsAuthzEncryptionTest.java +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.security.ConstraintMapping; -import org.eclipse.jetty.security.ConstraintSecurityHandler; -import org.eclipse.jetty.security.HashLoginService; -import org.eclipse.jetty.security.UserStore; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.DefaultHandler; -import org.eclipse.jetty.server.handler.HandlerList; -import org.eclipse.jetty.server.handler.ResourceHandler; -import org.eclipse.jetty.util.security.Constraint; -import org.eclipse.jetty.util.security.Password; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.eclipse.jetty.util.security.Constraint.__BASIC_AUTH; - -/** - * This is a test set for MNG-553. - * - * @author Benjamin Bentmann - */ -public class MavenITmng0553SettingsAuthzEncryptionTest extends AbstractMavenIntegrationTestCase { - - private File testDir; - - private Server server; - - private int port; - - public MavenITmng0553SettingsAuthzEncryptionTest() { - super("[2.1.0,3.0-alpha-1),[3.0-alpha-3,)"); - } - - @BeforeEach - protected void setUp() throws Exception { - testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0553"); - - Constraint constraint = new Constraint(__BASIC_AUTH, "user"); - constraint.setAuthenticate(true); - - ConstraintMapping constraintMapping = new ConstraintMapping(); - constraintMapping.setConstraint(constraint); - constraintMapping.setPathSpec("/*"); - - HashLoginService userRealm = new HashLoginService("TestRealm"); - UserStore userStore = new UserStore(); - userStore.addUser("testuser", new Password("testtest"), new String[] {"user"}); - userRealm.setUserStore(userStore); - - server = new Server(0); - ConstraintSecurityHandler securityHandler = new ConstraintSecurityHandler(); - securityHandler.setLoginService(userRealm); - securityHandler.setAuthMethod(__BASIC_AUTH); - securityHandler.setConstraintMappings(new ConstraintMapping[] {constraintMapping}); - - ResourceHandler repoHandler = new ResourceHandler(); - repoHandler.setResourceBase(new File(testDir, "repo").getAbsolutePath()); - - HandlerList handlerList = new HandlerList(); - handlerList.addHandler(securityHandler); - handlerList.addHandler(repoHandler); - handlerList.addHandler(new DefaultHandler()); - - server.setHandler(handlerList); - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + port); - } - - @AfterEach - protected void tearDown() throws Exception { - if (server != null) { - server.stop(); - server.join(); - } - } - - /** - * Test that the encrypted auth infos given in the settings.xml are decrypted. - * - * @throws Exception in case of failure - */ - @Test - public void testitBasic() throws Exception { - testDir = new File(testDir, "test-1"); - - Map filterProps = new HashMap<>(); - filterProps.put("@port@", Integer.toString(port)); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng0553"); - verifier.verifyArtifactNotPresent("org.apache.maven.its.mng0553", "a", "0.1-SNAPSHOT", "jar"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - ItUtils.setUserHome(verifier, new File(testDir, "userhome")); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng0553", "a", "0.1-SNAPSHOT", "jar"); - } - - /** - * Test that the encrypted auth infos given in the settings.xml are decrypted when the master password resides - * in an external file. - * - * @throws Exception in case of failure - */ - @Test - public void testitRelocation() throws Exception { - testDir = new File(testDir, "test-2"); - - Map filterProps = new HashMap<>(); - filterProps.put("@port@", Integer.toString(port)); - // NOTE: The upper-case scheme name is essential part of the test - String secUrl = "FILE://" - + new File(testDir, "relocated-settings-security.xml").toURI().getRawPath(); - filterProps.put("@relocation@", secUrl); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng0553"); - verifier.verifyArtifactNotPresent("org.apache.maven.its.mng0553", "a", "0.1-SNAPSHOT", "jar"); - - // NOTE: The tilde ~ in the file name is essential part of the test - verifier.filterFile("security-template.xml", "settings~security.xml", "UTF-8", filterProps); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - // NOTE: The selection of the Turkish language for the JVM locale is essential part of the test - verifier.setEnvironmentVariable( - "MAVEN_OPTS", - "-Dsettings.security=" + new File(testDir, "settings~security.xml").getAbsolutePath() - + " -Duser.language=tr"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng0553", "a", "0.1-SNAPSHOT", "jar"); - } - - /** - * Test that the CLI supports generation of encrypted (master) passwords. - * - * @throws Exception in case of failure - */ - @Test - public void testitEncryption() throws Exception { - requiresMavenVersion("[2.1.0,3.0-alpha-1),[3.0-alpha-7,)"); - - testDir = new File(testDir, "test-3"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - ItUtils.setUserHome(verifier, new File(testDir, "userhome")); - verifier.addCliArgument("--encrypt-master-password"); - verifier.addCliArgument("test"); - verifier.setLogFileName("log-emp.txt"); - verifier.addCliArgument("-e"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List log = verifier.loadLines(verifier.getLogFileName(), null); - assertNotNull(findPassword(log)); - - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - ItUtils.setUserHome(verifier, new File(testDir, "userhome")); - verifier.addCliArgument("--encrypt-password"); - verifier.addCliArgument("testpass"); - verifier.setLogFileName("log-ep.txt"); - verifier.addCliArgument("-e"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - log = verifier.loadLines(verifier.getLogFileName(), null); - assertNotNull(findPassword(log)); - } - - private String findPassword(List log) { - for (String line : log) { - if (line.matches(".*\\{[A-Za-z0-9+/=]+\\}.*")) { - return line; - } - } - - return null; - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0557UserSettingsCliOptionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0557UserSettingsCliOptionTest.java deleted file mode 100644 index 6f8047405..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0557UserSettingsCliOptionTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-557. - * - * @author John Casey - * - */ -public class MavenITmng0557UserSettingsCliOptionTest extends AbstractMavenIntegrationTestCase { - public MavenITmng0557UserSettingsCliOptionTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test --settings CLI option - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG557() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0557"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-touch:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/test.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0612NewestConflictResolverTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0612NewestConflictResolverTest.java deleted file mode 100644 index d0d0a6947..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0612NewestConflictResolverTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-612. - * - * @author Mark Hobson - * - */ -@Disabled -public class MavenITmng0612NewestConflictResolverTest extends AbstractMavenIntegrationTestCase { - public MavenITmng0612NewestConflictResolverTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that ensures the newest-wins conflict resolver is used. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG612() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0612/dependency"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0612/plugin"); - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0612/project"); - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("verify"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0666IgnoreLegacyPomTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0666IgnoreLegacyPomTest.java deleted file mode 100644 index dfc9b2c90..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0666IgnoreLegacyPomTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-666. - * - * @author John Casey - * - */ -public class MavenITmng0666IgnoreLegacyPomTest extends AbstractMavenIntegrationTestCase { - public MavenITmng0666IgnoreLegacyPomTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that maven-1 POMs will be ignored but not stop the resolution - * process. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG666() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0666"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.it0059"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - // don't verify error free log - - verifier.verifyArtifactPresent("org.apache.maven.its.it0059", "test", "3.8.1", "jar"); - - List artifacts = verifier.loadLines("target/artifacts.txt", "UTF-8"); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.it0059:test:jar:3.8.1")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0674PluginParameterAliasTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0674PluginParameterAliasTest.java deleted file mode 100644 index 68c478045..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0674PluginParameterAliasTest.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-674 and - * MNG-4997. - * - * @author John Casey - * - */ -public class MavenITmng0674PluginParameterAliasTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng0674PluginParameterAliasTest() { - super("[3.0,)"); - } - - /** - * Test parameter alias usage for lifecycle-bound goal execution. - * - * @throws Exception in case of failure - */ - @Test - public void testitLifecycle() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0674"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.setLogFileName("log-lifecycle.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/config.properties"); - assertEquals("MNG-674-1", props.getProperty("aliasParam")); - assertEquals("MNG-674-2", props.getProperty("aliasDefaultExpressionParam")); - assertEquals("MNG-4997", props.getProperty("aliasStringParams.0")); - } - - /** - * Test parameter alias usage for direct goal execution from CLI. - * - * @throws Exception in case of failure - */ - @Test - public void testitCli() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0674"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.setLogFileName("log-cli.txt"); - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-configuration:config"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/config.properties"); - assertEquals("MNG-674-1", props.getProperty("aliasParam")); - assertEquals("MNG-674-2", props.getProperty("aliasDefaultExpressionParam")); - assertEquals("MNG-4997", props.getProperty("aliasStringParams.0")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0680ParentBasedirTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0680ParentBasedirTest.java deleted file mode 100644 index 15373739b..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0680ParentBasedirTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-680. - * - * @author Brett Porter - * - */ -public class MavenITmng0680ParentBasedirTest extends AbstractMavenIntegrationTestCase { - public MavenITmng0680ParentBasedirTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that the basedir of the parent is set correctly. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG680() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0680"); - - testDir = testDir.getCanonicalFile(); - - File subDir = new File(testDir, "subproject"); - - Verifier verifier = newVerifier(subDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/basedir.properties"); - assertEquals(subDir, new File(props.getProperty("project.basedir"))); - assertEquals(testDir, new File(props.getProperty("project.parent.basedir"))); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0761MissingSnapshotDistRepoTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0761MissingSnapshotDistRepoTest.java deleted file mode 100644 index 78cbe1bcc..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0761MissingSnapshotDistRepoTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-761. - * - * @author Brett Porter - * - */ -public class MavenITmng0761MissingSnapshotDistRepoTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng0761MissingSnapshotDistRepoTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that a deployment of a snapshot falls back to a non-snapshot repository if no snapshot repository is - * specified. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG761() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0761"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng0761"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/repo/org/apache/maven/its/mng0761/test/1.0-SNAPSHOT/test-1.0-*.jar"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0768OfflineModeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0768OfflineModeTest.java deleted file mode 100644 index 4b6689b3b..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0768OfflineModeTest.java +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import java.io.File; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Properties; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.server.Handler; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.AbstractHandler; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-768. - * - * @author John Casey - * - */ -public class MavenITmng0768OfflineModeTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng0768OfflineModeTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test offline mode. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG768() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0768"); - - final List requestedUris = Collections.synchronizedList(new ArrayList<>()); - - Handler repoHandler = new AbstractHandler() { - public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) - throws IOException { - System.out.println("Handling " + request.getMethod() + " " + request.getRequestURL()); - - requestedUris.add(request.getRequestURI()); - - PrintWriter writer = response.getWriter(); - - response.setStatus(HttpServletResponse.SC_OK); - - if (request.getRequestURI().endsWith(".pom")) { - writer.println(""); - writer.println(" 4.0.0"); - writer.println(" org.apache.maven.its.mng0768"); - writer.println(" dep"); - writer.println(" 0.1"); - writer.println(""); - } else if (request.getRequestURI().endsWith(".jar")) { - writer.println("empty"); - } else if (request.getRequestURI().endsWith(".md5") - || request.getRequestURI().endsWith(".sha1")) { - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - } - - ((Request) request).setHandled(true); - } - }; - - Server server = new Server(0); - server.setHandler(repoHandler); - - try { - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - - int port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - - { - // phase 1: run build in online mode to fill local repo - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng0768"); - verifier.setLogFileName("log1.txt"); - Properties props = new Properties(); - props.put("@port@", Integer.toString(port)); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", props); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument( - "org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution:2.1-SNAPSHOT:compile"); - verifier.execute(); - verifier.verifyFilePresent("target/compile.txt"); - verifier.verifyErrorFreeLog(); - } - - requestedUris.clear(); - - { - // phase 2: run build in offline mode to check it still passes, without network accesses - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-o"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.setLogFileName("log2.txt"); - verifier.addCliArgument( - "org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution:2.1-SNAPSHOT:compile"); - verifier.execute(); - verifier.verifyFilePresent("target/compile.txt"); - verifier.verifyErrorFreeLog(); - } - - assertTrue(requestedUris.toString(), requestedUris.isEmpty()); - - { - // phase 3: delete test artifact and run build in offline mode to check it fails now - // NOTE: Adding the settings again to offer Maven the bad choice of using the remote repo - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng0768"); - verifier.addCliArgument("-o"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.setLogFileName("log3.txt"); - try { - verifier.addCliArgument( - "org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution:2.1-SNAPSHOT:compile"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Build did not fail to resolve missing dependency although Maven ought to work offline!"); - } catch (VerificationException e) { - // expected, should fail - } - } - - System.out.println("Bound server socket to the port " + port); - - assertTrue(requestedUris.toString(), requestedUris.isEmpty()); - } finally { - server.stop(); - server.join(); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0773SettingsProfileReactorPollutionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0773SettingsProfileReactorPollutionTest.java deleted file mode 100644 index 70380b77f..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0773SettingsProfileReactorPollutionTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-773. - * - * @author John Casey - * - */ -public class MavenITmng0773SettingsProfileReactorPollutionTest extends AbstractMavenIntegrationTestCase { - public MavenITmng0773SettingsProfileReactorPollutionTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that profiles from settings.xml do not pollute module lists across projects in a reactorized build. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG773() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0773"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0781PluginConfigVsExecConfigTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0781PluginConfigVsExecConfigTest.java deleted file mode 100644 index 5f710a1f5..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0781PluginConfigVsExecConfigTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-781. - * - * @author John Casey - * - */ -public class MavenITmng0781PluginConfigVsExecConfigTest extends AbstractMavenIntegrationTestCase { - public MavenITmng0781PluginConfigVsExecConfigTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that plugin-level configuration instances are not nullified by - * execution-level configuration instances. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG0781() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0781"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("process-resources"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/exec-level.txt"); - verifier.verifyFilePresent("target/resources-resources.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0786ProfileAwareReactorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0786ProfileAwareReactorTest.java deleted file mode 100644 index 42bbf9525..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0786ProfileAwareReactorTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-786. - * - * @author John Casey - * - */ -public class MavenITmng0786ProfileAwareReactorTest extends AbstractMavenIntegrationTestCase { - public MavenITmng0786ProfileAwareReactorTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that direct invocation of a mojo from the command line still - * results in the processing of modules included via profiles. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG0786() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0786"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("sub1/target"); - verifier.deleteDirectory("sub2/target"); - verifier.addCliArgument("-Dexpression.outputFile=target/expression.properties"); - verifier.addCliArgument("-Dactivate=anything"); - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-expression:2.1-SNAPSHOT:eval"); - verifier.execute(); - verifier.verifyFilePresent("sub1/target/expression.properties"); - verifier.verifyFilePresent("sub2/target/expression.properties"); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0814ExplicitProfileActivationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0814ExplicitProfileActivationTest.java deleted file mode 100644 index 77d54f0cd..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0814ExplicitProfileActivationTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-814. - * - * @author John Casey - * - */ -public class MavenITmng0814ExplicitProfileActivationTest extends AbstractMavenIntegrationTestCase { - public MavenITmng0814ExplicitProfileActivationTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test activation of a profile from the command line. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG814() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0814"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-P"); - verifier.addCliArgument("test-profile"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/profile.properties"); - assertEquals("PASSED", props.getProperty("project.properties.testProp")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0818WarDepsNotTransitiveTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0818WarDepsNotTransitiveTest.java deleted file mode 100644 index 95faf9af0..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0818WarDepsNotTransitiveTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Collection; -import java.util.Collections; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-818. - * - * @author Brett Porter - * - */ -public class MavenITmng0818WarDepsNotTransitiveTest extends AbstractMavenIntegrationTestCase { - public MavenITmng0818WarDepsNotTransitiveTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that depending on a WAR doesn't also get its dependencies transitively. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG0818() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0818"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.it0080"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Collection artifacts = verifier.loadLines("target/artifacts.txt", "UTF-8"); - assertEquals(Collections.singletonList("org.apache.maven.its.it0080:war:war:0.1"), artifacts); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0820ConflictResolutionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0820ConflictResolutionTest.java deleted file mode 100644 index 42f798a83..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0820ConflictResolutionTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Collection; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-820. - * - * @author Brett Porter - * - */ -public class MavenITmng0820ConflictResolutionTest extends AbstractMavenIntegrationTestCase { - public MavenITmng0820ConflictResolutionTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that the collector selecting a particular version gets the correct subtree - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG0820() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0820"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng0820"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Collection artifacts = verifier.loadLines("target/artifacts.txt", "UTF-8"); - assertEquals(3, artifacts.size()); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng0820:d:jar:2.0")); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng0820:c:jar:1.4")); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng0820:a:jar:1.0")); - assertFalse(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng0505:b:jar:1.0")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0823MojoContextPassingTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0823MojoContextPassingTest.java deleted file mode 100644 index be446da28..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0823MojoContextPassingTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-823. - * - * @author John Casey - * - */ -public class MavenITmng0823MojoContextPassingTest extends AbstractMavenIntegrationTestCase { - public MavenITmng0823MojoContextPassingTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Tests context passing between mojos in the same plugin. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG0823() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0823"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArguments( - "org.apache.maven.its.plugins:maven-it-plugin-context-passing:throw", - "org.apache.maven.its.plugins:maven-it-plugin-context-passing:catch"); - verifier.execute(); - verifier.verifyFilePresent("target/thrown-value"); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0828PluginConfigValuesInDebugTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0828PluginConfigValuesInDebugTest.java deleted file mode 100644 index f5b043868..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0828PluginConfigValuesInDebugTest.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.Locale; - -import org.apache.maven.shared.utils.io.FileUtils; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-828. - * - * @author Slawomir Jaranowski - */ -public class MavenITmng0828PluginConfigValuesInDebugTest extends AbstractMavenIntegrationTestCase { - - private static final String NL = System.lineSeparator(); - - public MavenITmng0828PluginConfigValuesInDebugTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that plain plugin configuration values are listed correctly in debug mode. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG0828() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0828"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-X"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - String log = FileUtils.fileRead(new File(verifier.getBasedir(), verifier.getLogFileName())); - - checkLog(log, "[DEBUG] (f) aliasDefaultExpressionParam = test"); - checkLog(log, "[DEBUG] (f) basedir = " + testDir.getCanonicalPath()); - checkLog( - log, - "[DEBUG] (f) beanParam = org.apache.maven.plugin.coreit.Bean[fieldParam=field, setterParam=setter, setterCalled=true]"); - checkLog(log, "[DEBUG] (f) booleanParam = true"); - checkLog(log, "[DEBUG] (f) byteParam = 42"); - checkLog(log, "[DEBUG] (f) byteParam = 42"); - checkLog(log, "[DEBUG] (f) characterParam = X"); - - Date date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S a", Locale.US).parse("2008-11-09 11:59:03.0 AM"); - checkLog(log, "[DEBUG] (f) dateParam = " + date); - - checkLog(log, "[DEBUG] (f) defaultParam = maven-core-it"); - checkLog(log, "[DEBUG] (f) defaultParamWithExpression = org.apache.maven.its.mng0828:test1:1.0-SNAPSHOT"); - - // new line of dumping dom is not guaranteed, but all items should be present - checkLog(log, "[DEBUG] (f) domParam = one"); - checkLog(log, "two"); - checkLog(log, "three"); - checkLog(log, "four"); - checkLog(log, ""); - - checkLog(log, "[DEBUG] (f) doubleParam = -1.5"); - checkLog(log, "[DEBUG] (f) fieldParam = field"); - checkLog(log, "[DEBUG] (f) fileParam = " + new File(testDir, "pom.xml").getCanonicalPath()); - checkLog(log, "[DEBUG] (f) floatParam = 0.0"); - checkLog(log, "[DEBUG] (f) integerParam = 0"); - checkLog(log, "[DEBUG] (f) listParam = [one, two, three, four]"); - checkLog(log, "[DEBUG] (f) longParam = 9876543210"); - - // Map items order is not guaranteed, so only check begin of params ... - checkLog(log, "[DEBUG] (f) mapParam = {key"); - checkLog( - log, - "[DEBUG] (f) propertiesFile = " - + new File(testDir, "target/plugin-config.properties").getCanonicalPath()); - - // Properties item order is not guaranteed, so only check begin of params ... - checkLog(log, "[DEBUG] (f) propertiesParam = {key"); - checkLog(log, "[DEBUG] (f) setParam = [item]"); - checkLog(log, "[DEBUG] (f) shortParam = -12345"); - checkLog(log, "[DEBUG] (f) stringParam = Hello World!"); - checkLog(log, "[DEBUG] (f) stringParams = [one, two, three, four]"); - checkLog(log, "[DEBUG] (f) urlParam = http://maven.apache.org/"); - checkLog(log, "[DEBUG] (s) setterParam = setter"); - } - - private void checkLog(String log, String expected) { - assertTrue( - NL + ">>>" + NL + log + "<<<" + NL + NL + "does not contains: " + NL + expected + NL, - log.contains(expected)); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0836PluginParentResolutionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0836PluginParentResolutionTest.java deleted file mode 100644 index fc9e9f2f8..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0836PluginParentResolutionTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-836. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng0836PluginParentResolutionTest extends AbstractMavenIntegrationTestCase { - public MavenITmng0836PluginParentResolutionTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that parent POMs referenced by a plugin POM can be resolved from ordinary repos, i.e. non-plugin repos. - * As a motivation for this, imagine the plugin repository hosts only snapshots while the ordinary repository - * hosts releases and a snapshot plugin might easily use a released parent. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG836() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0836"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng836"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - // Maven 3.x aims to separate plugins and project dependencies (MNG-4191) - if (matchesVersionRange("(,3.0-alpha-1),(3.0-alpha-1,3.0-alpha-7)")) { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } else { - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Plugin parent POM was erroneously resolved from non-plugin repository."); - } catch (VerificationException e) { - // expected - } - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0848UserPropertyOverridesDefaultValueTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0848UserPropertyOverridesDefaultValueTest.java deleted file mode 100644 index 8cb8f4912..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0848UserPropertyOverridesDefaultValueTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-848. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng0848UserPropertyOverridesDefaultValueTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng0848UserPropertyOverridesDefaultValueTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that execution/system properties take precedence over default value of plugin parameters. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG848() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0848"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-Dconfig.aliasDefaultExpressionParam=PASSED"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties configProps = verifier.loadProperties("target/config.properties"); - assertEquals("maven-core-it", configProps.getProperty("defaultParam")); - assertEquals("PASSED", configProps.getProperty("aliasDefaultExpressionParam")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0866EvaluateDefaultValueTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0866EvaluateDefaultValueTest.java deleted file mode 100644 index 562c6412b..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0866EvaluateDefaultValueTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-866 and - * MNG-160. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng0866EvaluateDefaultValueTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng0866EvaluateDefaultValueTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that expressions inside the default value of plugin parameters are evaluated. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG866() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0866"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties configProps = verifier.loadProperties("target/config.properties"); - assertEquals("maven-core-it", configProps.getProperty("defaultParam")); - assertEquals( - "org.apache.maven.its.mng0866:test:1.0-SNAPSHOT", - configProps.getProperty("defaultParamWithExpression")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0870ReactorAwarePluginDiscoveryTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0870ReactorAwarePluginDiscoveryTest.java deleted file mode 100644 index 522d9a015..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0870ReactorAwarePluginDiscoveryTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-870. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng0870ReactorAwarePluginDiscoveryTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng0870ReactorAwarePluginDiscoveryTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that the reactor can resolve plugins that have just been built by a previous module and are not yet - * installed to the local repo. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG0870() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0870"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("project/target"); - verifier.deleteArtifacts("org.apache.maven.its.mng0870"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("initialize"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("project/target/touch.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0947OptionalDependencyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0947OptionalDependencyTest.java deleted file mode 100644 index 786fe5e8c..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0947OptionalDependencyTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-947. - * - * @author Benjamin Bentmann - */ -public class MavenITmng0947OptionalDependencyTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng0947OptionalDependencyTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that direct optional dependencies are included in the project class paths while transitive optional - * dependencies are excluded. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - // failingMavenVersions("(,3.1.0-alpha-1)"); - - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0947"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng0947"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List compile = verifier.loadLines("target/compile.txt", "UTF-8"); - assertTrue(compile.toString(), compile.contains("org.apache.maven.its.mng0947:d:jar:0.1 (optional)")); - assertTrue(compile.toString(), compile.contains("org.apache.maven.its.mng0947:e:jar:0.1 (optional)")); - assertEquals(2, compile.size()); - - List runtime = verifier.loadLines("target/runtime.txt", "UTF-8"); - assertTrue(runtime.toString(), runtime.contains("org.apache.maven.its.mng0947:c:jar:0.1")); - assertTrue(runtime.toString(), runtime.contains("org.apache.maven.its.mng0947:d:jar:0.1 (optional)")); - assertTrue(runtime.toString(), runtime.contains("org.apache.maven.its.mng0947:e:jar:0.1 (optional)")); - assertEquals(3, runtime.size()); - - List test = verifier.loadLines("target/test.txt", "UTF-8"); - assertTrue(test.toString(), test.contains("org.apache.maven.its.mng0947:c:jar:0.1")); - assertTrue(test.toString(), test.contains("org.apache.maven.its.mng0947:d:jar:0.1 (optional)")); - assertTrue(test.toString(), test.contains("org.apache.maven.its.mng0947:e:jar:0.1 (optional)")); - assertEquals(3, test.size()); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0956ComponentInjectionViaProjectLevelPluginDepTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0956ComponentInjectionViaProjectLevelPluginDepTest.java deleted file mode 100644 index fcbe0fc87..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0956ComponentInjectionViaProjectLevelPluginDepTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-956. - * - * @author Brett Porter - * - */ -public class MavenITmng0956ComponentInjectionViaProjectLevelPluginDepTest extends AbstractMavenIntegrationTestCase { - public MavenITmng0956ComponentInjectionViaProjectLevelPluginDepTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test component injection from project-level plugin dependencies. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG0956() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0956"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng0956"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties apiProps = verifier.loadProperties("target/component.properties"); - assertEquals("true", apiProps.getProperty("org.apache.maven.plugin.coreit.DefaultTestComponent")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0985NonExecutedPluginMgmtGoalsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0985NonExecutedPluginMgmtGoalsTest.java deleted file mode 100644 index a1fbd26a1..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0985NonExecutedPluginMgmtGoalsTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-985. - * - * @author John Casey - * - */ -public class MavenITmng0985NonExecutedPluginMgmtGoalsTest extends AbstractMavenIntegrationTestCase { - public MavenITmng0985NonExecutedPluginMgmtGoalsTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that plugins in pluginManagement aren't included in the build - * unless they are referenced by groupId/artifactId within the plugins - * section of a pom. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG0985() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0985"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("initialize"); - verifier.execute(); - verifier.verifyFileNotPresent("target/unexpected.txt"); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1021EqualAttachmentBuildNumberTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1021EqualAttachmentBuildNumberTest.java deleted file mode 100644 index b282b97e3..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1021EqualAttachmentBuildNumberTest.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-1021. - * - * @author John Casey - * - */ -public class MavenITmng1021EqualAttachmentBuildNumberTest extends AbstractMavenIntegrationTestCase { - public MavenITmng1021EqualAttachmentBuildNumberTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that source attachments have the same build number and timestamp as the main - * artifact when deployed. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG1021() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1021"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("repo"); - verifier.deleteArtifacts("org.apache.maven.its.mng1021"); - verifier.addCliArgument("-Dmaven.experimental.buildconsumer=false"); - verifier.addCliArgument("initialize"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng1021", "test", "1-SNAPSHOT", "pom"); - verifier.verifyArtifactPresent("org.apache.maven.its.mng1021", "test", "1-SNAPSHOT", "jar"); - - String dir = "repo/org/apache/maven/its/mng1021/test/"; - String snapshot = getSnapshotVersion(new File(testDir, dir + "1-SNAPSHOT")); - assertTrue(snapshot, snapshot.endsWith("-1")); - - verifier.verifyFilePresent(dir + "maven-metadata.xml"); - verifier.verifyFilePresent(dir + "maven-metadata.xml.md5"); - verifier.verifyFilePresent(dir + "maven-metadata.xml.sha1"); - verifier.verifyFilePresent(dir + "1-SNAPSHOT/maven-metadata.xml"); - verifier.verifyFilePresent(dir + "1-SNAPSHOT/maven-metadata.xml.md5"); - verifier.verifyFilePresent(dir + "1-SNAPSHOT/maven-metadata.xml.sha1"); - verifier.verifyFilePresent(dir + "1-SNAPSHOT/test-" + snapshot + ".pom"); - verifier.verifyFilePresent(dir + "1-SNAPSHOT/test-" + snapshot + ".pom.md5"); - verifier.verifyFilePresent(dir + "1-SNAPSHOT/test-" + snapshot + ".pom.sha1"); - verifier.verifyFilePresent(dir + "1-SNAPSHOT/test-" + snapshot + ".jar"); - verifier.verifyFilePresent(dir + "1-SNAPSHOT/test-" + snapshot + ".jar.md5"); - verifier.verifyFilePresent(dir + "1-SNAPSHOT/test-" + snapshot + ".jar.sha1"); - verifier.verifyFilePresent(dir + "1-SNAPSHOT/test-" + snapshot + "-it.jar"); - verifier.verifyFilePresent(dir + "1-SNAPSHOT/test-" + snapshot + "-it.jar.md5"); - verifier.verifyFilePresent(dir + "1-SNAPSHOT/test-" + snapshot + "-it.jar.sha1"); - } - - private String getSnapshotVersion(File artifactDir) { - File[] files = artifactDir.listFiles(); - for (File file : files) { - String name = file.getName(); - if (name.endsWith(".pom")) { - return name.substring("test-".length(), name.length() - ".pom".length()); - } - } - throw new IllegalStateException("POM not found in " + artifactDir); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1052PluginMgmtConfigTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1052PluginMgmtConfigTest.java deleted file mode 100644 index 0582fce93..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1052PluginMgmtConfigTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-1052. - * - * @author John Casey - * - */ -public class MavenITmng1052PluginMgmtConfigTest extends AbstractMavenIntegrationTestCase { - public MavenITmng1052PluginMgmtConfigTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that configuration for a lifecycle-bound plugin is injected from - * PluginManagement section even when it's not explicitly defined in the - * plugins section. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG1052() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1052"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("process-resources"); - verifier.execute(); - verifier.verifyFilePresent("target/plugin-management.txt"); - verifier.verifyFileNotPresent("target/resources-resources.txt"); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1073AggregatorForksReactorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1073AggregatorForksReactorTest.java deleted file mode 100644 index abbde7041..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1073AggregatorForksReactorTest.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-1073. - * - * @author Benjamin Bentmann - */ -public class MavenITmng1073AggregatorForksReactorTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng1073AggregatorForksReactorTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that aggregator mojos invoked from the CLI that fork the lifecycle do so for the entire reactor. - * - * @throws Exception in case of failure - */ - @Test - public void testitForkLifecycle() throws Exception { - // excluded 2.1.x and 2.2.x due to MNG-4325 - requiresMavenVersion("[2.0,2.1.0),[3.0-alpha-3,)"); - - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1073"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("sub-1/target"); - verifier.deleteDirectory("sub-2/target"); - verifier.setLogFileName("log-lifecycle.txt"); - verifier.addCliArgument( - "org.apache.maven.its.plugins:maven-it-plugin-fork:2.1-SNAPSHOT:fork-lifecycle-aggregator"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/forked/touch.txt"); - verifier.verifyFilePresent("sub-1/target/forked/touch.txt"); - verifier.verifyFilePresent("sub-2/target/forked/touch.txt"); - } - - /** - * Verify that aggregator mojos invoked from the CLI that fork a goal do so for the entire reactor. - * - * @throws Exception in case of failure - */ - @Test - public void testitForkGoal() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1073"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("sub-1/target"); - verifier.deleteDirectory("sub-2/target"); - verifier.setLogFileName("log-goal.txt"); - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-fork:2.1-SNAPSHOT:fork-goal-aggregator"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch.txt"); - verifier.verifyFilePresent("sub-1/target/touch.txt"); - verifier.verifyFilePresent("sub-2/target/touch.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1088ReactorPluginResolutionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1088ReactorPluginResolutionTest.java deleted file mode 100644 index e457de456..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1088ReactorPluginResolutionTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-1088. - * - * @author Brett Porter - * - */ -public class MavenITmng1088ReactorPluginResolutionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng1088ReactorPluginResolutionTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that the plugin manager falls back to resolution from the repository if a plugin is part of the reactor - * (i.e. an active project artifact) but the lifecycle has not been executed far enough to produce a file for - * the plugin (i.e. a phase before "compile"). - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG1088() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1088"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("client/target"); - verifier.deleteArtifacts("org.apache.maven.its.mng1088"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - // NOTE: It's essential part of the test to invoke a phase before "compile" - verifier.addCliArgument("initialize"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("client/target/touch.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1142VersionRangeIntersectionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1142VersionRangeIntersectionTest.java deleted file mode 100644 index 91e8fad21..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1142VersionRangeIntersectionTest.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-1142. - * - * @author Benjamin Bentmann - */ -public class MavenITmng1142VersionRangeIntersectionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng1142VersionRangeIntersectionTest() { - super("[2.0.7,3.0-alpha-1),[3.0,)"); - } - - /** - * Verify that user properties from the CLI do not override POM properties of transitive dependencies. - * This variant checks dependency order a, b. - * - * @throws Exception in case of failure - */ - @Test - public void testitAB() throws Exception { - testit("test-ab"); - } - - /** - * Verify that combination of two version ranges doesn't erroneously select an exclusive upper bound. - * This variant checks dependency order b, a. - * - * @throws Exception in case of failure - */ - @Test - public void testitBA() throws Exception { - testit("test-ba"); - } - - private void testit(String project) throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1142"); - - Verifier verifier = newVerifier(new File(testDir, project).getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng1142"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("../settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List classpath = verifier.loadLines("target/classpath.txt", "UTF-8"); - - assertFalse(classpath.toString(), classpath.contains("a-1.1.2.jar")); - assertTrue(classpath.toString(), classpath.contains("a-1.1.1.jar")); - assertTrue(classpath.toString(), classpath.contains("b-0.1.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1144MultipleDefaultGoalsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1144MultipleDefaultGoalsTest.java deleted file mode 100644 index 2b51a3e49..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1144MultipleDefaultGoalsTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-1144. - * - * @author Benjamin Bentmann - */ -public class MavenITmng1144MultipleDefaultGoalsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng1144MultipleDefaultGoalsTest() { - super("[3.0-alpha-7,)"); - } - - /** - * Test that multiple goals can be specified as default goal using whitespace as delimiter. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1144"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/clean-clean.txt"); - verifier.verifyFilePresent("target/resources-resources.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1233WarDepWithProvidedScopeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1233WarDepWithProvidedScopeTest.java deleted file mode 100644 index 2163ebb99..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1233WarDepWithProvidedScopeTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Collection; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-1233. - * - * @author Brett Porter - * - */ -public class MavenITmng1233WarDepWithProvidedScopeTest extends AbstractMavenIntegrationTestCase { - public MavenITmng1233WarDepWithProvidedScopeTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that overriding a transitive compile time dependency as provided in a WAR ensures it is not included. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG1233() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1233"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.it0083"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Collection compileArtifacts = verifier.loadLines("target/compile.txt", "UTF-8"); - assertTrue( - compileArtifacts.toString(), - compileArtifacts.contains("org.apache.maven.its.it0083:direct-dep:jar:0.1")); - assertTrue( - compileArtifacts.toString(), - compileArtifacts.contains("org.apache.maven.its.it0083:trans-dep:jar:0.1")); - - Collection runtimeArtifacts = verifier.loadLines("target/runtime.txt", "UTF-8"); - assertTrue( - runtimeArtifacts.toString(), - runtimeArtifacts.contains("org.apache.maven.its.it0083:direct-dep:jar:0.1")); - assertFalse( - runtimeArtifacts.toString(), - runtimeArtifacts.contains("org.apache.maven.its.it0083:trans-dep:jar:0.1")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1323AntrunDependenciesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1323AntrunDependenciesTest.java deleted file mode 100644 index 888a8d92d..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1323AntrunDependenciesTest.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-1323. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng1323AntrunDependenciesTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng1323AntrunDependenciesTest() { - super("[3.0-alpha-1,)"); - } - - /** - * Verify that project-level plugin dependencies actually apply to the current project only and not the entire - * reactor. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG1323() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1323"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("a/target"); - verifier.deleteDirectory("b/target"); - verifier.deleteDirectory("c/target"); - verifier.deleteArtifacts("org.apache.maven.its.mng1323"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties pclProps; - - pclProps = verifier.loadProperties("target/pcl.properties"); - assertNull(pclProps.getProperty("org.apache.maven.its.mng1323.ClassA")); - assertNull(pclProps.getProperty("org.apache.maven.its.mng1323.ClassB")); - - pclProps = verifier.loadProperties("a/target/pcl.properties"); - assertNotNull(pclProps.getProperty("org.apache.maven.its.mng1323.ClassA")); - assertNull(pclProps.getProperty("org.apache.maven.its.mng1323.ClassB")); - - pclProps = verifier.loadProperties("b/target/pcl.properties"); - assertNull(pclProps.getProperty("org.apache.maven.its.mng1323.ClassA")); - assertNotNull(pclProps.getProperty("org.apache.maven.its.mng1323.ClassB")); - - pclProps = verifier.loadProperties("c/target/pcl.properties"); - assertNull(pclProps.getProperty("org.apache.maven.its.mng1323.ClassA")); - assertNull(pclProps.getProperty("org.apache.maven.its.mng1323.ClassB")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1349ChecksumFormatsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1349ChecksumFormatsTest.java deleted file mode 100644 index 65c670e74..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1349ChecksumFormatsTest.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-1349. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng1349ChecksumFormatsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng1349ChecksumFormatsTest() { - super("(2.0.10,2.1.0-M1),(2.1.0-M1,)"); - } - - /** - * Tests that different checksum formats are supported. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG1349() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1349"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng1349"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng1349", "md5-a", "0.1", "jar"); - verifier.verifyArtifactPresent("org.apache.maven.its.mng1349", "md5-a", "0.1", "pom"); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng1349", "md5-b", "0.1", "jar"); - verifier.verifyArtifactPresent("org.apache.maven.its.mng1349", "md5-b", "0.1", "pom"); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng1349", "md5-c", "0.1", "jar"); - verifier.verifyArtifactPresent("org.apache.maven.its.mng1349", "md5-c", "0.1", "pom"); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng1349", "sha1-a", "0.1", "jar"); - verifier.verifyArtifactPresent("org.apache.maven.its.mng1349", "sha1-a", "0.1", "pom"); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng1349", "sha1-b", "0.1", "jar"); - verifier.verifyArtifactPresent("org.apache.maven.its.mng1349", "sha1-b", "0.1", "pom"); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng1349", "sha1-c", "0.1", "jar"); - verifier.verifyArtifactPresent("org.apache.maven.its.mng1349", "sha1-c", "0.1", "pom"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1412DependenciesOrderTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1412DependenciesOrderTest.java deleted file mode 100644 index 709b33366..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1412DependenciesOrderTest.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-1412: - * it tests that dependencies order in classpath matches pom.xml. - * - * @author Hervé Boutemy - * - */ -public class MavenITmng1412DependenciesOrderTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng1412DependenciesOrderTest() { - super("(2.0.8,)"); // 2.0.9+ - } - - @Test - public void testitMNG1412() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1412"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng1412"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List compileArtifacts = verifier.loadLines("target/compile-artifacts.txt", "UTF-8"); - assertArtifactOrder(compileArtifacts); - - List compileClassPath = verifier.loadLines("target/compile-classpath.txt", "UTF-8"); - assertClassPathOrder(compileClassPath.subList(1, compileClassPath.size())); - - List runtimeArtifacts = verifier.loadLines("target/runtime-artifacts.txt", "UTF-8"); - assertArtifactOrder(runtimeArtifacts); - - List runtimeClassPath = verifier.loadLines("target/runtime-classpath.txt", "UTF-8"); - assertClassPathOrder(runtimeClassPath.subList(1, runtimeClassPath.size())); - - List testArtifacts = verifier.loadLines("target/test-artifacts.txt", "UTF-8"); - assertArtifactOrder(testArtifacts); - - List testClassPath = verifier.loadLines("target/test-classpath.txt", "UTF-8"); - assertClassPathOrder(testClassPath.subList(2, testClassPath.size())); - } - - private void assertArtifactOrder(List artifacts) { - assertEquals(4, artifacts.size()); - assertEquals("org.apache.maven.its.mng1412:a:jar:0.1", artifacts.get(0)); - assertEquals("org.apache.maven.its.mng1412:c:jar:0.1", artifacts.get(1)); - assertEquals("org.apache.maven.its.mng1412:b:jar:0.1", artifacts.get(2)); - assertEquals("org.apache.maven.its.mng1412:d:jar:0.1", artifacts.get(3)); - } - - private void assertClassPathOrder(List classpath) { - assertEquals(4, classpath.size()); - assertEquals("a-0.1.jar", classpath.get(0)); - assertEquals("c-0.1.jar", classpath.get(1)); - assertEquals("b-0.1.jar", classpath.get(2)); - assertEquals("d-0.1.jar", classpath.get(3)); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1415QuotedSystemPropertiesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1415QuotedSystemPropertiesTest.java deleted file mode 100644 index e6a8a1a24..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1415QuotedSystemPropertiesTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-1415. - * - * - */ -public class MavenITmng1415QuotedSystemPropertiesTest extends AbstractMavenIntegrationTestCase { - public MavenITmng1415QuotedSystemPropertiesTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that quoted system properties are processed correctly. [MNG-1415] - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG1415() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1415"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-Dtest.property=Test Property"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/cli.properties"); - assertEquals("Test Property", props.getProperty("stringParam")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1491ReactorArtifactIdCollisionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1491ReactorArtifactIdCollisionTest.java deleted file mode 100644 index 92b98de95..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1491ReactorArtifactIdCollisionTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-1491. - * - * - */ -public class MavenITmng1491ReactorArtifactIdCollisionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng1491ReactorArtifactIdCollisionTest() { - super(ALL_MAVEN_VERSIONS); - } - - @Test - public void testitMNG1491() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1491"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - - try { - verifier.addCliArgument("initialize"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - fail("Build should fail due to duplicate artifactId's in the reactor."); - } catch (VerificationException e) { - // expected. - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1493NonStandardModulePomNamesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1493NonStandardModulePomNamesTest.java deleted file mode 100644 index e35dd4713..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1493NonStandardModulePomNamesTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-1493. - */ -public class MavenITmng1493NonStandardModulePomNamesTest extends AbstractMavenIntegrationTestCase { - public MavenITmng1493NonStandardModulePomNamesTest() { - super("(2.0.8,)"); // 2.0.9+ (including snapshots) - } - - @Test - public void testitMNG1493() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1493"); - - Verifier verifier; - - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - - verifier.addCliArgument("initialize"); - verifier.execute(); - - /* - * This is the simplest way to check a build - * succeeded. It is also the simplest way to create - * an IT test: make the build pass when the test - * should pass, and make the build fail when the - * test should fail. There are other methods - * supported by the verifier. They can be seen here: - * http://maven.apache.org/shared/maven-verifier/apidocs/index.html - */ - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1701DuplicatePluginTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1701DuplicatePluginTest.java deleted file mode 100644 index f5431e275..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1701DuplicatePluginTest.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-1701. - * - * @author Benjamin Bentmann - */ -public class MavenITmng1701DuplicatePluginTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng1701DuplicatePluginTest() { - super("[3.0-beta-1,)"); - } - - /** - * Verify that duplicate plugin declarations cause a warning. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1701"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - } catch (VerificationException e) { - // expected with Maven 4+ - } - - String logLevel; - if (matchesVersionRange("(,4.0.0-alpha-1)")) { - logLevel = "WARNING"; - } else { - logLevel = "ERROR"; - } - - List lines = verifier.loadLines(verifier.getLogFileName(), "UTF-8"); - boolean foundMessage = false; - for (String line : lines) { - if (line.startsWith("[" + logLevel + "]") - && line.indexOf( - "duplicate declaration of plugin org.apache.maven.its.plugins:maven-it-plugin-expression") - > 0) { - foundMessage = true; - } - } - - assertTrue("Duplicate plugin message wasn't generated.", foundMessage); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1703PluginMgmtDepInheritanceTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1703PluginMgmtDepInheritanceTest.java deleted file mode 100644 index d8e31365d..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1703PluginMgmtDepInheritanceTest.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-1703. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng1703PluginMgmtDepInheritanceTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng1703PluginMgmtDepInheritanceTest() { - super("(2.0.2,)"); - } - - /** - * Verify that a project-level plugin dependency class/resource inherited from the parent can be loaded from both the plugin classloader - * and the context classloader available to the plugin. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG1703() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1703"); - - Verifier verifier = newVerifier(new File(testDir, "child").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng1703"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties pclProps = verifier.loadProperties("target/pcl.properties"); - assertNotNull(pclProps.getProperty("org.apache.maven.plugin.coreit.ClassA")); - assertNotNull(pclProps.getProperty("org.apache.maven.plugin.coreit.ClassB")); - assertNotNull(pclProps.getProperty("org.apache.maven.its.mng1703.MNG1703")); - assertNotNull(pclProps.getProperty("src/main/java/org/apache/maven/its/mng1703/MNG1703.java")); - assertEquals("1", pclProps.getProperty("src/main/java/org/apache/maven/its/mng1703/MNG1703.java.count")); - - Properties tcclProps = verifier.loadProperties("target/tccl.properties"); - assertEquals(pclProps, tcclProps); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1751ForcedMetadataUpdateDuringDeploymentTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1751ForcedMetadataUpdateDuringDeploymentTest.java deleted file mode 100644 index 41addbd18..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1751ForcedMetadataUpdateDuringDeploymentTest.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.utils.io.FileUtils; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-1751. - * - * @author Benjamin Bentmann - */ -public class MavenITmng1751ForcedMetadataUpdateDuringDeploymentTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng1751ForcedMetadataUpdateDuringDeploymentTest() { - super("[3.0-beta-1,)"); - } - - /** - * Verify that deployment always updates the metadata even if its remote timestamp currently refers to - * the future. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1751"); - - File dir = new File(testDir, "repo/org/apache/maven/its/mng1751/dep/0.1-SNAPSHOT"); - File templateMetadataFile = new File(dir, "template-metadata.xml"); - File metadataFile = new File(dir, "maven-metadata.xml"); - FileUtils.copyFile(templateMetadataFile, metadataFile); - String checksum = ItUtils.calcHash(metadataFile, "SHA-1"); - FileUtils.fileWrite(metadataFile.getPath() + ".sha1", checksum); - - // phase 1: deploy a new snapshot, this should update the metadata despite its future timestamp - Verifier verifier = newVerifier(new File(testDir, "dep").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng1751"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // phase 2: resolve snapshot, if the previous deployment didn't update the metadata, we get the wrong file - verifier = newVerifier(new File(testDir, "test").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng1751"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties checksums = verifier.loadProperties("target/checksum.properties"); - String sha1 = checksums.getProperty("dep-0.1-SNAPSHOT.jar", "").toLowerCase(java.util.Locale.ENGLISH); - assertEquals(sha1, 40, sha1.length()); - assertNotEquals("fc081cd365b837dcb01eb9991f21c409b155ea5c", sha1); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1803PomValidationErrorIncludesLineNumberTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1803PomValidationErrorIncludesLineNumberTest.java deleted file mode 100644 index 7f1660317..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1803PomValidationErrorIncludesLineNumberTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.artifact.versioning.DefaultArtifactVersion; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-1803. - * - * @author Benjamin Bentmann - */ -public class MavenITmng1803PomValidationErrorIncludesLineNumberTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng1803PomValidationErrorIncludesLineNumberTest() { - super("[3.0-beta-2,)"); - } - - /** - * Verify that POM errors indicate the line and column number in the input file. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1803"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - } catch (Exception e) { - // expected - } - - boolean foundError = false; - - List lines = verifier.loadLines(verifier.getLogFileName(), null); - for (String line : lines) { - if (line.contains(":bad/id:")) { - String location; - if (getMavenVersion().compareTo(new DefaultArtifactVersion("4.0.0-alpha-8-SNAPSHOT")) >= 0) { - location = "line 34, column 7"; - } else { - location = "line 34, column 19"; - } - assertTrue("Position not found in: " + line, line.indexOf(location) > 0); - foundError = true; - break; - } - } - - assertTrue("Build output did not mention validation error!", foundError); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1895ScopeConflictResolutionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1895ScopeConflictResolutionTest.java deleted file mode 100644 index d0dd94d5b..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1895ScopeConflictResolutionTest.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; -import java.util.Map; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-1895. - * - * @author Benjamin Bentmann - */ -public class MavenITmng1895ScopeConflictResolutionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng1895ScopeConflictResolutionTest() { - super("[2.0.3,)"); - } - - /** - * Verify that for a dependency being referenced in two different scopes, the scope given directly in the POM - * always wins, even if weaker than the scope of the transitive dependency. - * - * @throws Exception in case of failure - */ - @Test - public void testitDirectVsIndirect() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1895/direct-vs-indirect"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng1895"); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List compile = verifier.loadLines("target/compile.txt", "UTF-8"); - assertTrue(compile.toString(), compile.contains("a-0.1.jar")); - assertFalse(compile.toString(), compile.contains("b-0.1.jar")); - assertFalse(compile.toString(), compile.contains("c-0.1.jar")); - assertTrue(compile.toString(), compile.contains("d-0.1.jar")); - - List runtime = verifier.loadLines("target/runtime.txt", "UTF-8"); - assertFalse(runtime.toString(), runtime.contains("a-0.1.jar")); - assertTrue(runtime.toString(), runtime.contains("b-0.1.jar")); - assertFalse(runtime.toString(), runtime.contains("c-0.1.jar")); - assertTrue(runtime.toString(), runtime.contains("d-0.1.jar")); - - List test = verifier.loadLines("target/test.txt", "UTF-8"); - assertTrue(test.toString(), test.contains("a-0.1.jar")); - assertTrue(test.toString(), test.contains("b-0.1.jar")); - assertTrue(test.toString(), test.contains("c-0.1.jar")); - assertTrue(test.toString(), test.contains("d-0.1.jar")); - } - - /** - * Verify that for a dependency being referenced in compile and in runtime scope, compile scope wins. - * - * @throws Exception in case of failure - */ - @Test - public void testitCompileVsRuntime() throws Exception { - Verifier verifier = run("compile", "runtime"); - - List compile = verifier.loadLines("target/compile.txt", "UTF-8"); - assertTrue(compile.toString(), compile.contains("x-0.1.jar")); - assertFalse(compile.toString(), compile.contains("a-0.1.jar")); - - List runtime = verifier.loadLines("target/runtime.txt", "UTF-8"); - assertTrue(runtime.toString(), runtime.contains("x-0.1.jar")); - assertTrue(runtime.toString(), runtime.contains("a-0.1.jar")); - - List test = verifier.loadLines("target/test.txt", "UTF-8"); - assertTrue(test.toString(), test.contains("x-0.1.jar")); - assertTrue(test.toString(), test.contains("a-0.1.jar")); - } - - /** - * Verify that for a dependency being referenced in compile and in test scope, compile scope wins. - * - * @throws Exception in case of failure - */ - @Test - public void testitCompileVsTest() throws Exception { - Verifier verifier = run("compile", "test"); - - List compile = verifier.loadLines("target/compile.txt", "UTF-8"); - assertTrue(compile.toString(), compile.contains("x-0.1.jar")); - assertFalse(compile.toString(), compile.contains("a-0.1.jar")); - - List runtime = verifier.loadLines("target/runtime.txt", "UTF-8"); - assertTrue(runtime.toString(), runtime.contains("x-0.1.jar")); - assertFalse(runtime.toString(), runtime.contains("a-0.1.jar")); - - List test = verifier.loadLines("target/test.txt", "UTF-8"); - assertTrue(test.toString(), test.contains("x-0.1.jar")); - assertTrue(test.toString(), test.contains("a-0.1.jar")); - } - - /** - * Verify that for a dependency being referenced in compile and in provided scope, compile scope wins. - * - * @throws Exception in case of failure - */ - @Test - public void testitCompileVsProvided() throws Exception { - Verifier verifier = run("compile", "provided"); - - List compile = verifier.loadLines("target/compile.txt", "UTF-8"); - assertTrue(compile.toString(), compile.contains("x-0.1.jar")); - assertTrue(compile.toString(), compile.contains("a-0.1.jar")); - - List runtime = verifier.loadLines("target/runtime.txt", "UTF-8"); - assertTrue(runtime.toString(), runtime.contains("x-0.1.jar")); - assertFalse(runtime.toString(), runtime.contains("a-0.1.jar")); - - List test = verifier.loadLines("target/test.txt", "UTF-8"); - assertTrue(test.toString(), test.contains("x-0.1.jar")); - assertTrue(test.toString(), test.contains("a-0.1.jar")); - } - - /** - * Verify that for a dependency being referenced in runtime and in test scope, runtime scope wins. - * - * @throws Exception in case of failure - */ - @Test - public void testitRuntimeVsTest() throws Exception { - Verifier verifier = run("runtime", "test"); - - List compile = verifier.loadLines("target/compile.txt", "UTF-8"); - assertFalse(compile.toString(), compile.contains("x-0.1.jar")); - assertFalse(compile.toString(), compile.contains("a-0.1.jar")); - - List runtime = verifier.loadLines("target/runtime.txt", "UTF-8"); - assertTrue(runtime.toString(), runtime.contains("x-0.1.jar")); - assertFalse(runtime.toString(), runtime.contains("a-0.1.jar")); - - List test = verifier.loadLines("target/test.txt", "UTF-8"); - assertTrue(test.toString(), test.contains("x-0.1.jar")); - assertTrue(test.toString(), test.contains("a-0.1.jar")); - } - - /** - * Verify that for a dependency being referenced in runtime and in provided scope, runtime scope wins. - * - * @throws Exception in case of failure - */ - @Test - public void testitRuntimeVsProvided() throws Exception { - Verifier verifier = run("runtime", "provided"); - - List compile = verifier.loadLines("target/compile.txt", "UTF-8"); - assertFalse(compile.toString(), compile.contains("x-0.1.jar")); - assertTrue(compile.toString(), compile.contains("a-0.1.jar")); - - List runtime = verifier.loadLines("target/runtime.txt", "UTF-8"); - assertTrue(runtime.toString(), runtime.contains("x-0.1.jar")); - assertFalse(runtime.toString(), runtime.contains("a-0.1.jar")); - - List test = verifier.loadLines("target/test.txt", "UTF-8"); - assertTrue(test.toString(), test.contains("x-0.1.jar")); - assertTrue(test.toString(), test.contains("a-0.1.jar")); - } - - /** - * Verify that for a dependency being referenced in provided and in test scope, provided scope wins. - * - * @throws Exception in case of failure - */ - @Test - public void testitProvidedVsTest() throws Exception { - requiresMavenVersion("[3.0-beta-3,)"); // MNG-2686 - - Verifier verifier = run("provided", "test"); - - List compile = verifier.loadLines("target/compile.txt", "UTF-8"); - assertTrue(compile.toString(), compile.contains("x-0.1.jar")); - assertFalse(compile.toString(), compile.contains("a-0.1.jar")); - - List runtime = verifier.loadLines("target/runtime.txt", "UTF-8"); - assertFalse(runtime.toString(), runtime.contains("x-0.1.jar")); - assertFalse(runtime.toString(), runtime.contains("a-0.1.jar")); - - List test = verifier.loadLines("target/test.txt", "UTF-8"); - assertTrue(test.toString(), test.contains("x-0.1.jar")); - assertTrue(test.toString(), test.contains("a-0.1.jar")); - } - - private Verifier run(String scopeB, String scopeA) throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1895/strong-vs-weak"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng1895"); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - Map props = verifier.newDefaultFilterMap(); - props.put("@scope.a@", scopeA); - props.put("@scope.b@", scopeB); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", props); - verifier.filterFile("pom-template.xml", "pom.xml", "UTF-8", props); - verifier.setLogFileName("log-" + scopeB + "-vs-" + scopeA + ".txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - return verifier; - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1957JdkActivationWithVersionRangeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1957JdkActivationWithVersionRangeTest.java deleted file mode 100644 index 29c6cedd4..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1957JdkActivationWithVersionRangeTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-1957. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng1957JdkActivationWithVersionRangeTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng1957JdkActivationWithVersionRangeTest() { - super("[2.1.0,3.0-alpha-1),[3.0-alpha-6,)"); - } - - /** - * Test that JDK profile activation allows version ranges. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG1957() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1957"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/jdk.properties"); - assertEquals("PASSED", props.getProperty("project.properties.jdkProperty1")); - assertEquals("PASSED", props.getProperty("project.properties.jdkProperty2")); - assertEquals("PASSED", props.getProperty("project.properties.jdkProperty3")); - assertNull(props.getProperty("project.properties.jdkProperty4")); - assertNull(props.getProperty("project.properties.jdkProperty5")); - assertEquals("PASSED", props.getProperty("project.properties.jdkProperty6")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1992SystemPropOverridesPomPropTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1992SystemPropOverridesPomPropTest.java deleted file mode 100644 index c06fbb756..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1992SystemPropOverridesPomPropTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-1992. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng1992SystemPropOverridesPomPropTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng1992SystemPropOverridesPomPropTest() { - super("(2.1.0-M1,)"); - } - - /** - * Test that system/execution properties take precedence over the POM's properties section when configuring a - * plugin parameter that is annotated with @parameter expression="prop". Note that this issue is not about POM - * interpolation but rather plugin parameter expression evaluation. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG1992() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1992"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.getSystemProperties().setProperty("config.stringParam", "PASSED"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties configProps = verifier.loadProperties("target/config.properties"); - assertEquals("PASSED", configProps.getProperty("stringParam")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1995InterpolateBooleanModelElementsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1995InterpolateBooleanModelElementsTest.java deleted file mode 100644 index acc095d98..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1995InterpolateBooleanModelElementsTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-1995. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng1995InterpolateBooleanModelElementsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng1995InterpolateBooleanModelElementsTest() { - super("[3.0-alpha-1,)"); - } - - /** - * Verify that POM fields that are of type boolean can be interpolated with expressions. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG1995() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-1995"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/expression.properties"); - assertEquals("true", props.getProperty("project.build.resources.0.filtering")); - boolean foundTestRepo = false; - for (int i = Integer.parseInt(props.getProperty("project.repositories")) - 1; i >= 0; i--) { - if ("maven-core-it".equals(props.getProperty("project.repositories." + i + ".id"))) { - assertEquals("true", props.getProperty("project.repositories." + i + ".releases.enabled")); - foundTestRepo = true; - } - } - assertTrue(foundTestRepo); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2006ChildPathAwareUrlInheritanceTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2006ChildPathAwareUrlInheritanceTest.java deleted file mode 100644 index d0760828e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2006ChildPathAwareUrlInheritanceTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2006. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng2006ChildPathAwareUrlInheritanceTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2006ChildPathAwareUrlInheritanceTest() { - super("(2.0.2,)"); - } - - /** - * Test that inheritance of those URLs which automatically append the child's artifact id take the child's - * relative location to the parent into account. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG2006() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2006"); - - Verifier verifier = newVerifier(new File(testDir, "child").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - assertEquals("http://project.url/child", props.getProperty("project.url")); - assertEquals("http://viewvc.project.url/child", props.getProperty("project.scm.url")); - assertEquals("http://scm.project.url/child", props.getProperty("project.scm.connection")); - assertEquals("https://scm.project.url/child", props.getProperty("project.scm.developerConnection")); - if (matchesVersionRange("(2.0.7,)")) { - // MNG-3134 - assertEquals("http://site.project.url/child", props.getProperty("project.distributionManagement.site.url")); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2045testJarDependenciesBrokenInReactorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2045testJarDependenciesBrokenInReactorTest.java deleted file mode 100644 index beb0b29cd..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2045testJarDependenciesBrokenInReactorTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2045: - * Simple IT test invoking maven in a reactor with 2 projects -- - * first project produces a test-jar, which is required to - * compile second project. - * - * @author Brian Fox - * @author mikko.koponen@ri.fi - */ -public class MavenITmng2045testJarDependenciesBrokenInReactorTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2045testJarDependenciesBrokenInReactorTest() { - super("(2.0.7,)"); // 2.0.8+ - } - - @Test - public void testitMNG2045() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2045"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("test-user/target"); - verifier.deleteArtifacts("org.apache.maven.its.mng2045"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List compile = verifier.loadLines("test-user/target/compile.txt", "UTF-8"); - assertTestClasses(compile); - assertNotMainClasses(compile); - - List runtime = verifier.loadLines("test-user/target/runtime.txt", "UTF-8"); - assertTestClasses(runtime); - assertNotMainClasses(runtime); - - List test = verifier.loadLines("test-user/target/test.txt", "UTF-8"); - assertTestClasses(test); - assertNotMainClasses(test); - } - - private void assertTestClasses(List classpath) { - /* - * Different Maven versions use the test-classes directory or the assembled test JAR but all that matters here - * is merely that we have the test classes on the classpath. - */ - assertTrue( - "test classes missing in " + classpath, - classpath.contains("test") - || classpath.contains("test.jar") - || classpath.contains("test-jar-0.1-SNAPSHOT-tests.jar")); - } - - private void assertNotMainClasses(List classpath) { - // When depending on the test JAR of some module, we shouldn't get its main classes - assertFalse("main classes present in " + classpath, classpath.contains("main")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2052InterpolateWithSettingsProfilePropertiesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2052InterpolateWithSettingsProfilePropertiesTest.java deleted file mode 100644 index 0da02efda..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2052InterpolateWithSettingsProfilePropertiesTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2052. - * - * - */ -public class MavenITmng2052InterpolateWithSettingsProfilePropertiesTest extends AbstractMavenIntegrationTestCase { - public MavenITmng2052InterpolateWithSettingsProfilePropertiesTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that properties defined in an active profile in the user's - * settings are available for interpolation of systemPath in a dependency. - * [MNG-2052] - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG2052() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2052"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2054PluginExecutionInheritanceTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2054PluginExecutionInheritanceTest.java deleted file mode 100644 index 6f9f3c0fd..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2054PluginExecutionInheritanceTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Arrays; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2054. - * - * - */ -public class MavenITmng2054PluginExecutionInheritanceTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2054PluginExecutionInheritanceTest() { - super("(2.0.3,)"); - } - - /** - * Test that plugin executions from >1 step of inheritance don't run multiple times. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG2054() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2054"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("project/project-level2/project-level3/project-jar/target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List executions = - verifier.loadLines("project/project-level2/project-level3/project-jar/target/exec.log", "UTF-8"); - List expected = Arrays.asList(new String[] {"once"}); - assertEquals(expected, executions); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2068ReactorRelativeParentsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2068ReactorRelativeParentsTest.java deleted file mode 100644 index 840baf251..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2068ReactorRelativeParentsTest.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2068. - * - * Verify that a multi-module build, built from the middle node in an inheritance hierarchy, - * can find all parent POMs necessary to build each project in the reactor using ONLY the - * relativePath from the parent specification (in this case, the implied one of '../pom.xml'). - * - * @author jdcasey - * - */ -public class MavenITmng2068ReactorRelativeParentsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2068ReactorRelativeParentsTest() { - super("(2.0.6,)"); // only test in 2.0.7+ - } - - /** - * Test successful lineage construction when parent inherits groupId+version from grand-parent. - * - * @throws Exception in case of failure - */ - @Test - public void testitInheritedIdFields() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2068/test-1"); - File projectDir = new File(testDir, "parent"); - - Verifier verifier = newVerifier(projectDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng2068"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } - - /** - * Test successful lineage construction when parent specifies groupId+version itself. - * - * @throws Exception in case of failure - */ - @Test - public void testitExplicitIdFields() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2068/test-2"); - File projectDir = new File(testDir, "parent"); - - Verifier verifier = newVerifier(projectDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng2068"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } - - /** - * Test that the implied relative path for the parent POM works, even two levels deep. - * - * @throws Exception in case of failure - */ - @Test - public void testitComplex() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2068/test-3"); - File projectDir = testDir; - - Verifier verifier = newVerifier(projectDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng2068"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2098VersionRangeSatisfiedFromWrongRepoTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2098VersionRangeSatisfiedFromWrongRepoTest.java deleted file mode 100644 index c56a882d2..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2098VersionRangeSatisfiedFromWrongRepoTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2098. - * - * @author Benjamin Bentmann - */ -public class MavenITmng2098VersionRangeSatisfiedFromWrongRepoTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2098VersionRangeSatisfiedFromWrongRepoTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Test that the selected version from a version range can be successfully resolved even if the repository - * with the newest metadata does not provide the selected version. In particular, the repository with the - * newest metadata must not be the only repository used during artifact resolution, all repositories must - * be considered. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2098"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng2098"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng2098", "dep", "0.1", "jar"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2103PluginExecutionInheritanceTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2103PluginExecutionInheritanceTest.java deleted file mode 100644 index 9332e2718..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2103PluginExecutionInheritanceTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Arrays; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2103. - * - * @author Benjamin Bentmann - */ -public class MavenITmng2103PluginExecutionInheritanceTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2103PluginExecutionInheritanceTest() { - super("[3.0-beta-1,)"); - } - - /** - * Verify that the plugin-level inherited flag can be overridden by the execution-level flag. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2103"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("child-1/target"); - verifier.deleteDirectory("child-2/target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List execs = verifier.loadLines("child-1/target/log.txt", "UTF-8"); - assertEquals(Arrays.asList(new String[] {"inherited"}), execs); - - execs = verifier.loadLines("child-2/target/log.txt", "UTF-8"); - assertEquals(Arrays.asList(new String[] {"inherited"}), execs); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2123VersionRangeDependencyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2123VersionRangeDependencyTest.java deleted file mode 100644 index 2f120fe5b..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2123VersionRangeDependencyTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2123. - */ -public class MavenITmng2123VersionRangeDependencyTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2123VersionRangeDependencyTest() { - super("(2.0.8,)"); - } - - @Test - public void testitMNG2123() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2123"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng2123"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List artifacts = verifier.loadLines("target/artifacts.txt", "UTF-8"); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng2123:fixed:jar:0.1")); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng2123:common:jar:3.1")); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng2123:range:jar:0.1")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2124PomInterpolationWithParentValuesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2124PomInterpolationWithParentValuesTest.java deleted file mode 100644 index 176d8b172..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2124PomInterpolationWithParentValuesTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2124. - */ -public class MavenITmng2124PomInterpolationWithParentValuesTest extends AbstractMavenIntegrationTestCase { - public MavenITmng2124PomInterpolationWithParentValuesTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that ${parent.artifactId} resolves correctly. [MNG-2124] - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG2124() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2124"); - File child = new File(testDir, "parent/child"); - - Verifier verifier = newVerifier(child.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("initialize"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/parent.properties"); - assertEquals("parent, child", props.getProperty("project.description")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2130ParentLookupFromReactorCacheTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2130ParentLookupFromReactorCacheTest.java deleted file mode 100644 index 7c170e0a2..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2130ParentLookupFromReactorCacheTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2130. - */ -public class MavenITmng2130ParentLookupFromReactorCacheTest extends AbstractMavenIntegrationTestCase { - public MavenITmng2130ParentLookupFromReactorCacheTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that parent-POMs cached during a build are available as parents - * to other POMs in the multi-module build. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG2130() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2130"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.mng2130"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2135PluginBuildInReactorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2135PluginBuildInReactorTest.java deleted file mode 100644 index be3fff25b..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2135PluginBuildInReactorTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2135. - * - * @author Benjamin Bentmann - */ -public class MavenITmng2135PluginBuildInReactorTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2135PluginBuildInReactorTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Test that the reactor can handle builds where one module provides a Maven plugin that another module uses. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2135"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - verifier.setAutoclean(false); - verifier.deleteDirectory("plugin/target"); - verifier.deleteDirectory("project/target"); - verifier.deleteArtifacts("org.apache.maven.its.mng2135"); - verifier.addCliArgument("package"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("project/target/touch.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2136ActiveByDefaultProfileTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2136ActiveByDefaultProfileTest.java deleted file mode 100644 index 09f8e1e46..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2136ActiveByDefaultProfileTest.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2136. - * - * - */ -public class MavenITmng2136ActiveByDefaultProfileTest extends AbstractMavenIntegrationTestCase { - public MavenITmng2136ActiveByDefaultProfileTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that <activeByDefault/> calculations for profile activation only - * use profiles defined in the POM. [MNG-2136] - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG2136() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2136"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - - verifier.addCliArgument( - "-Dexpression.outputFile=" + new File(testDir, "target/expression.properties").getPath()); - verifier.addCliArgument("-Dexpression.expressions=project/properties"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-expression:2.1-SNAPSHOT:eval"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/expression.properties"); - Properties props = verifier.loadProperties("target/expression.properties"); - assertNull(props.getProperty("project.properties.it0102.testOutput")); - assertEquals("Success", props.getProperty("project.properties.testOutput")); - assertEquals("PASSED", props.getProperty("project.properties.settingsValue")); - if (matchesVersionRange("[2.0,3.0-alpha-1)")) { - // support for profiles.xml removed from 3.x (see MNG-4060) - assertEquals("Present", props.getProperty("project.properties.profilesXmlValue")); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2140ReactorAwareDepResolutionWhenForkTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2140ReactorAwareDepResolutionWhenForkTest.java deleted file mode 100644 index 7a9c65637..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2140ReactorAwareDepResolutionWhenForkTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2140. - * - * @author Benjamin Bentmann - */ -public class MavenITmng2140ReactorAwareDepResolutionWhenForkTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2140ReactorAwareDepResolutionWhenForkTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Test that mojos in a forked lifecycle can also resolve dependencies from the reactor. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2140"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List artifacts = verifier.loadLines("project/target/test.txt", "UTF-8"); - assertTrue(artifacts.toString(), artifacts.contains("dependency/pom.xml")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2174PluginDepsManagedByParentProfileTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2174PluginDepsManagedByParentProfileTest.java deleted file mode 100644 index f88b05823..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2174PluginDepsManagedByParentProfileTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2174. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng2174PluginDepsManagedByParentProfileTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2174PluginDepsManagedByParentProfileTest() { - super("[2.0.9,3.0-alpha-1),[3.0-alpha-3,)"); - } - - /** - * Verify that plugin dependencies defined by plugin management of a parent profile are not lost when the - * parent's main plugin management section is also present. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG2174() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2174"); - - Verifier verifier = newVerifier(new File(testDir, "sub").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng2174"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pcl.properties"); - assertEquals("1", props.getProperty("mng-2174.properties.count")); - assertNotNull(props.getProperty("mng-2174.properties")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2196ParentResolutionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2196ParentResolutionTest.java deleted file mode 100644 index d82c34af1..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2196ParentResolutionTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2196. - */ -public class MavenITmng2196ParentResolutionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2196ParentResolutionTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that multi-module builds where one project references another as - * a parent can build, even if that parent is not correctly referenced by - * <relativePath/> and is not in the local repository. [MNG-2196] - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG2196() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2196"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng2196"); - - if (matchesVersionRange("(,3.0-alpha-1)")) { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } else { - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Build should have failed due to bad relativePath"); - } catch (VerificationException e) { - // expected - } - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2199ParentVersionRangeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2199ParentVersionRangeTest.java deleted file mode 100644 index ef5029669..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2199ParentVersionRangeTest.java +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; -import java.util.regex.Pattern; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng2199ParentVersionRangeTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2199ParentVersionRangeTest() { - super("[3.2.2,)"); - } - - @Test - public void testValidParentVersionRangeWithInclusiveUpperBound() throws Exception { - // failingMavenVersions("(3.2.2,3.5.0-alpha-0)"); - Verifier verifier = null; - File testDir = ResourceExtractor.simpleExtractResources( - getClass(), "/mng-2199-parent-version-range/valid-inclusive-upper-bound"); - - verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("-U"); - verifier.setAutoclean(false); - verifier.addCliArgument("verify"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // All Maven versions not supporting remote parent version ranges will log a warning message whenever - // building a parent fails. The build succeeds without any parent. If that warning message appears in the - // log, parent resolution failed. - final List lines = verifier.loadFile(new File(testDir, "log.txt"), false); - assertFalse("Unexpected error message found.", indexOf(lines, ".*Failed to build parent project.*") >= 0); - } - - @Test - public void testValidParentVersionRangeWithExclusiveUpperBound() throws Exception { - // failingMavenVersions("(3.2.2,3.5.0-alpha-0)"); - Verifier verifier = null; - File testDir = ResourceExtractor.simpleExtractResources( - getClass(), "/mng-2199-parent-version-range/valid-exclusive-upper-bound"); - - verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("-U"); - verifier.setAutoclean(false); - verifier.addCliArgument("verify"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // All Maven versions not supporting remote parent version ranges will log a warning message whenever - // building a parent fails. The build succeeds without any parent. If that warning message appears in the - // log, parent resolution failed. - final List lines = verifier.loadFile(new File(testDir, "log.txt"), false); - assertFalse("Unexpected error message found.", indexOf(lines, ".*Failed to build parent project.*") >= 0); - } - - @Test - public void testInvalidParentVersionRangeWithoutUpperBound() throws Exception { - Verifier verifier = null; - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2199-parent-version-range/invalid"); - - try { - verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - verifier.setAutoclean(false); - verifier.addCliArgument("-U"); - verifier.addCliArgument("verify"); - verifier.execute(); - fail("Expected 'VerificationException' not thrown."); - } catch (final VerificationException e) { - assertNotNull(verifier); - final List lines = verifier.loadFile(new File(testDir, "log.txt"), false); - assertTrue( - "Expected error message not found.", - indexOf(lines, ".*(parent)? version range.*does not specify an upper bound.*") >= 0); - } - } - - @Test - public void testValidParentVersionRangeInvalidVersionExpression() throws Exception { - Verifier verifier = null; - File testDir = - ResourceExtractor.simpleExtractResources(getClass(), "/mng-2199-parent-version-range/expression"); - - try { - verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - verifier.setAutoclean(false); - verifier.addCliArgument("-U"); - verifier.addCliArgument("verify"); - verifier.execute(); - fail("Expected 'VerificationException' not thrown."); - } catch (final VerificationException e) { - assertNotNull(verifier); - final List lines = verifier.loadFile(new File(testDir, "log.txt"), false); - int msg = indexOf(lines, ".*Version must be a constant.*org.apache.maven.its.mng2199:expression.*"); - assertTrue("Expected error message not found.", msg >= 0); - } - } - - @Test - public void testValidParentVersionRangeInvalidVersionInheritance() throws Exception { - Verifier verifier = null; - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2199-parent-version-range/inherited"); - - try { - verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - verifier.setAutoclean(false); - verifier.addCliArgument("-U"); - verifier.addCliArgument("verify"); - verifier.execute(); - fail("Expected 'VerificationException' not thrown."); - } catch (final VerificationException e) { - assertNotNull(verifier); - final List lines = verifier.loadFile(new File(testDir, "log.txt"), false); - int msg = indexOf(lines, ".*Version must be a constant.*org.apache.maven.its.mng2199:inherited.*"); - assertTrue("Expected error message not found.", msg >= 0); - } - } - - @Test - public void testValidLocalParentVersionRange() throws Exception { - // failingMavenVersions("(,3.3.0),(3.3.9,3.5.0-alpha-0)"); - Verifier verifier = null; - File testDir = ResourceExtractor.simpleExtractResources( - getClass(), "/mng-2199-parent-version-range/valid-local/child"); - - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("verify"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // All Maven versions not supporting remote parent version ranges will log a warning message whenever - // building a parent fails. The build succeeds without any parent. If that warning message appears in the - // log, parent resolution failed. For this test, this really just tests the project on disk getting tested - // is not corrupt. It's expected to find the local parent and not fall back to remote resolution. If it - // falls back to remote resolution, this just catches the test project to be broken. - final List lines = verifier.loadFile(new File(testDir, "log.txt"), false); - assertFalse("Unexpected error message found.", indexOf(lines, ".*Failed to build parent project.*") >= 0); - } - - @Test - public void testInvalidLocalParentVersionRange() throws Exception { - // failingMavenVersions("[3.3.0,3.3.9)"); - // Fallback to remote resolution not tested here. Remote parent expected to not be available anywhere. - Verifier verifier = null; - File testDir = ResourceExtractor.simpleExtractResources( - getClass(), "/mng-2199-parent-version-range/invalid-local/child"); - - try { - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("verify"); - verifier.execute(); - fail("Expected 'VerificationException' not thrown."); - } catch (final VerificationException e) { - assertNotNull(verifier); - final List lines = verifier.loadFile(new File(testDir, "log.txt"), false); - int msg = - indexOf(lines, ".*Non-resolvable parent POM org.apache.maven.its.mng2199:local-parent:\\[2,3\\].*"); - assertTrue("Expected error message not found.", msg >= 0); - } - } - - @Test - public void testInvalidLocalParentVersionRangeFallingBackToRemote() throws Exception { - // failingMavenVersions("[3.3.9]"); - Verifier verifier = null; - File testDir = ResourceExtractor.simpleExtractResources( - getClass(), "/mng-2199-parent-version-range/local-fallback-to-remote/child"); - - verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("verify"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // All Maven versions not supporting remote parent version ranges will log a warning message whenever - // building a parent fails. The build succeeds without any parent. If that warning message appears in the - // log, parent resolution failed. For this test, local parent resolution falls back to remote parent - // resolution with a version range in use. If the warning message is in the logs, that remote parent - // resolution failed unexpectedly. - final List lines = verifier.loadFile(new File(testDir, "log.txt"), false); - assertFalse("Unexpected error message found.", indexOf(lines, ".*Failed to build parent project.*") >= 0); - } - - @Test - public void testValidLocalParentVersionRangeInvalidVersionExpression() throws Exception { - // failingMavenVersions("(,3.5.0-alpha-0)"); - Verifier verifier = null; - File testDir = ResourceExtractor.simpleExtractResources( - getClass(), "/mng-2199-parent-version-range/expression-local/child"); - - try { - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("verify"); - verifier.execute(); - fail("Expected 'VerificationException' not thrown."); - } catch (final VerificationException e) { - assertNotNull(verifier); - final List lines = verifier.loadFile(new File(testDir, "log.txt"), false); - int msg = indexOf(lines, ".*Version must be a constant.*org.apache.maven.its.mng2199:expression.*"); - assertTrue("Expected error message not found.", msg >= 0); - } - } - - @Test - public void testValidLocalParentVersionRangeInvalidVersionInheritance() throws Exception { - // failingMavenVersions("(,3.5.0-alpha-0)"); - Verifier verifier = null; - File testDir = ResourceExtractor.simpleExtractResources( - getClass(), "/mng-2199-parent-version-range/inherited-local/child"); - - try { - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("verify"); - verifier.execute(); - fail("Expected 'VerificationException' not thrown."); - } catch (final VerificationException e) { - assertNotNull(verifier); - final List lines = verifier.loadFile(new File(testDir, "log.txt"), false); - int msg = indexOf(lines, ".*Version must be a constant.*org.apache.maven.its.mng2199:inherited.*"); - assertTrue("Expected error message not found.", msg >= 0); - } - } - - private static int indexOf(final List logLines, final String regex) { - final Pattern pattern = Pattern.compile(regex); - - for (int i = 0, l0 = logLines.size(); i < l0; i++) { - if (pattern.matcher(logLines.get(i)).matches()) { - return i; - } - } - - return -1; - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2201PluginConfigInterpolationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2201PluginConfigInterpolationTest.java deleted file mode 100644 index a7431714e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2201PluginConfigInterpolationTest.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2201. - * - * - */ -public class MavenITmng2201PluginConfigInterpolationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2201PluginConfigInterpolationTest() { - super("(2.0.8,)"); - } - - /** - * Verify that plugin configurations are correctly interpolated - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG2201() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2201"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/config.properties"); - assertCanonicalFileEquals(new File(testDir, "target"), new File(props.getProperty("stringParam"))); - assertCanonicalFileEquals(new File(testDir, "target"), new File(props.getProperty("propertiesParam.buildDir"))); - assertCanonicalFileEquals(new File(testDir, "target"), new File(props.getProperty("mapParam.buildDir"))); - assertEquals("4.0.0", props.getProperty("domParam.children.modelVersion.0.value")); - assertEquals("org.apache.maven.its.it0104", props.getProperty("domParam.children.groupId.0.value")); - assertEquals("1.0-SNAPSHOT", props.getProperty("domParam.children.version.0.value")); - assertEquals("jar", props.getProperty("domParam.children.packaging.0.value")); - assertEquals("http://maven.apache.org", props.getProperty("domParam.children.url.0.value")); - assertEquals("Apache", props.getProperty("domParam.children.organization.0.children.name.0.value")); - assertCanonicalFileEquals( - new File(testDir, "target"), - new File(props.getProperty("domParam.children.build.0.children.directory.0.value"))); - assertCanonicalFileEquals( - new File(testDir, "target/classes"), - new File(props.getProperty("domParam.children.build.0.children.outputDirectory.0.value"))); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2222OutputDirectoryReactorResolutionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2222OutputDirectoryReactorResolutionTest.java deleted file mode 100644 index 2a97e34fe..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2222OutputDirectoryReactorResolutionTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2222. - * - * @author Benjamin Bentmann - */ -public class MavenITmng2222OutputDirectoryReactorResolutionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2222OutputDirectoryReactorResolutionTest() { - super("[3.0-beta-1,)"); - } - - /** - * Test that dependencies on reactor projects can be satisfied by their output directories even if those do not - * exist (e.g. due to non-existing sources). This ensures consistent build results for "mvn compile" and - * "mvn package". - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2222"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("mod-a/target"); - verifier.deleteDirectory("mod-b/target"); - verifier.deleteArtifacts("org.apache.maven.its.mng2222"); - verifier.addCliArgument("compile"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List classpath = verifier.loadLines("mod-b/target/compile.txt", "UTF-8"); - assertTrue(classpath.toString(), classpath.contains("mod-a/target/classes")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2228ComponentInjectionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2228ComponentInjectionTest.java deleted file mode 100644 index 4e6c91f22..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2228ComponentInjectionTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2228. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng2228ComponentInjectionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2228ComponentInjectionTest() { - super("(2.0.4,)"); - } - - /** - * Verify that components injected into plugins are actually assignment-compatible with the corresponding mojo - * fields in case the field type is both provided by a plugin dependency and by a build extension. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG2228() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2228"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng2228"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties apiProps = verifier.loadProperties("target/api.properties"); - assertEquals("true", apiProps.getProperty("org.apache.maven.its.mng2228.DefaultComponent")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2234ActiveProfilesFromSettingsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2234ActiveProfilesFromSettingsTest.java deleted file mode 100644 index 9dde813e6..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2234ActiveProfilesFromSettingsTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2234. - */ -public class MavenITmng2234ActiveProfilesFromSettingsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2234ActiveProfilesFromSettingsTest() { - super("(2.0.8,)"); - } - - /** - * Verify that the activeProfile section from the settings.xml can also activate profiles specified in the POM, - * i.e. outside of the settings.xml. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG2234() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2234"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2254PomEncodingTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2254PomEncodingTest.java deleted file mode 100644 index db82bec8b..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2254PomEncodingTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2254: - * it tests that pom.xml encoding is properly detected. - * - * @author Hervé Boutemy - * - */ -public class MavenITmng2254PomEncodingTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2254PomEncodingTest() { - super("(2.0.7,)"); // 2.0.8+ - } - - /** - * Verify that the encoding declaration of the POM is respected. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG2254() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2254"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("utf-8/target"); - verifier.deleteDirectory("latin-1/target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties utf8 = verifier.loadProperties("utf-8/target/pom.properties"); - assertEquals("TEST-CHARS: \u00DF\u0131\u03A3\u042F\u05D0\u20AC", utf8.getProperty("project.description")); - - Properties latin1 = verifier.loadProperties("latin-1/target/pom.properties"); - assertEquals( - "TEST-CHARS: \u00C4\u00D6\u00DC\u00E4\u00F6\u00FC\u00DF", latin1.getProperty("project.description")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2276ProfileActivationBySettingsPropertyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2276ProfileActivationBySettingsPropertyTest.java deleted file mode 100644 index e5a5b522c..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2276ProfileActivationBySettingsPropertyTest.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2276. - * - * @author Benjamin Bentmann - */ -public class MavenITmng2276ProfileActivationBySettingsPropertyTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2276ProfileActivationBySettingsPropertyTest() { - super("[3.0-beta-1,)"); - } - - /** - * Test that profiles in the POM can be activated by properties declared in active profiles from the settings. - * - * @throws Exception in case of failure - */ - @Test - public void testitActivation() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2276"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.setLogFileName("log-1.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/profile.properties"); - assertEquals("settings", props.getProperty("project.properties.settingsProperty")); - assertEquals("pom", props.getProperty("project.properties.pomProperty")); - } - - /** - * Tests that system properties defined on the CLI are dominant over settings properties during profile activation. - * - * @throws Exception in case of failure - */ - @Test - public void testitCliWins() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2276"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("-DsettingsProperty=cli"); - verifier.setLogFileName("log-2.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/profile.properties"); - assertEquals("settings", props.getProperty("project.properties.settingsProperty")); - assertEquals("", props.getProperty("project.properties.pomProperty", "")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2277AggregatorAndResolutionPluginsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2277AggregatorAndResolutionPluginsTest.java deleted file mode 100644 index cc077be04..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2277AggregatorAndResolutionPluginsTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2277. - * - * @author Brian Fox - * - */ -public class MavenITmng2277AggregatorAndResolutionPluginsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2277AggregatorAndResolutionPluginsTest() { - super("(2.0.7,)"); // 2.0.8+ - } - - @Test - public void testitMNG2277() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2277"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng2277"); - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-all:aggregator-dependencies"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2305MultipleProxiesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2305MultipleProxiesTest.java deleted file mode 100644 index 3ade494f2..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2305MultipleProxiesTest.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import java.io.File; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.List; -import java.util.Map; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.server.HttpConfiguration; -import org.eclipse.jetty.server.HttpConnectionFactory; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.SecureRequestCustomizer; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.ServerConnector; -import org.eclipse.jetty.server.SslConnectionFactory; -import org.eclipse.jetty.server.handler.AbstractHandler; -import org.eclipse.jetty.util.ssl.SslContextFactory; -import org.junit.jupiter.api.Test; - -import static org.eclipse.jetty.http.HttpVersion.HTTP_1_1; - -/** - * This is a test set for MNG-2305. - * - * @author Benjamin Bentmann - */ -public class MavenITmng2305MultipleProxiesTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2305MultipleProxiesTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Verify that proxies can be setup for multiple protocols, in this case HTTP and HTTPS. As a nice side effect, - * this checks HTTPS tunneling over a web proxy. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2305"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - - // NOTE: trust store cannot be reliably configured for the current JVM - verifier.setForkJvm(true); - - // keytool -genkey -alias https.mngit -keypass key-passwd -keystore keystore -storepass store-passwd \ - // -validity 4096 -dname "cn=https.mngit, ou=None, L=Seattle, ST=Washington, o=ExampleOrg, c=US" -keyalg RSA - String storePath = new File(testDir, "keystore").getAbsolutePath(); - String storePwd = "store-passwd"; - String keyPwd = "key-passwd"; - - Server server = new Server(0); - addHttpsConnector(server, storePath, storePwd, keyPwd); - server.setHandler(new RepoHandler()); - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - int httpPort = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to HTTP port " + httpPort); - int httpsPort = ((NetworkConnector) server.getConnectors()[1]).getLocalPort(); - System.out.println("Bound server socket to HTTPS port " + httpsPort); - - TunnelingProxyServer proxy = new TunnelingProxyServer(0, "localhost", httpsPort, "https.mngit:443"); - proxy.start(); - int proxyPort = proxy.getPort(); - System.out.println("Bound server socket to the proxy port " + proxyPort); - - try { - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng2305"); - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@proxy.http@", Integer.toString(httpPort)); - filterProps.put("@proxy.https@", Integer.toString(proxyPort)); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.setEnvironmentVariable( - "MAVEN_OPTS", - "-Djavax.net.ssl.trustStore=" + storePath + " -Djavax.net.ssl.trustStorePassword=" + storePwd); - // disable concurrent downloading as not all wagons (e.g. wagon-lightweight-http) are thread-safe regarding - // proxy settings - verifier.addCliArgument("-Dmaven.artifact.threads=1"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } finally { - proxy.stop(); - server.stop(); - server.join(); - } - - List cp = verifier.loadLines("target/classpath.txt", "UTF-8"); - assertTrue(cp.toString(), cp.contains("http-0.1.jar")); - assertTrue(cp.toString(), cp.contains("https-0.1.jar")); - } - - private void addHttpsConnector(Server server, String keyStorePath, String keyStorePassword, String keyPassword) { - SslContextFactory sslContextFactory = new SslContextFactory(keyStorePath); - sslContextFactory.setKeyStorePassword(keyStorePassword); - sslContextFactory.setKeyManagerPassword(keyPassword); - HttpConfiguration httpConfiguration = new HttpConfiguration(); - httpConfiguration.setSecureScheme("https"); - HttpConfiguration httpsConfiguration = new HttpConfiguration(httpConfiguration); - httpsConfiguration.addCustomizer(new SecureRequestCustomizer()); - ServerConnector httpsConnector = new ServerConnector( - server, - new SslConnectionFactory(sslContextFactory, HTTP_1_1.asString()), - new HttpConnectionFactory(httpsConfiguration)); - server.addConnector(httpsConnector); - } - - static class RepoHandler extends AbstractHandler { - public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) - throws IOException { - PrintWriter writer = response.getWriter(); - - String uri = request.getRequestURI(); - - if (!uri.startsWith("/repo/org/apache/maven/its/mng2305/" + request.getScheme() + "/")) { - // HTTP connector serves only http-0.1.jar and HTTPS connector serves only https-0.1.jar - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - } else if (uri.endsWith(".pom")) { - writer.println(""); - writer.println(" 4.0.0"); - writer.println(" org.apache.maven.its.mng2305"); - writer.println(" " + request.getScheme() + ""); - writer.println(" 0.1"); - writer.println(""); - response.setStatus(HttpServletResponse.SC_OK); - } else if (uri.endsWith(".jar")) { - writer.println("empty"); - response.setStatus(HttpServletResponse.SC_OK); - } else { - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - } - - ((Request) request).setHandled(true); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2309ProfileInjectionOrderTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2309ProfileInjectionOrderTest.java deleted file mode 100644 index ae5c30b3e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2309ProfileInjectionOrderTest.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2309. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng2309ProfileInjectionOrderTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2309ProfileInjectionOrderTest() { - super("[2.0.5,)"); - } - - /** - * Test that profiles are injected in declaration order, with the last profile being the most dominant. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG2309() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2309"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - if (matchesVersionRange("[4.0.0-alpha-1,)")) { - verifier.addCliArgument( - "-P" + "pom-a,pom-b,pom-e,pom-c,pom-d" + ",settings-a,settings-b,settings-e,settings-c,settings-d"); - } else { - verifier.addCliArgument("-P" - + "pom-a,pom-b,pom-e,pom-c,pom-d" - + ",profiles-a,profiles-b,profiles-e,profiles-c,profiles-d" - + ",settings-a,settings-b,settings-e,settings-c,settings-d"); - } - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - assertEquals("e", props.getProperty("project.properties.pomProperty")); - assertEquals("e", props.getProperty("project.properties.settingsProperty")); - if (matchesVersionRange("(,3.0-alpha-1)")) { - // MNG-4060, profiles.xml support dropped - assertEquals("e", props.getProperty("project.properties.profilesProperty")); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2318LocalParentResolutionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2318LocalParentResolutionTest.java deleted file mode 100644 index 62bbe96a5..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2318LocalParentResolutionTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2318. - * - * - */ -public class MavenITmng2318LocalParentResolutionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2318LocalParentResolutionTest() { - super("(2.0.6,)"); - } - - /** - * When a project has modules and its parent is not preinstalled [MNG-2318] - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG2318() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2318"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2339BadProjectInterpolationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2339BadProjectInterpolationTest.java deleted file mode 100644 index fd95d1748..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2339BadProjectInterpolationTest.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2339. - */ -public class MavenITmng2339BadProjectInterpolationTest extends AbstractMavenIntegrationTestCase { - public MavenITmng2339BadProjectInterpolationTest() { - super("(2.0.8,)"); // 2.0.9+ - } - - @Test - public void testitMNG2339a() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2339/a"); - - Verifier verifier; - - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - - verifier.addCliArgument("-Dversion=foo"); - verifier.addCliArgument("validate"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - } - - // test that -Dversion=1.0 is still available for interpolation. - @Test - public void testitMNG2339b() throws Exception { - requiresMavenVersion("(2.0.8,4.0.0-alpha-1)"); - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2339/b"); - - Verifier verifier; - - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - - verifier.setLogFileName("log-pom-specified.txt"); - verifier.addCliArgument("initialize"); - verifier.execute(); - - assertTrue( - "Touchfile using ${project.version} for ${version} does not exist.", - new File(testDir, "target/touch-1.txt").exists()); - - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - - verifier.addCliArgument("-Dversion=2"); - verifier.setLogFileName("log-cli-specified.txt"); - verifier.addCliArgument("initialize"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - assertTrue( - "Touchfile using CLI-specified ${version} does not exist.", - new File(testDir, "target/touch-2.txt").exists()); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2362DeployedPomEncodingTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2362DeployedPomEncodingTest.java deleted file mode 100644 index cfa240138..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2362DeployedPomEncodingTest.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.utils.io.FileUtils; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2362. - * - * @author Benjamin Bentmann - */ -public class MavenITmng2362DeployedPomEncodingTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2362DeployedPomEncodingTest() { - super("[2.0.5,)"); - } - - /** - * Verify that installed/deployed POMs retain their original file encoding and don't get messed up by some - * transformation that erroneously uses the platform's default encoding for reading/writing them. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2362"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("utf-8/target"); - verifier.deleteDirectory("latin-1/target"); - verifier.deleteArtifacts("org.apache.maven.its.mng2362"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - File pomFile; - - pomFile = new File(verifier.getArtifactPath("org.apache.maven.its.mng2362", "utf-8", "0.1", "pom")); - assertPomUtf8(pomFile); - - pomFile = new File(testDir, "utf-8/target/repo/org/apache/maven/its/mng2362/utf-8/0.1/utf-8-0.1.pom"); - assertPomUtf8(pomFile); - - pomFile = new File(verifier.getArtifactPath("org.apache.maven.its.mng2362", "latin-1", "0.1", "pom")); - assertPomLatin1(pomFile); - - pomFile = new File(testDir, "latin-1/target/repo/org/apache/maven/its/mng2362/latin-1/0.1/latin-1-0.1.pom"); - assertPomLatin1(pomFile); - } - - private void assertPomUtf8(File pomFile) throws Exception { - String pom = FileUtils.fileRead(pomFile, "UTF-8"); - String chars = "\u00DF\u0131\u03A3\u042F\u05D0\u20AC"; - assertPom(pomFile, pom, chars); - } - - private void assertPomLatin1(File pomFile) throws Exception { - String pom = FileUtils.fileRead(pomFile, "ISO-8859-1"); - String chars = "\u00C4\u00D6\u00DC\u00E4\u00F6\u00FC\u00DF"; - assertPom(pomFile, pom, chars); - } - - private void assertPom(File pomFile, String pom, String chars) throws Exception { - String prefix = "TEST-CHARS: "; - int pos = pom.indexOf(prefix); - assertTrue( - "Corrupt data " + pom.substring(pos, pos + prefix.length() + chars.length()) + " in " + pomFile, - pom.contains(prefix + chars)); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2363BasedirAwareFileActivatorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2363BasedirAwareFileActivatorTest.java deleted file mode 100644 index 5667b2b93..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2363BasedirAwareFileActivatorTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2363. - * - * @author Benjamin Bentmann - */ -public class MavenITmng2363BasedirAwareFileActivatorTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2363BasedirAwareFileActivatorTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Test that the file-based profile activator resolves relative paths against the current project's base directory - * and also interpolates ${basedir} if explicitly given, just like usual for other parts of the POM. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2363"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("sub-a/target"); - verifier.deleteDirectory("sub-b/target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/parent1.txt"); - verifier.verifyFilePresent("target/parent2.txt"); - verifier.verifyFileNotPresent("target/file1.txt"); - verifier.verifyFileNotPresent("target/file2.txt"); - - verifier.verifyFileNotPresent("sub-a/target/parent1.txt"); - verifier.verifyFileNotPresent("sub-a/target/parent2.txt"); - verifier.verifyFilePresent("sub-a/target/file1.txt"); - verifier.verifyFileNotPresent("sub-a/target/file2.txt"); - - verifier.verifyFileNotPresent("sub-b/target/parent1.txt"); - verifier.verifyFileNotPresent("sub-b/target/parent2.txt"); - verifier.verifyFileNotPresent("sub-b/target/file1.txt"); - verifier.verifyFilePresent("sub-b/target/file2.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2387InactiveProxyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2387InactiveProxyTest.java deleted file mode 100644 index fb7bc464b..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2387InactiveProxyTest.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.net.InetAddress; -import java.util.Map; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.server.Handler; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.DefaultHandler; -import org.eclipse.jetty.server.handler.HandlerList; -import org.eclipse.jetty.server.handler.ResourceHandler; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2387. - * - * @author Brett Porter - * - */ -public class MavenITmng2387InactiveProxyTest extends AbstractMavenIntegrationTestCase { - private Server server; - - private int port; - - private Server proxyServer; - - private int proxyPort; - - private File testDir; - - public MavenITmng2387InactiveProxyTest() { - super("[2.0.11,2.1.0-M1),[2.1.0,)"); // 2.0.11+, 2.1.0+ - } - - @BeforeEach - protected void setUp() throws Exception { - testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2387"); - - ResourceHandler resourceHandler = new ResourceHandler(); - resourceHandler.setResourceBase(new File(testDir, "repo").getAbsolutePath()); - - HandlerList handlers = new HandlerList(); - handlers.setHandlers(new Handler[] {resourceHandler, new DefaultHandler()}); - - server = new Server(0); - server.setHandler(handlers); - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the HTTP port " + port); - - resourceHandler = new ResourceHandler(); - resourceHandler.setResourceBase(new File(testDir, "proxy").getAbsolutePath()); - - handlers = new HandlerList(); - handlers.setHandlers(new Handler[] {resourceHandler, new DefaultHandler()}); - - proxyServer = new Server(0); - proxyServer.setHandler(handlers); - proxyServer.start(); - if (proxyServer.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - proxyPort = ((NetworkConnector) proxyServer.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the HTTPS port " + port); - } - - @AfterEach - protected void tearDown() throws Exception { - if (server != null) { - server.stop(); - server.join(); - } - if (proxyServer != null) { - proxyServer.stop(); - proxyServer.join(); - } - } - - /** - * Test that no proxy is used if none of the configured proxies is actually set as active. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - - Map properties = verifier.newDefaultFilterMap(); - properties.put("@host@", InetAddress.getLoopbackAddress().getCanonicalHostName()); - properties.put("@port@", Integer.toString(port)); - properties.put("@proxyPort@", Integer.toString(proxyPort)); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", properties); - - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng2387"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng2387", "a", "0.1", "jar"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2432PluginPrefixOrderTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2432PluginPrefixOrderTest.java deleted file mode 100644 index 78594937e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2432PluginPrefixOrderTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2432 - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng2432PluginPrefixOrderTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2432PluginPrefixOrderTest() { - super("[2.1.0,)"); - } - - /** - * Verify that when resolving plugin prefixes the plugins from the POM are searched before the plugin groups - * from the settings. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG2432() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2432"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng2432.pom"); - verifier.deleteArtifacts("org.apache.maven.its.mng2432.settings"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("it:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFileNotPresent("target/touch-settings.txt"); - verifier.verifyFilePresent("target/touch-pom.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2486TimestampedDependencyVersionInterpolationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2486TimestampedDependencyVersionInterpolationTest.java deleted file mode 100644 index 6fba8a255..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2486TimestampedDependencyVersionInterpolationTest.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2486. - * - * @author Benjamin Bentmann - */ -public class MavenITmng2486TimestampedDependencyVersionInterpolationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2486TimestampedDependencyVersionInterpolationTest() { - super("[2.0.5,)"); - } - - /** - * Verify that the expression ${project.version} gets resolved to X-SNAPSHOT and not the actual timestamp - * during transitive dependency resolution. In part, this depends on the deployed SNAPSHOT POMs to retain their - * X-SNAPSHOT project version and not having it replaced with the timestamp version. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2486"); - - Verifier verifier; - - verifier = newVerifier(new File(testDir, "dep-a").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng2486"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(new File(testDir, "parent").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(new File(testDir, "dep-b").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(new File(testDir, "test").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - // enforce remote resolution - verifier.deleteArtifacts("org.apache.maven.its.mng2486"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List files = verifier.loadLines("target/classpath.txt", "UTF-8"); - assertTrue(files.toString(), files.contains("dep-a-0.1-SNAPSHOT.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2562Timestamp322Test.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2562Timestamp322Test.java deleted file mode 100644 index 9775616b5..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2562Timestamp322Test.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2562. - */ -public class MavenITmng2562Timestamp322Test extends AbstractMavenIntegrationTestCase { - - public MavenITmng2562Timestamp322Test() { - super("[3.2.2,)"); // 3.2.2+ only as we changed the timestamp format - } - - @Test - public void testitDefaultFormat() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2562/default"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Date now = new Date(); - - Properties props = verifier.loadProperties("target/pom.properties"); - - String timestamp1 = props.getProperty("project.properties.timestamp1", ""); - assertTrue(timestamp1, timestamp1.matches("\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z")); - Date date = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").parse(timestamp1); - assertTrue(now + " vs " + date, Math.abs(now.getTime() - date.getTime()) < 24 * 60 * 60 * 1000); - - String timestamp2 = props.getProperty("project.properties.timestamp2", ""); - assertEquals(timestamp1, timestamp2); - } - - @Test - public void testitCustomFormat() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2562/custom"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Date now = new Date(); - - Properties props = verifier.loadProperties("target/pom.properties"); - - String timestamp1 = props.getProperty("project.properties.timestamp", ""); - Date date = new SimpleDateFormat("mm:HH dd-MM-yyyy").parse(timestamp1); - assertTrue(now + " vs " + date, Math.abs(now.getTime() - date.getTime()) < 24 * 60 * 60 * 1000); - } - - @Test - public void testitSameValueAcrossModules() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2562/reactor"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("child-1/target"); - verifier.deleteDirectory("child-2/target"); - verifier.deleteDirectory("child-3/target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - String timestamp = props.getProperty("project.properties.timestamp", ""); - - Properties props1 = verifier.loadProperties("child-1/target/pom.properties"); - String timestamp1 = props1.getProperty("project.properties.timestamp", ""); - - Properties props2 = verifier.loadProperties("child-2/target/pom.properties"); - String timestamp2 = props2.getProperty("project.properties.timestamp", ""); - - Properties props3 = verifier.loadProperties("child-3/target/pom.properties"); - String timestamp3 = props3.getProperty("project.properties.timestamp", ""); - - assertEquals(timestamp, timestamp1); - assertEquals(timestamp, timestamp2); - assertEquals(timestamp, timestamp3); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2576MakeLikeReactorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2576MakeLikeReactorTest.java deleted file mode 100644 index 4b0426996..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2576MakeLikeReactorTest.java +++ /dev/null @@ -1,289 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2576. - * - * @author Benjamin Bentmann - */ -public class MavenITmng2576MakeLikeReactorTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2576MakeLikeReactorTest() { - super("[2.1.0,)"); - } - - private void clean(Verifier verifier) throws Exception { - verifier.deleteDirectory("target"); - verifier.deleteDirectory("sub-a/target"); - verifier.deleteDirectory("sub-b/target"); - verifier.deleteDirectory("sub-c/target"); - verifier.deleteDirectory("sub-d/target"); - } - - /** - * Verify that project list by itself only builds specified projects. - * - * @throws Exception in case of failure - */ - @Test - public void testitMakeOnlyList() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2576"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - clean(verifier); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("sub-b"); - verifier.setLogFileName("log-only.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFileNotPresent("target/touch.txt"); - verifier.verifyFileNotPresent("sub-a/target/touch.txt"); - verifier.verifyFilePresent("sub-b/target/touch.txt"); - verifier.verifyFileNotPresent("sub-c/target/touch.txt"); - verifier.verifyFileNotPresent("sub-d/target/touch.txt"); - } - - /** - * Verify that project list and all their upstream projects are built. - * - * @throws Exception in case of failure - */ - @Test - public void testitMakeUpstream() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2576"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - clean(verifier); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("sub-b"); - verifier.addCliArgument("-am"); - verifier.setLogFileName("log-upstream.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch.txt"); - verifier.verifyFilePresent("sub-a/target/touch.txt"); - verifier.verifyFilePresent("sub-b/target/touch.txt"); - verifier.verifyFileNotPresent("sub-c/target/touch.txt"); - verifier.verifyFileNotPresent("sub-d/target/touch.txt"); - } - - /** - * Verify that project list and all their downstream projects are built. - * - * @throws Exception in case of failure - */ - @Test - public void testitMakeDownstream() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2576"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - clean(verifier); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("sub-b"); - verifier.addCliArgument("-amd"); - verifier.setLogFileName("log-downstream.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFileNotPresent("target/touch.txt"); - verifier.verifyFileNotPresent("sub-a/target/touch.txt"); - verifier.verifyFilePresent("sub-b/target/touch.txt"); - verifier.verifyFilePresent("sub-c/target/touch.txt"); - verifier.verifyFileNotPresent("sub-d/target/touch.txt"); - } - - /** - * Verify that project list and all their upstream and downstream projects are built. - * - * @throws Exception in case of failure - */ - @Test - public void testitMakeBoth() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2576"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - clean(verifier); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("sub-b"); - verifier.addCliArgument("-am"); - verifier.addCliArgument("-amd"); - verifier.setLogFileName("log-both.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch.txt"); - verifier.verifyFilePresent("sub-a/target/touch.txt"); - verifier.verifyFilePresent("sub-b/target/touch.txt"); - verifier.verifyFilePresent("sub-c/target/touch.txt"); - verifier.verifyFileNotPresent("sub-d/target/touch.txt"); - } - - /** - * Verify that using the mere basedir in the project list properly matches projects with non-default POM files. - * - * @throws Exception in case of failure - */ - @Test - public void testitMatchesByBasedir() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2576"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - clean(verifier); - verifier.verifyFileNotPresent("sub-d/pom.xml"); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("sub-d"); - verifier.setLogFileName("log-basedir.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFileNotPresent("target/touch.txt"); - verifier.verifyFileNotPresent("sub-a/target/touch.txt"); - verifier.verifyFileNotPresent("sub-b/target/touch.txt"); - verifier.verifyFileNotPresent("sub-c/target/touch.txt"); - verifier.verifyFilePresent("sub-d/target/touch.txt"); - } - - /** - * Verify that using the mere basedir in the project list properly matches projects with non-default POM files. - * - * @throws Exception in case of failure - */ - @Test - public void testitMatchesByBasedirPlus() throws Exception { - // as per MNG-5230 - requiresMavenVersion("[3.2,)"); - - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2576"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - clean(verifier); - verifier.verifyFileNotPresent("sub-d/pom.xml"); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("+sub-d"); - verifier.setLogFileName("log-basedir-plus.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFileNotPresent("target/touch.txt"); - verifier.verifyFileNotPresent("sub-a/target/touch.txt"); - verifier.verifyFileNotPresent("sub-b/target/touch.txt"); - verifier.verifyFileNotPresent("sub-c/target/touch.txt"); - verifier.verifyFilePresent("sub-d/target/touch.txt"); - } - /** - * Verify that the project list can also specify project ids. - * - * @throws Exception in case of failure - */ - @Test - public void testitMatchesById() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2576"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - clean(verifier); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("org.apache.maven.its.mng2576:sub-b"); - verifier.setLogFileName("log-id.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFileNotPresent("target/touch.txt"); - verifier.verifyFileNotPresent("sub-a/target/touch.txt"); - verifier.verifyFilePresent("sub-b/target/touch.txt"); - verifier.verifyFileNotPresent("sub-c/target/touch.txt"); - verifier.verifyFileNotPresent("sub-d/target/touch.txt"); - } - - /** - * Verify that the project list can also specify artifact ids. - * - * @throws Exception in case of failure - */ - @Test - public void testitMatchesByArtifactId() throws Exception { - // as per MNG-4244 - requiresMavenVersion("[3.0-alpha-3,)"); - - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2576"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - clean(verifier); - verifier.addCliArgument("-pl"); - verifier.addCliArgument(":sub-b"); - verifier.setLogFileName("log-artifact-id.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFileNotPresent("target/touch.txt"); - verifier.verifyFileNotPresent("sub-a/target/touch.txt"); - verifier.verifyFilePresent("sub-b/target/touch.txt"); - verifier.verifyFileNotPresent("sub-c/target/touch.txt"); - verifier.verifyFileNotPresent("sub-d/target/touch.txt"); - } - - /** - * Verify that reactor is resumed from specified project. - * - * @throws Exception in case of failure - */ - @Test - public void testitResumeFrom() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2576"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - clean(verifier); - verifier.addCliArgument("-rf"); - verifier.addCliArgument("sub-b"); - verifier.setLogFileName("log-resume.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFileNotPresent("target/touch.txt"); - verifier.verifyFileNotPresent("sub-a/target/touch.txt"); - verifier.verifyFilePresent("sub-b/target/touch.txt"); - verifier.verifyFilePresent("sub-c/target/touch.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2577SettingsXmlInterpolationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2577SettingsXmlInterpolationTest.java deleted file mode 100644 index 1fddb9fb7..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2577SettingsXmlInterpolationTest.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2577. - * - * @author Benjamin Bentmann - */ -public class MavenITmng2577SettingsXmlInterpolationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2577SettingsXmlInterpolationTest() { - super("[2.0.3,)"); - } - - /** - * Verify that the settings.xml can be interpolated using environment variables. - * - * @throws Exception in case of failure - */ - @Test - public void testitEnvVars() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2577"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings-env.xml"); - verifier.setEnvironmentVariable("MNGIT", "env-var-test"); - verifier.setLogFileName("log-env.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/settings.properties"); - assertEquals("env-var-test", props.getProperty("settings.servers.0.username")); - } - - /** - * Verify that the settings.xml can be interpolated using user properties. - * - * @throws Exception in case of failure - */ - @Test - public void testitSystemProps() throws Exception { - requiresMavenVersion("[3.0-alpha-1,)"); - - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2577"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings-sys.xml"); - verifier.addCliArgument("-Dusr.MNGIT=usr-prop-test"); - verifier.setLogFileName("log-sys.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/settings.properties"); - assertEquals("usr-prop-test", props.getProperty("settings.servers.0.username")); - assertEquals(File.separator, props.getProperty("settings.servers.0.password")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2591MergeInheritedPluginConfigTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2591MergeInheritedPluginConfigTest.java deleted file mode 100644 index 1e6966f7a..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2591MergeInheritedPluginConfigTest.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2591. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng2591MergeInheritedPluginConfigTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2591MergeInheritedPluginConfigTest() { - super("(2.0.7,)"); - } - - /** - * Test aggregation of list configuration items for build plugins when using 'combine.children=append' attribute. - * This variation of the test does not employ profiles. - * - * @throws Exception in case of failure - */ - @Test - public void testitNoProfile() throws Exception { - testit("no-profile"); - } - - /** - * Test aggregation of list configuration items for build plugins when using 'combine.children=append' attribute. - * This variation of the test employs active profiles which however are empty and should not change the result. - * - * @throws Exception in case of failure - */ - @Test - public void testitWithProfile() throws Exception { - testit("with-profile"); - } - - private void testit(String project) throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2591/" + project); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("subproject/target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("subproject/target/config.properties"); - - assertEquals("8", props.getProperty("stringParams")); - assertEquals("PARENT-1", props.getProperty("stringParams.0")); - assertEquals("PARENT-3", props.getProperty("stringParams.1")); - assertEquals("PARENT-2", props.getProperty("stringParams.2")); - assertEquals("PARENT-4", props.getProperty("stringParams.3")); - assertEquals("CHILD-1", props.getProperty("stringParams.4")); - assertEquals("CHILD-3", props.getProperty("stringParams.5")); - assertEquals("CHILD-2", props.getProperty("stringParams.6")); - assertEquals("CHILD-4", props.getProperty("stringParams.7")); - - assertEquals("8", props.getProperty("listParam")); - assertEquals("PARENT-1", props.getProperty("listParam.0")); - assertEquals("PARENT-3", props.getProperty("listParam.1")); - assertEquals("PARENT-2", props.getProperty("listParam.2")); - assertEquals("PARENT-4", props.getProperty("listParam.3")); - assertEquals("CHILD-1", props.getProperty("listParam.4")); - assertEquals("CHILD-3", props.getProperty("listParam.5")); - assertEquals("CHILD-2", props.getProperty("listParam.6")); - assertEquals("CHILD-4", props.getProperty("listParam.7")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2605BogusProfileActivationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2605BogusProfileActivationTest.java deleted file mode 100644 index c9a410451..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2605BogusProfileActivationTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2605. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng2605BogusProfileActivationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2605BogusProfileActivationTest() { - super("(2.0.10,2.1.0-M1),(2.1.0-M1,3.0-alpha-1),(3.0-alpha-1,)"); - } - - /** - * Test that profiles are not accidentally activated when they have no activation element at all and - * the user did not request their activation via id. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG2605() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2605"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/profile.properties"); - assertNull(props.getProperty("project.properties.pomProperty")); - assertNull(props.getProperty("project.properties.settingsProperty")); - assertNull(props.getProperty("project.properties.profilesProperty")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2668UsePluginDependenciesForSortingTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2668UsePluginDependenciesForSortingTest.java deleted file mode 100644 index 55ecd507a..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2668UsePluginDependenciesForSortingTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2668. - * - * - */ -public class MavenITmng2668UsePluginDependenciesForSortingTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2668UsePluginDependenciesForSortingTest() { - super("(2.1.0-M1,3.0-alpha-1),[3.0-alpha-3,)"); // 2.1.0-M2+ - } - - @Test - public void testitMNG2668() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2668"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng2668"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng2668", "project", "1.0-SNAPSHOT", "jar"); - verifier.verifyArtifactPresent("org.apache.maven.its.mng2668", "tools", "1.0-SNAPSHOT", "jar"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2690MojoLoadingErrorsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2690MojoLoadingErrorsTest.java deleted file mode 100644 index b95c951fa..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2690MojoLoadingErrorsTest.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.IOException; -import java.util.List; -import java.util.regex.Pattern; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2690. - * - * It checks, at the most basic level possible, that the plugin manager is intercepting things like - * {@link NoClassDefFoundError} and ComponentLookupException, then throwing user-friendly errors when loading and - * configuring a mojo. - * - * @author jdcasey - */ -public class MavenITmng2690MojoLoadingErrorsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2690MojoLoadingErrorsTest() { - super("(2.1.0-M1,)"); - } - - @Test - public void testNoClassDefFromMojoLoad() throws IOException, VerificationException { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2690/noclassdef-mojo"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - - try { - verifier.addCliArgument("validate"); - verifier.execute(); - - fail("should throw an error during execution."); - } catch (VerificationException e) { - // expected...it'd be nice if we could get the specifics of the exception right here... - } - - List lines = verifier.loadFile(new File(testDir, "log.txt"), false); - - int msg = indexOf(lines, "(?i).*required class is missing.*"); - assertTrue("User-friendly message was not found in output.", msg >= 0); - - int cls = lines.get(msg).toString().replace('/', '.').indexOf("junit.framework.TestCase"); - assertTrue("Missing class name was not found in output.", cls >= 0); - } - - @Test - public void testNoClassDefFromMojoConfiguration() throws IOException, VerificationException { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2690/noclassdef-param"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - - try { - verifier.addCliArgument("validate"); - verifier.execute(); - - fail("should throw an error during execution."); - } catch (VerificationException e) { - // expected...it'd be nice if we could get the specifics of the exception right here... - } - - List lines = verifier.loadFile(new File(testDir, "log.txt"), false); - - int msg = indexOf(lines, "(?i).*required class (i|wa)s missing( during (mojo )?configuration)?.*"); - assertTrue("User-friendly message was not found in output.", msg >= 0); - - int cls = lines.get(msg).toString().replace('/', '.').indexOf("junit.framework.TestCase"); - assertTrue("Missing class name was not found in output.", cls >= 0); - } - - @Test - public void testMojoComponentLookupException() throws IOException, VerificationException { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2690/mojo-complookup"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - - try { - verifier.addCliArgument("validate"); - verifier.execute(); - - fail("should throw an error during execution."); - } catch (VerificationException e) { - // expected...it'd be nice if we could get the specifics of the exception right here... - } - - List lines = verifier.loadFile(new File(testDir, "log.txt"), false); - - String compLookupMsg = "(?i).*unable to .* mojo 'mojo-component-lookup-exception' .* plugin " - + "'org\\.apache\\.maven\\.its\\.plugins:maven-it-plugin-error.*"; - - assertTrue("User-friendly message was not found in output.", indexOf(lines, compLookupMsg) > 0); - } - - @Test - public void testMojoRequirementComponentLookupException() throws IOException, VerificationException { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2690/requirement-complookup"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - - try { - verifier.addCliArgument("validate"); - verifier.execute(); - - fail("should throw an error during execution."); - } catch (VerificationException e) { - // expected...it'd be nice if we could get the specifics of the exception right here... - } - - List lines = verifier.loadFile(new File(testDir, "log.txt"), false); - - String compLookupMsg = "(?i).*unable to .* mojo 'requirement-component-lookup-exception' .* plugin " - + "'org\\.apache\\.maven\\.its\\.plugins:maven-it-plugin-error.*"; - - assertTrue("User-friendly message was not found in output.", indexOf(lines, compLookupMsg) > 0); - } - - private int indexOf(List logLines, String regex) { - Pattern pattern = Pattern.compile(regex); - - for (int i = 0; i < logLines.size(); i++) { - String logLine = logLines.get(i); - - if (pattern.matcher(logLine).matches()) { - return i; - } - } - - return -1; - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2693SitePluginRealmTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2693SitePluginRealmTest.java deleted file mode 100644 index 4835a865c..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2693SitePluginRealmTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2693. - * - * @author Benjamin Bentmann - */ -public class MavenITmng2693SitePluginRealmTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2693SitePluginRealmTest() { - super("(2.0.2,)"); - } - - /** - * Verify that a plugin class/resource can be loaded from the plugin realm, also during the site lifecycle. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2693"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("pre-site"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties pclProps = verifier.loadProperties("target/pcl.properties"); - assertNotNull(pclProps.getProperty("org.apache.maven.plugin.coreit.ClassA")); - assertNotNull(pclProps.getProperty("org.apache.maven.plugin.coreit.ClassB")); - assertNotNull(pclProps.getProperty("org.apache.maven.plugin.coreit.SomeClass")); - assertNotNull(pclProps.getProperty("org/apache/maven/plugin/coreit/a.properties")); - assertEquals("1", pclProps.getProperty("org/apache/maven/plugin/coreit/a.properties.count")); - assertNotNull(pclProps.getProperty("org/apache/maven/plugin/coreit/b.properties")); - assertEquals("1", pclProps.getProperty("org/apache/maven/plugin/coreit/b.properties.count")); - assertNotNull(pclProps.getProperty("org/apache/maven/plugin/coreit/it.properties")); - assertEquals("2", pclProps.getProperty("org/apache/maven/plugin/coreit/it.properties.count")); - - Properties tcclProps = verifier.loadProperties("target/tccl.properties"); - assertEquals(pclProps, tcclProps); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2695OfflinePluginSnapshotsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2695OfflinePluginSnapshotsTest.java deleted file mode 100644 index cf863cf73..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2695OfflinePluginSnapshotsTest.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2695. - * - * Verifies that offline mode functions correctly for snapshot plugins. - * - * @author Brian Fox - * @author jdcasey - */ -public class MavenITmng2695OfflinePluginSnapshotsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2695OfflinePluginSnapshotsTest() { - super("(2.0.9,2.1.0-M1),(2.1.0-M1,)"); // only test in 2.0.10+, and not in 2.1.0-M1 - } - - /** - * Verify that snapshot plugins which are scheduled for an update don't fail the build when in offline mode. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG2695() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2695"); - - { - // phase 1: run build in online mode to fill local repo - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng2695"); - verifier.setAutoclean(false); - verifier.setLogFileName("log1.txt"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyFilePresent("target/a.txt"); - verifier.verifyFilePresent("target/b.txt"); - verifier.verifyErrorFreeLog(); - } - - { - // phase 2: run build in offline mode to check it still passes - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.deleteDirectory("target"); - verifier.setAutoclean(false); - verifier.setLogFileName("log2.txt"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("--offline"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyFilePresent("target/a.txt"); - verifier.verifyFilePresent("target/b.txt"); - verifier.verifyErrorFreeLog(); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2720SiblingClasspathArtifactsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2720SiblingClasspathArtifactsTest.java deleted file mode 100644 index 8d85adfec..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2720SiblingClasspathArtifactsTest.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2720. - * - * This test will ensure that running the 'package' phase on a multi-module build with child - * interdependency will result in one child using the JAR of the other child in its compile - * classpath, NOT the target/classes directory. This is critical, since sibling projects might - * use literally ANY artifact produced by another module project, and limiting to target/classes - * and target/test-classes eliminates many of the options that would be possible if the dependent - * sibling were built on its own. - * - * @author jdcasey - * - */ -public class MavenITmng2720SiblingClasspathArtifactsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2720SiblingClasspathArtifactsTest() { - super("[2.1.0,)"); - } - - @Test - public void testIT() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2720"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("child2/target"); - verifier.deleteDirectory("child3/target"); - verifier.addCliArgument("initialize"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List classPath; - - classPath = verifier.loadLines("child2/target/compile.txt", "UTF-8"); - assertMainJar(classPath); - - classPath = verifier.loadLines("child2/target/runtime.txt", "UTF-8"); - assertMainJar(classPath); - - classPath = verifier.loadLines("child2/target/test.txt", "UTF-8"); - assertMainJar(classPath); - - classPath = verifier.loadLines("child3/target/compile.txt", "UTF-8"); - assertTestJar(classPath); - - classPath = verifier.loadLines("child3/target/runtime.txt", "UTF-8"); - assertTestJar(classPath); - - classPath = verifier.loadLines("child3/target/test.txt", "UTF-8"); - assertTestJar(classPath); - } - - private void assertMainJar(List classPath) { - assertTrue(classPath.toString(), classPath.contains("main.jar")); - assertFalse(classPath.toString(), classPath.contains("main")); - assertFalse(classPath.toString(), classPath.contains("test.jar")); - assertFalse(classPath.toString(), classPath.contains("test")); - } - - private void assertTestJar(List classPath) { - assertFalse(classPath.toString(), classPath.contains("main.jar")); - assertFalse(classPath.toString(), classPath.contains("main")); - assertTrue(classPath.toString(), classPath.contains("test.jar")); - assertFalse(classPath.toString(), classPath.contains("test")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2738ProfileIdCollidesWithCliOptionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2738ProfileIdCollidesWithCliOptionTest.java deleted file mode 100644 index 9eb1af17e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2738ProfileIdCollidesWithCliOptionTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2738. - * - * @author Benjamin Bentmann - */ -public class MavenITmng2738ProfileIdCollidesWithCliOptionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2738ProfileIdCollidesWithCliOptionTest() { - super("[2.2.0,3.0-alpha-1),[3.0,)"); - } - - /** - * Verify that the CLI parsing properly handles activation of profiles whose id happens to match a short command - * line option. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2738"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-Pe"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2739RequiredRepositoryElementsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2739RequiredRepositoryElementsTest.java deleted file mode 100644 index efc037949..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2739RequiredRepositoryElementsTest.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2739. - * todo Fill in a better description of what this test verifies! - * - * @author Brian Fox - * @author jdcasey - */ -public class MavenITmng2739RequiredRepositoryElementsTest extends AbstractMavenIntegrationTestCase { - public MavenITmng2739RequiredRepositoryElementsTest() { - super("(2.0.9,)"); // only test in 2.0.9+ - } - - @Test - public void testitMNG2739_RepositoryId() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2739/repo-id"); - - Verifier verifier; - - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - - try { - verifier.addCliArgument("validate"); - verifier.execute(); - - fail("POM should NOT validate: repository element is missing in: " + new File(testDir, "pom.xml")); - } catch (VerificationException e) { - // expected - } - - List listing = verifier.loadFile(new File(testDir, "log.txt"), false); - boolean foundNpe = false; - for (String line : listing) { - if (line.contains("NullPointerException")) { - foundNpe = true; - break; - } - } - - assertFalse("Missing repository-id should not result in a NullPointerException.", foundNpe); - } - - @Test - public void testitMNG2739_RepositoryUrl() throws Exception { - // The testdir is computed from the location of this - // file. - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2739/repo-url"); - - Verifier verifier; - - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - - try { - verifier.addCliArgument("validate"); - verifier.execute(); - - fail("POM should NOT validate: repository element is missing in: " + new File(testDir, "pom.xml")); - } catch (VerificationException e) { - // expected - } - - List listing = verifier.loadFile(new File(testDir, "log.txt"), false); - boolean foundNpe = false; - for (String line : listing) { - if (line.contains("NullPointerException")) { - foundNpe = true; - break; - } - } - - assertFalse("Missing repository-url should not result in a NullPointerException.", foundNpe); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2741PluginMetadataResolutionErrorMessageTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2741PluginMetadataResolutionErrorMessageTest.java deleted file mode 100644 index a82bbe031..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2741PluginMetadataResolutionErrorMessageTest.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2741. - * - * - */ -public class MavenITmng2741PluginMetadataResolutionErrorMessageTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2741PluginMetadataResolutionErrorMessageTest() { - super("[2.1.0,3.0-alpha-1),[3.0-beta-1,)"); - } - - /** - * Tests that plugin prefix metadata resolution errors tell the underlying transport issue. - * - * @throws Exception in case of failure - */ - @Test - public void testitPrefix() throws Exception { - testit("prefix", "foo:bar"); - } - - /** - * Tests that plugin version metadata resolution errors tell the underlying transport issue. - * - * @throws Exception in case of failure - */ - @Test - public void testitVersion() throws Exception { - testit("version", "org.apache.maven.its.mng2741:maven-it-plugin:foo"); - } - - private void testit(String test, String goal) throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2741"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.setLogFileName("log-" + test + ".txt"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - try { - verifier.addCliArgument(goal); - verifier.execute(); - fail("Build should have failed to resolve plugin prefix"); - } catch (VerificationException e) { - boolean foundCause = false; - StringBuilder sb = new StringBuilder(); - List lines = verifier.loadLines(verifier.getLogFileName(), "UTF-8"); - for (String line : lines) { - sb.append(line).append(System.lineSeparator()); - if (line.matches(".*Connection refused.*")) { - foundCause = true; - break; - } - if (line.matches(".*Connection to http://localhost:54312 refused.*")) { - foundCause = true; - break; - } - if (line.matches(".*[Tt]ransfer failed for http://localhost:54312/repo/.*/maven-metadata.xml.*")) { - foundCause = true; - break; - } - } - assertTrue("Transfer error cause was not found: " + sb, foundCause); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2744checksumVerificationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2744checksumVerificationTest.java deleted file mode 100644 index c5b752f70..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2744checksumVerificationTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2744. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng2744checksumVerificationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2744checksumVerificationTest() { - super("(2.0.8,)"); // only test in 2.0.9+ - } - - /** - * Tests that hex digits of checksums are compared without regard to case. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG2744() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2744"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng2744"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng2744", "a", "1", "jar"); - verifier.verifyArtifactPresent("org.apache.maven.its.mng2744", "a", "1", "pom"); - verifier.verifyArtifactPresent("org.apache.maven.its.mng2744", "b", "1", "jar"); - verifier.verifyArtifactPresent("org.apache.maven.its.mng2744", "b", "1", "pom"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2749ExtensionAvailableToPluginTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2749ExtensionAvailableToPluginTest.java deleted file mode 100644 index 6daf9fa87..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2749ExtensionAvailableToPluginTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2749. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng2749ExtensionAvailableToPluginTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2749ExtensionAvailableToPluginTest() { - super("(2.0.2,)"); - } - - /** - * Verify that plugins can load classes/resources from a build extension. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG2749() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2749"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng2749"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties pclProps = verifier.loadProperties("target/pcl.properties"); - assertNotNull(pclProps.getProperty("org.apache.maven.its.mng2749.ExtensionClass")); - assertNotNull(pclProps.getProperty("org/apache/maven/its/mng2749/extension.properties")); - - Properties tcclProps = verifier.loadProperties("target/tccl.properties"); - assertEquals(pclProps, tcclProps); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2771PomExtensionComponentOverrideTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2771PomExtensionComponentOverrideTest.java deleted file mode 100644 index e55cec9e3..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2771PomExtensionComponentOverrideTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2771 - * - * @author Mark Hobson - * - */ -@Disabled -public class MavenITmng2771PomExtensionComponentOverrideTest extends AbstractMavenIntegrationTestCase { - public MavenITmng2771PomExtensionComponentOverrideTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that ensures the POM extensions can override default component implementations. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG2771() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2771/extension"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2771/plugin"); - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2771/project"); - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("verify"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2790LastUpdatedMetadataTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2790LastUpdatedMetadataTest.java deleted file mode 100644 index 48b389518..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2790LastUpdatedMetadataTest.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.TimeZone; - -import org.apache.maven.shared.utils.io.FileUtils; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2790. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng2790LastUpdatedMetadataTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2790LastUpdatedMetadataTest() { - super("(2.0.4,)"); - } - - /** - * Verify that the field lastUpdated of existing local repo metadata is updated upon install of new a snapshot. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG2790() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2790"); - - Date now = new Date(); - - /* - * Phase 1: Install initial snapshot into local repo. - */ - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.deleteArtifacts("org.apache.maven.its.mng2790"); - verifier.setAutoclean(false); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - File metadataArtifactVersionFile = - new File(verifier.getArtifactMetadataPath("org.apache.maven.its.mng2790", "project", "1.0-SNAPSHOT")); - File metadataArtifactFile = - new File(verifier.getArtifactMetadataPath("org.apache.maven.its.mng2790", "project")); - - Date artifactVersionLastUpdated1 = getLastUpdated(metadataArtifactVersionFile); - Date artifactLastUpdated1 = getLastUpdated(metadataArtifactFile); - - // sanity check: timestamps shouldn't differ by more than 10 min from now (i.e. timezone is UTC) - assertTrue( - artifactVersionLastUpdated1 + " ~ " + now, - Math.abs(artifactVersionLastUpdated1.getTime() - now.getTime()) < 10 * 60 * 1000); - assertTrue( - artifactLastUpdated1 + " ~ " + now, - Math.abs(artifactLastUpdated1.getTime() - now.getTime()) < 10 * 60 * 1000); - - // enforce some advance of time - Thread.sleep(1000); - - /* - * Phase 2: Re-install snapshot and check for proper timestamp update in local metadata. - */ - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Date artifactVersionLastUpdated2 = getLastUpdated(metadataArtifactVersionFile); - Date artifactLastUpdated2 = getLastUpdated(metadataArtifactFile); - - // check that new timestamps are strictly later than from original install - assertTrue( - artifactVersionLastUpdated1 + " < " + artifactVersionLastUpdated2, - artifactVersionLastUpdated2.after(artifactVersionLastUpdated1)); - assertTrue( - artifactLastUpdated1 + " < " + artifactLastUpdated2, artifactLastUpdated2.after(artifactLastUpdated1)); - } - - private Date getLastUpdated(File metadataFile) throws Exception { - String xml = FileUtils.fileRead(metadataFile, "UTF-8"); - String timestamp = xml.replaceAll("(?s)\\A.*\\s*([0-9]++)\\s*.*\\z", "$1"); - SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss"); - format.setTimeZone(TimeZone.getTimeZone("UTC")); - return format.parse(timestamp); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2820PomCommentsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2820PomCommentsTest.java deleted file mode 100644 index 6475affe9..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2820PomCommentsTest.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.utils.io.FileUtils; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2820. - * - * @author Benjamin Bentmann - */ -public class MavenITmng2820PomCommentsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2820PomCommentsTest() { - super("[2.0.5,)"); - } - - /** - * Verify that installed/deployed POMs retain any XML-comments like license headers. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2820"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng2820"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - File installed = new File(verifier.getArtifactPath("org.apache.maven.its.mng2820", "test", "0.1", "pom")); - assertPomComments(installed); - - File deployed = new File(testDir, "target/repo/org/apache/maven/its/mng2820/test/0.1/test-0.1.pom"); - assertPomComments(deployed); - } - - private void assertPomComments(File pomFile) throws Exception { - String pom = FileUtils.fileRead(pomFile, "UTF-8"); - assertPomComment(pom, "DOCUMENT-COMMENT-PRE-1"); - assertPomComment(pom, "DOCUMENT-COMMENT-PRE-2"); - assertPomComment(pom, "DOCUMENT-COMMENT-POST-1"); - assertPomComment(pom, "DOCUMENT-COMMENT-POST-2"); - assertPomComment(pom, "MODEL-COMMENT"); - assertPomComment(pom, "INLINE-COMMENT-1"); - assertPomComment(pom, "INLINE-COMMENT-2"); - assertPomComment(pom, "INLINE-COMMENT-3"); - } - - private void assertPomComment(String pom, String comment) throws Exception { - assertTrue("Missing comment: " + comment, pom.contains(comment)); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2831CustomArtifactHandlerAndCustomLifecycleTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2831CustomArtifactHandlerAndCustomLifecycleTest.java deleted file mode 100644 index 241dada72..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2831CustomArtifactHandlerAndCustomLifecycleTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2831. - * - * - */ -public class MavenITmng2831CustomArtifactHandlerAndCustomLifecycleTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2831CustomArtifactHandlerAndCustomLifecycleTest() { - super("(2.0.1,2.0.5),(2.0.6,3.0-alpha-1),[3.0-alpha-3,)"); - } - - /** - * Test the use of a custom lifecycle from a plugin that is defined as a build extension. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG2831() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2831"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("package"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/test-1.0-it.jar"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2843PluginConfigPropertiesInjectionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2843PluginConfigPropertiesInjectionTest.java deleted file mode 100644 index b2b00a439..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2843PluginConfigPropertiesInjectionTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2843. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng2843PluginConfigPropertiesInjectionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2843PluginConfigPropertiesInjectionTest() { - super("(2.0.5,)"); - } - - /** - * Test that plugins can have the project properties injected via ${project.properties}. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG2843() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2843"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/project.properties"); - assertEquals("PASSED", props.getProperty("key")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2848ProfileActivationByEnvironmentVariableTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2848ProfileActivationByEnvironmentVariableTest.java deleted file mode 100644 index 55d71e680..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2848ProfileActivationByEnvironmentVariableTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2848. - * - * @author Benjamin Bentmann - */ -public class MavenITmng2848ProfileActivationByEnvironmentVariableTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2848ProfileActivationByEnvironmentVariableTest() { - super("[2.0.9,)"); - } - - /** - * Test activation of a profile via environment variables. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2848"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.setEnvironmentVariable("MNG2848", "GO"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/profile.properties"); - assertEquals("PASSED", props.getProperty("project.properties.testProp")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2861RelocationsAndRangesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2861RelocationsAndRangesTest.java deleted file mode 100644 index 11c0a1abb..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2861RelocationsAndRangesTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2861. - * - * - */ -public class MavenITmng2861RelocationsAndRangesTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2861RelocationsAndRangesTest() { - super("(2.0.8,)"); - } - - @Test - public void testitMNG2861() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2861"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("A/target"); - verifier.deleteArtifacts("org.apache.maven.its.mng2861"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List artifacts = verifier.loadLines("A/target/artifacts.txt", "UTF-8"); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng2861:B:jar:1.0-SNAPSHOT")); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng2861.new:project:jar:2.0")); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng2861:C:jar:1.0-SNAPSHOT")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2865MirrorWildcardTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2865MirrorWildcardTest.java deleted file mode 100644 index 32fe41788..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2865MirrorWildcardTest.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2865. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng2865MirrorWildcardTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2865MirrorWildcardTest() { - super("(2.0.4,)"); - } - - /** - * Test that the mirror wildcard * matches any repo, in particular file:// repos. - * - * @throws Exception in case of failure - */ - @Test - public void testitFileRepo() throws Exception { - testit("file"); - } - - /** - * Test that the mirror wildcard * matches any repo, in particular http://localhost repos. - * - * @throws Exception in case of failure - */ - @Test - public void testitLocalhostRepo() throws Exception { - testit("localhost"); - } - - /** - * Test that the mirror wildcard * matches any repo, in particular external repos. - * - * @throws Exception in case of failure - */ - @Test - public void testitExternalRepo() throws Exception { - testit("external"); - } - - /** - * Test that the mirror wildcard * matches any repo, in particular central. - * - * @throws Exception in case of failure - */ - @Test - public void testitCentralRepo() throws Exception { - testit("central"); - } - - private void testit(String project) throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2865"); - - Verifier verifier = newVerifier(new File(testDir, project).getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng2865"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng2865", "a", "0.1", "jar"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2871PrePackageSubartifactResolutionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2871PrePackageSubartifactResolutionTest.java deleted file mode 100644 index 23104d49c..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2871PrePackageSubartifactResolutionTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2871. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng2871PrePackageSubartifactResolutionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2871PrePackageSubartifactResolutionTest() { - super("[3.0-alpha-1,)"); - } - - /** - * Verify that dependencies on not-yet-packaged sub artifacts in build phases prior to package can be satisfied - * from a module's output directory, i.e. with the loose class files. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG2871() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2871"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("consumer/target"); - verifier.addCliArgument("compile"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List compileClassPath = verifier.loadLines("consumer/target/compile.txt", "UTF-8"); - assertEquals(2, compileClassPath.size()); - assertEquals( - new File(testDir, "ejbs/target/classes").getCanonicalFile(), - new File(compileClassPath.get(1).toString()).getCanonicalFile()); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2892HideCorePlexusUtilsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2892HideCorePlexusUtilsTest.java deleted file mode 100644 index fcfae013e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2892HideCorePlexusUtilsTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2892. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng2892HideCorePlexusUtilsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2892HideCorePlexusUtilsTest() { - super("(2.0.8,)"); - } - - /** - * Verify that plugins can use their own version of plexus-utils and are not bound to the version bundled in the - * core. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG2892() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2892"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifact("org.codehaus.plexus", "plexus-utils", "0.1-mng2892", "jar"); - verifier.deleteArtifact("org.codehaus.plexus", "plexus-utils", "0.1-mng2892", "pom"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties pclProps = verifier.loadProperties("target/pcl.properties"); - assertEquals("methodStub", pclProps.getProperty("org.codehaus.plexus.util.StringUtils.methods")); - - Properties tcclProps = verifier.loadProperties("target/tccl.properties"); - assertEquals(pclProps, tcclProps); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2921ActiveAttachedArtifactsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2921ActiveAttachedArtifactsTest.java deleted file mode 100644 index 5b84e4699..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2921ActiveAttachedArtifactsTest.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Collection; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2921. It naturally includes the - * test for the related issue MNG-2877 whose original test was - * too weak to prevent this issue. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng2921ActiveAttachedArtifactsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2921ActiveAttachedArtifactsTest() { - super("(2.0.6,)"); - } - - /** - * Verify that attached project artifacts can be resolved from the reactor as active project artifacts for - * consumption on other module's class paths. Note the subtle difference of this test compared to the closely - * related issue MNG-2871: This test is about *attached* artifacts, i.e. dependencies that have already been - * packaged. MNG-2871 on the other hand is about dependencies that haven't been packaged yet but merely exist - * as loose class files in a module's output directory. In other words, this test is concerned with the situation - * during the lifecycle phase "package" while MNG-2871 is concerned with earlier phases like "test". - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG2921() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2921"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("consumer/target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Collection compileArtifacts = verifier.loadLines("consumer/target/compile.txt", "UTF-8"); - assertTrue( - compileArtifacts.toString(), - compileArtifacts.contains("org.apache.maven.its.mng2921:ejbs:ejb-client:client:1.0-SNAPSHOT")); - assertTrue( - compileArtifacts.toString(), - compileArtifacts.contains("org.apache.maven.its.mng2921:producer:ejb-client:client:1.0-SNAPSHOT")); - assertFalse( - compileArtifacts.toString(), - compileArtifacts.contains("org.apache.maven.its.mng2921:tests:test-jar:tests:1.0-SNAPSHOT")); - assertFalse( - compileArtifacts.toString(), - compileArtifacts.contains("org.apache.maven.its.mng2921:producer:test-jar:tests:1.0-SNAPSHOT")); - - Collection testArtifacts = verifier.loadLines("consumer/target/test.txt", "UTF-8"); - assertTrue( - testArtifacts.toString(), - testArtifacts.contains("org.apache.maven.its.mng2921:ejbs:ejb-client:client:1.0-SNAPSHOT")); - assertTrue( - testArtifacts.toString(), - testArtifacts.contains("org.apache.maven.its.mng2921:producer:ejb-client:client:1.0-SNAPSHOT")); - assertTrue( - testArtifacts.toString(), - testArtifacts.contains("org.apache.maven.its.mng2921:tests:test-jar:tests:1.0-SNAPSHOT")); - assertTrue( - testArtifacts.toString(), - testArtifacts.contains("org.apache.maven.its.mng2921:producer:test-jar:tests:1.0-SNAPSHOT")); - - Collection testClassPath = verifier.loadLines("consumer/target/test-classpath.txt", "UTF-8"); - assertTrue(testClassPath.toString(), testClassPath.contains("ejbs/attached.jar")); - assertTrue(testClassPath.toString(), testClassPath.contains("tests/attached.jar")); - assertTrue(testClassPath.toString(), testClassPath.contains("producer/client.jar")); - assertTrue(testClassPath.toString(), testClassPath.contains("producer/tests.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2926PluginPrefixOrderTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2926PluginPrefixOrderTest.java deleted file mode 100644 index 95f7f8f7f..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2926PluginPrefixOrderTest.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2926 - * - * @author Brian Fox - * - */ -public class MavenITmng2926PluginPrefixOrderTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2926PluginPrefixOrderTest() { - super("(2.0.6,)"); - } - - /** - * Verify that when resolving plugin prefixes the group org.apache.maven.plugins is searched before - * org.codehaus.mojo and that custom groups from the settings are searched before these standard ones. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG2926() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2926"); - - Verifier verifier; - - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.deleteArtifacts("org.apache.maven.its.mng2926"); - verifier.deleteArtifacts("org.apache.maven.plugins", "mng-2926", "0.1"); - verifier.deleteArtifacts("org.apache.maven.plugins", "mng-2926", "0.1"); - new File(verifier.getArtifactMetadataPath( - "org.apache.maven.plugins", null, null, "maven-metadata-maven-core-it.xml")) - .delete(); - new File(verifier.getArtifactMetadataPath("org.apache.maven.plugins", null, null, "resolver-status.properties")) - .delete(); - verifier.deleteArtifacts("org.codehaus.mojo", "mng-2926", "0.1"); - verifier.deleteArtifacts("org.codehaus.mojo", "mng-2926", "0.1"); - new File(verifier.getArtifactMetadataPath("org.codehaus.mojo", null, null, "maven-metadata-maven-core-it.xml")) - .delete(); - new File(verifier.getArtifactMetadataPath("org.codehaus.mojo", null, null, "resolver-status.properties")) - .delete(); - - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.setLogFileName("log-default.txt"); - verifier.filterFile("settings-default-template.xml", "settings-default.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings-default.xml"); - verifier.addCliArgument("mng-2926:apache"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.setLogFileName("log-custom.txt"); - verifier.filterFile("settings-custom-template.xml", "settings-custom.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings-custom.xml"); - verifier.addCliArgument("mng-2926:custom"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2972OverridePluginDependencyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2972OverridePluginDependencyTest.java deleted file mode 100644 index 48eacb0f1..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2972OverridePluginDependencyTest.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2972. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng2972OverridePluginDependencyTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2972OverridePluginDependencyTest() { - super("(2.0.8,)"); - } - - /** - * Verify that a project-level plugin dependency replaces the original dependency from the plugin POM. - * - * @throws Exception in case of failure - */ - @Test - public void testitLifecycleInvocation() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2972/test1"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifact("org.apache.maven.its.plugins.class-loader", "dep-b", "0.2-mng-2972", "jar"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties pclProps = verifier.loadProperties("target/pcl.properties"); - verify(pclProps); - } - - /** - * Verify that a project-level plugin dependency replaces the original dependency from the plugin POM. - * Apart from testing direct CLI invocation this time, this test also employs a slightly different version for the - * overriding dependency. The original bug is caused by usage of a HashSet but whenever the random order of its - * elements happens to match the correct ordering, the test cannot detect the bad implementation. The obvious way - * to increase the test coverage is re-running the test with different dependency versions, each time producing - * another hash code for the dependency artifact and thereby changing its position in the HashSet's element order. - * The two versions 0.2-mng-2972 and 9.9-MNG-2972 we use here have at least once proven (on Sun JDK 1.6.0_07) to - * successfully break the correctness of the random ordering. - * - * @throws Exception in case of failure - */ - @Test - public void testitCommandLineInvocation() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2972/test2"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifact("org.apache.maven.its.plugins.class-loader", "dep-b", "9.9-MNG-2972", "jar"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-class-loader:2.1-SNAPSHOT:load"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties pclProps = verifier.loadProperties("target/pcl.properties"); - verify(pclProps); - } - - private void verify(Properties pclProps) throws Exception { - assertNotNull(pclProps.getProperty("org.apache.maven.its.mng2972.MNG2972")); - assertNull(pclProps.getProperty("org.apache.maven.plugin.coreit.ClassA")); - assertNull(pclProps.getProperty("org.apache.maven.plugin.coreit.ClassB")); - assertEquals("1", pclProps.getProperty("org/apache/maven/its/mng2972/mng-2972.properties.count")); - assertEquals("0", pclProps.getProperty("org/apache/maven/plugin/coreit/a.properties.count")); - assertEquals("0", pclProps.getProperty("org/apache/maven/plugin/coreit/b.properties.count")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2994SnapshotRangeRepositoryTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2994SnapshotRangeRepositoryTest.java deleted file mode 100644 index 9ee5c8f3f..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2994SnapshotRangeRepositoryTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-2994 - * - * @author Mark Hobson - * - */ -public class MavenITmng2994SnapshotRangeRepositoryTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng2994SnapshotRangeRepositoryTest() { - super("[3.0-beta-1,)"); - } - - /** - * Test that snapshot repositories are checked for ranges with snapshot boundaries. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2994"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.deleteArtifacts("org.apache.maven.its.mng2994"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3004ReactorFailureBehaviorMultithreadedTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3004ReactorFailureBehaviorMultithreadedTest.java deleted file mode 100644 index f5822f579..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3004ReactorFailureBehaviorMultithreadedTest.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3004. - * - * @author Dan Fabulich - * - */ -public class MavenITmng3004ReactorFailureBehaviorMultithreadedTest extends AbstractMavenIntegrationTestCase { - public MavenITmng3004ReactorFailureBehaviorMultithreadedTest() { - super("(3.0-alpha-3,)"); - } - - /** - * Test fail-fast reactor behavior. Forces an exception to be thrown in - * the first module and checks that the second & third module is not built and the overall build fails, too. - * - * @throws Exception in case of failure - */ - @Test - public void testitFailFastSingleThread() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0095"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("subproject1/target"); - verifier.deleteDirectory("subproject2/target"); - verifier.deleteDirectory("subproject3/target"); - verifier.addCliArgument("--fail-fast"); - verifier.setLogFileName("log-ff-mt1.txt"); - verifier.addCliArgument("-Dmaven.threads.experimental=1"); - - try { - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-touch:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } catch (VerificationException e) { - // expected - } - - verifier.verifyFilePresent("target/touch.txt"); - verifier.verifyFileNotPresent("subproject1/target/touch.txt"); - verifier.verifyFileNotPresent("subproject2/target/touch.txt"); - verifier.verifyFileNotPresent("subproject3/target/touch.txt"); - } - - /** - * Test fail-never reactor behavior. Forces an exception to be thrown in - * the first module, but checks that the second & third module is built and the overall build succeeds. - * - * @throws Exception in case of failure - */ - @Test - public void testitFailNeverSingleThread() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0095"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("subproject1/target"); - verifier.deleteDirectory("subproject2/target"); - verifier.deleteDirectory("subproject3/target"); - verifier.addCliArgument("--fail-never"); - verifier.setLogFileName("log-fn-mt1.txt"); - verifier.addCliArgument("-Dmaven.threads.experimental=1"); - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-touch:touch"); - verifier.execute(); - - verifier.verifyFilePresent("target/touch.txt"); - verifier.verifyFileNotPresent("subproject1/target/touch.txt"); - verifier.verifyFilePresent("subproject2/target/touch.txt"); - verifier.verifyFilePresent("subproject3/target/touch.txt"); - } - - /** - * Test fail-at-end reactor behavior. Forces an exception to be thrown in - * the first module and checks that the second module is still built but the overall build finally fails - * and the third module (which depends on the failed module) is skipped. - * - * @throws Exception in case of failure - */ - @Test - public void testitFailAtEndSingleThread() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0095"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("subproject1/target"); - verifier.deleteDirectory("subproject2/target"); - verifier.deleteDirectory("subproject3/target"); - verifier.addCliArgument("--fail-at-end"); - verifier.setLogFileName("log-fae-mt1.txt"); - verifier.addCliArgument("-Dmaven.threads.experimental=1"); - try { - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-touch:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } catch (VerificationException e) { - // expected - } - - verifier.verifyFilePresent("target/touch.txt"); - verifier.verifyFileNotPresent("subproject1/target/touch.txt"); - verifier.verifyFilePresent("subproject2/target/touch.txt"); - verifier.verifyFileNotPresent("subproject3/target/touch.txt"); - } - - /** - * Test fail-never reactor behavior. Forces an exception to be thrown in - * the first module, but checks that the second & third module is built and the overall build succeeds. - * - * @throws Exception in case of failure - */ - @Test - public void testitFailNeverTwoThreads() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0095"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("subproject1/target"); - verifier.deleteDirectory("subproject2/target"); - verifier.deleteDirectory("subproject3/target"); - verifier.addCliArgument("--fail-never"); - verifier.setLogFileName("log-fn-mt2.txt"); - verifier.addCliArgument("-Dmaven.threads.experimental=2"); - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-touch:touch"); - verifier.execute(); - - verifier.verifyFilePresent("target/touch.txt"); - verifier.verifyFileNotPresent("subproject1/target/touch.txt"); - verifier.verifyFilePresent("subproject2/target/touch.txt"); - verifier.verifyFilePresent("subproject3/target/touch.txt"); - } - - /** - * Test fail-at-end reactor behavior. Forces an exception to be thrown in - * the first module and checks that the second module is still built but the overall build finally fails - * and the third module (which depends on the failed module) is skipped. - * - * @throws Exception in case of failure - */ - @Test - public void testitFailAtEndTwoThreads() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-0095"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("subproject1/target"); - verifier.deleteDirectory("subproject2/target"); - verifier.deleteDirectory("subproject3/target"); - verifier.addCliArgument("--fail-at-end"); - verifier.setLogFileName("log-fae-mt2.txt"); - verifier.addCliArgument("-Dmaven.threads.experimental=2"); - try { - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-touch:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } catch (VerificationException e) { - // expected - } - - verifier.verifyFilePresent("target/touch.txt"); - verifier.verifyFileNotPresent("subproject1/target/touch.txt"); - verifier.verifyFilePresent("subproject2/target/touch.txt"); - verifier.verifyFileNotPresent("subproject3/target/touch.txt"); - } - - // DGF not testing fail fast with multiple real threads since that's a "best effort" attempt to halt the build - // The whole build could have finished by the time you try to halt. - -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3012CoreClassImportTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3012CoreClassImportTest.java deleted file mode 100644 index 2f806e048..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3012CoreClassImportTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3012. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3012CoreClassImportTest extends AbstractMavenIntegrationTestCase { - public MavenITmng3012CoreClassImportTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that classes shared with the Maven core realm are imported into the plugin realm such that instances of - * these classes created by the core can be cast to classes loaded by the plugin. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3012() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3012"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifact("org.codehaus.plexus", "plexus-utils", "0.1-mng3012", "jar"); - verifier.deleteArtifact("org.codehaus.plexus", "plexus-utils", "0.1-mng3012", "pom"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties xpp3domProps = verifier.loadProperties("target/xpp3dom.properties"); - assertEquals("true", xpp3domProps.getProperty("project.reporting.plugins.0.configuration")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3023ReactorDependencyResolutionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3023ReactorDependencyResolutionTest.java deleted file mode 100644 index 7f3cc4488..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3023ReactorDependencyResolutionTest.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3023 - * - * @author Mark Hobson - * @author jdcasey - * - */ -public class MavenITmng3023ReactorDependencyResolutionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3023ReactorDependencyResolutionTest() { - super("(2.1.0-M1,)"); - } - - /** - * Test that reactor projects are included in dependency resolution. - * - * In this pass, the dependency artifact should be missing from the local repository, and since the 'compile' phase - * has not been called, i.e. the output directory for the compiled classes has not been created yet, the - * dependency project artifact should not have a file associated with it. Therefore, the dependency artifact - * should fail to resolve, and the build should fail. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3023A() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3023"); - - // First pass. Make sure the dependency cannot be resolved. - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.setLogFileName("log-a.txt"); - - verifier.deleteDirectory("dependency/dependency-classes"); - verifier.deleteArtifacts("org.apache.maven.its.mng3023"); - - try { - verifier.addCliArgument("validate"); - verifier.execute(); - fail("Expected failure to resolve dependency artifact without at least calling 'compile' phase."); - } catch (VerificationException e) { - // expected. - } - } - - /** - * Test that reactor projects are included in dependency resolution. - * - * If this passes, the dependency artifact should have the file $(basedir)/dependency/dependency-classes - * (a directory) associated with it, since the 'compile' phase has run. This location should be - * present in the compile classpath output from the maven-it-plugin-dependency-resolution:compile - * mojo execution. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3023B() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3023"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.setLogFileName("log-b.txt"); - // The IT doesn't actually run the compiler but merely mimics its effect, i.e. the creation of the output dir - new File(testDir, "dependency/dependency-classes").mkdirs(); - verifier.deleteDirectory("consumer/target"); - verifier.deleteArtifacts("org.apache.maven.its.mng3023"); - - verifier.addCliArgument("initialize"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List compileClassPath = verifier.loadLines("consumer/target/compile.classpath", "UTF-8"); - assertTrue(compileClassPath.toString(), compileClassPath.contains("dependency-classes")); - assertFalse(compileClassPath.toString(), compileClassPath.contains("dependency-1.jar")); - } - - /** - * Test that reactor projects are included in dependency resolution. - * - * If this passes, the dependency should have been installed, so the dependency artifact should have - * a file of .../dependency-1.jar associated with it, since the 'install' phase has run. This - * location should be present in the compile classpath output from the - * maven-it-plugin-dependency-resolution:compile mojo execution. - * - * Afterwards, the projects are cleaned and a separate Maven call to the 'initialize' phase should succeed, since - * the dependency artifact has been installed locally. This second execution should use the jar file - * from the local repository in its classpath output. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3023C() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3023"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - - verifier.deleteArtifacts("org.apache.maven.its.mng3023"); - - verifier.deleteDirectory("consumer/target"); - verifier.setLogFileName("log-c-1.txt"); - verifier.addCliArgument("generate-sources"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List compileClassPath = verifier.loadLines("consumer/target/compile.classpath", "UTF-8"); - assertTrue(compileClassPath.toString(), compileClassPath.contains("dependency-1.jar")); - assertFalse(compileClassPath.toString(), compileClassPath.contains("dependency-classes")); - - verifier.deleteDirectory("dependency/dependency-classes"); - verifier.deleteDirectory("consumer/target"); - verifier.setLogFileName("log-c-2.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - compileClassPath = verifier.loadLines("consumer/target/compile.classpath", "UTF-8"); - assertTrue(compileClassPath.toString(), compileClassPath.contains("dependency-1.jar")); - assertFalse(compileClassPath.toString(), compileClassPath.contains("dependency-classes")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3038TransitiveDepManVersionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3038TransitiveDepManVersionTest.java deleted file mode 100644 index ea2cf9fc2..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3038TransitiveDepManVersionTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.IOException; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3038 - * - * @author Joakim Erdfelt - * - */ -@Disabled("cannot reproduce") -public class MavenITmng3038TransitiveDepManVersionTest extends AbstractMavenIntegrationTestCase { - public MavenITmng3038TransitiveDepManVersionTest() { - super(ALL_MAVEN_VERSIONS); - } - - @Test - public void testitMNG3038() throws Exception { - File testDirBase = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3038"); - - compileDDep(testDirBase, "D1", "1.0"); - compileDDep(testDirBase, "D2", "2.0"); - - File testProjectDir = new File(testDirBase, "test-project"); - - Verifier verifier = newVerifier(testProjectDir.getAbsolutePath()); - verifier.deleteArtifact("org.apache.maven.its.it0121", "A", "1.0", "pom"); - verifier.deleteArtifact("org.apache.maven.its.it0121", "A", "1.0", "jar"); - verifier.deleteArtifact("org.apache.maven.its.it0121", "B", "1.0", "pom"); - verifier.deleteArtifact("org.apache.maven.its.it0121", "B", "1.0", "jar"); - verifier.deleteArtifact("org.apache.maven.its.it0121", "C", "1.0", "pom"); - verifier.deleteArtifact("org.apache.maven.its.it0121", "D", "1.0", "jar"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } - - private void compileDDep(File testDirBase, String projectDDepDir, String version) - throws VerificationException, IOException { - File testOtherDepDir = new File(testDirBase, "test-other-deps/" + projectDDepDir); - Verifier verifierOtherDep = newVerifier(testOtherDepDir.getAbsolutePath()); - verifierOtherDep.deleteArtifact("org.apache.maven.its.it0121", "D", version, "jar"); - verifierOtherDep.deleteArtifact("org.apache.maven.its.it0121", "D", version, "pom"); - verifierOtherDep.addCliArgument("install"); - verifierOtherDep.execute(); - verifierOtherDep.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3043BestEffortReactorResolutionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3043BestEffortReactorResolutionTest.java deleted file mode 100644 index d3a098798..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3043BestEffortReactorResolutionTest.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3043. - * - * @author Benjamin Bentmann - */ -public class MavenITmng3043BestEffortReactorResolutionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3043BestEffortReactorResolutionTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Test that dependencies on attached artifacts like a test JAR or an EJB client JAR which have not been built - * yet, i.e. in build phases prior to "package" like "test", are satisfied from the output directories of the - * projects in the reactor. This is meant as a best effort to provide a class path for compilation or testing. - * - * @throws Exception in case of failure - */ - @Test - public void testitTestPhase() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3043"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("consumer-a/target"); - verifier.deleteDirectory("consumer-b/target"); - verifier.deleteDirectory("consumer-c/target"); - verifier.deleteArtifacts("org.apache.maven.its.mng3043"); - verifier.setLogFileName("log-test.txt"); - verifier.addCliArgument("test"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List classpath; - - classpath = verifier.loadLines("consumer-a/target/compile.txt", "UTF-8"); - assertContains(classpath, new String[] {"classes-test"}); - assertNotContains(classpath, new String[] {"classes-main"}); - classpath = verifier.loadLines("consumer-a/target/runtime.txt", "UTF-8"); - assertContains(classpath, new String[] {"classes-test"}); - assertNotContains(classpath, new String[] {"classes-main"}); - classpath = verifier.loadLines("consumer-a/target/test.txt", "UTF-8"); - assertContains(classpath, new String[] {"classes-test"}); - assertNotContains(classpath, new String[] {"classes-main"}); - - classpath = verifier.loadLines("consumer-b/target/compile.txt", "UTF-8"); - assertContains(classpath, new String[] {"classes-main"}); - assertNotContains(classpath, new String[] {"classes-test"}); - classpath = verifier.loadLines("consumer-b/target/runtime.txt", "UTF-8"); - assertContains(classpath, new String[] {"classes-main"}); - assertNotContains(classpath, new String[] {"classes-test"}); - classpath = verifier.loadLines("consumer-b/target/test.txt", "UTF-8"); - assertContains(classpath, new String[] {"classes-main"}); - assertNotContains(classpath, new String[] {"classes-test"}); - - classpath = verifier.loadLines("consumer-c/target/compile.txt", "UTF-8"); - assertContains(classpath, new String[] {"classes-main"}); - assertContains(classpath, new String[] {"classes-test"}); - classpath = verifier.loadLines("consumer-c/target/runtime.txt", "UTF-8"); - assertContains(classpath, new String[] {"classes-main"}); - assertContains(classpath, new String[] {"classes-test"}); - classpath = verifier.loadLines("consumer-c/target/test.txt", "UTF-8"); - assertContains(classpath, new String[] {"classes-main"}); - assertContains(classpath, new String[] {"classes-test"}); - } - - /** - * Test that dependency resolution still uses the actual artifact files once these have been - * assembled/attached in the "package" phase. This ensures the class path is accurate and not locked to - * the output directories of the best effort model from above. - * - * @throws Exception in case of failure - */ - @Test - public void testitPackagePhase() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3043"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("consumer-a/target"); - verifier.deleteDirectory("consumer-b/target"); - verifier.deleteDirectory("consumer-c/target"); - verifier.deleteArtifacts("org.apache.maven.its.mng3043"); - verifier.setLogFileName("log-package.txt"); - verifier.addCliArgument("package"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - String prefix = matchesVersionRange("[4.0.0-alpha-4,)") ? "dependency-0.1-SNAPSHOT-" : ""; - - List classpath; - - classpath = verifier.loadLines("consumer-a/target/compile.txt", "UTF-8"); - assertContains(classpath, new String[] {prefix + "tests.jar"}); - assertNotContains(classpath, new String[] {prefix + "client.jar"}); - classpath = verifier.loadLines("consumer-a/target/runtime.txt", "UTF-8"); - assertContains(classpath, new String[] {prefix + "tests.jar"}); - assertNotContains(classpath, new String[] {prefix + "client.jar"}); - classpath = verifier.loadLines("consumer-a/target/test.txt", "UTF-8"); - assertContains(classpath, new String[] {prefix + "tests.jar"}); - assertNotContains(classpath, new String[] {prefix + "client.jar"}); - - classpath = verifier.loadLines("consumer-b/target/compile.txt", "UTF-8"); - assertContains(classpath, new String[] {prefix + "client.jar"}); - assertNotContains(classpath, new String[] {prefix + "tests.jar"}); - classpath = verifier.loadLines("consumer-b/target/runtime.txt", "UTF-8"); - assertContains(classpath, new String[] {prefix + "client.jar"}); - assertNotContains(classpath, new String[] {prefix + "tests.jar"}); - classpath = verifier.loadLines("consumer-b/target/test.txt", "UTF-8"); - assertContains(classpath, new String[] {prefix + "client.jar"}); - assertNotContains(classpath, new String[] {prefix + "tests.jar"}); - - classpath = verifier.loadLines("consumer-c/target/compile.txt", "UTF-8"); - assertContains(classpath, new String[] {prefix + "client.jar"}); - assertContains(classpath, new String[] {prefix + "tests.jar"}); - classpath = verifier.loadLines("consumer-c/target/runtime.txt", "UTF-8"); - assertContains(classpath, new String[] {prefix + "client.jar"}); - assertContains(classpath, new String[] {prefix + "tests.jar"}); - classpath = verifier.loadLines("consumer-c/target/test.txt", "UTF-8"); - assertContains(classpath, new String[] {prefix + "client.jar"}); - assertContains(classpath, new String[] {prefix + "tests.jar"}); - } - - private void assertContains(List collection, String[] items) { - for (String item : items) { - assertContains(collection, item); - } - } - - private void assertContains(List collection, String item) { - assertTrue(item + " missing in " + collection, collection.contains(item)); - } - - private void assertNotContains(List collection, String[] items) { - for (String item : items) { - assertNotContains(collection, item); - } - } - - private void assertNotContains(List collection, String item) { - assertFalse(item + " present in " + collection, collection.contains(item)); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3052DepRepoAggregationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3052DepRepoAggregationTest.java deleted file mode 100644 index 629056848..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3052DepRepoAggregationTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3052. - * - * When a project dependency declares its own repositories, they should be used to - * resolve that dependency's dependencies. This includes both steps: determining - * the dependency artifact information (version, etc.) AND resolving the actual - * artifact itself. - * - * NOTE: The SNAPSHOT versions are CRITICAL in this test, since they force the - * correct resolution of artifact metadata, which depends on having the correct - * set of repositories present. - * - * @author jdcasey - */ -public class MavenITmng3052DepRepoAggregationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3052DepRepoAggregationTest() { - super("(2.0.9,)"); // only test in 2.0.10+ - } - - @Test - public void testitMNG3052() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3052") - .getCanonicalFile(); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng3052"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.filterFile( - "repo-d/org/apache/maven/its/mng3052/direct/0.1-SNAPSHOT/template.pom", - "repo-d/org/apache/maven/its/mng3052/direct/0.1-SNAPSHOT/direct-0.1-20090517.133956-1.pom", - "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng3052", "direct", "0.1-SNAPSHOT", "jar"); - verifier.verifyArtifactPresent("org.apache.maven.its.mng3052", "trans", "0.1-SNAPSHOT", "jar"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3092SnapshotsExcludedFromVersionRangeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3092SnapshotsExcludedFromVersionRangeTest.java deleted file mode 100644 index ebbf0d5c4..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3092SnapshotsExcludedFromVersionRangeTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3092. - * - * @author Benjamin Bentmann - */ -@Disabled("not fixed yet") -public class MavenITmng3092SnapshotsExcludedFromVersionRangeTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3092SnapshotsExcludedFromVersionRangeTest() { - super("[3.0-beta-1,)"); - } - - /** - * Verify that snapshots are not included in version ranges unless explicitly declared as the lower/upper bound - * of the range. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3092"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng3092"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List classpath = verifier.loadLines("target/classpath.txt", "UTF-8"); - assertTrue(classpath.toString(), classpath.contains("a-1.1.jar")); - assertTrue(classpath.toString(), classpath.contains("b-1.0-SNAPSHOT.jar")); - assertTrue(classpath.toString(), classpath.contains("c-1.1-SNAPSHOT.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3099SettingsProfilesWithNoPomTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3099SettingsProfilesWithNoPomTest.java deleted file mode 100644 index 2bc267646..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3099SettingsProfilesWithNoPomTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3099. - * - * @author Brian Fox - */ -public class MavenITmng3099SettingsProfilesWithNoPomTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3099SettingsProfilesWithNoPomTest() { - super("(2.0.8,)"); // 2.0.9+ - } - - /** - * Verify that (active) profiles from the settings are effective even if no POM is in use (e.g. archetype:create). - * In more detail, this means the plugin can be resolved from the repositories given in the settings and the plugin - * can access properties defined by the profiles. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3099"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng3099"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("org.apache.maven.its.mng3099:maven-mng3099-plugin:0.1:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/PASSED.txt"); - verifier.verifyFileNotPresent("target/touch.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3118TestClassPathOrderTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3118TestClassPathOrderTest.java deleted file mode 100644 index af2bce344..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3118TestClassPathOrderTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Arrays; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3118. - * - * @author Benjamin Bentmann - */ -public class MavenITmng3118TestClassPathOrderTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3118TestClassPathOrderTest() { - super("[2.0.8,)"); - } - - /** - * Check that test classes appear before main classes on the test class path. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3118"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List testClassPath = verifier.loadLines("target/test-classpath.txt", "UTF-8"); - assertEquals(Arrays.asList(new String[] {"test-classes", "classes"}), testClassPath); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3122ActiveProfilesNoDuplicatesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3122ActiveProfilesNoDuplicatesTest.java deleted file mode 100644 index 095c4e736..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3122ActiveProfilesNoDuplicatesTest.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3122. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3122ActiveProfilesNoDuplicatesTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3122ActiveProfilesNoDuplicatesTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Verify that MavenProject.getActiveProfiles() reports profiles from the settings.xml with activeByDefault=true - * only once. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3122() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3122"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/profile.properties"); - int count = 0; - int n = Integer.parseInt(props.getProperty("project.activeProfiles", "0")); - for (int i = 0; i < n; i++) { - if ("mng3122".equals(props.getProperty("project.activeProfiles." + i + ".id"))) { - count++; - } - } - assertEquals(1, count); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3133UrlNormalizationNotBeforeInterpolationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3133UrlNormalizationNotBeforeInterpolationTest.java deleted file mode 100644 index 6db357035..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3133UrlNormalizationNotBeforeInterpolationTest.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3133. - * - * @author Benjamin Bentmann - */ -public class MavenITmng3133UrlNormalizationNotBeforeInterpolationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3133UrlNormalizationNotBeforeInterpolationTest() { - super("[3.0-beta-1,)"); - } - - /** - * Verify that URL normalization does not happen before interpolation which would result in invalid - * inherited URLs for project layouts where the parent resides in a sibling directory of the child - * and expressions are used for the parent URLs ("${expression}/../foo" -> "foo"). - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3133"); - - Verifier verifier = newVerifier(new File(testDir, "child").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/url.properties"); - String url; - - url = props.getProperty("project.url"); - assertEquals("http://server.org/child", url); - url = props.getProperty("project.scm.url"); - assertEquals("scm:svn:https://svn.org/child", url); - url = props.getProperty("project.scm.connection"); - assertEquals("scm:svn:https://svn.org/child", url); - url = props.getProperty("project.scm.developerConnection"); - assertEquals("scm:svn:https://svn.org/child", url); - url = props.getProperty("project.distributionManagement.site.url"); - assertEquals("dav://server.org/child", url); - - url = props.getProperty("project.properties.projectUrl"); - assertEquals("http://server.org/child/it", url); - url = props.getProperty("project.properties.projectScmUrl"); - assertEquals("scm:svn:https://svn.org/child/it", url); - url = props.getProperty("project.properties.projectScmConn"); - assertEquals("scm:svn:https://svn.org/child/it", url); - url = props.getProperty("project.properties.projectScmDevConn"); - assertEquals("scm:svn:https://svn.org/child/it", url); - url = props.getProperty("project.properties.projectDistSiteUrl"); - assertEquals("dav://server.org/child/it", url); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3139UseCachedMetadataOfBlacklistedRepoTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3139UseCachedMetadataOfBlacklistedRepoTest.java deleted file mode 100644 index 79230298b..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3139UseCachedMetadataOfBlacklistedRepoTest.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Collections; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3139. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3139UseCachedMetadataOfBlacklistedRepoTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3139UseCachedMetadataOfBlacklistedRepoTest() { - super("[2.0.11,2.1.0-M1),[2.1.0,)"); - } - - /** - * Test that locally cached metadata of blacklisted repositories is consulted to resolve metaversions. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3139() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3139"); - - // phase 1: get the metadata into the local repo - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng3139"); - - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.setLogFileName("log1.txt"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // phase 2: trigger blacklisting of repo (by invalid URL) and check previously downloaded metadata is still used - - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - - verifier.filterFile( - "settings-template.xml", - "settings.xml", - "UTF-8", - Collections.singletonMap("@baseurl@", "http://localhost:63412")); - verifier.setLogFileName("log2.txt"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3183LoggingToFileTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3183LoggingToFileTest.java deleted file mode 100644 index f90ba8ebb..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3183LoggingToFileTest.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3183. - * - * @author Benjamin Bentmann - */ -public class MavenITmng3183LoggingToFileTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3183LoggingToFileTest() { - super("[3.0-alpha-1,)"); - } - - /** - * Test that the CLI parameter -l can be used to direct logging to a file. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3183"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("-l"); - verifier.addCliArgument("maven.log"); - verifier.setLogFileName("stdout.txt"); - new File(testDir, "stdout.txt").delete(); - new File(testDir, "maven.log").delete(); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List stdout = verifier.loadLines("stdout.txt", "UTF-8"); - - for (Iterator it = stdout.iterator(); it.hasNext(); ) { - String line = it.next(); - if (line.startsWith("+") || line.startsWith("EMMA")) { - it.remove(); - } - } - - assertEquals(Collections.EMPTY_LIST, stdout); - - List log = verifier.loadLines("maven.log", "UTF-8"); - - assertFalse(log.isEmpty()); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3203DefaultLifecycleExecIdTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3203DefaultLifecycleExecIdTest.java deleted file mode 100644 index 0d72c6906..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3203DefaultLifecycleExecIdTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3203. - * - * todo Fill in a better description of what this test verifies! - * - * @author Brian Fox - * @author jdcasey - * - */ -public class MavenITmng3203DefaultLifecycleExecIdTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3203DefaultLifecycleExecIdTest() { - super("[2.2.0,)"); - } - - @Test - public void testitMNG3203() throws Exception { - // The testdir is computed from the location of this - // file. - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3203"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - - verifier.addCliArgument("compile"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3208ProfileAwareReactorSortingTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3208ProfileAwareReactorSortingTest.java deleted file mode 100644 index 82854602e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3208ProfileAwareReactorSortingTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Arrays; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3208. - * - * @author Benjamin Bentmann - */ -public class MavenITmng3208ProfileAwareReactorSortingTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3208ProfileAwareReactorSortingTest() { - super("[2.0.3,)"); - } - - /** - * Verify that project sorting considers dependencies injected by profiles. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3208"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-Pmng3208"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List order = verifier.loadLines("target/order.txt", "UTF-8"); - assertEquals(Arrays.asList(new String[] {"mod-b", "mod-a"}), order); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3217InterPluginDependencyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3217InterPluginDependencyTest.java deleted file mode 100644 index ea7876650..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3217InterPluginDependencyTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3217. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3217InterPluginDependencyTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3217InterPluginDependencyTest() { - super("[2.1.0-M2,)"); - } - - /** - * Verify that the dependency of plugin A on some plugin B does not influence the build of another module in the - * reactor that uses a different version of plugin B for normal build tasks. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3217() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3217"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("sub-1/target"); - verifier.deleteDirectory("sub-2/target"); - verifier.deleteArtifacts("org.apache.maven.its.mng3217"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("sub-1/target/touch-1.txt"); - verifier.verifyFilePresent("sub-2/target/touch-2.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3220ImportScopeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3220ImportScopeTest.java deleted file mode 100644 index b465e406d..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3220ImportScopeTest.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3220. - * - * - */ -public class MavenITmng3220ImportScopeTest extends AbstractMavenIntegrationTestCase { - public MavenITmng3220ImportScopeTest() { - super("(2.0.8,3.0-alpha-1),[3.0-alpha-3,)"); - } - - @Test - public void testitMNG3220a() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3220"); - - testDir = new File(testDir, "imported-pom-depMgmt"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng3220"); - verifier.filterFile("../settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } - - @Test - public void testitMNG3220b() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3220"); - - testDir = new File(testDir, "depMgmt-pom-module-notImported"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng3220"); - verifier.filterFile("../settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Should fail to build with missing junit version."); - } catch (VerificationException e) { - // expected - } - - List lines = verifier.loadFile(new File(testDir, "log.txt"), false); - - boolean found = false; - for (String line : lines) { - if (line.contains("\'dependencies.dependency.version\' is missing for junit:junit") - || line.contains("\'dependencies.dependency.version\' for junit:junit:jar is missing")) { - found = true; - break; - } - } - - assertTrue("Should have found validation error line in output.", found); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3259DepsDroppedInMultiModuleBuildTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3259DepsDroppedInMultiModuleBuildTest.java deleted file mode 100644 index 0367992fd..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3259DepsDroppedInMultiModuleBuildTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3259. - * - * - */ -public class MavenITmng3259DepsDroppedInMultiModuleBuildTest extends AbstractMavenIntegrationTestCase { - - /* - * TODO: All combinations from the cross product {jdk-1.4.2_16, jdk-1.5.0_14, jdk-1.6.0_07} x {mvn-2.0.7, mvn-2.0.8} - * passed this test for me (bentmann on WinXP). This makes the test appear very weak. - */ - public MavenITmng3259DepsDroppedInMultiModuleBuildTest() { - super("(2.0.8,)"); - } - - @Test - public void testitMNG3259() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3259"); - - Verifier verifier; - - verifier = newVerifier(new File(testDir, "parent").getAbsolutePath(), "remote"); - - verifier.addCliArgument("install"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - - verifier.addCliArgument("install"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3268MultipleHyphenPCommandLineTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3268MultipleHyphenPCommandLineTest.java deleted file mode 100644 index d3c9d6be8..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3268MultipleHyphenPCommandLineTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3268. - * - * - */ -public class MavenITmng3268MultipleHyphenPCommandLineTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3268MultipleHyphenPCommandLineTest() { - super("(2.0.9,)"); - } - - @Test - public void testMultipleProfileParams() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3268"); - - Verifier verifier; - - verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - - verifier.addCliArgument("-Pprofile1,profile2"); - verifier.addCliArgument("-Pprofile3"); - verifier.addCliArgument("-P"); - verifier.addCliArgument("profile4"); - verifier.addCliArgument("package"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - verifier.verifyFilePresent("target/profile1/touch.txt"); - verifier.verifyFilePresent("target/profile2/touch.txt"); - verifier.verifyFilePresent("target/profile3/touch.txt"); - verifier.verifyFilePresent("target/profile4/touch.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3284UsingCachedPluginsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3284UsingCachedPluginsTest.java deleted file mode 100644 index 8c3baa1bd..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3284UsingCachedPluginsTest.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3284: - * that explicitly defined plugins are used, not the one that is cached. - */ -public class MavenITmng3284UsingCachedPluginsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3284UsingCachedPluginsTest() { - super("[2.1.0-M2,)"); - } - - /** - * Verify that the effective plugin versions used for a project are not influenced by other instances of this - * plugin in the reactor, i.e. each module gets exactly the plugin version it declares. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3284() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3284"); - - /* - * Phase 1: Ensure both plugin versions are already in the local repo. This is a crucial prerequisite for the - * test because downloading the plugins just-in-time during the test build would trigger a timestamp-based - * reloading of the plugin container by the DefaultPluginManager in Maven 2.x, thereby hiding the bug we want - * to expose here. - */ - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng3284"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - /* - * Phase 2: Now that the plugin versions have been downloaded to the local repo, run the actual test. - */ - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("mod-a/target"); - verifier.deleteDirectory("mod-b/target"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("mod-a/target/version-0.1.txt"); - verifier.verifyFileNotPresent("mod-a/target/version-0.2.txt"); - verifier.verifyFilePresent("mod-b/target/version-0.2.txt"); - verifier.verifyFileNotPresent("mod-b/target/version-0.1.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3288SystemScopeDirTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3288SystemScopeDirTest.java deleted file mode 100644 index d44c979d7..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3288SystemScopeDirTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test for MNG-3288. - * - * @author Benjamin Bentmann - */ -public class MavenITmng3288SystemScopeDirTest extends AbstractMavenIntegrationTestCase { - public MavenITmng3288SystemScopeDirTest() { - super("[2.0.9,)"); - } - - /** - * Test the use of a system scoped dependency to a directory instead of a JAR which should fail early. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3288() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3288"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - fail("Usage of directory instead of file for system-scoped dependency did not fail dependency resolution"); - } catch (VerificationException e) { - // expected, of a system-scoped dependency should be a file, not a directory - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3297DependenciesNotLeakedToMojoTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3297DependenciesNotLeakedToMojoTest.java deleted file mode 100644 index e56473463..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3297DependenciesNotLeakedToMojoTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3297. - * - * @author Benjamin Bentmann - */ -public class MavenITmng3297DependenciesNotLeakedToMojoTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3297DependenciesNotLeakedToMojoTest() { - super("[3.0-alpha-7,)"); - } - - /** - * Test that project dependencies resolved for one mojo are not exposed to another mojo if the latter - * does not require dependency resolution. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3297"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("initialize"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List artifacts = verifier.loadLines("target/artifacts.txt", "UTF-8"); - assertEquals(artifacts.toString(), 1, artifacts.size()); - - Properties props = verifier.loadProperties("target/artifact.properties"); - assertEquals("0", props.getProperty("project.artifacts")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3314OfflineSnapshotsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3314OfflineSnapshotsTest.java deleted file mode 100644 index 753b736a3..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3314OfflineSnapshotsTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3314. - * - * Verifies that offline mode functions correctly for snapshot dependencies. - * - * @author Brian Fox - * @author jdcasey - */ -public class MavenITmng3314OfflineSnapshotsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3314OfflineSnapshotsTest() { - super("(2.0.9,2.1.0-M1),(2.1.0-M1,)"); // only test in 2.0.10+, and not in 2.1.0-M1 - } - - /** - * Verify that snapshot dependencies which are scheduled for an update don't fail the build when in offline mode. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3314() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3314"); - - { - // phase 1: run build in online mode to fill local repo - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.deleteArtifacts("org.apache.maven.its.mng3314"); - verifier.setLogFileName("log1.txt"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyFilePresent("target/compile.txt"); - verifier.verifyErrorFreeLog(); - } - - { - // phase 2: run build in offline mode to check it still passes - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setLogFileName("log2.txt"); - verifier.addCliArgument("-o"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyFilePresent("target/compile.txt"); - verifier.verifyErrorFreeLog(); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3331ModulePathNormalizationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3331ModulePathNormalizationTest.java deleted file mode 100644 index 2c56bad48..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3331ModulePathNormalizationTest.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3331. - * - * @author Brian Fox - * - */ -public class MavenITmng3331ModulePathNormalizationTest extends AbstractMavenIntegrationTestCase { - public MavenITmng3331ModulePathNormalizationTest() { - super(ALL_MAVEN_VERSIONS); - } - - @Test - public void testitMNG3331a() throws Exception { - // testMNG3331ModuleWithSpaces - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3331/with-spaces"); - - Verifier verifier; - - verifier = newVerifier(testDir.getAbsolutePath()); - - verifier.addCliArgument("initialize"); - verifier.execute(); - - /* - * This is the simplest way to check a build - * succeeded. It is also the simplest way to create - * an IT test: make the build pass when the test - * should pass, and make the build fail when the - * test should fail. There are other methods - * supported by the verifier. They can be seen here: - * http://maven.apache.org/shared/maven-verifier/apidocs/index.html - */ - verifier.verifyErrorFreeLog(); - } - - @Test - public void testitMNG3331b() throws Exception { - // testMNG3331ModuleWithRelativeParentDirRef - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3331/with-relative-parentDir-ref"); - - Verifier verifier; - - verifier = newVerifier(new File(testDir, "parent").getAbsolutePath()); - - verifier.addCliArgument("initialize"); - verifier.execute(); - - /* - * This is the simplest way to check a build - * succeeded. It is also the simplest way to create - * an IT test: make the build pass when the test - * should pass, and make the build fail when the - * test should fail. There are other methods - * supported by the verifier. They can be seen here: - * http://maven.apache.org/shared/maven-verifier/apidocs/index.html - */ - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3355TranslatedPathInterpolationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3355TranslatedPathInterpolationTest.java deleted file mode 100644 index 8e02604d5..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3355TranslatedPathInterpolationTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3355. - * - * - */ -public class MavenITmng3355TranslatedPathInterpolationTest extends AbstractMavenIntegrationTestCase { - public MavenITmng3355TranslatedPathInterpolationTest() { - super("(2.0.8,)"); // 2.0.9+ - } - - @Test - public void testitMNG3355() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3355"); - - Verifier verifier; - - verifier = newVerifier(testDir.getAbsolutePath()); - - verifier.addCliArgument("-Dversion=foo"); - verifier.addCliArgument("validate"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3372DirectInvocationOfPluginsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3372DirectInvocationOfPluginsTest.java deleted file mode 100644 index c62c8f300..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3372DirectInvocationOfPluginsTest.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3372. - * - * - */ -public class MavenITmng3372DirectInvocationOfPluginsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3372DirectInvocationOfPluginsTest() { - super("(2.0.5,)"); - } - - @Test - public void testitMNG3372() throws Exception { - // The testdir is computed from the location of this - // file. - File testBaseDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3372/direct-using-prefix"); - File plugin = new File(testBaseDir, "plugin"); - File project = new File(testBaseDir, "project"); - File settingsFile = new File(testBaseDir, "settings.xml"); - - Verifier verifier = newVerifier(plugin.getAbsolutePath(), "remote"); - - verifier.deleteArtifacts("org.apache.maven.its.mng3372"); - - verifier.getSystemProperties().setProperty("updateReleaseInfo", "true"); - - verifier.addCliArguments("clean", "install"); - verifier.execute(); - - verifier = newVerifier(project.getAbsolutePath()); - - verifier.addCliArgument("-s"); - verifier.addCliArgument("\"" + settingsFile.getAbsolutePath() + "\""); - - verifier.addCliArgument("mng3372:test"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - } - - @Test - public void testDependencyTreeInvocation() throws Exception { - // The testdir is computed from the location of this - // file. - File testBaseDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3372/dependency-tree"); - - Verifier verifier = newVerifier(testBaseDir.getAbsolutePath(), "remote"); - - verifier.addCliArgument("-U"); - - verifier.addCliArgument("dependency:tree"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3379ParallelArtifactDownloadsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3379ParallelArtifactDownloadsTest.java deleted file mode 100644 index 88ca44089..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3379ParallelArtifactDownloadsTest.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3379. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3379ParallelArtifactDownloadsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3379ParallelArtifactDownloadsTest() { - super("[2.0.5,3.0-alpha-1),[3.0-alpha-2,)"); - } - - /** - * Tests that parallel downloads of artifacts from both the same and from different group ids don't corrupt - * the local repo. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3379() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3379"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng3379.a"); - verifier.deleteArtifacts("org.apache.maven.its.mng3379.b"); - verifier.deleteArtifacts("org.apache.maven.its.mng3379.c"); - verifier.deleteArtifacts("org.apache.maven.its.mng3379.d"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("-Dmaven.artifact.threads=16"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - String gid = "org.apache.maven.its.mng3379."; - assertArtifact(verifier, gid + "a", "x", "0.2-SNAPSHOT", "", "jar", "69c041c12f35894230c7c23c49cd245886c6fb6f"); - assertArtifact(verifier, gid + "a", "x", "0.2-SNAPSHOT", "", "pom", "04a8ecb6dc279585b6d17552a4518805f0ff33b9"); - assertArtifact( - verifier, gid + "a", "x", "0.2-SNAPSHOT", "tests", "jar", "69c041c12f35894230c7c23c49cd245886c6fb6f"); - assertArtifact( - verifier, gid + "a", "x", "0.2-SNAPSHOT", "sources", "jar", "166f8bef02b9e92f99ec3b163d8321dd1d087e34"); - assertArtifact( - verifier, gid + "a", "x", "0.2-SNAPSHOT", "javadoc", "jar", "4d96e09f7e93870685a317c574f851b407224415"); - assertMetadata(verifier, gid + "a", "x", "0.2-SNAPSHOT", "e1cfc3a77657fc46bb624dee25c61b290e5b4dd7"); - - assertArtifact(verifier, gid + "b", "x", "0.2-SNAPSHOT", "", "jar", "efb7c4046565774cd7e44645e02f06ecdf91098d"); - assertArtifact(verifier, gid + "b", "x", "0.2-SNAPSHOT", "", "pom", "834b45a91af07702a59855bf99614c099979c065"); - assertArtifact( - verifier, gid + "b", "x", "0.2-SNAPSHOT", "tests", "jar", "efb7c4046565774cd7e44645e02f06ecdf91098d"); - assertArtifact( - verifier, gid + "b", "x", "0.2-SNAPSHOT", "sources", "jar", "9ad231fc04ea1114987c377cc5cbccfbf83e3dbf"); - assertArtifact( - verifier, gid + "b", "x", "0.2-SNAPSHOT", "javadoc", "jar", "7807daefd3af3be73d3b92f9c5ab1b52510c0767"); - assertMetadata(verifier, gid + "b", "x", "0.2-SNAPSHOT", "5ccc4edfb503f9a5ccadedf102dff8943250d830"); - assertMetadata(verifier, gid + "b", "x", "8f38b1041871f22dcb031544d8a3436c335bfcdb"); - - assertArtifact(verifier, gid + "c", "x", "0.2-SNAPSHOT", "", "jar", "1eb0d5a421b3074e8a69b0dcca7e325c0636a932"); - assertArtifact(verifier, gid + "c", "x", "0.2-SNAPSHOT", "", "pom", "f25d7907d7bd9807e823d15f49363de7826204b0"); - assertArtifact( - verifier, gid + "c", "x", "0.2-SNAPSHOT", "tests", "jar", "1eb0d5a421b3074e8a69b0dcca7e325c0636a932"); - assertArtifact( - verifier, gid + "c", "x", "0.2-SNAPSHOT", "sources", "jar", "82f9664b3a910fb861fc4ed2b79e39d8f95e3675"); - assertArtifact( - verifier, gid + "c", "x", "0.2-SNAPSHOT", "javadoc", "jar", "64a3bfe19b294f67b1c52a2514c58922b88e5f97"); - assertMetadata(verifier, gid + "c", "x", "0.2-SNAPSHOT", "b31ef40a51bdab4e6e44bfe3f2d1da42e5e42e46"); - assertMetadata(verifier, gid + "c", "x", "c4848e60d226ec6304df3abd9eba8fdb301b3660"); - - assertArtifact(verifier, gid + "d", "x", "0.2-SNAPSHOT", "", "jar", "3d606c564625a594165bcbbe4a24c8f11b18b5a0"); - assertArtifact(verifier, gid + "d", "x", "0.2-SNAPSHOT", "", "pom", "4255f7a5781e1be7564a09c86eee140fad042de8"); - assertArtifact( - verifier, gid + "d", "x", "0.2-SNAPSHOT", "tests", "jar", "3d606c564625a594165bcbbe4a24c8f11b18b5a0"); - assertArtifact( - verifier, gid + "d", "x", "0.2-SNAPSHOT", "sources", "jar", "35a7e140307f4bb67984dc72aa551f0faabacd36"); - assertArtifact( - verifier, gid + "d", "x", "0.2-SNAPSHOT", "javadoc", "jar", "2fe3487f496fe66f23772b1bada066ec6bd9222f"); - assertMetadata(verifier, gid + "d", "x", "0.2-SNAPSHOT", "a0d0b5efd5d6f6a921a3f7c1a6a503359fccef04"); - assertMetadata(verifier, gid + "d", "x", "1d2bf926862f2131f1229328e588b906b087bdb3"); - } - - private void assertArtifact( - Verifier verifier, String gid, String aid, String ver, String cls, String ext, String sha1) - throws Exception { - File file = new File(verifier.getArtifactPath(gid, aid, ver, ext, cls)); - assertTrue(file.getAbsolutePath(), file.isFile()); - assertEquals(sha1, ItUtils.calcHash(file, "SHA-1")); - } - - private void assertMetadata(Verifier verifier, String gid, String aid, String ver, String sha1) throws Exception { - String name = "maven-metadata-maven-core-it.xml"; - File file = new File(verifier.getArtifactMetadataPath(gid, aid, ver, name)); - assertTrue(file.getAbsolutePath(), file.isFile()); - assertEquals(sha1, ItUtils.calcHash(file, "SHA-1")); - } - - private void assertMetadata(Verifier verifier, String gid, String aid, String sha1) throws Exception { - String name = "maven-metadata-maven-core-it.xml"; - File file = new File(verifier.getArtifactMetadataPath(gid, aid, null, name)); - assertTrue(file.getAbsolutePath(), file.isFile()); - assertEquals(sha1, ItUtils.calcHash(file, "SHA-1")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3380ManagedRelocatedTransdepsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3380ManagedRelocatedTransdepsTest.java deleted file mode 100644 index f9d461dd1..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3380ManagedRelocatedTransdepsTest.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3380. - * - * expected project.getArtifacts() results: - * - * org.apache.maven.its.mng3380:direct:jar:1:compile - * org.apache.maven.its.mng3380.new:transitive:jar:2:compile - * org.apache.maven.its.mng3380.other:a:jar:1:compile - * org.apache.maven.its.mng3380.other:b:jar:1:compile - * - * - */ -public class MavenITmng3380ManagedRelocatedTransdepsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3380ManagedRelocatedTransdepsTest() { - super("(2.0.9,)"); - } - - /** - * Verify that dependency resolution considers dependency management also for relocated artifacts. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3380() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3380"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng3380"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List artifacts = verifier.loadLines("target/artifacts.txt", "UTF-8"); - assertEquals(4, artifacts.size()); - assertEquals("org.apache.maven.its.mng3380:direct:jar:1", artifacts.get(0)); - assertEquals("org.apache.maven.its.mng3380.new:transitive:jar:2", artifacts.get(1)); - assertEquals("org.apache.maven.its.mng3380.other:a:jar:1", artifacts.get(2)); - assertEquals("org.apache.maven.its.mng3380.other:b:jar:1", artifacts.get(3)); - - List paths = verifier.loadLines("target/test.txt", "UTF-8"); - assertEquals(6, paths.size()); - assertEquals("direct-1.jar", paths.get(2)); - assertEquals("transitive-2.jar", paths.get(3)); - assertEquals("a-1.jar", paths.get(4)); - assertEquals("b-1.jar", paths.get(5)); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3394POMPluginVersionDominanceTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3394POMPluginVersionDominanceTest.java deleted file mode 100644 index 6f7795915..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3394POMPluginVersionDominanceTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3394: - * it checks that plugin versions in the POM obey the correct order - * of precedence. Specifically, that mojos in the default lifecycle - * bindings can find plugin versions in the pluginManagement section - * when the build/plugins section is missing that plugin, and that - * plugin versions in build/plugins override those in build/pluginManagement. - */ -public class MavenITmng3394POMPluginVersionDominanceTest extends AbstractMavenIntegrationTestCase { - - private static final String BASEDIR_PREFIX = "/mng-3394/"; - - public MavenITmng3394POMPluginVersionDominanceTest() { - super("(2.0.8,)"); // only test in 2.0.9+ - } - - @Test - public void testitMNG3394a() throws Exception { - // testShouldUsePluginVersionFromPluginMgmtForLifecycleMojoWhenNotInBuildPlugins - File testDir = ResourceExtractor.simpleExtractResources( - getClass(), BASEDIR_PREFIX + "lifecycleMojoVersionInPluginMgmt"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("process-resources"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/resources-resources.txt"); - } - - @Test - public void testitMNG3394b() throws Exception { - // testShouldPreferPluginVersionFromBuildPluginsOverThatInPluginMgmt - File testDir = ResourceExtractor.simpleExtractResources( - getClass(), BASEDIR_PREFIX + "preferBuildPluginOverPluginMgmt"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("clean"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/clean-clean.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3396DependencyManagementForOverConstrainedRangesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3396DependencyManagementForOverConstrainedRangesTest.java deleted file mode 100644 index 9e34f8d59..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3396DependencyManagementForOverConstrainedRangesTest.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3396. - * - * - */ -public class MavenITmng3396DependencyManagementForOverConstrainedRangesTest extends AbstractMavenIntegrationTestCase { - private static final String GROUP_ID = "org.apache.maven.its.mng3396"; - - public MavenITmng3396DependencyManagementForOverConstrainedRangesTest() { - super("(2.0.8,)"); // 2.0.9+ - } - - @Test - public void testitMNG3396() throws Exception { - String baseDir = "/mng-3396"; - File testDir = ResourceExtractor.simpleExtractResources(getClass(), baseDir + "/dependencies"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - verifier.deleteArtifact(GROUP_ID, "A", "1.0", "pom"); - verifier.deleteArtifact(GROUP_ID, "A", "1.0", "jar"); - verifier.deleteArtifact(GROUP_ID, "B", "1.0", "pom"); - verifier.deleteArtifact(GROUP_ID, "B", "1.0", "jar"); - verifier.addCliArgument("-Dmaven.experimental.buildconsumer=false"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - testDir = ResourceExtractor.simpleExtractResources(getClass(), baseDir + "/plugin"); - - verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - verifier.deleteArtifact(GROUP_ID, "A", "1.0", "pom"); - verifier.deleteArtifact(GROUP_ID, "A", "1.0", "jar"); - verifier.deleteArtifact(GROUP_ID, "A", "3.0", "pom"); - verifier.deleteArtifact(GROUP_ID, "A", "3.0", "jar"); - verifier.deleteArtifact(GROUP_ID, "plugin", "1.0", "pom"); - verifier.deleteArtifact(GROUP_ID, "plugin", "1.0", "jar"); - verifier.addCliArgument("-Dmaven.experimental.buildconsumer=false"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - testDir = ResourceExtractor.simpleExtractResources(getClass(), baseDir + "/pluginuser"); - - verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - verifier.deleteArtifact(GROUP_ID, "pluginuser", "1.0", "pom"); - verifier.deleteArtifact(GROUP_ID, "pluginuser", "1.0", "jar"); - verifier.addCliArgument("-Dmaven.experimental.buildconsumer=false"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3401CLIDefaultExecIdTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3401CLIDefaultExecIdTest.java deleted file mode 100644 index 225c2d9ea..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3401CLIDefaultExecIdTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3401. - * - * @author Brian Fox - * @author jdcasey - */ -public class MavenITmng3401CLIDefaultExecIdTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3401CLIDefaultExecIdTest() { - super("[2.2.0,)"); - } - - /** - * Test that the configuration of an execution block with the id "default-cli" applies to direct CLI - * invocations of a goal as well if the plugin is configured under build/plugins. - * - * @throws Exception in case of failure - */ - @Test - public void testitWithoutPluginManagement() throws Exception { - testit("without-mgmt"); - } - - /** - * Test that the configuration of an execution block with the id "default-cli" applies to direct CLI - * invocations of a goal as well if the plugin is configured under build/pluginManagement/plugins. - * - * @throws Exception in case of failure - */ - @Test - public void testitWithPluginManagement() throws Exception { - testit("with-mgmt"); - } - - private void testit(String project) throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3401/" + project); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-configuration:2.1-SNAPSHOT:config"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/config.properties"); - - assertEquals("PASSED", props.getProperty("stringParam")); - - assertEquals("4", props.getProperty("stringParams")); - assertEquals("a", props.getProperty("stringParams.0")); - assertEquals("c", props.getProperty("stringParams.1")); - assertEquals("b", props.getProperty("stringParams.2")); - assertEquals("d", props.getProperty("stringParams.3")); - - assertEquals("maven-core-it", props.getProperty("defaultParam")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3415JunkRepositoryMetadataTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3415JunkRepositoryMetadataTest.java deleted file mode 100644 index 432c1e2c2..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3415JunkRepositoryMetadataTest.java +++ /dev/null @@ -1,291 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import java.io.File; -import java.io.IOException; -import java.util.Deque; -import java.util.Map; -import java.util.concurrent.ConcurrentLinkedDeque; - -import org.apache.maven.shared.utils.io.FileUtils; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.server.Handler; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.AbstractHandler; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3415. - */ -public class MavenITmng3415JunkRepositoryMetadataTest extends AbstractMavenIntegrationTestCase { - private static final String RESOURCE_BASE = "/mng-3415"; - - public MavenITmng3415JunkRepositoryMetadataTest() { - // we're going to control the test execution according to the maven version present within each test method. - // all methods should execute as long as we're using maven 2.0.9+, but the specific tests may vary a little - // depending on which version we're using above 2.0.8. - super("(2.0.8,)"); // only test in 2.0.9+ - } - - /** - * This test simply verifies that when a metadata transfer fails (network error, etc.) - * no metadata file is written to the local repository. - *

- * Steps executed to verify this test: - *

- * 0. Find the local repository directory: - * a. build the maven-find-local-repo-plugin, then run it, to spit out the path of the - * local repository in use by default. Read the output file to get this path. - * (Yes, it's heavy, but it's reliable.) - * 1. Setup the test: - * a. Make sure the metadata for the test-repo is NOT in the local repository. - * b. Make sure the dependency POM IS in the local repository, so we're not - * distracted by failed builds that are unrelated. - * c. Create the settings file for use in this test, which contains the invalid - * remote repository entry. - * 2. Build the test project the first time - * a. Verify that a TransferFailedException is in the build output for the test-repo - * b. Verify that the metadata for the dependency POM is NOT in the local - * repository afterwards. - * 3. Build the test project the second time - * a. See (2.a) and (2.b) above; the same criteria applies here. - * - * @throws Exception in case of failure - */ - @Test - public void testitTransferFailed() throws Exception { - String methodName = getMethodName(); - - File testDir = ResourceExtractor.simpleExtractResources(getClass(), RESOURCE_BASE); - - Verifier verifier; - - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng3415"); - - setupDummyDependency(verifier, testDir, true); - - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@protocol@", "invalid"); - filterProps.put("@port@", "0"); - File settings = verifier.filterFile("settings-template.xml", "settings-a.xml", "UTF-8", filterProps); - - verifier.addCliArgument("-X"); - verifier.addCliArgument("-s"); - verifier.addCliArgument(settings.getName()); - - verifier.setLogFileName("log-" + methodName + "-firstBuild.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - assertMetadataMissing(verifier); - - setupDummyDependency(verifier, testDir, true); - - verifier.setLogFileName("log-" + methodName + "-secondBuild.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - assertMetadataMissing(verifier); - } - - private String getMethodName() { - return new Throwable().getStackTrace()[1].getMethodName(); - } - - /** - * This test simply verifies that when metadata doesn't exist on the remote - * repository, a basic metadata file is written to the local repository. - *

- * Steps executed to verify this test: - *

- * 0. Find the local repository directory: - * a. build the maven-find-local-repo-plugin, then run it, to spit out the path of the - * local repository in use by default. Read the output file to get this path. - * (Yes, it's heavy, but it's reliable.) - * 1. Setup the test: - * a. Make sure the metadata for the test-repo is NOT in the local repository. - * b. Make sure the dependency POM IS in the local repository, so we're not - * distracted by failed builds that are unrelated. - * c. Create the settings file for use in this test, which contains the VALID - * remote repository entry. - * 2. Build the test project the first time - * a. Verify that the remote repository is checked for the metadata file - * 3. Build the test project the second time - * a. Verify that the remote repository is NOT checked for the metadata file again - * b. Verify that the file used for updateInterval calculations was NOT changed from - * the first build. - * - * @throws Exception in case of failure - */ - @Test - public void testShouldNotRepeatedlyUpdateOnResourceNotFoundException() throws Exception { - String methodName = getMethodName(); - - File testDir = ResourceExtractor.simpleExtractResources(getClass(), RESOURCE_BASE); - - Verifier verifier; - - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng3415"); - - final Deque requestUris = new ConcurrentLinkedDeque<>(); - - Handler repoHandler = new AbstractHandler() { - @Override - public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { - System.out.println("Handling " + request.getMethod() + " " + request.getRequestURL()); - - requestUris.add(request.getRequestURI()); - - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - - ((Request) request).setHandled(true); - } - }; - - Server server = new Server(0); - server.setHandler(repoHandler); - - try { - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - - int port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + port); - - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@protocol@", "http"); - filterProps.put("@port@", Integer.toString(port)); - File settings = verifier.filterFile("settings-template.xml", "settings-b.xml", "UTF-8", filterProps); - - verifier.addCliArgument("-X"); - verifier.addCliArgument("-s"); - verifier.addCliArgument(settings.getName()); - - setupDummyDependency(verifier, testDir, true); - - verifier.setLogFileName("log-" + methodName + "-firstBuild.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - assertTrue( - requestUris.toString(), - requestUris.contains("/org/apache/maven/its/mng3415/missing/1.0-SNAPSHOT/maven-metadata.xml")); - - requestUris.clear(); - - File updateCheckFile = getUpdateCheckFile(verifier); - long firstLastMod = updateCheckFile.lastModified(); - - setupDummyDependency(verifier, testDir, false); - - verifier.setLogFileName("log-" + methodName + "-secondBuild.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - assertFalse( - requestUris.toString(), - requestUris.contains("/org/apache/maven/its/mng3415/missing/1.0-SNAPSHOT/maven-metadata.xml")); - - assertEquals( - "Last-modified time should be unchanged from first build through second build for the file we use for" - + " updateInterval checks.", - firstLastMod, - updateCheckFile.lastModified()); - } finally { - server.stop(); - server.join(); - } - } - - private void assertMetadataMissing(Verifier verifier) { - File metadata = getMetadataFile(verifier); - - assertFalse( - "Metadata file should NOT be present in local repository: " + metadata.getAbsolutePath(), - metadata.exists()); - } - - private void setupDummyDependency(Verifier verifier, File testDir, boolean resetUpdateInterval) throws IOException { - String gid = "org.apache.maven.its.mng3415"; - String aid = "missing"; - String version = "1.0-SNAPSHOT"; - - if (resetUpdateInterval) { - verifier.deleteArtifacts(gid); - } - - File pom = new File(verifier.getArtifactPath(gid, aid, version, "pom")); - - File pomSrc = new File(testDir, "dependency-pom.xml"); - - System.out.println("Copying dependency POM\nfrom: " + pomSrc + "\nto: " + pom); - FileUtils.copyFile(pomSrc, pom); - } - - private File getMetadataFile(Verifier verifier) { - String gid = "org.apache.maven.its.mng3415"; - String aid = "missing"; - String version = "1.0-SNAPSHOT"; - String name = "maven-metadata-testing-repo.xml"; - - return new File(verifier.getArtifactMetadataPath(gid, aid, version, name)); - } - - /** - * If the current maven version is < 3.0, we'll use the metadata file itself (old maven-artifact code)... - * otherwise, use the new resolver-status.properties file (new artifact code). - */ - private File getUpdateCheckFile(Verifier verifier) { - String gid = "org.apache.maven.its.mng3415"; - String aid = "missing"; - String version = "1.0-SNAPSHOT"; - String name; - - // < 3.0 (including snapshots) - if (matchesVersionRange("(2.0.8,3.0-alpha-1)")) { - name = "maven-metadata-testing-repo.xml"; - } else { - name = "resolver-status.properties"; - } - - return new File(verifier.getArtifactMetadataPath(gid, aid, version, name)); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3422ActiveComponentCollectionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3422ActiveComponentCollectionTest.java deleted file mode 100644 index 062f13d0e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3422ActiveComponentCollectionTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3422. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3422ActiveComponentCollectionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3422ActiveComponentCollectionTest() { - super("[2.0,)"); - } - - /** - * Verify that active collections of core components are properly injected into plugins. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3422() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3422"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/layout.properties"); - assertNotEquals("0", props.getProperty("layouts", "0")); - assertNotEquals("", props.getProperty("layouts.default", "")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3441MetadataUpdatedFromDeploymentRepositoryTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3441MetadataUpdatedFromDeploymentRepositoryTest.java deleted file mode 100644 index 5a976b97d..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3441MetadataUpdatedFromDeploymentRepositoryTest.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.FileReader; -import java.io.IOException; - -import org.apache.maven.shared.utils.io.FileUtils; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.codehaus.plexus.util.xml.Xpp3Dom; -import org.codehaus.plexus.util.xml.Xpp3DomBuilder; -import org.codehaus.plexus.util.xml.pull.XmlPullParserException; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3441. - * - * - */ -public class MavenITmng3441MetadataUpdatedFromDeploymentRepositoryTest extends AbstractMavenIntegrationTestCase { - public MavenITmng3441MetadataUpdatedFromDeploymentRepositoryTest() { - super("(2.0.8,)"); - } - - @Test - public void testitMNG3441() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3441"); - - File targetRepository = new File(testDir, "target-repo"); - FileUtils.deleteDirectory(targetRepository); - FileUtils.copyDirectoryStructure(new File(testDir, "deploy-repo"), targetRepository); - - Verifier verifier; - - verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("deploy"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - Xpp3Dom dom = readDom(new File( - targetRepository, "org/apache/maven/its/mng3441/test-artifact/1.0-SNAPSHOT/maven-metadata.xml")); - assertEquals( - "2", - dom.getChild("versioning") - .getChild("snapshot") - .getChild("buildNumber") - .getValue()); - - dom = readDom(new File(targetRepository, "org/apache/maven/its/mng3441/maven-metadata.xml")); - Xpp3Dom[] plugins = dom.getChild("plugins").getChildren(); - assertEquals("other-plugin", plugins[0].getChild("prefix").getValue()); - assertEquals("test-artifact", plugins[1].getChild("prefix").getValue()); - } - - private Xpp3Dom readDom(File file) throws XmlPullParserException, IOException { - try (FileReader reader = new FileReader(file)) { - return Xpp3DomBuilder.build(reader); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3461MirrorMatchingTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3461MirrorMatchingTest.java deleted file mode 100644 index 90b8ec6a3..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3461MirrorMatchingTest.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import java.io.File; -import java.io.IOException; -import java.util.Map; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.server.Handler; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.AbstractHandler; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3461. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3461MirrorMatchingTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3461MirrorMatchingTest() { - super("(2.0.8,)"); - } - - /** - * Test that mirror definitions are properly evaluated. In particular, an exact match by id should always - * win over wildcard matches. - * - * @throws Exception in case of failure - */ - @Test - public void testitExactMatchDominatesWildcard() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3461/test-1"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng3461"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng3461", "a", "0.1", "jar"); - } - - /** - * Test that mirror definitions are properly evaluated. In particular, the wildcard external:* should not - * match file:// and localhost repos but only external repos. - * - * @throws Exception in case of failure - */ - @Test - public void testitExternalWildcard() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3461/test-2"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - - Handler repoHandler = new AbstractHandler() { - @Override - public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) - throws IOException { - System.out.println("Handling " + request.getMethod() + " " + request.getRequestURL()); - - if (request.getRequestURI().endsWith("/b-0.1.jar")) { - response.setStatus(HttpServletResponse.SC_OK); - response.getWriter().println(request.getRequestURI()); - } else if (request.getRequestURI().endsWith("/b-0.1.pom")) { - response.setStatus(HttpServletResponse.SC_OK); - response.getWriter().println(""); - response.getWriter().println(" 4.0.0"); - response.getWriter().println(" org.apache.maven.its.mng3461"); - response.getWriter().println(" b"); - response.getWriter().println(" 0.1"); - response.getWriter().println(""); - } else { - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - } - - ((Request) request).setHandled(true); - } - }; - - Server server = new Server(0); - server.setHandler(repoHandler); - - try { - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - - int port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + port); - - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng3461"); - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@test.port@", Integer.toString(port)); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } finally { - server.stop(); - server.join(); - } - - verifier.verifyArtifactPresent("org.apache.maven.its.mng3461", "a", "0.1", "jar"); - verifier.verifyArtifactPresent("org.apache.maven.its.mng3461", "b", "0.1", "jar"); - verifier.verifyArtifactPresent("org.apache.maven.its.mng3461", "c", "0.1", "jar"); - } - - /** - * Test that mirror definitions are properly evaluated. In particular, the wildcards within a single mirrorOf - * spec should not be greedy. - * - * @throws Exception in case of failure - */ - @Test - public void testitNonGreedyWildcard() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3461/test-3"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng3461"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng3461", "a", "0.1", "jar"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3470StrictChecksumVerificationOfDependencyPomTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3470StrictChecksumVerificationOfDependencyPomTest.java deleted file mode 100644 index 6d0c8e75d..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3470StrictChecksumVerificationOfDependencyPomTest.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3740. - * - * @author Benjamin Bentmann - */ -public class MavenITmng3470StrictChecksumVerificationOfDependencyPomTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3470StrictChecksumVerificationOfDependencyPomTest() { - super("[2.0.3,2.0.4],[3.0-beta-1,)"); - } - - /** - * Verify that strict checksum verification fails the build in case a dependency POM is corrupt. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3470"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng3470"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - try { - verifier.setLogFileName("log-1.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Build did not fail despite broken checksum of dependency POM."); - } catch (VerificationException e) { - // expected - } - - // NOTE: This second try is to make sure the state caching in the local repo properly replays the error - try { - verifier.setLogFileName("log-2.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Build did not fail despite broken checksum of dependency POM."); - } catch (VerificationException e) { - // expected - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3475BaseAlignedDirTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3475BaseAlignedDirTest.java deleted file mode 100644 index d74e7c6ad..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3475BaseAlignedDirTest.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.IOException; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3475 and - * MNG-1927. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3475BaseAlignedDirTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3475BaseAlignedDirTest() { - super("(2.0.1,2.0.3),(2.0.3,)"); - } - - /** - * Verify that project directories are basedir aligned when queried by plugin parameter expressions. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3475() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3475"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties configProps = verifier.loadProperties("target/config.properties"); - - assertPathEquals(testDir, "target", configProps.getProperty("mapParam.buildDirectory")); - - assertPathEquals(testDir, "target/classes", configProps.getProperty("mapParam.buildOutputDirectory")); - - assertPathEquals(testDir, "target/test-classes", configProps.getProperty("mapParam.buildTestOutputDirectory")); - - assertPathEquals(testDir, "src/main/java", configProps.getProperty("mapParam.buildSourceDirectory")); - - assertPathEquals(testDir, "src/test/java", configProps.getProperty("mapParam.buildTestSourceDirectory")); - - if (matchesVersionRange("[2.1.0-M1,)")) { - assertPathEquals(testDir, "target/site", configProps.getProperty("mapParam.reportingOutputDirectory")); - } - - // show that using relative paths is aligned for File configuration properties regardless - assertPathEquals(testDir, "target/site", configProps.getProperty("fileParam")); - - /* - * NOTE: The script source directory is deliberately excluded from the checks due to MNG-3741. - */ - } - - private void assertPathEquals(File basedir, String expected, String actual) throws IOException { - File actualFile = new File(actual); - assertTrue("path not absolute: " + actualFile, actualFile.isAbsolute()); - assertCanonicalFileEquals(new File(basedir, expected), actualFile); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3477DependencyResolutionErrorMessageTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3477DependencyResolutionErrorMessageTest.java deleted file mode 100644 index 015bb71e8..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3477DependencyResolutionErrorMessageTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3477. - */ -public class MavenITmng3477DependencyResolutionErrorMessageTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3477DependencyResolutionErrorMessageTest() { - super("[2.1.0,3.0-alpha-1),[3.0-beta-1,)"); - } - - /** - * Tests that dependency resolution errors tell the underlying transport issue. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3477"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng3477"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - fail("Build should have failed to resolve dependency"); - } catch (VerificationException e) { - boolean foundCause = false; - List lines = verifier.loadLines(verifier.getLogFileName(), "UTF-8"); - for (String line : lines) { - if (line.matches(".*org.apache.maven.its.mng3477:dep:jar:1.0.*Connection.*refused.*")) { - foundCause = true; - break; - } - } - assertTrue("Transfer error cause was not found", foundCause); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3482DependencyPomInterpolationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3482DependencyPomInterpolationTest.java deleted file mode 100644 index 1cd06f2a2..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3482DependencyPomInterpolationTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3482. - * - * @author Brian Fox - * @author jdcasey - */ -public class MavenITmng3482DependencyPomInterpolationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3482DependencyPomInterpolationTest() { - super(ALL_MAVEN_VERSIONS); - } - - @Test - public void testitMNG3482() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3482"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng3482"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List classpath = verifier.loadLines("target/classpath.txt", "UTF-8"); - assertTrue(classpath.toString(), classpath.contains("dep2-1.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3485OverrideWagonExtensionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3485OverrideWagonExtensionTest.java deleted file mode 100644 index ec9873a8e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3485OverrideWagonExtensionTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3485. - * - * - */ -public class MavenITmng3485OverrideWagonExtensionTest extends AbstractMavenIntegrationTestCase { - public MavenITmng3485OverrideWagonExtensionTest() { - super("(2.0.8,3.0-alpha-1),[3.0-alpha-7,)"); - } - - @Test - public void testitMNG3485() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3485"); - - Verifier verifier; - - verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - - verifier.addCliArgument("deploy"); - verifier.execute(); - - verifier.verifyFilePresent("target/wagon.properties"); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3498ForkToOtherMojoTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3498ForkToOtherMojoTest.java deleted file mode 100644 index a2013af9d..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3498ForkToOtherMojoTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3498. - * - * todo Fill in a better description of what this test verifies! - * - * @author Brian Fox - * @author jdcasey - * - */ -public class MavenITmng3498ForkToOtherMojoTest extends AbstractMavenIntegrationTestCase { - public MavenITmng3498ForkToOtherMojoTest() { - super(ALL_MAVEN_VERSIONS); - } - - @Test - public void testitMNG3498() throws Exception { - // The testdir is computed from the location of this - // file. - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3498"); - - File pluginDir = new File(testDir, "maven-mng3498-plugin"); - File projectDir = new File(testDir, "mng-3498-project"); - - Verifier verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - verifier.deleteArtifact("org.apache.maven.its.mng3498", "mavenit-mng3498-plugin", "1", "pom"); - - verifier.addCliArgument("install"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(projectDir.getAbsolutePath()); - - verifier.addCliArgument("validate"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3503Xpp3ShadingTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3503Xpp3ShadingTest.java deleted file mode 100644 index 62f4ac0a9..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3503Xpp3ShadingTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.utils.io.FileUtils; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3503. The first test verifies that - * a plugin using plexus-utils-1.1 does not cause linkage errors. The second test verifies that a plugin with a - * different implementation of the shaded classes is used instead. - */ -public class MavenITmng3503Xpp3ShadingTest extends AbstractMavenIntegrationTestCase { - public MavenITmng3503Xpp3ShadingTest() { - super("(2.0.9,2.1.0-M1),(2.1.0-M1,)"); // only test in 2.0.10+, and not in 2.1.0-M1 - } - - @Test - public void testitMNG3503NoLinkageErrors() throws Exception { - File dir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3503/mng-3503-xpp3Shading-pu11"); - - Verifier verifier; - - verifier = newVerifier(dir.getAbsolutePath()); - - verifier.addCliArgument("validate"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - assertEquals("", FileUtils.fileRead(new File(dir, "target/serialized.xml"), "UTF-8")); - } - - @Test - public void testitMNG3503Xpp3Shading() throws Exception { - File dir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3503/mng-3503-xpp3Shading-pu-new"); - Verifier verifier = newVerifier(dir.getAbsolutePath()); - - verifier.addCliArgument("validate"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - assertEquals("root", FileUtils.fileRead(new File(dir, "target/serialized.xml"), "UTF-8")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3506ArtifactHandlersFromPluginsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3506ArtifactHandlersFromPluginsTest.java deleted file mode 100644 index ada97222a..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3506ArtifactHandlersFromPluginsTest.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.IOException; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3506. - * - * @author John Casey - * - */ -public class MavenITmng3506ArtifactHandlersFromPluginsTest extends AbstractMavenIntegrationTestCase { - - private static final String GID = "org.apache.maven.its.mng3506"; - private static final String AID = "mng-3506"; - private static final String VERSION = "1"; - private static final String TYPE = "jar"; - private static final String BAD_TYPE1 = "coreit-1"; - private static final String BAD_TYPE2 = "coreit-2"; - - public MavenITmng3506ArtifactHandlersFromPluginsTest() { - super("(2.2.0,)"); - } - - @Test - public void testProjectPackagingUsage() throws IOException, VerificationException { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/" + AID); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - - verifier.deleteArtifacts(GID); - - verifier.addCliArgument("install"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - // Now, if everything worked, we have .pom and a .jar in the local repo for each child, and a pom for the - // parent. - // IF IT DIDN'T, we have a .pom and a .coreit-1 for child 1 AND/OR .pom and .coreit-2 for child 2 in the local - // repo... - - // Parent POM - String path = verifier.getArtifactPath(GID, AID, VERSION, "pom"); - assertTrue(path + " should have been installed.", new File(path).exists()); - - // Child 1 - path = verifier.getArtifactPath(GID, AID + ".1", VERSION, TYPE); - assertTrue(path + " should have been installed.", new File(path).exists()); - - path = verifier.getArtifactPath(GID, AID + ".1", VERSION, "pom"); - assertTrue(path + " should have been installed.", new File(path).exists()); - - path = verifier.getArtifactPath(GID, AID + ".1", VERSION, BAD_TYPE1); - assertFalse(path + " should NOT have been installed.", new File(path).exists()); - - path = verifier.getArtifactPath(GID, AID + ".1", VERSION, BAD_TYPE2); - assertFalse(path + " should _NEVER_ be installed!!!", new File(path).exists()); - - // Child 2 - path = verifier.getArtifactPath(GID, AID + ".2", VERSION, TYPE); - assertTrue(path + " should have been installed.", new File(path).exists()); - - path = verifier.getArtifactPath(GID, AID + ".2", VERSION, "pom"); - assertTrue(path + " should have been installed.", new File(path).exists()); - - path = verifier.getArtifactPath(GID, AID + ".2", VERSION, BAD_TYPE1); - assertFalse(path + " should _NEVER_ be installed!!!", new File(path).exists()); - - path = verifier.getArtifactPath(GID, AID + ".2", VERSION, BAD_TYPE2); - assertFalse(path + " should NOT have been installed.", new File(path).exists()); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3529QuotedCliArgTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3529QuotedCliArgTest.java deleted file mode 100644 index 18be2b43c..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3529QuotedCliArgTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3529. - * - * @author Benjamin Bentmann - */ -public class MavenITmng3529QuotedCliArgTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3529QuotedCliArgTest() { - super("[3.0-beta-1,)"); - } - - /** - * Verify that the command line processing doesn't choke on things like -Da=" ". - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3529"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setForkJvm(true); // NOTE: We want to go through the launcher script - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-Dtest.a= "); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - assertEquals("- -", props.getProperty("project.properties.propA")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3535SelfReferentialPropertiesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3535SelfReferentialPropertiesTest.java deleted file mode 100644 index c9109879d..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3535SelfReferentialPropertiesTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3535. - * - * - */ -public class MavenITmng3535SelfReferentialPropertiesTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3535SelfReferentialPropertiesTest() { - super("[2.1.0-M1,3.0-alpha-1),[3.0-alpha-3,)"); - } - - @Test - public void testitMNG3535_ShouldSucceed() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3535/success"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - - verifier.addCliArgument("-X"); - - verifier.setAutoclean(false); - verifier.addCliArgument("verify"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - } - - @Test - public void testitMNG3535_ShouldFail() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3535/failure"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - - verifier.addCliArgument("-X"); - - verifier.setAutoclean(false); - - try { - verifier.addCliArgument("verify"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - fail("There is a self-referential property in this build; it should fail."); - } catch (Exception e) { - // should fail this verification, because there truly is a self-referential property. - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3536AppendedAbsolutePathsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3536AppendedAbsolutePathsTest.java deleted file mode 100644 index ea2807b6c..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3536AppendedAbsolutePathsTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3536. - * - * - */ -public class MavenITmng3536AppendedAbsolutePathsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3536AppendedAbsolutePathsTest() { - super("[2.1.0-M1,)"); // 2.1.0+ only - } - - @Test - public void testitMNG3536() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3536"); - File pluginDir = new File(testDir, "plugin"); - Verifier verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - - verifier.addCliArgument("install"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - File projectDir = new File(testDir, "project"); - verifier = newVerifier(projectDir.getAbsolutePath()); - - verifier.addCliArgument("verify"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3545ProfileDeactivationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3545ProfileDeactivationTest.java deleted file mode 100644 index bd5d7bfee..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3545ProfileDeactivationTest.java +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3545: - * it tests activation and deactivation of profiles. - * - */ -public class MavenITmng3545ProfileDeactivationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3545ProfileDeactivationTest() { - super("(2.0.9,)"); - } - - /** - * Test build with two active by default profiles - * - * @throws Exception in case of failure - */ - @Test - public void testBasicBuildWithDefaultProfiles() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3545"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.setLogFileName("log1.txt"); - - verifier.addCliArgument("validate"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - // profile 1 and 2 are active by default - verifier.verifyFilePresent("target/profile1/touch.txt"); - verifier.verifyFilePresent("target/profile2/touch.txt"); - verifier.verifyFileNotPresent("target/profile3/touch.txt"); - verifier.verifyFileNotPresent("target/profile4/touch.txt"); - verifier.verifyFileNotPresent("target/profile5/touch.txt"); - } - - /** - * Test command line deactivation of active by default profiles. - * - * @throws Exception in case of failure - */ - @Test - public void testDeactivateDefaultProfilesHyphen() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3545"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.setLogFileName("log2.txt"); - - // Deactivate active by default profiles - verifier.addCliArgument("-P-profile1"); - verifier.addCliArgument("-P"); - verifier.addCliArgument("-profile2"); - - verifier.addCliArgument("validate"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - verifier.verifyFileNotPresent("target/profile1/touch.txt"); - verifier.verifyFileNotPresent("target/profile2/touch.txt"); - } - - @Test - public void testDeactivateDefaultProfilesExclamation() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3545"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.setLogFileName("log3.txt"); - - // Deactivate active by default profiles - verifier.addCliArgument("-P!profile1"); - verifier.addCliArgument("-P"); - verifier.addCliArgument("!profile2"); - - verifier.addCliArgument("validate"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - verifier.verifyFileNotPresent("target/profile1/touch.txt"); - verifier.verifyFileNotPresent("target/profile2/touch.txt"); - } - - /** - * Test command line deactivation of a profile that was activated - * by a property - * - * @throws Exception in case of failure - */ - @Test - public void testDeactivateActivatedByProp() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3545"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.setLogFileName("log4.txt"); - - // Activate with a prop, then deactivate - verifier.addCliArgument("-Dprofile3-active-by-property=true"); - verifier.addCliArgument("-P-profile3"); - - verifier.addCliArgument("validate"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - verifier.verifyFilePresent("target/profile1/touch.txt"); - verifier.verifyFilePresent("target/profile2/touch.txt"); - verifier.verifyFileNotPresent("target/profile3/touch.txt"); - verifier.verifyFileNotPresent("target/profile4/touch.txt"); - verifier.verifyFileNotPresent("target/profile5/touch.txt"); - } - - /** - * Test that deactivating from the command line takes priority over - * activating from the command line. - * - * @throws Exception in case of failure - */ - @Test - public void testActivateThenDeactivate() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3545"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.setLogFileName("log5.txt"); - - // Activate then deactivate - verifier.addCliArgument("-Pprofile4"); - verifier.addCliArgument("-P-profile4"); - - verifier.addCliArgument("validate"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - verifier.verifyFilePresent("target/profile1/touch.txt"); - verifier.verifyFilePresent("target/profile2/touch.txt"); - verifier.verifyFileNotPresent("target/profile3/touch.txt"); - verifier.verifyFileNotPresent("target/profile4/touch.txt"); - verifier.verifyFileNotPresent("target/profile5/touch.txt"); - } - - /** - * Test that default profiles are deactivated when another profile is - * activated. - * - * @throws Exception in case of failure - */ - @Test - public void testDefaultProfileAutoDeactivation() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3545"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.setLogFileName("log6.txt"); - - // Activate - verifier.addCliArgument("-Pprofile4"); - - verifier.addCliArgument("validate"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - verifier.verifyFileNotPresent("target/profile1/touch.txt"); - verifier.verifyFileNotPresent("target/profile2/touch.txt"); - verifier.verifyFileNotPresent("target/profile3/touch.txt"); - verifier.verifyFilePresent("target/profile4/touch.txt"); - verifier.verifyFileNotPresent("target/profile5/touch.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3575HexadecimalOctalPluginParameterConfigTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3575HexadecimalOctalPluginParameterConfigTest.java deleted file mode 100644 index d385946bf..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3575HexadecimalOctalPluginParameterConfigTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3575. - */ -public class MavenITmng3575HexadecimalOctalPluginParameterConfigTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3575HexadecimalOctalPluginParameterConfigTest() { - super("[3.0.3,)"); - } - - /** - * Verify that numeric plugin parameters can be configured using hexadecimal/octal notation. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3575"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/config.properties"); - assertEquals("64", props.getProperty("byteParam")); - assertEquals("1024", props.getProperty("shortParam")); - assertEquals("65536", props.getProperty("integerParam")); - assertEquals("68719476735", props.getProperty("longParam")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3581PluginUsesWagonDependencyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3581PluginUsesWagonDependencyTest.java deleted file mode 100644 index 7ff9047b3..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3581PluginUsesWagonDependencyTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3581. - * - * - */ -public class MavenITmng3581PluginUsesWagonDependencyTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3581PluginUsesWagonDependencyTest() { - // Not 2.0.9 - super("(2.0.4,2.0.9),(2.0.9,)"); - } - - /** - * Test that a plugin using a specific wagon implementation directly works. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3581"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("initialize"); - verifier.execute(); - verifier.addCliArgument("-B"); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3586SystemScopePluginDependencyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3586SystemScopePluginDependencyTest.java deleted file mode 100644 index f20a99c0b..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3586SystemScopePluginDependencyTest.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3586. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3586SystemScopePluginDependencyTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3586SystemScopePluginDependencyTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that plugin dependencies with scope system are part of the plugin class realm. This test checks - * dependencies that are declared in the plugin POM. - * - * @throws Exception in case of failure - */ - @Test - public void testitFromPlugin() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3586/test-1"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng3586"); - verifier.getSystemProperties().setProperty("test.home", testDir.getAbsolutePath()); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/it.properties"); - assertEquals("PASSED", props.getProperty("test")); - } - - /** - * Test that plugin dependencies with scope system are part of the plugin class realm. This test checks - * dependencies that are declared in the project POM that uses the plugin. - * - * @throws Exception in case of failure - */ - @Test - public void testitFromProject() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3586/test-2"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.getSystemProperties().setProperty("test.home", testDir.getAbsolutePath()); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pcl.properties"); - assertEquals("1", props.getProperty("maven-core-it.properties.count")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3599useHttpProxyForWebDAVMk2Test.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3599useHttpProxyForWebDAVMk2Test.java deleted file mode 100644 index 617ac2ba4..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3599useHttpProxyForWebDAVMk2Test.java +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import java.io.File; -import java.io.IOException; - -import org.apache.maven.shared.utils.StringUtils; -import org.apache.maven.shared.utils.io.FileUtils; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.server.Handler; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.AbstractHandler; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3599. - * - * @author Brett Porter - * @author John Casey - * - */ -public class MavenITmng3599useHttpProxyForWebDAVMk2Test extends AbstractMavenIntegrationTestCase { - private Server server; - - private int port; - - private static final String CONTENT = - "\n" - + " 4.0.0\n" - + " org.apache.maven.its.mng3599\n" - + " test\n" - + " 1.0-SNAPSHOT\n" - + " MNG-3599\n" - + ""; - - private static final String CONTENT_CHECKSUM_SHA1 = "8c2562233bae8fa8aa40697d6bbd5115f9062a71"; - - public MavenITmng3599useHttpProxyForWebDAVMk2Test() { - super("[3.3.9,)"); - } - - @BeforeEach - protected void setUp() throws Exception { - Handler handler = new AbstractHandler() { - public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) - throws IOException { - System.out.println("Got request for URL: '" + request.getRequestURL() + "'"); - System.out.flush(); - - response.setContentType("text/plain"); - - System.out.println("Checking for 'Proxy-Connection' header..."); - if (request.getHeader("Proxy-Connection") != null) { - response.setStatus(HttpServletResponse.SC_OK); - if (request.getRequestURI().endsWith(".sha1")) { - response.getWriter().print(CONTENT_CHECKSUM_SHA1); - } else { - response.getWriter().print(CONTENT); - } - - System.out.println("Proxy-Connection found."); - } - /* - * 2008-09-29 Oleg: "Proxy-Connection" is not part of http spec, but an extended header, and - * as such cannot be expected from all the clients. - * Changing the code to test for more generalized case: local proxy receives a request with - * correct server url and resource uri - */ - else if (request.getRequestURI().startsWith("/org/apache/maven/its/mng3599/test-dependency") - && request.getRequestURL().toString().startsWith("http://www.example.com")) { - response.setStatus(HttpServletResponse.SC_OK); - if (request.getRequestURI().endsWith(".sha1")) { - response.getWriter().print(CONTENT_CHECKSUM_SHA1); - } else { - response.getWriter().print(CONTENT); - } - - System.out.println( - "Correct proxied request 'http://www.example.com' for resource '/org/apache/maven/its/mng3599/test-dependency' found."); - } else { - response.setStatus(HttpServletResponse.SC_BAD_REQUEST); - - System.out.println("Proxy-Connection not found."); - } - - ((Request) request).setHandled(true); - } - }; - - server = new Server(0); - server.setHandler(handler); - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + port); - } - - @AfterEach - protected void tearDown() throws Exception { - if (server != null) { - server.stop(); - server.join(); - } - } - - @Test - public void testitUseHttpProxyForHttp() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3599-mk2"); - - /* - * NOTE: Make sure the WebDAV extension required by the test project has been pulled down into the local - * repo before the actual test installs Jetty as a mirror for everything. Otherwise, we will get garbage - * for the JAR/POM of the extension and its dependencies when run against a vanilla repo. - */ - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - String settings = FileUtils.fileRead(new File(testDir, "settings-template.xml")); - settings = StringUtils.replace(settings, "@port@", Integer.toString(port)); - String newSettings = StringUtils.replace(settings, "@protocol@", "http"); - - FileUtils.fileWrite(new File(testDir, "settings.xml").getAbsolutePath(), newSettings); - - verifier = newVerifier(testDir.getAbsolutePath()); - - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("-X"); - - verifier.deleteArtifacts("org.apache.maven.its.mng3599"); - - verifier.setLogFileName("logHttp.txt"); - verifier.addCliArgument("compile"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng3599", "test-dependency", "1.0", "jar"); - verifier.verifyArtifactContent("org.apache.maven.its.mng3599", "test-dependency", "1.0", "jar", CONTENT); - } - - /** - * Test that HTTP proxy is used for HTTP and for WebDAV. - * - * @throws Exception in case of failure - */ - @Test - public void testitUseHttpProxyForWebDAV() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3599-mk2"); - - /* - * NOTE: Make sure the WebDAV extension required by the test project has been pulled down into the local - * repo before the actual test installs Jetty as a mirror for everything. Otherwise, we will get garbage - * for the JAR/POM of the extension and its dependencies when run against a vanilla repo. - */ - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - String settings = FileUtils.fileRead(new File(testDir, "settings-template.xml")); - settings = StringUtils.replace(settings, "@port@", Integer.toString(port)); - String newSettings = StringUtils.replace(settings, "@protocol@", "dav"); - - FileUtils.fileWrite(new File(testDir, "settings.xml").getAbsolutePath(), newSettings); - - verifier = newVerifier(testDir.getAbsolutePath()); - - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("-X"); - - verifier.deleteArtifacts("org.apache.maven.its.mng3599"); - - verifier.setLogFileName("logDAV.txt"); - verifier.addCliArgument("compile"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng3599", "test-dependency", "1.0", "jar"); - verifier.verifyArtifactContent("org.apache.maven.its.mng3599", "test-dependency", "1.0", "jar", CONTENT); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3600DeploymentModeDefaultsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3600DeploymentModeDefaultsTest.java deleted file mode 100644 index 3203f3923..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3600DeploymentModeDefaultsTest.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3600. - * - * - */ -public class MavenITmng3600DeploymentModeDefaultsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3600DeploymentModeDefaultsTest() { - super("(2.1.0-M1,3.0-alpha-1),[3.0.1,)"); - } - - @Test - public void testitMNG3600NoSettings() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3600"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - - new File(testDir, "wagon.properties").delete(); - verifier.setLogFileName("log-no-settings.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("wagon.properties"); - Properties props = verifier.loadProperties("wagon.properties"); - assertNull(props.get("directory.mode")); - assertNull(props.get("file.mode")); - } - - @Test - public void testitMNG3600ServerDefaults() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3600"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - - new File(testDir, "wagon.properties").delete(); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings-server-defaults.xml"); - verifier.setLogFileName("log-server-defaults.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("wagon.properties"); - Properties props = verifier.loadProperties("wagon.properties"); - assertNull(props.get("directory.mode")); - assertNull(props.get("file.mode")); - } - - @Test - public void testitMNG3600ModesSet() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3600"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - - new File(testDir, "wagon.properties").delete(); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings-modes-set.xml"); - verifier.setLogFileName("log-modes-set.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("wagon.properties"); - Properties props = verifier.loadProperties("wagon.properties"); - assertEquals("700", props.get("directory.mode")); - assertEquals("600", props.get("file.mode")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3607ClassLoadersUseValidUrlsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3607ClassLoadersUseValidUrlsTest.java deleted file mode 100644 index f7dea97aa..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3607ClassLoadersUseValidUrlsTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.net.URI; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3607. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3607ClassLoadersUseValidUrlsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3607ClassLoadersUseValidUrlsTest() { - super("[3.0-alpha-2,)"); - } - - /** - * Test that class loaders created by Maven employ valid URLs, e.g. properly encode characters like spaces. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3607"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.getSystemProperties().setProperty("test.home", testDir.getAbsolutePath()); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pcl.properties"); - String url = props.getProperty("maven-core-it.properties"); - assertNotNull(url); - assertNotNull(new URI(url)); - assertTrue(url.indexOf(' ') < 0); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3621UNCInheritedPathsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3621UNCInheritedPathsTest.java deleted file mode 100644 index f4b34dff7..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3621UNCInheritedPathsTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3621. - * - * @author Brett Porter - * - */ -public class MavenITmng3621UNCInheritedPathsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3621UNCInheritedPathsTest() { - super("[2.0.11,2.1.0-M1),[2.1.0,)"); - } - - /** - * Verifies that UNC paths are inherited correctly. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3621() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3621"); - - Verifier verifier = newVerifier(new File(testDir, "child").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - assertEquals("file:////host/site/test-child", props.getProperty("project.distributionManagement.site.url")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3641ProfileActivationWarningTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3641ProfileActivationWarningTest.java deleted file mode 100644 index b4fd7d787..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3641ProfileActivationWarningTest.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; -import java.util.regex.Pattern; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3641: - * Profile activation warning test - */ -public class MavenITmng3641ProfileActivationWarningTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3641ProfileActivationWarningTest() { - super("[2.0.11,2.1.0-M1),[2.1.0,4.0.0-alpha-1)"); // only test in 2.0.11+, 2.1.0+ - } - - @Test - public void testitMNG3641() throws Exception { - // (0) Initialize. - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3641"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - - // Delete this artifact. Just in case. - verifier.deleteArtifact("org.apache.maven.its.mng3641", "parent", "1.0", "pom"); - - // (1) make sure the profile is found. Must not contain a warning. - verifier.addCliArgument("-P"); - verifier.addCliArgument("mng-3641-it-provided-profile"); - verifier.setLogFileName("log-1.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List logFile = verifier.loadFile(verifier.getBasedir(), verifier.getLogFileName(), false); - assertNull(findWarning(logFile, "mng-3641-it-provided-profile")); - - // (2) make sure the profile was not found and a warning was printed. - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("-P"); - verifier.addCliArgument("mng-3641-TWlzdGVyIFQgd2FzIGhlcmUuICheX14p"); - verifier.setLogFileName("log-2.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - logFile = verifier.loadFile(verifier.getBasedir(), verifier.getLogFileName(), false); - assertNotNull(findWarning(logFile, "mng-3641-TWlzdGVyIFQgd2FzIGhlcmUuICheX14p")); - - // (3) make sure the first profile is found while the other is not and a warning was printed - // accordingly. - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("-P"); - verifier.addCliArgument("mng-3641-it-provided-profile,mng-3641-TWlzdGVyIFQgd2FzIGhlcmUuICheX14p"); - verifier.setLogFileName("log-3.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - logFile = verifier.loadFile(verifier.getBasedir(), verifier.getLogFileName(), false); - assertNull(findWarning(logFile, "mng-3641-it-provided-profile")); - assertNotNull(findWarning(logFile, "mng-3641-TWlzdGVyIFQgd2FzIGhlcmUuICheX14p")); - - // (4) make sure the warning is only printed when the profile is missing in all projects - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("-P"); - verifier.addCliArgument("mng-3641-it-provided-profile-child"); - verifier.setLogFileName("log-4.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - logFile = verifier.loadFile(verifier.getBasedir(), verifier.getLogFileName(), false); - assertNull(findWarning(logFile, "mng-3641-it-provided-profile-child")); - - // (5) make sure the profile is found in subproject. Must not contain a warning. - verifier = newVerifier(new File(testDir, "child1").getAbsolutePath()); - verifier.addCliArgument("-P"); - verifier.addCliArgument("mng-3641-it-provided-profile-child"); - verifier.setLogFileName("log-5.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - logFile = verifier.loadFile(verifier.getBasedir(), verifier.getLogFileName(), false); - assertNull(findWarning(logFile, "mng-3641-it-provided-profile-child")); - - // (6) make sure the profile is found from parent in subproject. Must not contain a warning. - verifier = newVerifier(new File(testDir, "child1").getAbsolutePath()); - verifier.addCliArgument("-P"); - verifier.addCliArgument("mng-3641-it-provided-profile"); - verifier.setLogFileName("log-6.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - logFile = verifier.loadFile(verifier.getBasedir(), verifier.getLogFileName(), false); - assertNull(findWarning(logFile, "mng-3641-it-provided-profile")); - } - - private String findWarning(List logLines, String profileId) { - Pattern pattern = Pattern.compile("(?i).*profile\\s.*\\Q" + profileId + "\\E.*\\snot\\s.*activated.*"); - - for (String logLine : logLines) { - if (pattern.matcher(logLine).matches()) { - return logLine; - } - } - - return null; - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3642DynamicResourcesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3642DynamicResourcesTest.java deleted file mode 100644 index 4ee7b841d..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3642DynamicResourcesTest.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3642. - * - * todo Fill in a better description of what this test verifies! - * - * @author Brian Fox - * @author jdcasey - * - */ -public class MavenITmng3642DynamicResourcesTest extends AbstractMavenIntegrationTestCase { - public MavenITmng3642DynamicResourcesTest() { - super("(2.0.9,)"); // only test in 2.0.9+ - } - - @Test - public void testitMNG3642() throws Exception { - // The testdir is computed from the location of this - // file. - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3642"); - - Verifier verifier; - - /* - * We must first make sure that any artifact created - * by this test has been removed from the local - * repository. Failing to do this could cause - * unstable test results. Fortunately, the verifier - * makes it easy to do this. - */ - verifier = newVerifier(testDir.getAbsolutePath()); - - /* - * The Command Line Options (CLI) are passed to the - * verifier as a list. This is handy for things like - * redefining the local repository if needed. In - * this case, we use the -N flag so that Maven won't - * recurse. We are only installing the parent pom to - * the local repo here. - */ - verifier.addCliArgument("process-test-resources"); - verifier.execute(); - - /* - * This is the simplest way to check a build - * succeeded. It is also the simplest way to create - * an IT test: make the build pass when the test - * should pass, and make the build fail when the - * test should fail. There are other methods - * supported by the verifier. They can be seen here: - * http://maven.apache.org/shared/maven-verifier/apidocs/index.html - */ - verifier.verifyErrorFreeLog(); - - File first = new File(testDir, "target/test-classes/one.txt"); - assertTrue("First resource file was not present: " + first, first.exists()); - - File second = new File(testDir, "target/test-classes/two.txt"); - assertTrue("Second resource file was not present: " + second, second.exists()); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3645POMSyntaxErrorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3645POMSyntaxErrorTest.java deleted file mode 100644 index 24e7a44a2..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3645POMSyntaxErrorTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3645. - * - * todo Fill in a better description of what this test verifies! - * - * @author Brian Fox - * @author jdcasey - * - */ -public class MavenITmng3645POMSyntaxErrorTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3645POMSyntaxErrorTest() { - super("[2.0.10,2.1.0-M1),[2.1.0,3.0-alpha-1),[3.0-alpha-3,)"); - } - - /** - * Verify that POMs of reactor projects are parsed in strict mode. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3645"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - fail( - "Should fail to validate the POM syntax due to missing dependency element inside dependencyManagement section."); - } catch (VerificationException e) { - // expect this. - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3652UserAgentHeaderTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3652UserAgentHeaderTest.java deleted file mode 100644 index d25b6fc9a..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3652UserAgentHeaderTest.java +++ /dev/null @@ -1,300 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import java.io.File; -import java.io.IOException; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.server.Handler; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.AbstractHandler; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3652. - */ -public class MavenITmng3652UserAgentHeaderTest extends AbstractMavenIntegrationTestCase { - private Server server; - - private int port; - - private String userAgent; - - private String customHeader; - - public MavenITmng3652UserAgentHeaderTest() { - super("[3.0-beta-3,)"); - } - - @BeforeEach - protected void setUp() throws Exception { - Handler handler = new AbstractHandler() { - @Override - public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) - throws IOException { - System.out.println("Handling URL: '" + request.getRequestURL() + "'"); - - userAgent = request.getHeader("User-Agent"); - - customHeader = request.getHeader("Custom-Header"); - - System.out.println("Got User-Agent: '" + userAgent + "'"); - - response.setContentType("text/plain"); - response.setStatus(HttpServletResponse.SC_OK); - response.getWriter().println("some content"); - response.getWriter().println(); - - ((Request) request).setHandled(true); - } - }; - - server = new Server(0); - server.setHandler(handler); - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + port); - } - - @AfterEach - protected void tearDown() throws Exception { - if (server != null) { - server.stop(); - server.join(); - } - } - - /** - * Test that the user agent header is configured in the wagon manager. - * - * @throws Exception in case of failure - */ - @Test - public void testmng3652_UnConfiguredHttp() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3652"); - File pluginDir = new File(testDir, "test-plugin"); - File projectDir = new File(testDir, "test-project"); - - Verifier verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(projectDir.getAbsolutePath(), "remote"); - - verifier.addCliArgument("-DtestPort=" + port); - verifier.addCliArgument("-X"); - - verifier.setLogFileName("log-unConfiguredHttp.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - String userAgent = this.userAgent; - assertNotNull(userAgent); - - File touchFile = new File(projectDir, "target/touch.txt"); - assertTrue(touchFile.exists()); - - List lines = verifier.loadFile(touchFile, false); - - // NOTE: system property for maven.version may not exist if you use -Dtest - // surefire parameter to run this single test. Therefore, the plugin writes - // the maven version into the check file. - String mavenVersion = lines.get(0); - String javaVersion = lines.get(1); - String os = lines.get(2) + " " + lines.get(3); - String artifactVersion = lines.get(4); - - assertEquals( - "Comparing User-Agent '" + userAgent + "'", - "Apache-Maven/" + mavenVersion + " (Java " + javaVersion + "; " + os + ")", - userAgent); - } - - @Test - public void testmng3652_UnConfiguredDAV() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3652"); - File pluginDir = new File(testDir, "test-plugin"); - File projectDir = new File(testDir, "test-project"); - - Verifier verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(projectDir.getAbsolutePath(), "remote"); - - // test webdav - verifier.addCliArgument("-DtestPort=" + port); - verifier.addCliArgument("-DtestProtocol=dav:http"); - verifier.addCliArgument("-X"); - - verifier.setLogFileName("log-unConfiguredDAV.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - File touchFile = new File(projectDir, "target/touch.txt"); - assertTrue(touchFile.exists()); - - List lines = verifier.loadFile(touchFile, false); - - // NOTE: system property for maven.version may not exist if you use -Dtest - // surefire parameter to run this single test. Therefore, the plugin writes - // the maven version into the check file. - String mavenVersion = lines.get(0); - String javaVersion = lines.get(1); - String os = lines.get(2) + " " + lines.get(3); - String artifactVersion = lines.get(4); - - String userAgent = this.userAgent; - assertNotNull(userAgent); - - assertEquals( - "Comparing User-Agent '" + userAgent + "'", - "Apache-Maven/" + mavenVersion + " (Java " + javaVersion + "; " + os + ")", - userAgent); - } - - @Test - public void testmng3652_ConfigurationInSettingsWithoutUserAgent() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3652"); - File pluginDir = new File(testDir, "test-plugin"); - File projectDir = new File(testDir, "test-project"); - - Verifier verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(projectDir.getAbsolutePath(), "remote"); - - // test settings with no config - - verifier.addCliArgument("-DtestPort=" + port); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings-no-config.xml"); - verifier.addCliArgument("-X"); - - verifier.setLogFileName("log-configWithoutUserAgent.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - File touchFile = new File(projectDir, "target/touch.txt"); - assertTrue(touchFile.exists()); - - List lines = verifier.loadFile(touchFile, false); - - // NOTE: system property for maven.version may not exist if you use -Dtest - // surefire parameter to run this single test. Therefore, the plugin writes - // the maven version into the check file. - String mavenVersion = lines.get(0); - String javaVersion = lines.get(1); - String os = lines.get(2) + " " + lines.get(3); - String artifactVersion = lines.get(4); - - String userAgent = this.userAgent; - assertNotNull(userAgent); - - assertEquals( - "Comparing User-Agent '" + userAgent + "'", - "Apache-Maven/" + mavenVersion + " (Java " + javaVersion + "; " + os + ")", - userAgent); - } - - @Test - public void testmng3652_UserAgentConfiguredInSettings() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3652"); - File pluginDir = new File(testDir, "test-plugin"); - File projectDir = new File(testDir, "test-project"); - - Verifier verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(projectDir.getAbsolutePath(), "remote"); - - // test settings with config - - verifier.addCliArgument("-DtestPort=" + port); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("-X"); - - verifier.setLogFileName("log-configWithUserAgent.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - String userAgent = this.userAgent; - assertNotNull(userAgent); - - assertEquals("Maven Fu", userAgent); - assertEquals("My wonderful header", customHeader); - } - - @Test - public void testmng3652_AdditionnalHttpHeaderConfiguredInSettings() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3652"); - File pluginDir = new File(testDir, "test-plugin"); - File projectDir = new File(testDir, "test-project"); - - Verifier verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(projectDir.getAbsolutePath(), "remote"); - - // test settings with config - - verifier.addCliArgument("-DtestPort=" + port); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("-X"); - - verifier.setLogFileName("log-configWithUserAgent.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - String userAgent = this.userAgent; - assertNotNull(userAgent); - - assertEquals("Maven Fu", userAgent); - assertEquals("My wonderful header", customHeader); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3667ResolveDepsWithBadPomVersionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3667ResolveDepsWithBadPomVersionTest.java deleted file mode 100644 index 485063b15..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3667ResolveDepsWithBadPomVersionTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3667. - * - * @author Brian Fox - * @author jdcasey - * - */ -public class MavenITmng3667ResolveDepsWithBadPomVersionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3667ResolveDepsWithBadPomVersionTest() { - super("[2.0.3,)"); - } - - /** - * Verify that dependency resolution gracefully ignores dependency POMs that have coordinates which don't - * match the deployed artifact. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3667"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng3667"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List cp = verifier.loadLines("target/classpath.txt", "UTF-8"); - assertTrue(cp.toString(), cp.contains("dep-0.1.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3671PluginLevelDepInterpolationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3671PluginLevelDepInterpolationTest.java deleted file mode 100644 index 7df5e2d5c..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3671PluginLevelDepInterpolationTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3671. - * - * Tests to make sure that custom plugin dependencies (defined in your local POM) have - * their information interpolated before they are injected into the plugin descriptor - * for eventual resolution and inclusion in the plugin classpath. Otherwise, resolution - * errors will occur and the plugin will fail to initialize. - * - * @author jdcasey - * - */ -public class MavenITmng3671PluginLevelDepInterpolationTest extends AbstractMavenIntegrationTestCase { - public MavenITmng3671PluginLevelDepInterpolationTest() { - super("(2.0.8,)"); // only test in 2.0.9+ - } - - @Test - public void testitMNG3671() throws Exception { - // The testdir is computed from the location of this - // file. - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3671"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - - verifier.addCliArgument("compile"); - verifier.execute(); - - /* - * This is the simplest way to check a build - * succeeded. It is also the simplest way to create - * an IT test: make the build pass when the test - * should pass, and make the build fail when the - * test should fail. There are other methods - * supported by the verifier. They can be seen here: - * http://maven.apache.org/shared/maven-verifier/apidocs/index.html - */ - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3679PluginExecIdInterpolationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3679PluginExecIdInterpolationTest.java deleted file mode 100644 index bdeed493f..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3679PluginExecIdInterpolationTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3679: - * it checks that a plugin execution with an id that contains an expression will - * still execute without a problem. - * - * @author jdcasey - */ -public class MavenITmng3679PluginExecIdInterpolationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3679PluginExecIdInterpolationTest() { - super(ALL_MAVEN_VERSIONS); - } - - @Test - public void testitMNG3679() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3679"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/check.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3680InvalidDependencyPOMTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3680InvalidDependencyPOMTest.java deleted file mode 100644 index 1fe7007bc..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3680InvalidDependencyPOMTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3680. - * - * @author jdcasey - */ -public class MavenITmng3680InvalidDependencyPOMTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3680InvalidDependencyPOMTest() { - super("(2.0.9,)"); - } - - /** - * Verify that dependencies with invalid POMs can still be used without failing the build. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3680() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3680"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng3680"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List artifacts = verifier.loadLines("target/artifacts.txt", "UTF-8"); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng3680:direct:jar:0.1")); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng3680:transitive:jar:0.1")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3684BuildPluginParameterTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3684BuildPluginParameterTest.java deleted file mode 100644 index 6eac610d0..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3684BuildPluginParameterTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3684: - * Verify that the Build instance injected as a plugin parameter contains - * interpolated values for things like the various build paths, etc. - * - * @author jdcasey - */ -public class MavenITmng3684BuildPluginParameterTest extends AbstractMavenIntegrationTestCase { - public MavenITmng3684BuildPluginParameterTest() { - super("(2.0.9,)"); - } - - @Test - public void testitMNG3684() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3684"); - File pluginDir = new File(testDir, "maven-mng3684-plugin"); - File projectDir = new File(testDir, "project"); - - Verifier verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(projectDir.getAbsolutePath(), "remote"); - verifier.setLogFileName("log-validate.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - verifier.setLogFileName("log-site.txt"); - verifier.addCliArgument("site"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3693PomFileBasedirChangeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3693PomFileBasedirChangeTest.java deleted file mode 100644 index d65a6edd2..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3693PomFileBasedirChangeTest.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.utils.io.FileUtils; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3693: - * it tests that changes to a project's POM file reference (MavenProject.setFile(..)) - * doesn't affect the basedir of the project instance for using that project's classes directory - * in the classpath of another project's build...this happens when both projects are - * built in the same reactor, and one project depends on the other. - * - * @author jdcasey - */ -public class MavenITmng3693PomFileBasedirChangeTest extends AbstractMavenIntegrationTestCase { - public MavenITmng3693PomFileBasedirChangeTest() { - super(ALL_MAVEN_VERSIONS); - } - - @Test - public void testitMNG3693() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3693"); - - File pluginDir = new File(testDir, "maven-mng3693-plugin"); - File projectsDir = new File(testDir, "projects"); - - Verifier verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - - verifier.addCliArgument("install"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - String depPath = verifier.getArtifactPath("org.apache.maven.its.mng3693", "dep", "1", "pom"); - - File dep = new File(depPath); - dep = dep.getParentFile().getParentFile(); - - // remove the dependency from the local repository. - FileUtils.deleteDirectory(dep); - - verifier = newVerifier(projectsDir.getAbsolutePath()); - - verifier.addCliArgument("package"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3694ReactorProjectsDynamismTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3694ReactorProjectsDynamismTest.java deleted file mode 100644 index 92308df21..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3694ReactorProjectsDynamismTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3694: - * Verify that any plugin injecting reactorProjects gets project instances that - * have their concrete state calculated. - * - * @author jdcasey - */ -public class MavenITmng3694ReactorProjectsDynamismTest extends AbstractMavenIntegrationTestCase { - public MavenITmng3694ReactorProjectsDynamismTest() { - super(ALL_MAVEN_VERSIONS); - } - - @Test - public void testitMNG3694() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3694"); - - File pluginDir = new File(testDir, "maven-mng3694-plugin"); - File projectDir = new File(testDir, "projects"); - - Verifier verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(projectDir.getAbsolutePath()); - - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3701ImplicitProfileIdTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3701ImplicitProfileIdTest.java deleted file mode 100644 index bfb5beb66..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3701ImplicitProfileIdTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3701. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3701ImplicitProfileIdTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3701ImplicitProfileIdTest() { - super("[2.0.11,)"); - } - - /** - * Verify that profiles without explicit id get a default id and in particular don't cause NPEs when - * they are active by default. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3701() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3701"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3703ExecutionProjectWithRelativePathsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3703ExecutionProjectWithRelativePathsTest.java deleted file mode 100644 index 67d4cd926..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3703ExecutionProjectWithRelativePathsTest.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3703. - * - * todo Fill in a better description of what this test verifies! - * - * @author Brian Fox - * @author jdcasey - */ -public class MavenITmng3703ExecutionProjectWithRelativePathsTest extends AbstractMavenIntegrationTestCase { - public MavenITmng3703ExecutionProjectWithRelativePathsTest() { - super("[2.1.0-M1,)"); // only test in 2.1.0+ - } - - @Test - public void testForkFromMojo() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3703"); - File pluginDir = new File(testDir, "maven-mng3703-plugin"); - File projectDir = new File(testDir, "project"); - - Verifier verifier; - - verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - - verifier.addCliArgument("install"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(projectDir.getAbsolutePath()); - verifier.setLogFileName("log-mojo.txt"); - - verifier.addCliArgument("package"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - } - - @Test - public void testForkFromReport() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3703"); - File pluginDir = new File(testDir, "maven-mng3703-plugin"); - File projectDir = new File(testDir, "project"); - - Verifier verifier; - - verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - - verifier.addCliArgument("install"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(projectDir.getAbsolutePath()); - verifier.setLogFileName("log-report.txt"); - - verifier.addCliArgument("site"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3710PollutedClonedPluginsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3710PollutedClonedPluginsTest.java deleted file mode 100644 index 490bd9384..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3710PollutedClonedPluginsTest.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3710. - * - * todo Fill in a better description of what this test verifies! - * - * @author Brian Fox - * @author jdcasey - * - */ -public class MavenITmng3710PollutedClonedPluginsTest extends AbstractMavenIntegrationTestCase { - public MavenITmng3710PollutedClonedPluginsTest() { - super("(2.0.8,)"); // only test in 2.0.9+ - } - - @Test - public void testitMNG3710_POMInheritance() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3710/pom-inheritance"); - File pluginDir = new File(testDir, "maven-mng3710-pomInheritance-plugin"); - File projectsDir = new File(testDir, "projects"); - - Verifier verifier; - - verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(projectsDir.getAbsolutePath()); - verifier.addCliArgument("validate"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - File topLevelTouchFile = new File(projectsDir, "target/touch.txt"); - assertFalse("Top-level touch file should NOT be created in projects tree.", topLevelTouchFile.exists()); - - File midLevelTouchFile = new File(projectsDir, "middle/target/touch.txt"); - assertTrue("Mid-level touch file should have been created in projects tree.", midLevelTouchFile.exists()); - - File childLevelTouchFile = new File(projectsDir, "middle/child/target/touch.txt"); - assertTrue("Child-level touch file should have been created in projects tree.", childLevelTouchFile.exists()); - } - - @Test - public void testitMNG3710_OriginalModel() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3710/original-model"); - File pluginsDir = new File(testDir, "plugins"); - File projectDir = new File(testDir, "project"); - - Verifier verifier; - - verifier = newVerifier(pluginsDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(projectDir.getAbsolutePath()); - - verifier.addCliArguments("org.apache.maven.its.mng3710:mavenit-mng3710-directInvoke-plugin:1:run", "validate"); - - verifier.execute(); - - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3714ToolchainsCliOptionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3714ToolchainsCliOptionTest.java deleted file mode 100644 index 1b8299e5c..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3714ToolchainsCliOptionTest.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Map; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3714. - * - * @author Brett Porter - * - */ -public class MavenITmng3714ToolchainsCliOptionTest extends AbstractMavenIntegrationTestCase { - public MavenITmng3714ToolchainsCliOptionTest() { - super("[2.3.0,)"); - } - - /** - * Test --toolchains CLI option - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3714() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3714"); - - File javaHome = new File(testDir, "javaHome"); - javaHome.mkdirs(); - new File(javaHome, "bin").mkdirs(); - new File(javaHome, "bin/javac").createNewFile(); - new File(javaHome, "bin/javac.exe").createNewFile(); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - Map properties = verifier.newDefaultFilterMap(); - properties.put("@javaHome@", javaHome.getAbsolutePath()); - - verifier.filterFile("toolchains.xml", "toolchains.xml", "UTF-8", properties); - - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("--toolchains"); - verifier.addCliArgument("toolchains.xml"); - verifier.addCliArgument("initialize"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/toolchains.properties"); - Properties results = verifier.loadProperties("target/toolchains.properties"); - String tool = results.getProperty("tool.1", ""); - if (tool.endsWith(".exe")) { - tool = tool.substring(0, tool.length() - 4); - } - assertEquals(new File(javaHome, "bin/javac").getAbsolutePath(), tool); - - verifier.verifyFilePresent("target/tool.properties"); - Properties toolProps = verifier.loadProperties("target/tool.properties"); - String path = toolProps.getProperty("tool.javac", ""); - assertEquals(results.getProperty("tool.1", ""), path); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3716AggregatorForkingTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3716AggregatorForkingTest.java deleted file mode 100644 index 25eeb4094..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3716AggregatorForkingTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3716. - * - * todo Fill in a better description of what this test verifies! - * - * @author Brian Fox - * @author jdcasey - * - */ -public class MavenITmng3716AggregatorForkingTest extends AbstractMavenIntegrationTestCase { - public MavenITmng3716AggregatorForkingTest() { - super("(2.0.8,)"); // only test in 2.0.9+ - } - - @Test - public void testitMNG3716() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3716"); - File pluginDir = new File(testDir, "maven-mng3716-plugin"); - File projectsDir = new File(testDir, "projects"); - - Verifier verifier; - - verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(projectsDir.getAbsolutePath()); - verifier.addCliArgument("org.apache.maven.its.mng3716:mavenit-mng3716-plugin:1:run"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3719PomExecutionOrderingTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3719PomExecutionOrderingTest.java deleted file mode 100644 index 775bc360e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3719PomExecutionOrderingTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3719. - * - * @author Brett Porter - * - */ -public class MavenITmng3719PomExecutionOrderingTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3719PomExecutionOrderingTest() { - super("[2.0.11,2.1.0-M1),[2.1.0-M2,4.0.0-alpha-1)"); - } - - /** - * Test that 3 executions are run in the correct order. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3719() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3719"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Pattern pattern = Pattern.compile(".*step-([0-9])\\.properties.*"); - - int[] stepLines = new int[3]; - List content = verifier.loadFile(verifier.getBasedir(), verifier.getLogFileName(), false); - for (int i = 0; i < content.size(); i++) { - String line = (String) content.get(i); - - Matcher m = pattern.matcher(line); - if (m.matches()) { - int step = Integer.valueOf(m.group(1)); - stepLines[step - 1] = i + 1; - } - } - - // check order - note it is not in sequence as the plugin definitions are merged - assertTrue("Step 1 should be found", stepLines[0] > 0); - assertTrue("Step 3 should be second", stepLines[0] < stepLines[2]); - assertTrue("Step 2 should be third", stepLines[2] < stepLines[1]); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3723ConcreteParentProjectTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3723ConcreteParentProjectTest.java deleted file mode 100644 index 0183c9f4c..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3723ConcreteParentProjectTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3723. - * - * Tests that the parent MavenProject instance of the current project has been - * transitioned into a concrete state before a mojo is executed. If this is true, - * then injecting ${project} into the mojo and traversing to project.getParent().getBasedir() - * should retrieve a File instance that is interpolated and exists (since we're - * going to be using a parent-child project set in the projects directory). - * - * @author jdcasey - * - */ -public class MavenITmng3723ConcreteParentProjectTest extends AbstractMavenIntegrationTestCase { - public MavenITmng3723ConcreteParentProjectTest() { - super("(2.0.8,)"); // only test in 2.0.9+ - } - - @Test - public void testitMNG3723() throws Exception { - // The testdir is computed from the location of this - // file. - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3723"); - File pluginDir = new File(testDir, "maven-mng3723-plugin"); - File projectDir = new File(testDir, "projects"); - - Verifier verifier; - - verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(projectDir.getAbsolutePath()); - - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3724ExecutionProjectSyncTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3724ExecutionProjectSyncTest.java deleted file mode 100644 index a66eda022..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3724ExecutionProjectSyncTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3724. - * - * todo Fill in a better description of what this test verifies! - * - * @author Brian Fox - * @author jdcasey - * - */ -public class MavenITmng3724ExecutionProjectSyncTest extends AbstractMavenIntegrationTestCase { - public MavenITmng3724ExecutionProjectSyncTest() { - super("(2.0.8,)"); // only test in 2.0.9+ - } - - @Test - public void testitMNG3724() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3724"); - File pluginDir = new File(testDir, "maven-mng3724-plugin"); - File projectDir = new File(testDir, "project"); - - Verifier verifier; - - verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(projectDir.getAbsolutePath()); - - verifier.addCliArgument("package"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3729MultiForkAggregatorsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3729MultiForkAggregatorsTest.java deleted file mode 100644 index 4f1ac7932..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3729MultiForkAggregatorsTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3729. - *

- * Complicated use case, but say - * you have an aggregator plugin that forks a lifecycle, and this aggregator is bound to the main lifecycle in a - * multi-module build. Further, say you call another plugin directly from the command line for this multi-module build, - * which forks a new lifecycle (like assembly:assembly). - *

- * When the directly invoked aggregator forks, it will force the - * forked lifecycle phase to be run for each project in the reactor, regardless of whether this causes the bound - * aggregator mojo to run multiple times. When the bound aggregator executes for the first project (this will be in an - * inner fork, two levels removed from the main lifecycle execution) it will set the executionProject to null for the - * current project (which is one of the reactorProjects member instances). On the second pass, as it tries to execute - * the inner aggregator's forked lifecycle for the second project in the reactor, one of the reactorProjects' - * project.getExecutionProject() results will be null. If any of the mojos in this inner lifecycle fork requires - * dependency resolution, it will cause a NullPointerException in the DefaultPluginManager when it tries to resolve the - * dependencies for the current project. This happened in 2.0.10-RC11 (which was the predecessor to 2.1.0-RC12, since - * the version was renamed while the release process was in mid-execution). It did not happen in 2.0.9, and was fixed in - * 2.1.0-RC12. - * - * @author Brian Fox - * @author jdcasey - */ -public class MavenITmng3729MultiForkAggregatorsTest extends AbstractMavenIntegrationTestCase { - public MavenITmng3729MultiForkAggregatorsTest() { - super("(2.0.8,3.0-alpha-1),[3.0-alpha-3,)"); // only test in 2.0.9+ - } - - @Test - public void testitMNG3729() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3729"); - File pluginDir = new File(testDir, "maven-mng3729-plugin"); - File projectDir = new File(testDir, "projects"); - - Verifier verifier; - - verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(projectDir.getAbsolutePath()); - - verifier.addCliArgument("package"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3732ActiveProfilesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3732ActiveProfilesTest.java deleted file mode 100644 index 8a4e511a7..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3732ActiveProfilesTest.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3732. - * - * @author Benjamin Bentmann - */ -public class MavenITmng3732ActiveProfilesTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3732ActiveProfilesTest() { - super("[2.0,)"); - } - - /** - * Verify that MavenProject.getActiveProfiles() includes profiles from all sources. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3732() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3732"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - if (matchesVersionRange("[4.0.0-alpha-1,)")) { - verifier.addCliArgument("-Ppom,settings"); - } else { - verifier.addCliArgument("-Ppom,profiles,settings"); - } - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/profile.properties"); - List ids = new ArrayList<>(); - - // support for profiles.xml removed from 3.x (see MNG-4060) - if (matchesVersionRange("[2.0,3.0-alpha-1)")) { - ids.add(props.getProperty("project.activeProfiles.0.id", "")); - ids.add(props.getProperty("project.activeProfiles.1.id", "")); - ids.add(props.getProperty("project.activeProfiles.2.id", "")); - ids.add(props.getProperty("project.activeProfiles.3.id", "")); - ids.remove("it-defaults"); - Collections.sort(ids); - - assertEquals(Arrays.asList(new String[] {"pom", "profiles", "settings"}), ids); - assertEquals("4", props.getProperty("project.activeProfiles")); - - assertEquals("PASSED-1", props.getProperty("project.properties.pomProperty")); - assertEquals("PASSED-2", props.getProperty("project.properties.settingsProperty")); - assertEquals("PASSED-3", props.getProperty("project.properties.profilesProperty")); - } else { - ids.add(props.getProperty("project.activeProfiles.0.id", "")); - ids.add(props.getProperty("project.activeProfiles.1.id", "")); - ids.add(props.getProperty("project.activeProfiles.2.id", "")); - ids.remove("it-defaults"); - Collections.sort(ids); - - assertEquals(Arrays.asList(new String[] {"pom", "settings"}), ids); - assertEquals("3", props.getProperty("project.activeProfiles")); - - assertEquals("PASSED-1", props.getProperty("project.properties.pomProperty")); - assertEquals("PASSED-2", props.getProperty("project.properties.settingsProperty")); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3740SelfReferentialReactorProjectsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3740SelfReferentialReactorProjectsTest.java deleted file mode 100644 index 8e5410237..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3740SelfReferentialReactorProjectsTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3740. - * - * Check that when a plugin project build uses an earlier version of itself, it - * doesn't result in a StackOverflowError as a result of trying to calculate - * a concrete state for its project references, which includes itself because of - * this plugin configuration in the POM. - * - * @author jdcasey - * - */ -public class MavenITmng3740SelfReferentialReactorProjectsTest extends AbstractMavenIntegrationTestCase { - public MavenITmng3740SelfReferentialReactorProjectsTest() { - super("(2.0.8,)"); // only test in 2.0.9+ - } - - @Test - public void testitMNG3740() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3740"); - File v1 = new File(testDir, "projects.v1"); - File v2 = new File(testDir, "projects.v2"); - - Verifier verifier; - - verifier = newVerifier(v1.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(v2.getAbsolutePath()); - verifier.addCliArgument("package"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3746POMPropertyOverrideTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3746POMPropertyOverrideTest.java deleted file mode 100644 index e0f44310f..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3746POMPropertyOverrideTest.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3746. - * - * todo Fill in a better description of what this test verifies! - * - * @author Brian Fox - * @author jdcasey - */ -public class MavenITmng3746POMPropertyOverrideTest extends AbstractMavenIntegrationTestCase { - public MavenITmng3746POMPropertyOverrideTest() { - super("(2.0.8,)"); // only test in 2.0.9+ - } - - @Test - public void testitMNG3746_UsingDefaultSystemProperty() throws Exception { - // The testdir is computed from the location of this - // file. - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3746"); - File pluginDir = new File(testDir, "maven-mng3746-plugin"); - File projectDir = new File(testDir, "project"); - - Verifier verifier; - - verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - verifier.setLogFileName("log-sys.txt"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(projectDir.getAbsolutePath()); - verifier.setLogFileName("log-sys.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } - - @Test - public void testitMNG3746_UsingCLIProperty() throws Exception { - // The testdir is computed from the location of this - // file. - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3746"); - File pluginDir = new File(testDir, "maven-mng3746-plugin"); - File projectDir = new File(testDir, "project"); - - Verifier verifier; - - verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - verifier.setLogFileName("log-cli.txt"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(projectDir.getAbsolutePath()); - verifier.setLogFileName("log-cli.txt"); - - verifier.addCliArgument("-Dtest.verification=cli"); - verifier.addCliArgument("-Dtest.usingCliValue=true"); - verifier.addCliArgument("-Djava.version=cli"); - - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3747PrefixedPathExpressionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3747PrefixedPathExpressionTest.java deleted file mode 100644 index 6d0445ceb..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3747PrefixedPathExpressionTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3747. - * - * todo Fill in a better description of what this test verifies! - * - * @author Brian Fox - * @author jdcasey - * - */ -public class MavenITmng3747PrefixedPathExpressionTest extends AbstractMavenIntegrationTestCase { - public MavenITmng3747PrefixedPathExpressionTest() { - super("(2.0.8,)"); // only test in 2.0.9+ - } - - @Test - public void testitMNG3747() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3747"); - - Verifier verifier = newVerifier(testDir.getCanonicalPath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/config.properties"); - assertEquals( - "path is: " + new File(testDir, "relative").getCanonicalPath() + "/somepath", - props.getProperty("stringParam")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3748BadSettingsXmlTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3748BadSettingsXmlTest.java deleted file mode 100644 index bf1ffec36..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3748BadSettingsXmlTest.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3748. - * - * Verifies that the settings.xml file is parsed using strict mode, such that invalid - * xml will cause an error (specifically, when repositories are not contained within a profile declaration) - * - * @author jdcasey - * - */ -public class MavenITmng3748BadSettingsXmlTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3748BadSettingsXmlTest() { - super("(2.0.8,)"); // only test in 2.0.9+ - } - - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3748"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - - // Maven 3.x will only print warnings (see MNG-4390) - if (matchesVersionRange("(,3.0-alpha-3)")) { - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - fail("build should fail if settings.xml contains unrecognized elements."); - } catch (VerificationException e) { - // expected - } - } else { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List lines = verifier.loadLines(verifier.getLogFileName(), null); - boolean foundWarning = false; - boolean isWarning = false; - for (String line : lines) { - if (!isWarning) { - isWarning = line.startsWith("[WARNING]"); - } else { - if (line.matches("(?i).*unrecognised tag.+unknown.+2.*")) { - foundWarning = true; - break; - } - } - } - assertTrue(foundWarning); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3766ToolchainsFromExtensionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3766ToolchainsFromExtensionTest.java deleted file mode 100644 index 0c3deae87..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3766ToolchainsFromExtensionTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3766. - * - * @author Benjamin Bentmann - */ -public class MavenITmng3766ToolchainsFromExtensionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3766ToolchainsFromExtensionTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Test toolchain discovery from build extensions. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3766"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("--toolchains"); - verifier.addCliArgument("toolchains.xml"); - verifier.addCliArgument("initialize"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/tool.properties"); - Properties toolProps = verifier.loadProperties("target/tool.properties"); - assertEquals("toolname", toolProps.getProperty("tool.toolname", "")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3769ExclusionRelocatedTransdepsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3769ExclusionRelocatedTransdepsTest.java deleted file mode 100644 index 64c4d38ca..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3769ExclusionRelocatedTransdepsTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Collections; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3769. - * - * - */ -public class MavenITmng3769ExclusionRelocatedTransdepsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3769ExclusionRelocatedTransdepsTest() { - // also didn't work in 2.0, but did in 2.0.1+ until regressed in 2.1.0-M1 - super("[2.0.1,2.1.0-M1),(2.1.0-M1,)"); - } - - /** - * Verify that dependency resolution considers dependency management also for relocated artifacts. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3769() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3769"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng3769"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List artifacts = verifier.loadLines("target/artifacts.txt", "UTF-8"); - assertEquals(Collections.singletonList("org.apache.maven.its.mng3769:dependency:jar:1.0"), artifacts); - - List paths = verifier.loadLines("target/test.txt", "UTF-8"); - assertEquals(3, paths.size()); - assertEquals("dependency-1.0.jar", paths.get(2)); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3775ConflictResolutionBacktrackingTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3775ConflictResolutionBacktrackingTest.java deleted file mode 100644 index bfc174d34..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3775ConflictResolutionBacktrackingTest.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3775. - * - * @author Benjamin Bentmann - */ -public class MavenITmng3775ConflictResolutionBacktrackingTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3775ConflictResolutionBacktrackingTest() { - super("[3.0,)"); - } - - @Test - public void testitABC() throws Exception { - testit("test-abc"); - } - - @Test - public void testitACB() throws Exception { - testit("test-acb"); - } - - @Test - public void testitBAC() throws Exception { - testit("test-bac"); - } - - @Test - public void testitBCA() throws Exception { - testit("test-bca"); - } - - @Test - public void testitCAB() throws Exception { - testit("test-cab"); - } - - @Test - public void testitCBA() throws Exception { - testit("test-cba"); - } - - /** - * Verify that conflict resolution doesn't select nodes which are children of eventually disabled nodes. - * In other words, when a subtree gets disabled, all previously selected winners among the children need to - * be revised. - */ - private void testit(String project) throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3775"); - - Verifier verifier = newVerifier(new File(testDir, project).getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng3775"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("../settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List test = verifier.loadLines("target/test.txt", "UTF-8"); - - assertTrue(project + " > " + test.toString(), test.contains("a-0.1.jar")); - assertTrue(project + " > " + test.toString(), test.contains("b-0.1.jar")); - assertTrue(project + " > " + test.toString(), test.contains("x-0.1.jar")); - assertTrue(project + " > " + test.toString(), test.contains("c-0.1.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3796ClassImportInconsistencyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3796ClassImportInconsistencyTest.java deleted file mode 100644 index eb9737899..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3796ClassImportInconsistencyTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3796. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3796ClassImportInconsistencyTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3796ClassImportInconsistencyTest() { - super("(2.0.2,)"); - } - - /** - * Verify that classes shared with the Maven core realm are properly imported into the plugin realm. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3796() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3796"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties pclProps = verifier.loadProperties("target/pcl.properties"); - assertNotNull(pclProps.getProperty("org.codehaus.plexus.util.xml.Xpp3Dom")); - - Properties tcclProps = verifier.loadProperties("target/tccl.properties"); - assertEquals(pclProps, tcclProps); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3805ExtensionClassPathOrderingTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3805ExtensionClassPathOrderingTest.java deleted file mode 100644 index 4021fdba0..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3805ExtensionClassPathOrderingTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3805. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3805ExtensionClassPathOrderingTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3805ExtensionClassPathOrderingTest() { - super("(2.0.9,2.1.0-M1),(2.1.0-M1,)"); - } - - /** - * Verify that the extension manager respects the ordering of the extension's dependencies when setting up the - * class realm. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3805() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3805"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng3805"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties wclProps = verifier.loadProperties("target/wcl.properties"); - String prefix = "org/apache/maven/its/mng3805/a.properties."; - String resource = "org/apache/maven/its/mng3805/a.properties"; - assertEquals("5", wclProps.getProperty(prefix + "count")); - assertTrue(wclProps.getProperty(prefix + "0").endsWith("wagon-a-0.1.jar!/" + resource)); - assertTrue(wclProps.getProperty(prefix + "1").endsWith("dep-a-0.1.jar!/" + resource)); - assertTrue(wclProps.getProperty(prefix + "2").endsWith("dep-b-0.1.jar!/" + resource)); - assertTrue(wclProps.getProperty(prefix + "3").endsWith("dep-c-0.1.jar!/" + resource)); - assertTrue(wclProps.getProperty(prefix + "4").endsWith("dep-d-0.1.jar!/" + resource)); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3807PluginConfigExpressionEvaluationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3807PluginConfigExpressionEvaluationTest.java deleted file mode 100644 index 082f54088..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3807PluginConfigExpressionEvaluationTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3807. - * - * - */ -public class MavenITmng3807PluginConfigExpressionEvaluationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3807PluginConfigExpressionEvaluationTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Verify that plugin configurations are subject to the parameter expression evaluator, in particular composite - * parameter types. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3807"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/config.properties"); - - assertEvaluated(props.getProperty("stringParams.0")); - assertEvaluated(props.getProperty("stringParams.1")); - - assertEvaluated(props.getProperty("listParam.0")); - assertEvaluated(props.getProperty("listParam.1")); - - assertEvaluated(props.getProperty("mapParam.test0")); - assertEvaluated(props.getProperty("mapParam.test1")); - - assertEvaluated(props.getProperty("propertiesParam.test0")); - assertEvaluated(props.getProperty("propertiesParam.test1")); - } - - private void assertEvaluated(String value) { - assertNotNull(value); - assertTrue(value.length() > 0); - assertFalse(value, value.contains("${")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3808ReportInheritanceOrderingTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3808ReportInheritanceOrderingTest.java deleted file mode 100644 index 255b4a5cb..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3808ReportInheritanceOrderingTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3808. - * - * @author Brett Porter - * - */ -public class MavenITmng3808ReportInheritanceOrderingTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3808ReportInheritanceOrderingTest() { - super("[2.0.11,2.1.0-M1),[2.1.0-M2,)"); - } - - /** - * Test that 3 executions are run in the correct order. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3808() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3808"); - testDir = new File(testDir, "child"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/model.properties"); - Properties props = verifier.loadProperties("target/model.properties"); - assertEquals("maven-it-plugin-log-file", props.getProperty("project.reporting.plugins.0.artifactId")); - assertEquals("maven-it-plugin-expression", props.getProperty("project.reporting.plugins.1.artifactId")); - assertEquals("maven-it-plugin-configuration", props.getProperty("project.reporting.plugins.2.artifactId")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3810BadProfileActivationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3810BadProfileActivationTest.java deleted file mode 100644 index 9bc8dae31..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3810BadProfileActivationTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3810. - * - * @author Brett Porter - * - */ -public class MavenITmng3810BadProfileActivationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3810BadProfileActivationTest() { - super("(2.0.10,2.1.0-M1),(2.1.0-M1,3.0-alpha-1),[3.0-alpha-3,)"); // 2.0.11+, 2.1.0-M2+ - } - - @Test - public void testitMNG3810Property() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3810/property"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - fail("Build should not succeed"); - } catch (Exception e) { - verifier.verifyTextInLog("The property name is required to activate the profile"); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3811ReportingPluginConfigurationInheritanceTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3811ReportingPluginConfigurationInheritanceTest.java deleted file mode 100644 index 0b22d85a8..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3811ReportingPluginConfigurationInheritanceTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3811. - * - * @author Brett Porter - * - */ -public class MavenITmng3811ReportingPluginConfigurationInheritanceTest extends AbstractMavenIntegrationTestCase { - public MavenITmng3811ReportingPluginConfigurationInheritanceTest() { - // TODO: fix for 3.0+ - super("[2.0.11,2.1.0-M1),[2.1.0,)"); - } - - /** - * Verifies that reporting configuration is inherited properly. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3811() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3811"); - - Verifier verifier = newVerifier(new File(testDir, "child").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/config.properties"); - String p = "project.reporting.plugins.0.configuration.children."; - - assertEquals("2", props.getProperty(p + "stringParams.0.children")); - assertEquals("parentParam", props.getProperty(p + "stringParams.0.children.stringParam.0.value")); - assertEquals("childParam", props.getProperty(p + "stringParams.0.children.stringParam.1.value")); - assertEquals("true", props.getProperty(p + "booleanParam.0.value")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3813PluginClassPathOrderingTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3813PluginClassPathOrderingTest.java deleted file mode 100644 index b7ce64cc9..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3813PluginClassPathOrderingTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3813. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3813PluginClassPathOrderingTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3813PluginClassPathOrderingTest() { - super("(2.0.8,)"); - } - - /** - * Verify that the ordering of the plugin class path matches the ordering of the dependencies as given in the POM. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3813() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3813"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng3813"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties pclProps = verifier.loadProperties("target/pcl.properties"); - - String className = "org.apache.maven.its.mng3813.SomeClass"; - String resName = className.replace('.', '/') + ".class"; - - assertEquals("depA", pclProps.getProperty(className + ".methods")); - assertTrue(pclProps.getProperty(resName).endsWith("/dep-a-0.1.jar!/" + resName)); - - assertEquals("8", pclProps.getProperty(resName + ".count")); - - assertTrue(pclProps.getProperty(resName + ".0").endsWith("/dep-a-0.1.jar!/" + resName)); - assertTrue(pclProps.getProperty(resName + ".1").endsWith("/dep-aa-0.1.jar!/" + resName)); - assertTrue(pclProps.getProperty(resName + ".2").endsWith("/dep-ac-0.1.jar!/" + resName)); - assertTrue(pclProps.getProperty(resName + ".3").endsWith("/dep-ab-0.1.jar!/" + resName)); - assertTrue(pclProps.getProperty(resName + ".4").endsWith("/dep-ad-0.1.jar!/" + resName)); - assertTrue(pclProps.getProperty(resName + ".5").endsWith("/dep-c-0.1.jar!/" + resName)); - assertTrue(pclProps.getProperty(resName + ".6").endsWith("/dep-b-0.1.jar!/" + resName)); - assertTrue(pclProps.getProperty(resName + ".7").endsWith("/dep-d-0.1.jar!/" + resName)); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3814BogusProjectCycleTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3814BogusProjectCycleTest.java deleted file mode 100644 index d39cbe18c..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3814BogusProjectCycleTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3814. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3814BogusProjectCycleTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3814BogusProjectCycleTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Verify that the reactor's project sorter considers artifact versions when checking for cycles. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3814() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3814"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng3814"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3821EqualPluginExecIdsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3821EqualPluginExecIdsTest.java deleted file mode 100644 index 668793703..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3821EqualPluginExecIdsTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3821. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3821EqualPluginExecIdsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3821EqualPluginExecIdsTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that using the same id for executions/reportsets of different plugins doesn't blow up the project - * builder. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3821() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3821"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3822BasedirAlignedInterpolationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3822BasedirAlignedInterpolationTest.java deleted file mode 100644 index d8e7ee3b1..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3822BasedirAlignedInterpolationTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3822. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3822BasedirAlignedInterpolationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3822BasedirAlignedInterpolationTest() { - super("[2.1.0-M1,)"); - } - - /** - * Verify that POM interpolation uses basedir-aligned build directories. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3822() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3822"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("initialize"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties pomProps = verifier.loadProperties("target/interpolated.properties"); - assertEquals(testDir, "src/main/java", pomProps.getProperty("project.properties.buildMainSrc")); - assertEquals(testDir, "src/test/java", pomProps.getProperty("project.properties.buildTestSrc")); - assertEquals(testDir, "src/main/scripts", pomProps.getProperty("project.properties.buildScriptSrc")); - assertEquals(testDir, "target", pomProps.getProperty("project.properties.buildOut")); - assertEquals(testDir, "target/classes", pomProps.getProperty("project.properties.buildMainOut")); - assertEquals(testDir, "target/test-classes", pomProps.getProperty("project.properties.buildTestOut")); - assertEquals(testDir, "target/site", pomProps.getProperty("project.properties.siteOut")); - } - - private void assertEquals(File testDir, String buildDir, String interpolatedPath) throws Exception { - File actual = new File(interpolatedPath); - File expected = new File(testDir, buildDir); - - assertTrue(actual.isAbsolute()); - assertEquals(expected.getCanonicalFile(), actual.getCanonicalFile()); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3827PluginConfigTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3827PluginConfigTest.java deleted file mode 100644 index 7224b4316..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3827PluginConfigTest.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3827. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3827PluginConfigTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3827PluginConfigTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that plain plugin configuration works correctly. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3827() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3827"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/plugin-config.properties"); - - assertCanonicalFileEquals(new File(testDir, "pom.xml"), new File(props.getProperty("fileParam"))); - assertEquals("true", props.getProperty("booleanParam")); - assertEquals("42", props.getProperty("byteParam")); - assertEquals("-12345", props.getProperty("shortParam")); - assertEquals("0", props.getProperty("integerParam")); - assertEquals("9876543210", props.getProperty("longParam")); - assertEquals("0.0", props.getProperty("floatParam")); - assertEquals("-1.5", props.getProperty("doubleParam")); - assertEquals("X", props.getProperty("characterParam")); - assertEquals("Hello World!", props.getProperty("stringParam")); - assertEquals("2008-11-09 11:59:03", props.getProperty("dateParam")); - assertEquals("http://maven.apache.org/", props.getProperty("urlParam")); - - assertEquals("4", props.getProperty("stringParams")); - assertEquals("one", props.getProperty("stringParams.0")); - assertEquals("two", props.getProperty("stringParams.1")); - assertEquals("three", props.getProperty("stringParams.2")); - assertEquals("four", props.getProperty("stringParams.3")); - - assertEquals("4", props.getProperty("listParam")); - assertEquals("one", props.getProperty("listParam.0")); - assertEquals("two", props.getProperty("listParam.1")); - assertEquals("three", props.getProperty("listParam.2")); - assertEquals("four", props.getProperty("listParam.3")); - - assertEquals("1", props.getProperty("setParam")); - assertEquals("item", props.getProperty("setParam.0")); - - assertEquals("2", props.getProperty("mapParam")); - assertEquals("value1", props.getProperty("mapParam.key1")); - assertEquals("value2", props.getProperty("mapParam.key2")); - - assertEquals("2", props.getProperty("propertiesParam")); - assertEquals("value1", props.getProperty("propertiesParam.key1")); - assertEquals("value2", props.getProperty("propertiesParam.key2")); - - assertEquals("field", props.getProperty("beanParam.fieldParam")); - assertEquals("setter", props.getProperty("beanParam.setterParam")); - assertEquals("true", props.getProperty("beanParam.setterCalled")); - - assertEquals("4", props.getProperty("domParam.children")); - assertEquals("one", props.getProperty("domParam.children.echo.0.value")); - assertEquals("two", props.getProperty("domParam.children.echo.1.value")); - assertEquals("three", props.getProperty("domParam.children.echo.2.value")); - assertEquals("four", props.getProperty("domParam.children.echo.3.value")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3831PomInterpolationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3831PomInterpolationTest.java deleted file mode 100644 index 5c03a62c9..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3831PomInterpolationTest.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3831. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3831PomInterpolationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3831PomInterpolationTest() { - super("(,2.0.2),(2.0.2,4.0.0-alpha-1)"); - } - - /** - * Test that expressions of the form ${*} resolve correctly to POM values (ugly but real). - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3831() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3831"); - File child = new File(testDir, "child"); - - Verifier verifier = newVerifier(child.getAbsolutePath()); - verifier.addCliArgument("initialize"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/interpolated.properties"); - String prefix = "project.properties."; - - assertEquals(child.getCanonicalFile(), new File(props.getProperty(prefix + "projectDir")).getCanonicalFile()); - - assertEquals("org.apache.maven.its.mng3831.child", props.getProperty(prefix + "projectGroupId")); - assertEquals("child", props.getProperty(prefix + "projectArtifactId")); - assertEquals("2.0-alpha-1", props.getProperty(prefix + "projectVersion")); - assertEquals("jar", props.getProperty(prefix + "projectPackaging")); - - assertEquals("child-name", props.getProperty(prefix + "projectName")); - assertEquals("child-desc", props.getProperty(prefix + "projectDesc")); - assertEquals("http://child.org/", props.getProperty(prefix + "projectUrl")); - assertEquals("2008", props.getProperty(prefix + "projectYear")); - assertEquals("child-org-name", props.getProperty(prefix + "projectOrgName")); - - assertEquals("2.0.0", props.getProperty(prefix + "projectPrereqMvn")); - assertEquals("http://scm.org/", props.getProperty(prefix + "projectScmUrl")); - assertEquals("http://issue.org/", props.getProperty(prefix + "projectIssueUrl")); - assertEquals("http://ci.org/", props.getProperty(prefix + "projectCiUrl")); - assertEquals("child-dist-repo", props.getProperty(prefix + "projectDistRepoName")); - assertEquals("http://dist.org/", props.getProperty(prefix + "projectDistRepoUrl")); - assertEquals("http://site.org/", props.getProperty(prefix + "projectDistSiteUrl")); - - assertEquals("org.apache.maven.its.mng3831", props.getProperty(prefix + "parentGroupId")); - assertEquals("parent", props.getProperty(prefix + "parentArtifactId")); - assertEquals("1.0", props.getProperty(prefix + "parentVersion")); - - /* - * NOTE: We intentionally do not check whether the build paths have been basedir aligned, that's another - * story... - */ - if (matchesVersionRange("(2.0.8,)")) { - assertTrue(props.getProperty(prefix + "projectBuildOut").endsWith("bin")); - } - assertTrue(props.getProperty(prefix + "projectSiteOut").endsWith("doc")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3833PomInterpolationDataFlowChainTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3833PomInterpolationDataFlowChainTest.java deleted file mode 100644 index 1e88f4a0f..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3833PomInterpolationDataFlowChainTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3833. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3833PomInterpolationDataFlowChainTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3833PomInterpolationDataFlowChainTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that POM interpolation fully interpolates all properties in data flow chain, i.e. where property - * A depends on property B, and property B depends on property C and so on. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3833() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3833"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/interpolated.properties"); - - for (int i = 0; i < 24; i++) { - String index = ((i < 10) ? "0" : "") + i; - assertEquals("PASSED", props.getProperty("project.properties.property" + index)); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3836PluginConfigInheritanceTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3836PluginConfigInheritanceTest.java deleted file mode 100644 index af8c9f4b9..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3836PluginConfigInheritanceTest.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3836. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3836PluginConfigInheritanceTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3836PluginConfigInheritanceTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that submodules can *override* inherited plugin configuration. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3836() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3836"); - - Verifier verifier = newVerifier(new File(testDir, "child").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/plugin-config.properties"); - - assertEquals("4", props.getProperty("stringParams")); - assertEquals("PASSED-1", props.getProperty("stringParams.0")); - assertEquals("PASSED-3", props.getProperty("stringParams.1")); - assertEquals("PASSED-2", props.getProperty("stringParams.2")); - assertEquals("PASSED-4", props.getProperty("stringParams.3")); - - assertEquals("4", props.getProperty("listParam")); - assertEquals("PASSED-1", props.getProperty("listParam.0")); - assertEquals("PASSED-3", props.getProperty("listParam.1")); - assertEquals("PASSED-2", props.getProperty("listParam.2")); - assertEquals("PASSED-4", props.getProperty("listParam.3")); - - assertEquals("4", props.getProperty("domParam.children")); - assertEquals("PASSED-1", props.getProperty("domParam.children.echo.0.value")); - assertEquals("PASSED-3", props.getProperty("domParam.children.echo.1.value")); - assertEquals("PASSED-2", props.getProperty("domParam.children.echo.2.value")); - assertEquals("PASSED-4", props.getProperty("domParam.children.echo.3.value")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3838EqualPluginDepsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3838EqualPluginDepsTest.java deleted file mode 100644 index 4f5848727..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3838EqualPluginDepsTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3838. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3838EqualPluginDepsTest extends AbstractMavenIntegrationTestCase { - public MavenITmng3838EqualPluginDepsTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that using the same dependency for different plugins doesn't blow up the project builder. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3838() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3838"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3839PomParsingCoalesceTextTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3839PomParsingCoalesceTextTest.java deleted file mode 100644 index d22db371d..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3839PomParsingCoalesceTextTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3839. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3839PomParsingCoalesceTextTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3839PomParsingCoalesceTextTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that POM parsing properly coalesces text data. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3839() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3839"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/xml.properties"); - assertEquals("A Test Project Property", props.getProperty("project.properties.prop0")); - assertEquals("That's a test!", props.getProperty("project.properties.prop1")); - assertEquals( - 32 * 1024, - props.getProperty("project.properties.prop2") - .trim() - .replaceAll("[\n\r]", "") - .length()); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3843PomInheritanceTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3843PomInheritanceTest.java deleted file mode 100644 index a5bd36b0e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3843PomInheritanceTest.java +++ /dev/null @@ -1,302 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Collection; -import java.util.Properties; -import java.util.TreeSet; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3843. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3843PomInheritanceTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3843PomInheritanceTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test various inheritance scenarios. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3843() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3843"); - - testDir = testDir.getCanonicalFile(); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("test-1/target"); - verifier.deleteDirectory("test-2/target"); - verifier.deleteDirectory("test-2/child-1/target"); - verifier.deleteDirectory("test-2/child-2/target"); - verifier.deleteDirectory("test-3/sub-parent/child-a/target"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props; - File basedir; - - basedir = new File(verifier.getBasedir(), "test-1"); - props = verifier.loadProperties("test-1/target/pom.properties"); - assertEquals("org.apache.maven.its.mng3843", props.getProperty("project.groupId")); - assertEquals("test-1", props.getProperty("project.artifactId")); - assertEquals("0.1", props.getProperty("project.version")); - assertEquals("jar", props.getProperty("project.packaging")); - assertEquals("test", props.getProperty("project.name", "")); - assertEquals("", props.getProperty("project.description", "")); - assertEquals("", props.getProperty("project.url", "")); - assertEquals("", props.getProperty("project.inceptionYear", "")); - assertEquals("", props.getProperty("project.build.defaultGoal", "")); - if (matchesVersionRange("[4.0.0-alpha-6,)")) { - assertEquals("2", props.getProperty("project.properties")); - assertEquals("UTF-8", props.getProperty("project.properties.project.build.sourceEncoding")); - assertEquals("UTF-8", props.getProperty("project.properties.project.reporting.outputEncoding")); - } else { - assertMissing(props, "project.properties."); - } - assertMissing(props, "project.prerequisites."); - assertMissing(props, "project.modules."); - assertMissing(props, "project.licenses."); - assertMissing(props, "project.developers."); - assertMissing(props, "project.contributors."); - assertMissing(props, "project.mailingLists."); - assertMissing(props, "project.organization."); - assertMissing(props, "project.scm."); - assertMissing(props, "project.ciManagement."); - assertMissing(props, "project.issueManagement."); - assertMissing(props, "project.distributionManagement."); - assertMissing(props, "project.profiles."); - assertEquals("test-1-0.1", props.getProperty("project.build.finalName")); - assertPathEquals(basedir, "src/main/java", props.getProperty("project.build.sourceDirectory")); - assertPathEquals(basedir, "src/test/java", props.getProperty("project.build.testSourceDirectory")); - assertPathEquals(basedir, "src/main/scripts", props.getProperty("project.build.scriptSourceDirectory")); - if (matchesVersionRange("[4.0.0-alpha-1,)")) { - assertEquals("2", props.getProperty("project.build.resources")); - assertEquals("2", props.getProperty("project.build.testResources")); - } else { - assertEquals("1", props.getProperty("project.build.resources")); - assertEquals("1", props.getProperty("project.build.testResources")); - } - assertPathEquals(basedir, "src/main/resources", props.getProperty("project.build.resources.0.directory")); - assertPathEquals(basedir, "src/test/resources", props.getProperty("project.build.testResources.0.directory")); - if (matchesVersionRange("[4.0.0-alpha-1,)")) { - assertPathEquals( - basedir, "src/main/resources-filtered", props.getProperty("project.build.resources.1.directory")); - assertPathEquals( - basedir, - "src/test/resources-filtered", - props.getProperty("project.build.testResources.1.directory")); - } - assertPathEquals(basedir, "target", props.getProperty("project.build.directory")); - assertPathEquals(basedir, "target/classes", props.getProperty("project.build.outputDirectory")); - assertPathEquals(basedir, "target/test-classes", props.getProperty("project.build.testOutputDirectory")); - assertPathEquals(basedir, "target/site", props.getProperty("project.reporting.outputDirectory")); - assertEquals("false", props.getProperty("project.reporting.excludeDefaults")); - assertTrue(Integer.parseInt(props.getProperty("project.repositories")) > 0); - if (matchesVersionRange("(,3.0-alpha-3)")) { - // 3.x will provide the lifecycle bindings in the effective model, don't count these - assertEquals("1", props.getProperty("project.build.plugins")); - } - assertMissing(props, "project.dependencies."); - assertMissing(props, "project.dependencyManagement."); - - basedir = new File(verifier.getBasedir(), "test-2"); - props = verifier.loadProperties("test-2/target/pom.properties"); - - basedir = new File(verifier.getBasedir(), "test-2/child-1"); - props = verifier.loadProperties("test-2/child-1/target/pom.properties"); - assertEquals("org.apache.maven.its.mng3843", props.getProperty("project.groupId")); - assertEquals("child-1", props.getProperty("project.artifactId")); - assertEquals("0.1", props.getProperty("project.version")); - assertEquals("jar", props.getProperty("project.packaging")); - assertNotEquals("parent-name", props.getProperty("project.name")); - assertEquals("parent-description", props.getProperty("project.description", "")); - assertUrlCommon("http://parent.url", props.getProperty("project.url", "")); - assertEquals("2008", props.getProperty("project.inceptionYear", "")); - assertEquals("initialize", props.getProperty("project.build.defaultGoal")); - assertEquals("parent-property", props.getProperty("project.properties.parentProperty")); - assertMissing(props, "project.prerequisites."); - assertMissing(props, "project.modules."); - assertEquals("1", props.getProperty("project.licenses")); - assertEquals("http://parent.url/license", props.getProperty("project.licenses.0.url")); - assertEquals("1", props.getProperty("project.developers")); - assertEquals("parent-developer", props.getProperty("project.developers.0.name")); - assertEquals("1", props.getProperty("project.contributors")); - assertEquals("parent-contributor", props.getProperty("project.contributors.0.name")); - assertEquals("1", props.getProperty("project.mailingLists")); - assertEquals("parent-mailing-list", props.getProperty("project.mailingLists.0.name")); - assertEquals("http://parent-org.url/", props.getProperty("project.organization.url")); - assertUrlCommon("http://parent.url/trunk", props.getProperty("project.scm.url")); - assertUrlCommon("http://parent.url/scm", props.getProperty("project.scm.connection")); - assertUrlCommon("https://parent.url/scm", props.getProperty("project.scm.developerConnection")); - assertEquals("http://parent.url/ci", props.getProperty("project.ciManagement.url")); - assertEquals("http://parent.url/issues", props.getProperty("project.issueManagement.url")); - assertEquals("http://parent.url/dist", props.getProperty("project.distributionManagement.repository.url")); - assertEquals( - "http://parent.url/snaps", props.getProperty("project.distributionManagement.snapshotRepository.url")); - assertUrlCommon("http://parent.url/site", props.getProperty("project.distributionManagement.site.url")); - assertUrlCommon("http://parent.url/download", props.getProperty("project.distributionManagement.downloadUrl")); - if (matchesVersionRange("(2.0.2,)")) { - assertMissing(props, "project.distributionManagement.relocation."); - } - assertMissing(props, "project.profiles."); - assertEquals("child-1-0.1", props.getProperty("project.build.finalName")); - assertPathEquals(basedir, "src/main", props.getProperty("project.build.sourceDirectory")); - assertPathEquals(basedir, "src/test", props.getProperty("project.build.testSourceDirectory")); - assertPathEquals(basedir, "src/scripts", props.getProperty("project.build.scriptSourceDirectory")); - assertEquals("1", props.getProperty("project.build.resources")); - assertPathEquals(basedir, "res/main", props.getProperty("project.build.resources.0.directory")); - assertEquals("1", props.getProperty("project.build.testResources")); - assertPathEquals(basedir, "res/test", props.getProperty("project.build.testResources.0.directory")); - assertPathEquals(basedir, "out", props.getProperty("project.build.directory")); - assertPathEquals(basedir, "out/main", props.getProperty("project.build.outputDirectory")); - assertPathEquals(basedir, "out/test", props.getProperty("project.build.testOutputDirectory")); - assertPathEquals(basedir, "site", props.getProperty("project.reporting.outputDirectory")); - if (matchesVersionRange("(2.0.9,2.1.0-M1),(2.1.0-M1,)")) { - // MNG-1999 - assertEquals("true", props.getProperty("project.reporting.excludeDefaults")); - } - assertTrue(Integer.parseInt(props.getProperty("project.repositories")) > 1); - if (matchesVersionRange("(,3.0-alpha-3)")) { - // 3.x will provide the lifecycle bindings in the effective model, don't count these - assertEquals("1", props.getProperty("project.build.plugins")); - } - assertEquals("1", props.getProperty("project.dependencies")); - assertEquals("parent-dep-b", props.getProperty("project.dependencies.0.artifactId")); - assertEquals("1", props.getProperty("project.dependencyManagement.dependencies")); - assertEquals("parent-dep-a", props.getProperty("project.dependencyManagement.dependencies.0.artifactId")); - - basedir = new File(verifier.getBasedir(), "test-2/child-2"); - props = verifier.loadProperties("test-2/child-2/target/pom.properties"); - assertEquals("org.apache.maven.its.mng3843.child", props.getProperty("project.groupId")); - assertEquals("child-2", props.getProperty("project.artifactId")); - assertEquals("0.2", props.getProperty("project.version")); - assertEquals("jar", props.getProperty("project.packaging")); - assertEquals("child-name", props.getProperty("project.name")); - assertEquals("child-description", props.getProperty("project.description", "")); - assertUrlCommon("http://child.url", props.getProperty("project.url", "")); - assertEquals("2009", props.getProperty("project.inceptionYear", "")); - assertEquals("validate", props.getProperty("project.build.defaultGoal")); - assertEquals("parent-property", props.getProperty("project.properties.parentProperty")); - assertEquals("child-property", props.getProperty("project.properties.childProperty")); - assertEquals("child-override", props.getProperty("project.properties.overriddenProperty")); - assertEquals("2.0.1", props.getProperty("project.prerequisites.maven")); - assertMissing(props, "project.modules."); - assertEquals("1", props.getProperty("project.licenses")); - assertEquals("http://child.url/license", props.getProperty("project.licenses.0.url")); - assertEquals("1", props.getProperty("project.developers")); - assertEquals("child-developer", props.getProperty("project.developers.0.name")); - assertEquals("1", props.getProperty("project.contributors")); - assertEquals("child-contributor", props.getProperty("project.contributors.0.name")); - assertEquals("1", props.getProperty("project.mailingLists")); - assertEquals("child-mailing-list", props.getProperty("project.mailingLists.0.name")); - assertEquals("http://child-org.url/", props.getProperty("project.organization.url")); - assertUrlCommon("http://child.url/trunk", props.getProperty("project.scm.url")); - assertUrlCommon("http://child.url/scm", props.getProperty("project.scm.connection")); - assertUrlCommon("https://child.url/scm", props.getProperty("project.scm.developerConnection")); - assertEquals("http://child.url/ci", props.getProperty("project.ciManagement.url")); - assertEquals("http://child.url/issues", props.getProperty("project.issueManagement.url")); - assertEquals("http://child.url/dist", props.getProperty("project.distributionManagement.repository.url")); - assertEquals( - "http://child.url/snaps", props.getProperty("project.distributionManagement.snapshotRepository.url")); - assertUrlCommon("http://child.url/site", props.getProperty("project.distributionManagement.site.url")); - assertUrlCommon("http://child.url/download", props.getProperty("project.distributionManagement.downloadUrl")); - assertEquals("child-reloc-msg", props.getProperty("project.distributionManagement.relocation.message")); - assertMissing(props, "project.profiles."); - assertEquals("coreit", props.getProperty("project.build.finalName")); - assertPathEquals(basedir, "sources/main", props.getProperty("project.build.sourceDirectory")); - assertPathEquals(basedir, "sources/test", props.getProperty("project.build.testSourceDirectory")); - assertPathEquals(basedir, "sources/scripts", props.getProperty("project.build.scriptSourceDirectory")); - assertEquals("1", props.getProperty("project.build.resources")); - assertPathEquals(basedir, "resources/main", props.getProperty("project.build.resources.0.directory")); - assertEquals("1", props.getProperty("project.build.testResources")); - assertPathEquals(basedir, "resources/test", props.getProperty("project.build.testResources.0.directory")); - assertPathEquals(basedir, "build", props.getProperty("project.build.directory")); - assertPathEquals(basedir, "build/main", props.getProperty("project.build.outputDirectory")); - assertPathEquals(basedir, "build/test", props.getProperty("project.build.testOutputDirectory")); - assertPathEquals(basedir, "docs", props.getProperty("project.reporting.outputDirectory")); - assertEquals("false", props.getProperty("project.reporting.excludeDefaults")); - assertTrue(Integer.parseInt(props.getProperty("project.repositories")) > 1); - if (matchesVersionRange("(2.0.4,3.0-alpha-3)")) { - // 3.x will provide the lifecycle bindings in the effective model, don't count these - assertEquals("1", props.getProperty("project.build.plugins")); - } - assertEquals("4", props.getProperty("project.dependencies")); - Collection actualDeps = new TreeSet<>(); - actualDeps.add(props.getProperty("project.dependencies.0.artifactId")); - actualDeps.add(props.getProperty("project.dependencies.1.artifactId")); - actualDeps.add(props.getProperty("project.dependencies.2.artifactId")); - actualDeps.add(props.getProperty("project.dependencies.3.artifactId")); - Collection expectedDeps = new TreeSet<>(); - expectedDeps.add("parent-dep-b"); - expectedDeps.add("child-dep-b"); - expectedDeps.add("child-dep-c"); - expectedDeps.add("child-dep-d"); - assertEquals(expectedDeps, actualDeps); - assertEquals("2", props.getProperty("project.dependencyManagement.dependencies")); - Collection actualMngtDeps = new TreeSet<>(); - actualMngtDeps.add(props.getProperty("project.dependencyManagement.dependencies.0.artifactId")); - actualMngtDeps.add(props.getProperty("project.dependencyManagement.dependencies.1.artifactId")); - Collection expectedMngtDeps = new TreeSet<>(); - expectedMngtDeps.add("parent-dep-a"); - expectedMngtDeps.add("child-dep-a"); - assertEquals(expectedMngtDeps, actualMngtDeps); - - basedir = new File(verifier.getBasedir(), "test-3/sub-parent/child-a"); - props = verifier.loadProperties("test-3/sub-parent/child-a/target/pom.properties"); - String val = matchesVersionRange("(4.0-alpha-7,)") ? ".." : "../pom.xml"; - assertEquals(val, props.getProperty("project.originalModel.parent.relativePath")); - } - - private void assertPathEquals(File basedir, String expected, String actual) { - // NOTE: Basedir alignment is another issue, so don't test this here - File actualFile = new File(actual); - if (actualFile.isAbsolute()) { - assertEquals(new File(basedir, expected), actualFile); - } else { - assertEquals(new File(expected), actualFile); - } - } - - private void assertUrlCommon(String expected, String actual) { - // NOTE: URL adjustment is a slightly different issue, so don't test here and merely check for common prefix - assertTrue("expected " + expected + " but was " + actual, actual.startsWith(expected)); - } - - private void assertMissing(Properties props, String prefix) { - for (Object o : props.keySet()) { - String key = o.toString(); - assertFalse("Found unexpected key: " + key, key.startsWith(prefix)); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3845LimitedPomInheritanceTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3845LimitedPomInheritanceTest.java deleted file mode 100644 index eaf8cb962..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3845LimitedPomInheritanceTest.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3845. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3845LimitedPomInheritanceTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3845LimitedPomInheritanceTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that inheritance is all-or-nothing for certain subtrees of the POM. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3845() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3845"); - - Verifier verifier = newVerifier(new File(testDir, "child").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - assertEquals("child-org", props.getProperty("project.organization.name", "")); - assertEquals("", props.getProperty("project.organization.url", "")); - assertEquals("http://child.url/issues", props.getProperty("project.issueManagement.url", "")); - assertEquals("", props.getProperty("project.issueManagement.system", "")); - assertEquals("0", props.getProperty("project.ciManagement.notifiers", "0")); - assertEquals("child-distros", props.getProperty("project.distributionManagement.repository.id", "")); - assertEquals("ssh://child.url/distros", props.getProperty("project.distributionManagement.repository.url", "")); - assertEquals("", props.getProperty("project.distributionManagement.repository.name", "")); - assertEquals("true", props.getProperty("project.distributionManagement.repository.uniqueVersion", "true")); - assertEquals("default", props.getProperty("project.distributionManagement.repository.layout", "default")); - assertEquals("child-snaps", props.getProperty("project.distributionManagement.snapshotRepository.id", "")); - assertEquals( - "ssh://child.url/snaps", - props.getProperty("project.distributionManagement.snapshotRepository.url", "")); - assertEquals("", props.getProperty("project.distributionManagement.snapshotRepository.name", "")); - assertEquals( - "true", props.getProperty("project.distributionManagement.snapshotRepository.uniqueVersion", "true")); - assertEquals( - "default", props.getProperty("project.distributionManagement.snapshotRepository.layout", "default")); - assertEquals("child-site", props.getProperty("project.distributionManagement.site.id", "")); - assertEquals("scp://child.url/site", props.getProperty("project.distributionManagement.site.url", "")); - assertEquals("", props.getProperty("project.distributionManagement.site.name", "")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3846PomInheritanceUrlAdjustmentTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3846PomInheritanceUrlAdjustmentTest.java deleted file mode 100644 index 835dce4d9..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3846PomInheritanceUrlAdjustmentTest.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3846. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3846PomInheritanceUrlAdjustmentTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3846PomInheritanceUrlAdjustmentTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that inheritance of certain URLs automatically appends the child's artifact id. - * - * @throws Exception in case of failure - */ - @Test - public void testitOneParent() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3846"); - - Verifier verifier = newVerifier(new File(testDir, "sub").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - assertEquals("http://parent.url/child", props.getProperty("project.url")); - assertEquals("http://parent.url/org/", props.getProperty("project.organization.url")); - assertEquals("http://parent.url/license.txt", props.getProperty("project.licenses.0.url")); - assertEquals("http://parent.url/viewvc/child", props.getProperty("project.scm.url")); - assertEquals("http://parent.url/scm/child", props.getProperty("project.scm.connection")); - assertEquals("https://parent.url/scm/child", props.getProperty("project.scm.developerConnection")); - assertEquals("http://parent.url/issues", props.getProperty("project.issueManagement.url")); - assertEquals("http://parent.url/ci", props.getProperty("project.ciManagement.url")); - assertEquals("http://parent.url/dist", props.getProperty("project.distributionManagement.repository.url")); - assertEquals( - "http://parent.url/snaps", props.getProperty("project.distributionManagement.snapshotRepository.url")); - assertEquals("http://parent.url/site/child", props.getProperty("project.distributionManagement.site.url")); - assertEquals("http://parent.url/download", props.getProperty("project.distributionManagement.downloadUrl")); - } - - /** - * Test that inheritance of certain URLs automatically appends the child's artifact id. In a deeper inheritance - * hierarchy, this should contribute the artifact id of each parent that does not override the URLs. - * - * @throws Exception in case of failure - */ - @Test - public void testitTwoParents() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3846"); - - Verifier verifier = newVerifier(new File(testDir, "another-parent/sub").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - assertEquals("http://parent.url/ap/child", props.getProperty("project.url")); - assertEquals("http://parent.url/org/", props.getProperty("project.organization.url")); - assertEquals("http://parent.url/license.txt", props.getProperty("project.licenses.0.url")); - assertEquals("http://parent.url/viewvc/ap/child", props.getProperty("project.scm.url")); - assertEquals("http://parent.url/scm/ap/child", props.getProperty("project.scm.connection")); - assertEquals("https://parent.url/scm/ap/child", props.getProperty("project.scm.developerConnection")); - assertEquals("http://parent.url/issues", props.getProperty("project.issueManagement.url")); - assertEquals("http://parent.url/ci", props.getProperty("project.ciManagement.url")); - assertEquals("http://parent.url/dist", props.getProperty("project.distributionManagement.repository.url")); - assertEquals( - "http://parent.url/snaps", props.getProperty("project.distributionManagement.snapshotRepository.url")); - assertEquals("http://parent.url/site/ap/child", props.getProperty("project.distributionManagement.site.url")); - assertEquals("http://parent.url/download", props.getProperty("project.distributionManagement.downloadUrl")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3852PluginConfigWithHeterogeneousListTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3852PluginConfigWithHeterogeneousListTest.java deleted file mode 100644 index ad9393d16..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3852PluginConfigWithHeterogeneousListTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3852. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3852PluginConfigWithHeterogeneousListTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3852PluginConfigWithHeterogeneousListTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that list-valued plugin parameters respect the ordering of their elements as given in the POM, even - * if these elements have different names. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3852() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3852"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/plugin-config.properties"); - - assertEquals("5", props.getProperty("listParam")); - assertEquals("one", props.getProperty("listParam.0")); - assertEquals("two", props.getProperty("listParam.1")); - assertEquals("three", props.getProperty("listParam.3")); - assertEquals("four", props.getProperty("listParam.4")); - assertEquals( - "org.apache.maven.plugin.coreit.Bean", - props.getProperty("listParam.2").substring(0, 35)); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3853ProfileInjectedDistReposTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3853ProfileInjectedDistReposTest.java deleted file mode 100644 index ce8e525ea..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3853ProfileInjectedDistReposTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3853. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3853ProfileInjectedDistReposTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3853ProfileInjectedDistReposTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that distribution management repos injected by profiles are recognized by the MavenProject instance and - * that the resulting artifact repositories are available to plugins via the corresponding expressions. Note that - * this issue is not primarily about the effective model (which was correct for the original issue, i.e. reflected - * the injected distributionManagement section) but whether the MavenProject wrapper around the model is in sync - * with the model. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3853() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3853"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-Pcoreit"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/dist.properties"); - assertEquals("1", props.getProperty("listParam")); - assertEquals("maven-core-it", props.getProperty("listParam.0")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3863AutoPluginGroupIdTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3863AutoPluginGroupIdTest.java deleted file mode 100644 index 39184a443..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3863AutoPluginGroupIdTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3863. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3863AutoPluginGroupIdTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3863AutoPluginGroupIdTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that the group id "org.apache.maven.plugins" is *not* automatically assumed for dependencies. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3853() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3863"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Validation step did not detect missing groupId for dependency"); - } catch (VerificationException e) { - // expected - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3864PerExecPluginConfigTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3864PerExecPluginConfigTest.java deleted file mode 100644 index 527799407..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3864PerExecPluginConfigTest.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3864. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3864PerExecPluginConfigTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3864PerExecPluginConfigTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that plain per-execution plugin configuration works correctly. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3864() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3864"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/plugin-config.properties"); - - assertCanonicalFileEquals(new File(testDir, "pom.xml"), new File(props.getProperty("fileParam"))); - assertEquals("true", props.getProperty("booleanParam")); - assertEquals("42", props.getProperty("byteParam")); - assertEquals("-12345", props.getProperty("shortParam")); - assertEquals("0", props.getProperty("integerParam")); - assertEquals("9876543210", props.getProperty("longParam")); - assertEquals("0.0", props.getProperty("floatParam")); - assertEquals("-1.5", props.getProperty("doubleParam")); - assertEquals("X", props.getProperty("characterParam")); - assertEquals("Hello World!", props.getProperty("stringParam")); - assertEquals("2008-11-09 11:59:03", props.getProperty("dateParam")); - assertEquals("http://maven.apache.org/", props.getProperty("urlParam")); - - assertEquals("4", props.getProperty("stringParams")); - assertEquals("one", props.getProperty("stringParams.0")); - assertEquals("two", props.getProperty("stringParams.1")); - assertEquals("three", props.getProperty("stringParams.2")); - assertEquals("four", props.getProperty("stringParams.3")); - - assertEquals("4", props.getProperty("listParam")); - assertEquals("one", props.getProperty("listParam.0")); - assertEquals("two", props.getProperty("listParam.1")); - assertEquals("three", props.getProperty("listParam.2")); - assertEquals("four", props.getProperty("listParam.3")); - - assertEquals("1", props.getProperty("setParam")); - assertEquals("item", props.getProperty("setParam.0")); - - assertEquals("2", props.getProperty("mapParam")); - assertEquals("value1", props.getProperty("mapParam.key1")); - assertEquals("value2", props.getProperty("mapParam.key2")); - - assertEquals("2", props.getProperty("propertiesParam")); - assertEquals("value1", props.getProperty("propertiesParam.key1")); - assertEquals("value2", props.getProperty("propertiesParam.key2")); - - assertEquals("field", props.getProperty("beanParam.fieldParam")); - assertEquals("setter", props.getProperty("beanParam.setterParam")); - assertEquals("true", props.getProperty("beanParam.setterCalled")); - - assertEquals("4", props.getProperty("domParam.children")); - assertEquals("one", props.getProperty("domParam.children.echo.0.value")); - assertEquals("two", props.getProperty("domParam.children.echo.1.value")); - assertEquals("three", props.getProperty("domParam.children.echo.2.value")); - assertEquals("four", props.getProperty("domParam.children.echo.3.value")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3866PluginConfigInheritanceTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3866PluginConfigInheritanceTest.java deleted file mode 100644 index ef8e2dbfb..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3866PluginConfigInheritanceTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3866. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3866PluginConfigInheritanceTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3866PluginConfigInheritanceTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that inheritance merges plugin definitions based on groupId:artifactId, i.e. plugin version is - * irrelevant for merging. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3866() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3866"); - - Verifier verifier = newVerifier(new File(testDir, "sub").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/plugin-config.properties"); - assertEquals("PASSED", props.getProperty("stringParam")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3872ProfileActivationInRelocatedPomTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3872ProfileActivationInRelocatedPomTest.java deleted file mode 100644 index fc054957e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3872ProfileActivationInRelocatedPomTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3872. - * - * @author Benjamin Bentmann - */ -public class MavenITmng3872ProfileActivationInRelocatedPomTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3872ProfileActivationInRelocatedPomTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that profiles are activated in relocated POMs. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3872"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng3872"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List compileClassPath = verifier.loadLines("target/compile.txt", "UTF-8"); - assertTrue(compileClassPath.toString(), compileClassPath.contains("a-0.1.jar")); - assertTrue(compileClassPath.toString(), compileClassPath.contains("b-0.1.jar")); - assertFalse(compileClassPath.toString(), compileClassPath.contains("c-0.1.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3873MultipleExecutionGoalsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3873MultipleExecutionGoalsTest.java deleted file mode 100644 index d3d6f6dbf..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3873MultipleExecutionGoalsTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3873. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3873MultipleExecutionGoalsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3873MultipleExecutionGoalsTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that all goals from a plugin execution are actually executed and not only one when no {@code } - * is involved. - * - * @throws Exception in case of failure - */ - @Test - public void testitWithoutPluginMngt() throws Exception { - testitMNG3873("test-1"); - } - - /** - * Test that all goals from a plugin execution are actually executed and not only one when {@code } - * is involved. - * - * @throws Exception in case of failure - */ - @Test - public void testitWithPluginMngt() throws Exception { - testitMNG3873("test-2"); - } - - private void testitMNG3873(String project) throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3873"); - - Verifier verifier = newVerifier(new File(testDir, project).getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - /* - * NOTE: We deliberately don't check the exact order here, that's another issue. - */ - List lines = verifier.loadLines("target/it.log", "UTF-8"); - assertTrue(lines.toString(), lines.contains("test")); - assertTrue(lines.toString(), lines.contains("----")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3877BasedirAlignedModelTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3877BasedirAlignedModelTest.java deleted file mode 100644 index a05603576..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3877BasedirAlignedModelTest.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.IOException; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3877. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3877BasedirAlignedModelTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3877BasedirAlignedModelTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that project directories are basedir aligned when inspected by plugins via the MavenProject instance. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3877() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3877"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties modelProps = verifier.loadProperties("target/model.properties"); - - assertPathEquals(testDir, "target", modelProps.getProperty("project.build.directory")); - - assertPathEquals(testDir, "target/classes", modelProps.getProperty("project.build.outputDirectory")); - - assertPathEquals(testDir, "target/test-classes", modelProps.getProperty("project.build.testOutputDirectory")); - - assertPathEquals(testDir, "src/main/java", modelProps.getProperty("project.build.sourceDirectory")); - assertPathEquals(testDir, "src/main/java", modelProps.getProperty("project.compileSourceRoots.0")); - - assertPathEquals(testDir, "src/test/java", modelProps.getProperty("project.build.testSourceDirectory")); - assertPathEquals(testDir, "src/test/java", modelProps.getProperty("project.testCompileSourceRoots.0")); - - assertPathEquals(testDir, "src/main/resources", modelProps.getProperty("project.build.resources.0.directory")); - - assertPathEquals( - testDir, "src/test/resources", modelProps.getProperty("project.build.testResources.0.directory")); - - assertPathEquals(testDir, "src/main/filters/it.properties", modelProps.getProperty("project.build.filters.0")); - - /* - * NOTE: The script source directory is deliberately excluded from the checks due to MNG-3741. - */ - - // MNG-3877 - if (matchesVersionRange("[3.0-alpha-3,)")) { - assertPathEquals(testDir, "target/site", modelProps.getProperty("project.reporting.outputDirectory")); - } - } - - private void assertPathEquals(File basedir, String expected, String actual) throws IOException { - File actualFile = new File(actual); - assertTrue("path not absolute: " + actualFile, actualFile.isAbsolute()); - assertCanonicalFileEquals(new File(basedir, expected), actualFile); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3886ExecutionGoalsOrderTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3886ExecutionGoalsOrderTest.java deleted file mode 100644 index ec568d70a..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3886ExecutionGoalsOrderTest.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Arrays; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3886. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3886ExecutionGoalsOrderTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3886ExecutionGoalsOrderTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that the goals from a plugin execution are executed in the order given by the POM when no {@code } - * is involved. - * - * @throws Exception in case of failure - */ - @Test - public void testitWithoutPluginMngt() throws Exception { - testitMNG3886("test-1"); - } - - /** - * Test that the goals from a plugin execution are executed in the order given by the POM when {@code } - * is involved. - * - * @throws Exception in case of failure - */ - @Test - public void testitWithPluginMngt() throws Exception { - testitMNG3886("test-2"); - } - - private void testitMNG3886(String project) throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3886"); - - Verifier verifier = newVerifier(new File(testDir, project).getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List lines = verifier.loadLines("target/it.log", "UTF-8"); - assertEquals(Arrays.asList(new String[] {"test", "----"}), lines); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3887PluginExecutionOrderTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3887PluginExecutionOrderTest.java deleted file mode 100644 index 5e4dca64c..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3887PluginExecutionOrderTest.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Arrays; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3887. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3887PluginExecutionOrderTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3887PluginExecutionOrderTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that multiple plugin executions bound to the same phase are executed in the order given by the POM when no - * {@code } is involved. - * - * @throws Exception in case of failure - */ - @Test - public void testitWithoutPluginMngt() throws Exception { - testitMNG3887("test-1"); - } - - /** - * Test that multiple plugin executions bound to the same phase are executed in the order given by the POM when - * {@code } is involved. - * - * @throws Exception in case of failure - */ - @Test - public void testitWithPluginMngt() throws Exception { - testitMNG3887("test-2"); - } - - private void testitMNG3887(String project) throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3887"); - - Verifier verifier = newVerifier(new File(testDir, project).getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List lines = verifier.loadLines("target/it.log", "UTF-8"); - assertEquals(Arrays.asList(new String[] {"test", "----"}), lines); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3890TransitiveDependencyScopeUpdateTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3890TransitiveDependencyScopeUpdateTest.java deleted file mode 100644 index 9ad5bb332..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3890TransitiveDependencyScopeUpdateTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3890. - * - * @author Benjamin Bentmann - * - */ -@Disabled("won't fix") -public class MavenITmng3890TransitiveDependencyScopeUpdateTest extends AbstractMavenIntegrationTestCase { - public MavenITmng3890TransitiveDependencyScopeUpdateTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that transitive dependencies whose scope has been updated from "compile" to "provided" by a consumer - * remain in "provided" scope when depending on this consumer with scope "compile". - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3890() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3890"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng3890"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List artifacts = verifier.loadLines("target/artifacts.txt", "UTF-8"); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng3890:c:jar:0.1")); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng3890:b:jar:0.1")); - assertFalse(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng3890:a:jar:0.1")); - assertEquals(2, artifacts.size()); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3892ReleaseDeploymentTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3892ReleaseDeploymentTest.java deleted file mode 100644 index f2bc3767b..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3892ReleaseDeploymentTest.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Locale; - -import org.apache.maven.shared.utils.io.FileUtils; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3892. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3892ReleaseDeploymentTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3892ReleaseDeploymentTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that a bunch of release artifacts can be deployed without the deployer erroneously complaining about - * already deployed artifacts. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3892() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3892"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("repo"); - verifier.deleteArtifacts("org.apache.maven.its.mng3892"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng3892", "test", "1.0", "pom"); - verifier.verifyArtifactPresent("org.apache.maven.its.mng3892", "test", "1.0", "jar"); - - String groupDir = "repo/org/apache/maven/its/mng3892/test/"; - verifier.verifyFilePresent(groupDir + "maven-metadata.xml"); - verifier.verifyFilePresent(groupDir + "maven-metadata.xml.md5"); - verifier.verifyFilePresent(groupDir + "maven-metadata.xml.sha1"); - verifier.verifyFilePresent(groupDir + "1.0/test-1.0.pom"); - verifier.verifyFilePresent(groupDir + "1.0/test-1.0.pom.md5"); - verifier.verifyFilePresent(groupDir + "1.0/test-1.0.pom.sha1"); - verifier.verifyFilePresent(groupDir + "1.0/test-1.0.jar"); - verifier.verifyFilePresent(groupDir + "1.0/test-1.0.jar.md5"); - verifier.verifyFilePresent(groupDir + "1.0/test-1.0.jar.sha1"); - verifier.verifyFilePresent(groupDir + "1.0/test-1.0-it.jar"); - verifier.verifyFilePresent(groupDir + "1.0/test-1.0-it.jar.md5"); - verifier.verifyFilePresent(groupDir + "1.0/test-1.0-it.jar.sha1"); - - verify(testDir, groupDir + "1.0/test-1.0.jar.md5", "dd89c30cc71c3cd8a729622243c76770"); - verify(testDir, groupDir + "1.0/test-1.0.jar.sha1", "0b0717ff89d3cbadc3564270bf8930163753bf71"); - verify(testDir, groupDir + "1.0/test-1.0-it.jar.md5", "dd89c30cc71c3cd8a729622243c76770"); - verify(testDir, groupDir + "1.0/test-1.0-it.jar.sha1", "0b0717ff89d3cbadc3564270bf8930163753bf71"); - } - - private void verify(File testDir, String file, String checksum) throws Exception { - assertEquals(file, checksum, readChecksum(new File(testDir, file))); - } - - private String readChecksum(File checksumFile) throws Exception { - String checksum = FileUtils.fileRead(checksumFile, "UTF-8").trim(); - if (checksum.indexOf(' ') >= 0) { - checksum = checksum.substring(0, checksum.indexOf(' ')); - } - return checksum.toLowerCase(Locale.ENGLISH); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3899ExtensionInheritanceTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3899ExtensionInheritanceTest.java deleted file mode 100644 index 23a421261..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3899ExtensionInheritanceTest.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3899. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3899ExtensionInheritanceTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3899ExtensionInheritanceTest() { - super("(2.0.10,2.1.0-M1),(2.1.0-M1,)"); - } - - /** - * Test that build extensions are properly merged during inheritance. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3899() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3899"); - - Verifier verifier = newVerifier(new File(testDir, "sub").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng3899"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/extension.properties"); - assertEquals("3", props.getProperty("project.build.extensions")); - assertEquals("b", props.getProperty("project.build.extensions.0.artifactId")); - assertEquals("0.1", props.getProperty("project.build.extensions.0.version")); - assertEquals("a", props.getProperty("project.build.extensions.1.artifactId")); - assertEquals("0.2", props.getProperty("project.build.extensions.1.version")); - assertEquals("c", props.getProperty("project.build.extensions.2.artifactId")); - assertEquals("0.1", props.getProperty("project.build.extensions.2.version")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3900ProfilePropertiesInterpolationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3900ProfilePropertiesInterpolationTest.java deleted file mode 100644 index f7b06eead..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3900ProfilePropertiesInterpolationTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3900. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3900ProfilePropertiesInterpolationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3900ProfilePropertiesInterpolationTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that build properties defined via active profiles are used for interpolation. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3900() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3900"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-Pinterpolation-profile"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - assertEquals("PASSED", props.getProperty("project.properties.test")); - assertEquals("PASSED", props.getProperty("project.properties.property")); - assertEquals("http://maven.apache.org/PASSED", props.getProperty("project.url")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3904NestedBuildDirInterpolationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3904NestedBuildDirInterpolationTest.java deleted file mode 100644 index 135f1ed6d..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3904NestedBuildDirInterpolationTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3904. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3904NestedBuildDirInterpolationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3904NestedBuildDirInterpolationTest() { - super("[2.1.0-M1,)"); - } - - /** - * Test that properties which refer to build directories which in turn refer to other build directories are - * properly interpolated. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3904() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3904"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - assertCanonicalFileEquals( - new File(testDir, "target/classes/dir0"), new File(props.getProperty("project.properties.dir0"))); - assertCanonicalFileEquals( - new File(testDir, "src/test/dir1"), new File(props.getProperty("project.properties.dir1"))); - assertCanonicalFileEquals( - new File(testDir, "target/site/dir2"), new File(props.getProperty("project.properties.dir2"))); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3906MergedPluginClassPathOrderingTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3906MergedPluginClassPathOrderingTest.java deleted file mode 100644 index 5ce9b4438..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3906MergedPluginClassPathOrderingTest.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3906. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3906MergedPluginClassPathOrderingTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3906MergedPluginClassPathOrderingTest() { - super("(2.0.10,2.1.0-M1),(2.1.0-M1,)"); - } - - /** - * Test that project-level plugin dependencies are properly merged during inheritance. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3906() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3906"); - - Verifier verifier = newVerifier(new File(testDir, "sub").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng3906"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties pclProps = verifier.loadProperties("target/pcl.properties"); - - String className = "org.apache.maven.its.mng3906.SomeClass"; - String resName = className.replace('.', '/') + ".class"; - - assertEquals("5", pclProps.getProperty(resName + ".count")); - - assertTrue( - pclProps.getProperty(resName + ".0"), - pclProps.getProperty(resName + ".0").endsWith("/c-0.1.jar!/" + resName)); - assertTrue( - pclProps.getProperty(resName + ".1"), - pclProps.getProperty(resName + ".1").endsWith("/a-0.2.jar!/" + resName)); - assertTrue( - pclProps.getProperty(resName + ".2"), - pclProps.getProperty(resName + ".2").endsWith("/b-0.1.jar!/" + resName)); - assertTrue( - pclProps.getProperty(resName + ".3"), - pclProps.getProperty(resName + ".3").endsWith("/e-0.1.jar!/" + resName)); - assertTrue( - pclProps.getProperty(resName + ".4"), - pclProps.getProperty(resName + ".4").endsWith("/d-0.1.jar!/" + resName)); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3916PluginExecutionInheritanceTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3916PluginExecutionInheritanceTest.java deleted file mode 100644 index 99f0d9013..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3916PluginExecutionInheritanceTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3916. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3916PluginExecutionInheritanceTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3916PluginExecutionInheritanceTest() { - super("(2.0.4,)"); - } - - /** - * Test that plugin executions are properly merged during inheritance, even if the child plugin section has no - * version. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3916() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3916"); - - Verifier verifier = newVerifier(new File(testDir, "sub").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List executions = verifier.loadLines("target/exec.log", "UTF-8"); - // NOTE: Ordering of executions is another issue (MNG-3887), so ignore/normalize order - Collections.sort(executions); - List expected = Arrays.asList(new String[] {"child-1", "child-default", "parent-1"}); - assertEquals(expected, executions); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3924XmlMarkupInterpolationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3924XmlMarkupInterpolationTest.java deleted file mode 100644 index d3194efde..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3924XmlMarkupInterpolationTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3924 and - * MNG-3662 - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3924XmlMarkupInterpolationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3924XmlMarkupInterpolationTest() { - super("[2.1.0-M1,)"); - } - - /** - * Test that interpolation of properties that resolve to XML markup doesn't crash the project builder. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3924() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3924"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/xml.properties"); - assertEquals("Tom&Jerry", props.getProperty("project.properties.xmlMarkup")); - assertEquals("Tom&Jerry", props.getProperty("project.properties.xmlTest")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3925MergedPluginExecutionOrderTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3925MergedPluginExecutionOrderTest.java deleted file mode 100644 index 67321063f..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3925MergedPluginExecutionOrderTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Arrays; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3925. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3925MergedPluginExecutionOrderTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3925MergedPluginExecutionOrderTest() { - super("[2.0.5,)"); - } - - /** - * Test that multiple plugin executions bound to the same phase by child and parent are executed in the proper - * order when no {@code } is involved. - * - * @throws Exception in case of failure - */ - @Test - public void testitWithoutPluginMngt() throws Exception { - testitMNG3925("test-1"); - } - - /** - * Test that multiple plugin executions bound to the same phase by child and parent are executed in the proper - * order when {@code } is involved. - * - * @throws Exception in case of failure - */ - @Test - public void testitWithPluginMngt() throws Exception { - testitMNG3925("test-2"); - } - - private void testitMNG3925(String project) throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3925"); - - Verifier verifier = newVerifier(new File(new File(testDir, project), "sub").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List lines = verifier.loadLines("target/exec.log", "UTF-8"); - // Order is parent first and child appended, unless child overrides parent execution via equal id - List expected = - Arrays.asList(new String[] {"parent-1", "parent-2", "child-default", "child-1", "child-2"}); - assertEquals(expected, lines); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3927PluginDefaultExecutionConfigTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3927PluginDefaultExecutionConfigTest.java deleted file mode 100644 index 22c80a4ff..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3927PluginDefaultExecutionConfigTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3927. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3927PluginDefaultExecutionConfigTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3927PluginDefaultExecutionConfigTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that the configuration for a plugin execution without an identifier does not pollute the configuration - * of default plugin executions introduced by the packaging. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3927() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3927"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("process-resources"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFileNotPresent("target/failed.txt"); - verifier.verifyFilePresent("target/resources-resources.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3937MergedPluginExecutionGoalsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3937MergedPluginExecutionGoalsTest.java deleted file mode 100644 index 80db3543b..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3937MergedPluginExecutionGoalsTest.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Arrays; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3937. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3937MergedPluginExecutionGoalsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3937MergedPluginExecutionGoalsTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that during inheritance/merging of a plugin execution the goals specified by child and parent are properly - * ordered when no {@code } is involved. - * - * @throws Exception in case of failure - */ - @Test - public void testitWithoutPluginMngt() throws Exception { - testitMNG3937("test-1"); - } - - /** - * Test that during inheritance/merging of a plugin execution the goals specified by child and parent are properly - * ordered when {@code } is involved. - * - * @throws Exception in case of failure - */ - @Test - public void testitWithPluginMngt() throws Exception { - testitMNG3937("test-2"); - } - - private void testitMNG3937(String project) throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3937"); - - Verifier verifier = newVerifier(new File(new File(testDir, project), "sub").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List lines = verifier.loadLines("target/exec.log", "UTF-8"); - // Order is child first and parent appended but without duplicate goals - List expected = Arrays.asList(new String[] {"child", "----"}); - assertEquals(expected, lines); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3938MergePluginExecutionsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3938MergePluginExecutionsTest.java deleted file mode 100644 index b81b3e363..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3938MergePluginExecutionsTest.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Arrays; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3938. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3938MergePluginExecutionsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3938MergePluginExecutionsTest() { - super("(2.0.4,)"); - } - - /** - * Test that plugin executions with the same id are merged during inheritance, especially executions using the - * default id, regardless whether the id is given explicitly by the user or implicitly assumed from defaults, when - * no {@code } is involved. - * - * @throws Exception in case of failure - */ - @Test - public void testitWithoutPluginMngt() throws Exception { - testitMNG3938("test-1"); - } - - /** - * Test that plugin executions with the same id are merged during inheritance, especially executions using the - * default id, regardless whether the id is given explicitly by the user or implicitly assumed from defaults, when - * {@code } is involved. - * - * @throws Exception in case of failure - */ - @Test - public void testitWithPluginMngt() throws Exception { - testitMNG3938("test-2"); - } - - private void testitMNG3938(String project) throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3938/" + project); - - Verifier verifier = newVerifier(new File(testDir, "sub").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List lines = verifier.loadLines("target/default.log", "UTF-8"); - assertEquals(Arrays.asList(new String[] {"child"}), lines); - - lines = verifier.loadLines("target/non-default.log", "UTF-8"); - assertEquals(Arrays.asList(new String[] {"child"}), lines); - - verifier.verifyFileNotPresent("target/parent.log"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3940EnvVarInterpolationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3940EnvVarInterpolationTest.java deleted file mode 100644 index f96704f78..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3940EnvVarInterpolationTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.utils.Os; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3940. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3940EnvVarInterpolationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3940EnvVarInterpolationTest() { - super("(2.0.10,2.1.0-M1),(2.1.0-M1,)"); - } - - /** - * Test that interpolation of environment variables respects the casing rules of the underlying OS (especially - * Windows). - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3940() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3940"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - /* - * NOTE: The POM is using MAVEN_MNG_3940 to reference the var (just as one would refer to PATH). On Windows, - * this must resolve case-insensitively so we use different character casing for the variable here. - */ - if (Os.isFamily(Os.FAMILY_WINDOWS)) { - verifier.setEnvironmentVariable("Maven_mng_3940", "PASSED"); - } else { - verifier.setEnvironmentVariable("MAVEN_MNG_3940", "PASSED"); - } - - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/PASSED.properties"); - Properties props = verifier.loadProperties("target/PASSED.properties"); - assertEquals("PASSED", props.getProperty("project.properties.envTest")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3941ExecutionProjectRestrictedToForkingMojoTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3941ExecutionProjectRestrictedToForkingMojoTest.java deleted file mode 100644 index 1930d8b6f..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3941ExecutionProjectRestrictedToForkingMojoTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3941. - * - * @author Benjamin Bentmann - */ -public class MavenITmng3941ExecutionProjectRestrictedToForkingMojoTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3941ExecutionProjectRestrictedToForkingMojoTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Test that the execution project from a forked lifecycle does not leak into mojos that run after the mojo - * that forked the lifecycle. While this is rather irrelevant for Maven's core itself, this enforces proper - * mojo programming, i.e. a mojo should not access the execution project unless it forked the lifecycle. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3941"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("initialize"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/fork.properties"); - assertEquals("test-0.1", props.getProperty("executedProject.build.finalName")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3943PluginExecutionInheritanceTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3943PluginExecutionInheritanceTest.java deleted file mode 100644 index 00a761d08..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3943PluginExecutionInheritanceTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3943. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3943PluginExecutionInheritanceTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3943PluginExecutionInheritanceTest() { - super("(2.0.4,)"); - } - - /** - * Test that plugin executions are properly merged during inheritance, even if the child uses a different - * plugin version than the parent. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3943() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3943"); - - Verifier verifier = newVerifier(new File(testDir, "sub").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List executions = verifier.loadLines("target/exec.log", "UTF-8"); - // NOTE: Ordering of executions is another issue (MNG-3887), so ignore/normalize order - Collections.sort(executions); - List expected = Arrays.asList(new String[] {"child-1", "child-default", "parent-1"}); - assertEquals(expected, executions); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3944BasedirInterpolationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3944BasedirInterpolationTest.java deleted file mode 100644 index e8ce918c4..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3944BasedirInterpolationTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3944. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3944BasedirInterpolationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3944BasedirInterpolationTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that interpolation of ${basedir} works for a POM that is not named "pom.xml" - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3944() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3944"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-f"); - verifier.addCliArgument("pom-with-unusual-name.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/basedir.properties"); - Properties props = verifier.loadProperties("target/basedir.properties"); - assertCanonicalFileEquals(testDir, new File(props.getProperty("project.properties.prop0"))); - assertCanonicalFileEquals(testDir, new File(props.getProperty("project.properties.prop1"))); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3947PluginDefaultExecutionConfigTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3947PluginDefaultExecutionConfigTest.java deleted file mode 100644 index 4e2ba32fd..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3947PluginDefaultExecutionConfigTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3947. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3947PluginDefaultExecutionConfigTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3947PluginDefaultExecutionConfigTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that the configuration for a plugin execution with the identifier "default" does not pollute the - * configuration of standalone plugin executions from the CLI. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3947() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3947"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("org.apache.maven.plugins:maven-resources-plugin:resources"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFileNotPresent("target/failed.txt"); - verifier.verifyFilePresent("target/resources-resources.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3948ParentResolutionFromProfileReposTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3948ParentResolutionFromProfileReposTest.java deleted file mode 100644 index e8c6bec71..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3948ParentResolutionFromProfileReposTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3948. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3948ParentResolutionFromProfileReposTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3948ParentResolutionFromProfileReposTest() { - super("(2.0.10,2.1.0-M1),(2.1.0-M1,)"); - } - - /** - * Test that parent POMs can be resolved from remote repositories defined by (active) profiles in the POM. - * - * @throws Exception in case of failure - */ - @Test - public void testitFromPom() throws Exception { - requiresMavenVersion("[2.0,3.0-alpha-1),[3.0-beta-1,)"); - - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3948/test-2"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng3948"); - verifier.filterFile("pom.xml", "pom.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng3948", "parent", "0.2", "pom"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3951AbsolutePathsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3951AbsolutePathsTest.java deleted file mode 100644 index 058dd59c4..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3951AbsolutePathsTest.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3951. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3951AbsolutePathsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3951AbsolutePathsTest() { - super("(2.0.10,2.1.0-M1),(2.1.0-M1,)"); - } - - /** - * Test that the paths retrieved from the core are always absolute, in particular the drive-relative paths on - * Windows must be properly resolved. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3951() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3951"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - - /* - * Cut off anything before the first file separator from the local repo path. This is harmless on a Unix-like - * filesystem but will make the path drive-relative on Windows so we can check how Maven handles it. - */ - String repoDir = new File(verifier.getLocalRepository()).getAbsolutePath(); - if (getRoot(new File(repoDir)).equals(getRoot(testDir))) { - // NOTE: We can only test the local repo if it resides on the same drive as the test - verifier.setLocalRepo(repoDir.substring(repoDir.indexOf(File.separator))); - } - - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/path.properties"); - Properties props = verifier.loadProperties("target/path.properties"); - - assertCanonicalFileEquals( - new File(testDir, "tmp").getAbsoluteFile(), new File(props.getProperty("fileParams.0"))); - assertCanonicalFileEquals( - new File(getRoot(testDir), "tmp").getAbsoluteFile(), new File(props.getProperty("fileParams.1"))); - assertCanonicalFileEquals(new File(repoDir), new File(props.getProperty("stringParams.0"))); - } - - private static File getRoot(File path) { - File root = path; - for (File dir = path; dir != null; dir = dir.getParentFile()) { - root = dir; - } - return root; - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3953AuthenticatedDeploymentTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3953AuthenticatedDeploymentTest.java deleted file mode 100644 index bb53d856c..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3953AuthenticatedDeploymentTest.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.security.ConstraintMapping; -import org.eclipse.jetty.security.ConstraintSecurityHandler; -import org.eclipse.jetty.security.HashLoginService; -import org.eclipse.jetty.security.UserStore; -import org.eclipse.jetty.server.Handler; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.AbstractHandler; -import org.eclipse.jetty.server.handler.HandlerList; -import org.eclipse.jetty.util.security.Constraint; -import org.eclipse.jetty.util.security.Password; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.eclipse.jetty.util.security.Constraint.__BASIC_AUTH; - -/** - * This is a test set for MNG-3953. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3953AuthenticatedDeploymentTest extends AbstractMavenIntegrationTestCase { - private Server server; - - private int port; - - private volatile boolean deployed; - - public MavenITmng3953AuthenticatedDeploymentTest() { - super("(2.0.1,)"); - } - - @BeforeEach - protected void setUp() throws Exception { - Handler repoHandler = new AbstractHandler() { - @Override - public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { - System.out.println("Handling " + request.getMethod() + " " + request.getRequestURL()); - - if ("PUT".equalsIgnoreCase(request.getMethod())) { - response.setStatus(HttpServletResponse.SC_OK); - deployed = true; - } else { - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - } - - ((Request) request).setHandled(true); - } - }; - - Constraint constraint = new Constraint(); - constraint.setName(Constraint.__BASIC_AUTH); - constraint.setRoles(new String[] {"deployer"}); - constraint.setAuthenticate(true); - - ConstraintMapping constraintMapping = new ConstraintMapping(); - constraintMapping.setConstraint(constraint); - constraintMapping.setPathSpec("/*"); - - HashLoginService userRealm = new HashLoginService("TestRealm"); - UserStore userStore = new UserStore(); - userStore.addUser("testuser", new Password("testtest"), new String[] {"deployer"}); - userRealm.setUserStore(userStore); - - server = new Server(0); - ConstraintSecurityHandler securityHandler = new ConstraintSecurityHandler(); - securityHandler.setLoginService(userRealm); - securityHandler.setAuthMethod(__BASIC_AUTH); - securityHandler.setConstraintMappings(new ConstraintMapping[] {constraintMapping}); - - HandlerList handlerList = new HandlerList(); - handlerList.addHandler(securityHandler); - handlerList.addHandler(repoHandler); - - server.setHandler(handlerList); - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + port); - deployed = false; - } - - @AfterEach - protected void tearDown() throws Exception { - if (server != null) { - server.stop(); - server.join(); - } - } - - /** - * Test that deployment (of a release) to a repository that requires authentification works. - * - * @throws Exception in case of failure - */ - @Test - public void testitRelease() throws Exception { - testitMNG3953("release"); - } - - /** - * Test that deployment (of a snapshot) to a repository that requires authentification works. - * - * @throws Exception in case of failure - */ - @Test - public void testitSnapshot() throws Exception { - testitMNG3953("snapshot"); - } - - private void testitMNG3953(String project) throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3953/" + project); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("-DdeploymentPort=" + port); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - assertTrue(deployed); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3955EffectiveSettingsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3955EffectiveSettingsTest.java deleted file mode 100644 index 79b6f2a29..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3955EffectiveSettingsTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3955. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3955EffectiveSettingsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3955EffectiveSettingsTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that plugin parameter expressions referring to the settings reflect the actual core state, especially - * if settings have been overridden by CLI parameters. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3955() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3955"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("--offline"); - verifier.addCliArgument("--batch-mode"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/settings.properties"); - assertEquals("true", props.getProperty("settings.offline")); - assertEquals("false", props.getProperty("settings.interactiveMode")); - assertEquals( - new File(verifier.getLocalRepository()).getAbsoluteFile(), - new File(props.getProperty("settings.localRepository")).getAbsoluteFile()); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3970DepResolutionFromProfileReposTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3970DepResolutionFromProfileReposTest.java deleted file mode 100644 index 491fa5901..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3970DepResolutionFromProfileReposTest.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3970. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3970DepResolutionFromProfileReposTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3970DepResolutionFromProfileReposTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that dependencies can be resolved from remote repositories defined by (active) profiles in the POM. - * - * @throws Exception in case of failure - */ - @Test - public void testitFromPom() throws Exception { - requiresMavenVersion("[2.0,3.0-alpha-1),[3.0-beta-1,)"); - - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3970/test-2"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng3970"); - verifier.filterFile("pom.xml", "pom.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng3970", "a", "0.1", "jar"); - } - - /** - * Test that dependencies can be resolved from remote repositories defined by (active) profiles in settings.xml. - * - * @throws Exception in case of failure - */ - @Test - public void testitFromSettings() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3970/test-3"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng3970"); - verifier.filterFile("settings.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng3970", "a", "0.1", "jar"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3974MirrorOrderingTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3974MirrorOrderingTest.java deleted file mode 100644 index f2d0a23bc..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3974MirrorOrderingTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3974. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3974MirrorOrderingTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3974MirrorOrderingTest() { - super("(2.0.9,2.1.0-M1),(2.1.0-M1,3.0-alpha-1),(3.0-alpha-1,)"); - } - - /** - * Test that mirror definitions are properly evaluated. In particular, the first matching mirror definition - * from the settings should win, i.e. ordering of mirror definitions matters. - * - * @throws Exception in case of failure - */ - @Test - public void testitFirstMatchWins() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3974"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng3974"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng3974", "a", "0.1", "jar"); - verifier.verifyArtifactPresent("org.apache.maven.its.mng3974", "b", "0.1", "jar"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3979ElementJoinTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3979ElementJoinTest.java deleted file mode 100644 index e95281139..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3979ElementJoinTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3979. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3979ElementJoinTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3979ElementJoinTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that during inheritance the merging/joining of subtrees with equal identifier doesn't crash if the parent - * POM has a non-empty element and the child POM has an empty element to join. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3979() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3979"); - - testDir = new File(testDir, "sub"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3983PluginResolutionFromProfileReposTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3983PluginResolutionFromProfileReposTest.java deleted file mode 100644 index 8410fcdcb..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3983PluginResolutionFromProfileReposTest.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3983. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3983PluginResolutionFromProfileReposTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3983PluginResolutionFromProfileReposTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that plugins can be resolved from remote plugin repositories defined by (active) profiles in the POM. - * - * @throws Exception in case of failure - */ - @Test - public void testitFromPom() throws Exception { - requiresMavenVersion("[2.0,3.0-alpha-1),[3.0-alpha-3,)"); - - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3983/test-1"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setForkJvm(true); // Don't lock up plugin files in class loader within current JVM - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng3983"); - verifier.filterFile("pom.xml", "pom.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng3983", "p", "0.1", "jar"); - } - - /** - * Test that plugins can be resolved from remote plugin repositories defined by (active) profiles in settings.xml. - * - * @throws Exception in case of failure - */ - @Test - public void testitFromSettings() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3983/test-3"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setForkJvm(true); // Don't lock up plugin files in class loader within current JVM - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng3983"); - verifier.filterFile("settings.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng3983", "p", "0.1", "jar"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3991ValidDependencyScopeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3991ValidDependencyScopeTest.java deleted file mode 100644 index 874408471..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3991ValidDependencyScopeTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3991. - * - * @author Benjamin Bentmann - */ -public class MavenITmng3991ValidDependencyScopeTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3991ValidDependencyScopeTest() { - // TODO: One day, we should be able to error out but this requires to consider extensions and their use cases - super("[4.0,)"); - } - - /** - * Test that invalid dependency scopes cause a validation error during building. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3991"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Invalid dependency scope did not cause validation error"); - } catch (VerificationException e) { - // expected - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3998PluginExecutionConfigTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3998PluginExecutionConfigTest.java deleted file mode 100644 index 7cec97435..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3998PluginExecutionConfigTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3998. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng3998PluginExecutionConfigTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng3998PluginExecutionConfigTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that multiple plugin executions do not lose their configuration when plugin management is used. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG3998() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3998"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List executions = verifier.loadLines("target/exec.log", "UTF-8"); - // NOTE: Ordering of executions is another issue (MNG-3887), so ignore/normalize order - Collections.sort(executions); - List expected = Arrays.asList(new String[] {"exec-1", "exec-2"}); - assertEquals(expected, executions); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4000MultiPluginExecutionsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4000MultiPluginExecutionsTest.java deleted file mode 100644 index 9c742df4b..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4000MultiPluginExecutionsTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Arrays; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4000. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng4000MultiPluginExecutionsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4000MultiPluginExecutionsTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that plugin executions without id are not lost among other plugin executions when no {@code } - * is present. - * - * @throws Exception in case of failure - */ - @Test - public void testitWithoutPluginMngt() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4000/test-1"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List executions = verifier.loadLines("target/exec.log", "UTF-8"); - List expected = Arrays.asList(new String[] {"exec", "exec"}); - assertEquals(expected, executions); - } - - /** - * Test that plugin executions without id are not lost among other plugin executions when {@code } - * is present. - * - * @throws Exception in case of failure - */ - @Test - public void testitWithPluginMngt() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4000/test-2"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List executions = verifier.loadLines("target/exec.log", "UTF-8"); - List expected = Arrays.asList(new String[] {"exec", "exec"}); - assertEquals(expected, executions); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4005UniqueDependencyKeyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4005UniqueDependencyKeyTest.java deleted file mode 100644 index ebff7e8f8..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4005UniqueDependencyKeyTest.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4005. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4005UniqueDependencyKeyTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4005UniqueDependencyKeyTest() { - super("[3.0-beta-1,)"); - } - - /** - * Test that duplicate dependencies cause a validation error during building. - * - * @throws Exception in case of failure - */ - @Test - public void testitDependency() throws Exception { - test("dep"); - } - - /** - * Test that duplicate managed dependencies cause a validation error during building. - * - * @throws Exception in case of failure - */ - @Test - public void testitManagedDependency() throws Exception { - test("man-dep"); - } - - /** - * Test that duplicate dependencies in profiles cause a validation error during building. - * - * @throws Exception in case of failure - */ - @Test - public void testitProfileDependency() throws Exception { - test("profile-dep"); - } - - /** - * Test that duplicate managed dependencies in profiles cause a validation error during building. - * - * @throws Exception in case of failure - */ - @Test - public void testitProfileManagedDependency() throws Exception { - test("profile-man-dep"); - } - - private void test(String project) throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4005/" + project); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - } catch (VerificationException e) { - // expected with Maven 4+ - } - - String logLevel; - if (matchesVersionRange("(,4.0.0-alpha-1)")) { - logLevel = "WARNING"; - } else { - logLevel = "ERROR"; - } - - List lines = verifier.loadLines(verifier.getLogFileName(), "UTF-8"); - boolean foundMessage = false; - for (String line : lines) { - if (line.startsWith("[" + logLevel + "]") && line.indexOf("must be unique: junit:junit:jar") > 0) { - foundMessage = true; - } - } - - assertTrue("Duplicate dependency message wasn't generated.", foundMessage); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4007PlatformFileSeparatorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4007PlatformFileSeparatorTest.java deleted file mode 100644 index b4347761d..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4007PlatformFileSeparatorTest.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4007. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng4007PlatformFileSeparatorTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4007PlatformFileSeparatorTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that paths to project directories use the platform-specific file separator. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG4007() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4007"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties modelProps = verifier.loadProperties("target/model.properties"); - - assertPath(modelProps.getProperty("project.build.directory")); - - assertPath(modelProps.getProperty("project.build.outputDirectory")); - - assertPath(modelProps.getProperty("project.build.testOutputDirectory")); - - assertPath(modelProps.getProperty("project.build.sourceDirectory")); - assertPath(modelProps.getProperty("project.compileSourceRoots.0")); - - assertPath(modelProps.getProperty("project.build.testSourceDirectory")); - assertPath(modelProps.getProperty("project.testCompileSourceRoots.0")); - - assertPath(modelProps.getProperty("project.build.resources.0.directory")); - - assertPath(modelProps.getProperty("project.build.testResources.0.directory")); - - assertPath(modelProps.getProperty("project.build.filters.0")); - - /* - * NOTE: The script source directory is deliberately excluded from the checks due to MNG-3741. - */ - - // MNG-3877 - if (matchesVersionRange("[3.0-alpha-3,)")) { - assertPath(modelProps.getProperty("project.reporting.outputDirectory")); - } - } - - private void assertPath(String actual) { - /* - * NOTE: Whether the path is absolute is another issue (MNG-3877), we are only interested in the proper - * file separator here. - */ - assertEquals(new File(actual).getPath(), actual); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4008MergedFilterOrderTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4008MergedFilterOrderTest.java deleted file mode 100644 index 74d371bbc..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4008MergedFilterOrderTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4008. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng4008MergedFilterOrderTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4008MergedFilterOrderTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that filter definitions are properly merged. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG4008() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4008"); - - Verifier verifier = newVerifier(new File(testDir, "sub").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties modelProps = verifier.loadProperties("target/model.properties"); - - assertEquals("7", modelProps.getProperty("project.build.filters")); - - assertTrue(modelProps.getProperty("project.build.filters.0").endsWith("child-a.properties")); - assertTrue(modelProps.getProperty("project.build.filters.1").endsWith("child-c.properties")); - assertTrue(modelProps.getProperty("project.build.filters.2").endsWith("child-b.properties")); - assertTrue(modelProps.getProperty("project.build.filters.3").endsWith("child-d.properties")); - assertTrue(modelProps.getProperty("project.build.filters.4").endsWith("parent-c.properties")); - assertTrue(modelProps.getProperty("project.build.filters.5").endsWith("parent-b.properties")); - assertTrue(modelProps.getProperty("project.build.filters.6").endsWith("parent-d.properties")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4009InheritProfileEffectsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4009InheritProfileEffectsTest.java deleted file mode 100644 index d2e48e4da..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4009InheritProfileEffectsTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4009. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng4009InheritProfileEffectsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4009InheritProfileEffectsTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that the effects of profiles on a parent are inherited by children. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG4009() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4009"); - - Verifier verifier = newVerifier(new File(testDir, "sub").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-Pparent-profile"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/profile.properties"); - - assertEquals("PASSED", props.getProperty("project.properties.parentProfileProperty")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4016PrefixedPropertyInterpolationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4016PrefixedPropertyInterpolationTest.java deleted file mode 100644 index 108427c54..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4016PrefixedPropertyInterpolationTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4016. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng4016PrefixedPropertyInterpolationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4016PrefixedPropertyInterpolationTest() { - super("(2.1.0-M1,)"); - } - - /** - * Test that expressions with the special prefixes "project.", "pom." and "env." can be interpolated from - * properties that include the prefix. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG4016() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4016"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/model.properties"); - Properties props = verifier.loadProperties("target/model.properties"); - assertEquals("PASSED-1", props.getProperty("project.properties.projectProperty")); - assertEquals("PASSED-2", props.getProperty("project.properties.pomProperty")); - assertEquals("PASSED-3", props.getProperty("project.properties.envProperty")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4022IdempotentPluginConfigMergingTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4022IdempotentPluginConfigMergingTest.java deleted file mode 100644 index 6d80de8c6..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4022IdempotentPluginConfigMergingTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4022. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4022IdempotentPluginConfigMergingTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4022IdempotentPluginConfigMergingTest() { - super("[3.0-beta-1,)"); - } - - /** - * Test that merging of equal plugin configuration is idempotent. This is especially interesting for lists with - * empty elements. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4022"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-Pmng4022a,mng4022b"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/config.properties"); - assertEquals("5", props.getProperty("stringParams")); - assertEquals("", props.getProperty("stringParams.0", "")); - assertEquals("one", props.getProperty("stringParams.1", "")); - assertEquals("", props.getProperty("stringParams.2", "")); - assertEquals("two", props.getProperty("stringParams.3", "")); - assertEquals("", props.getProperty("stringParams.4", "")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4023ParentProfileOneTimeInjectionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4023ParentProfileOneTimeInjectionTest.java deleted file mode 100644 index 70bd23f82..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4023ParentProfileOneTimeInjectionTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4023. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng4023ParentProfileOneTimeInjectionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4023ParentProfileOneTimeInjectionTest() { - super("[2.0.11,2.1.0-M1),[2.1.0-M2,)"); - } - - /** - * Verify that profiles in a parent are only injected once during a reactor build that include the parent - * itself. The parent being part of the reactor makes it subject to project caching and proper use of the - * cache is crucial here. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG4023() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4023"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("sub/target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("sub/target/config.properties"); - assertEquals("1", props.getProperty("stringParams")); - assertEquals("test", props.getProperty("stringParams.0")); - assertNull(props.getProperty("stringParams.1")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4026ReactorDependenciesOrderTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4026ReactorDependenciesOrderTest.java deleted file mode 100644 index 55c9edcef..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4026ReactorDependenciesOrderTest.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4026. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng4026ReactorDependenciesOrderTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4026ReactorDependenciesOrderTest() { - // This feature depends on MNG-1412 - super("(2.0.8,)"); - } - - /** - * Verify that the project class path is properly ordered during a reactor build, i.e. when dependencies are - * resolved as active project artifacts from the reactor. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG4026() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4026"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("consumer/target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List classpath1 = verifier.loadLines("consumer/target/classpath-1.txt", "UTF-8"); - assertEquals(5, classpath1.size()); - assertEquals("consumer/classes", classpath1.get(0)); - assertEquals("dep-1/pom.xml", classpath1.get(1)); - assertEquals("dep-3/pom.xml", classpath1.get(2)); - assertEquals("dep-2/pom.xml", classpath1.get(3)); - assertEquals("dep-4/pom.xml", classpath1.get(4)); - - List classpath2 = verifier.loadLines("consumer/target/classpath-2.txt", "UTF-8"); - assertEquals(classpath1, classpath2); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4034ManagedProfileDependencyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4034ManagedProfileDependencyTest.java deleted file mode 100644 index e83adbc1a..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4034ManagedProfileDependencyTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4034. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng4034ManagedProfileDependencyTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4034ManagedProfileDependencyTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that dependencies defined in profiles get their version injected from the dependency management of the - * parent. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG4034() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4034"); - - Verifier verifier = newVerifier(new File(testDir, "sub").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List artifacts = verifier.loadLines("target/compile.txt", "UTF-8"); - assertEquals(Arrays.asList(new String[0]), artifacts); - - artifacts = verifier.loadLines("target/runtime.txt", "UTF-8"); - assertEquals(Collections.singletonList("org.apache.maven.its:maven-core-it-support:jar:1.3"), artifacts); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4036ParentResolutionFromSettingsRepoTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4036ParentResolutionFromSettingsRepoTest.java deleted file mode 100644 index 89071fbf3..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4036ParentResolutionFromSettingsRepoTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4036. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4036ParentResolutionFromSettingsRepoTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4036ParentResolutionFromSettingsRepoTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that a parent POM is downloaded from a default-style remote repo defined in the settings. - * - * @throws Exception in case of failure - */ - @Test - public void testitDefaultLayout() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4036/default"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.filterFile("settings.xml", "settings.xml", "UTF-8"); - verifier.deleteArtifacts("org.apache.maven.its.mng4036"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng4036", "parent", "0.2", "pom"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4040ProfileInjectedModulesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4040ProfileInjectedModulesTest.java deleted file mode 100644 index 61452e89c..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4040ProfileInjectedModulesTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4040. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4040ProfileInjectedModulesTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4040ProfileInjectedModulesTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that modules inside profiles are not accidentally inherited by the children. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4040"); - - Verifier verifier = newVerifier(new File(testDir, "sub").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4048VersionRangeReactorResolutionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4048VersionRangeReactorResolutionTest.java deleted file mode 100644 index ba4a0932a..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4048VersionRangeReactorResolutionTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4048. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4048VersionRangeReactorResolutionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4048VersionRangeReactorResolutionTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Verify that dependencies using version ranges can be resolved from the reactor. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4048"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("sub-2/target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4048"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List artifacts = verifier.loadLines("sub-2/target/compile.txt", "UTF-8"); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng4048:sub-1:jar:1.1-SNAPSHOT")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4052ReactorAwareImportScopeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4052ReactorAwareImportScopeTest.java deleted file mode 100644 index 69fa365d2..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4052ReactorAwareImportScopeTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4052. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4052ReactorAwareImportScopeTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4052ReactorAwareImportScopeTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Test that the project builder properly detects and handles inter-model dependencies within a reactor - * like a POM that imports another POM. To clarify, this is not about the kind of dependency where one - * project needs another project's output for compilation/testing but about the case where one project's - * effective model requires another project's model for its construction. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4052"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4053PluginConfigAttributesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4053PluginConfigAttributesTest.java deleted file mode 100644 index 885c084d9..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4053PluginConfigAttributesTest.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4053. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4053PluginConfigAttributesTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4053PluginConfigAttributesTest() { - super("[2.0.3,)"); - } - - /** - * Verify that attributes in plugin configuration elements are not erroneously duplicated to other elements when - * no plugin management is used. - * - * @throws Exception in case of failure - */ - @Test - public void testitWithoutPluginMngt() throws Exception { - testit("test-1"); - } - - /** - * Verify that attributes in plugin configuration elements are not erroneously duplicated to other elements when - * plugin management is used. - * - * @throws Exception in case of failure - */ - @Test - public void testitWithPluginMngt() throws Exception { - testit("test-2"); - } - - /** - * Verify that attributes in plugin configuration elements are not erroneously duplicated to other elements when - * plugin management and a profile are used. - * - * @throws Exception in case of failure - */ - @Test - public void testitWithPluginMngtAndProfile() throws Exception { - testit("test-3"); - } - - private void testit(String test) throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4053/" + test); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/config.properties"); - - assertEquals("src", props.getProperty("domParam.children.copy.0.attributes.todir")); - assertEquals("true", props.getProperty("domParam.children.copy.0.attributes.overwrite")); - assertEquals("2", props.getProperty("domParam.children.copy.0.attributes")); - - assertEquals("target", props.getProperty("domParam.children.copy.0.children.fileset.0.attributes.dir")); - assertNull(props.getProperty("domParam.children.copy.0.children.fileset.0.attributes.todir")); - assertNull(props.getProperty("domParam.children.copy.0.children.fileset.0.attributes.overwrite")); - assertEquals("1", props.getProperty("domParam.children.copy.0.children.fileset.0.attributes")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4056ClassifierBasedDepResolutionFromReactorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4056ClassifierBasedDepResolutionFromReactorTest.java deleted file mode 100644 index 5ffa82b31..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4056ClassifierBasedDepResolutionFromReactorTest.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4056. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4056ClassifierBasedDepResolutionFromReactorTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4056ClassifierBasedDepResolutionFromReactorTest() { - super("[2.1.0,)"); - } - - /** - * Test that attached artifacts can be resolved from the reactor cache even if the dependency declaration - * in the consumer module does not use the proper artifact type but merely specifies the classifier. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4056"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("consumer/target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4056"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List artifacts = verifier.loadLines("consumer/target/artifacts.txt", "UTF-8"); - if (matchesVersionRange("[3.0-alpha-3,)")) { - // artifact type unchanged to match type as declared in dependency - - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng4056:producer:jar:tests:0.1")); - assertTrue( - artifacts.toString(), artifacts.contains("org.apache.maven.its.mng4056:producer:jar:sources:0.1")); - assertTrue( - artifacts.toString(), artifacts.contains("org.apache.maven.its.mng4056:producer:jar:javadoc:0.1")); - assertTrue( - artifacts.toString(), artifacts.contains("org.apache.maven.its.mng4056:producer:jar:client:0.1")); - } else { - // artifact type updated to match type of active artifact - - assertTrue( - artifacts.toString(), - artifacts.contains("org.apache.maven.its.mng4056:producer:test-jar:tests:0.1")); - assertTrue( - artifacts.toString(), - artifacts.contains("org.apache.maven.its.mng4056:producer:java-source:sources:0.1")); - assertTrue( - artifacts.toString(), - artifacts.contains("org.apache.maven.its.mng4056:producer:javadoc:javadoc:0.1")); - assertTrue( - artifacts.toString(), - artifacts.contains("org.apache.maven.its.mng4056:producer:ejb-client:client:0.1")); - } - - List classpath = verifier.loadLines("consumer/target/compile.txt", "UTF-8"); - assertTrue(classpath.toString(), classpath.contains("producer/test.jar")); - assertTrue(classpath.toString(), classpath.contains("producer/client.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4068AuthenticatedMirrorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4068AuthenticatedMirrorTest.java deleted file mode 100644 index 4811de54f..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4068AuthenticatedMirrorTest.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.HashMap; -import java.util.Map; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.security.ConstraintMapping; -import org.eclipse.jetty.security.ConstraintSecurityHandler; -import org.eclipse.jetty.security.HashLoginService; -import org.eclipse.jetty.security.UserStore; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.DefaultHandler; -import org.eclipse.jetty.server.handler.HandlerList; -import org.eclipse.jetty.server.handler.ResourceHandler; -import org.eclipse.jetty.util.security.Constraint; -import org.eclipse.jetty.util.security.Password; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.eclipse.jetty.util.security.Constraint.__BASIC_AUTH; - -/** - * This is a test set for MNG-4068. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng4068AuthenticatedMirrorTest extends AbstractMavenIntegrationTestCase { - - private File testDir; - - private Server server; - - private int port; - - public MavenITmng4068AuthenticatedMirrorTest() { - super(ALL_MAVEN_VERSIONS); - } - - @BeforeEach - protected void setUp() throws Exception { - testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4068"); - - Constraint constraint = new Constraint(); - constraint.setName(Constraint.__BASIC_AUTH); - constraint.setRoles(new String[] {"user"}); - constraint.setAuthenticate(true); - - ConstraintMapping constraintMapping = new ConstraintMapping(); - constraintMapping.setConstraint(constraint); - constraintMapping.setPathSpec("/*"); - - HashLoginService userRealm = new HashLoginService("TestRealm"); - UserStore userStore = new UserStore(); - userStore.addUser("testuser", new Password("testtest"), new String[] {"user"}); - userRealm.setUserStore(userStore); - - server = new Server(0); - ConstraintSecurityHandler securityHandler = new ConstraintSecurityHandler(); - securityHandler.setLoginService(userRealm); - securityHandler.setAuthMethod(__BASIC_AUTH); - securityHandler.setConstraintMappings(new ConstraintMapping[] {constraintMapping}); - - ResourceHandler repoHandler = new ResourceHandler(); - repoHandler.setResourceBase(new File(testDir, "repo").getAbsolutePath()); - - HandlerList handlerList = new HandlerList(); - handlerList.addHandler(securityHandler); - handlerList.addHandler(repoHandler); - handlerList.addHandler(new DefaultHandler()); - - server.setHandler(handlerList); - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + port); - } - - @AfterEach - protected void tearDown() throws Exception { - if (server != null) { - server.stop(); - server.join(); - } - } - - /** - * Test that downloading of release/snapshot artifacts from an authenticated mirror works. This basically boils down - * to using the proper id for the mirrored repository when looking up the credentials. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - Map filterProps = new HashMap<>(); - filterProps.put("@mirrorPort@", Integer.toString(port)); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4068"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng4068", "a", "0.1", "jar"); - verifier.verifyArtifactPresent("org.apache.maven.its.mng4068", "b", "0.1-SNAPSHOT", "jar"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4070WhitespaceTrimmingTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4070WhitespaceTrimmingTest.java deleted file mode 100644 index fe495ea9c..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4070WhitespaceTrimmingTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Collections; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4070. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4070WhitespaceTrimmingTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4070WhitespaceTrimmingTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that whitespace around artifact coordinates does not change artifact identity. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4070"); - - Verifier verifier = newVerifier(new File(testDir, "sub").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4070"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List artifacts = verifier.loadLines("target/artifacts.txt", "UTF-8"); - assertEquals(Collections.singletonList("org.apache.maven.its.mng4070:a:jar:0.1"), artifacts); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4072InactiveProfileReposTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4072InactiveProfileReposTest.java deleted file mode 100644 index d72e4746f..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4072InactiveProfileReposTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4072. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4072InactiveProfileReposTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4072InactiveProfileReposTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that repositories from inactive profiles are actually not used for artifact resolution. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4072"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4072"); - verifier.filterFile("pom-template.xml", "pom.xml", "UTF-8"); - verifier.filterFile("profiles-template.xml", "profiles.xml", "UTF-8"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Dependency resolution succeeded although all profiles are inactive"); - } catch (Exception e) { - // expected, all profiles are inactive, hence the repos inaccessible - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4087PercentEncodedFileUrlTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4087PercentEncodedFileUrlTest.java deleted file mode 100644 index 429769629..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4087PercentEncodedFileUrlTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4087. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4087PercentEncodedFileUrlTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4087PercentEncodedFileUrlTest() { - super("[2.1.0,)"); - } - - /** - * Test that deployment to a file:// repository decodes percent-encoded characters. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4087"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4087"); - verifier.filterFile("pom-template.xml", "pom.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFileNotPresent("target/%72%65%70%6F"); - verifier.verifyFilePresent("target/repo"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4091BadPluginDescriptorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4091BadPluginDescriptorTest.java deleted file mode 100644 index 4a1c21bf9..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4091BadPluginDescriptorTest.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; -import java.util.Properties; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4091: - * Bad plugin descriptor error handling - */ -public class MavenITmng4091BadPluginDescriptorTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4091BadPluginDescriptorTest() { - super("[2.1.0,)"); // only test in 2.1.0+ - } - - @Test - public void testitMNG4091_InvalidDescriptor() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4091/invalid"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - - try { - verifier.addCliArgument("validate"); - verifier.execute(); - - fail("should throw an error during execution."); - } catch (VerificationException e) { - // expected...it'd be nice if we could get the specifics of the exception right here... - } - - List logFile = verifier.loadFile(verifier.getBasedir(), verifier.getLogFileName(), false); - - String msg = "Plugin's descriptor contains the wrong version: 2.0-SNAPSHOT"; - - boolean foundMessage = false; - for (String line : logFile) { - if (line.contains(msg)) { - foundMessage = true; - break; - } - } - - assertTrue("User-friendly message was not found in output.", foundMessage); - } - - @Test - public void testitMNG4091_PluginDependency() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4091/plugin-dependency"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/plugin-dependency.properties"); - assertTrue(props.isEmpty()); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4102InheritedPropertyInterpolationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4102InheritedPropertyInterpolationTest.java deleted file mode 100644 index 0d0525ecc..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4102InheritedPropertyInterpolationTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4102. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng4102InheritedPropertyInterpolationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4102InheritedPropertyInterpolationTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that the effective value of an inherited property reflects the values of any nested property - * as defined by the child. This boils down to the order of inheritance and (parent) interpolation. - * This variation of the test has no profiles. - * - * @throws Exception in case of failure - */ - @Test - public void testitNoProfiles() throws Exception { - testit("no-profile"); - } - - /** - * Verify that the effective value of an inherited property reflects the values of any nested property - * as defined by the child. This boils down to the order of inheritance and (parent) interpolation. - * This variation of the test has active profiles in parent and child (which should make no difference - * to the result). - * - * @throws Exception in case of failure - */ - @Test - public void testitActiveProfiles() throws Exception { - testit("active-profile"); - } - - private void testit(String project) throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4102/" + project); - - Verifier verifier = newVerifier(new File(testDir, "sub").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - assertEquals("CHILD", props.getProperty("project.properties.overridden")); - assertEquals("CHILD", props.getProperty("project.properties.interpolated")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4106InterpolationUsesDominantProfileTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4106InterpolationUsesDominantProfileTest.java deleted file mode 100644 index 61998ee37..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4106InterpolationUsesDominantProfileTest.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4106. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng4106InterpolationUsesDominantProfileTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4106InterpolationUsesDominantProfileTest() { - super("[2.0.5,)"); - } - - /** - * Test that interpolation uses the property values from the dominant (i.e. last) profile among a group - * of active profiles that define the same properties. This boils down to the proper order of profile - * injection and interpolation, i.e. interpolate after all profiles are injected. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG4106() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4106"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - if (matchesVersionRange("[4.0.0-alpha-1,)")) { - verifier.addCliArgument("-Ppom-a,pom-b,settings-a,settings-b"); - } else { - verifier.addCliArgument("-Ppom-a,pom-b,profiles-a,profiles-b,settings-a,settings-b"); - } - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - - assertEquals("b", props.getProperty("project.properties.pomProperty")); - assertEquals("b", props.getProperty("project.properties.pom")); - - assertEquals("b", props.getProperty("project.properties.settingsProperty")); - assertEquals("b", props.getProperty("project.properties.settings")); - - if (matchesVersionRange("(,3.0-alpha-1)")) { - // MNG-4060, profiles.xml support dropped - assertEquals("b", props.getProperty("project.properties.profilesProperty")); - assertEquals("b", props.getProperty("project.properties.profiles")); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4107InterpolationUsesDominantProfileSourceTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4107InterpolationUsesDominantProfileSourceTest.java deleted file mode 100644 index 0faa06f34..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4107InterpolationUsesDominantProfileSourceTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4107. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng4107InterpolationUsesDominantProfileSourceTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4107InterpolationUsesDominantProfileSourceTest() { - super("[2.0.5,)"); - } - - /** - * Test that POM interpolation uses the property values from the dominant profile source (POM vs. profiles.xml - * vs. settings.xml). This boils down to the proper order of profile injection and interpolation, i.e. - * interpolate after profiles from all sources are injected. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG4107() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4107"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - - assertEquals("applied", props.getProperty("project.properties.pomProfile")); - assertEquals("applied", props.getProperty("project.properties.settingsProfile")); - assertEquals("settings", props.getProperty("project.properties.pomVsSettings")); - assertEquals("settings", props.getProperty("project.properties.pomVsSettingsInterpolated")); - - if (matchesVersionRange("(,3.0-alpha-1)")) { - // MNG-4060, profiles.xml support dropped - assertEquals("applied", props.getProperty("project.properties.profilesProfile")); - assertEquals("profiles", props.getProperty("project.properties.pomVsProfiles")); - assertEquals("profiles", props.getProperty("project.properties.pomVsProfilesInterpolated")); - assertEquals("settings", props.getProperty("project.properties.profilesVsSettings")); - assertEquals("settings", props.getProperty("project.properties.profilesVsSettingsInterpolated")); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4112MavenVersionPropertyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4112MavenVersionPropertyTest.java deleted file mode 100644 index 9c0aa1f62..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4112MavenVersionPropertyTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng4112MavenVersionPropertyTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4112MavenVersionPropertyTest() { - super("(3.0.3,)"); - } - - /** - * Test for ${maven.version} and ${maven.build.version} property - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4112"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - - Properties props = verifier.loadProperties("target/pom.properties"); - - String testMavenVersion = props.getProperty("project.properties.simpleVersion", ""); - assertFalse(testMavenVersion, testMavenVersion.contains("$")); - assertTrue(testMavenVersion, testMavenVersion.matches("[0-9]+\\.[0-9]+.*")); - - String testMavenBuildVersion = props.getProperty("project.properties.fullVersion", ""); - assertTrue(testMavenBuildVersion, testMavenBuildVersion.contains(testMavenVersion)); - - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4116UndecodedUrlsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4116UndecodedUrlsTest.java deleted file mode 100644 index 3ac362648..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4116UndecodedUrlsTest.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4116. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng4116UndecodedUrlsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4116UndecodedUrlsTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that the project builder does not decode URLs (which must be done by the transport layer instead). - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG4116() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4116"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - - assertEquals("http://maven.apache.org/spacy%20path", props.getProperty("project.url")); - - assertEquals("http://svn.apache.org/viewvc/spacy%20path", props.getProperty("project.scm.url")); - assertEquals("scm:svn:svn+ssh://svn.apache.org/spacy%20path", props.getProperty("project.scm.connection")); - assertEquals( - "scm:svn:svn+ssh://svn.apache.org/spacy%20path", props.getProperty("project.scm.developerConnection")); - - assertEquals("http://ci.apache.org/spacy%20path", props.getProperty("project.ciManagement.url")); - - assertEquals("http://issues.apache.org/spacy%20path", props.getProperty("project.issueManagement.url")); - - assertEquals( - "scm:svn:svn+ssh://dist.apache.org/spacy%20path", - props.getProperty("project.distributionManagement.repository.url")); - assertEquals( - "scm:svn:svn+ssh://snap.apache.org/spacy%20path", - props.getProperty("project.distributionManagement.snapshotRepository.url")); - assertEquals( - "scm:svn:svn+ssh://site.apache.org/spacy%20path", - props.getProperty("project.distributionManagement.site.url")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4129PluginExecutionInheritanceTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4129PluginExecutionInheritanceTest.java deleted file mode 100644 index daaec472e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4129PluginExecutionInheritanceTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4129. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng4129PluginExecutionInheritanceTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4129PluginExecutionInheritanceTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Verify that plugin executions defined in the parent with inherited=false are not executed in child modules. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4129"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("child-1/target"); - verifier.deleteDirectory("child-2/target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List executions = verifier.loadLines("target/executions.txt", "UTF-8"); - Collections.sort(executions); - assertEquals(Arrays.asList(new String[] {"inherited-execution", "non-inherited-execution"}), executions); - - List executions1 = verifier.loadLines("child-1/target/executions.txt", "UTF-8"); - assertEquals(Collections.singletonList("inherited-execution"), executions1); - - List executions2 = verifier.loadLines("child-2/target/executions.txt", "UTF-8"); - assertEquals(Collections.singletonList("inherited-execution"), executions2); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4150VersionRangeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4150VersionRangeTest.java deleted file mode 100644 index 69e7f9221..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4150VersionRangeTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Collection; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-505. - * - * @author Brett Porter - * - */ -public class MavenITmng4150VersionRangeTest extends AbstractMavenIntegrationTestCase { - public MavenITmng4150VersionRangeTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test version range support. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG4150() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4150"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4150"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Collection artifacts = verifier.loadLines("target/artifacts.txt", "UTF-8"); - assertEquals(4, artifacts.size()); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng4150:a:jar:1.1")); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng4150:b:jar:1.0")); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng4150:c:jar:3.8")); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng4150:d:jar:2.1.1")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4162ReportingMigrationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4162ReportingMigrationTest.java deleted file mode 100644 index db55f250a..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4162ReportingMigrationTest.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4162. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4162ReportingMigrationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4162ReportingMigrationTest() { - super("[3.0-beta-1,4.0.0-alpha-2]"); - } - - /** - * Verify that the legacy reporting section is automatically converted into ordinary plugin configuration of the - * Maven Site Plugin to ease migration. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4162"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - String p = "project.build.plugins.0.executions.0.configuration.children."; - - Properties props = verifier.loadProperties("target/site.properties"); - assertTrue(props.getProperty(p + "outputDirectory.0.value").endsWith("other-site")); - assertEquals( - "maven-surefire-report-plugin", - props.getProperty(p + "reportPlugins.0.children.reportPlugin.0.children.artifactId.0.value")); - assertEquals( - "maven-project-info-reports-plugin", - props.getProperty(p + "reportPlugins.0.children.reportPlugin.1.children.artifactId.0.value")); - assertEquals( - "report", - props.getProperty( - p - + "reportPlugins.0.children.reportPlugin.0.children.reportSets.0.children.reportSet.0.children.reports.0.children.report.0.value")); - assertEquals( - "report-only", - props.getProperty( - p - + "reportPlugins.0.children.reportPlugin.0.children.reportSets.0.children.reportSet.1.children.reports.0.children.report.0.value")); - assertEquals( - "true", - props.getProperty( - p - + "reportPlugins.0.children.reportPlugin.0.children.reportSets.0.children.reportSet.0.children.configuration.0.children.skipTests.0.value")); - assertEquals( - "false", - props.getProperty( - p - + "reportPlugins.0.children.reportPlugin.0.children.reportSets.0.children.reportSet.1.children.configuration.0.children.skipTests.0.value")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4166HideCoreCommonsCliTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4166HideCoreCommonsCliTest.java deleted file mode 100644 index fd27b1c23..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4166HideCoreCommonsCliTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4166. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng4166HideCoreCommonsCliTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4166HideCoreCommonsCliTest() { - super("[2.2.0,)"); - } - - /** - * Verify that plugins can use their own version of commons-cli and are not bound to the version bundled in the - * core. - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG4166() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4166"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifact("commons-cli", "commons-cli", "0.1.4166", "jar"); - verifier.deleteArtifact("commons-cli", "commons-cli", "0.1.4166", "pom"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/class.properties"); - assertNotNull(props.getProperty("org.apache.maven.its.mng4166.CoreIt")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4172EmptyDependencySetTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4172EmptyDependencySetTest.java deleted file mode 100644 index 98766b407..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4172EmptyDependencySetTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4172. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4172EmptyDependencySetTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4172EmptyDependencySetTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that a project without dependencies is really constructed without dependency artifacts. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4172"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List artifacts = verifier.loadLines("target/artifacts.txt", "UTF-8"); - assertEquals(new ArrayList(), artifacts); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4180PerDependencyExclusionsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4180PerDependencyExclusionsTest.java deleted file mode 100644 index db708216d..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4180PerDependencyExclusionsTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4180. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4180PerDependencyExclusionsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4180PerDependencyExclusionsTest() { - super("[2.0.5,)"); - } - - /** - * Test that dependency exclusions are not applied globally but are limited to the subtree that is rooted at the - * dependency they are declared on. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4180"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4180"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List artifacts = verifier.loadLines("target/artifacts.txt", "UTF-8"); - Collections.sort(artifacts); - - List expected = new ArrayList<>(); - expected.add("org.apache.maven.its.mng4180:a:jar:0.1"); - expected.add("org.apache.maven.its.mng4180:b:jar:0.1"); - expected.add("org.apache.maven.its.mng4180:c:jar:0.1"); - - assertEquals(expected, artifacts); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4189UniqueVersionSnapshotTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4189UniqueVersionSnapshotTest.java deleted file mode 100644 index 3efa29ade..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4189UniqueVersionSnapshotTest.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4189. - * - * - * @author Maria Odea Ching - */ -public class MavenITmng4189UniqueVersionSnapshotTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4189UniqueVersionSnapshotTest() { - super("[2.2.1,),[3.0-alpha-3,)"); - } - - @Test - public void testit() throws Exception { - final File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4189"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.deleteArtifacts("org.apache.maven.its.mng4189"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - - // depend on org.apache.maven.its.mng4189:dep:1.0-20090608.090416-1:jar - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.setLogFileName("log-1.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - Properties checksums = verifier.loadProperties("target/checksum.properties"); - assertEquals("da2e54f69a9ba120f9211c476029f049967d840c", checksums.getProperty("dep-1.0-SNAPSHOT.jar")); - - // depend on org.apache.maven.its.mng4189:dep:1.0-20090608.090416-2:jar - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("-f"); - verifier.addCliArgument("dependent-on-newer-timestamp-pom.xml"); - verifier.setLogFileName("log-2.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - checksums = verifier.loadProperties("target/checksum.properties"); - assertEquals("835979c28041014c5fd55daa15302d92976924a7", checksums.getProperty("dep-1.0-SNAPSHOT.jar")); - - // revert back to org.apache.maven.its.mng4189:dep:1.0-20090608.090416-1:jar - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.setLogFileName("log-3.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - checksums = verifier.loadProperties("target/checksum.properties"); - assertEquals("da2e54f69a9ba120f9211c476029f049967d840c", checksums.getProperty("dep-1.0-SNAPSHOT.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4190MirrorRepoMergingTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4190MirrorRepoMergingTest.java deleted file mode 100644 index c20c4af71..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4190MirrorRepoMergingTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4190. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4190MirrorRepoMergingTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4190MirrorRepoMergingTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Test that artifact repositories are merged if they are mirrored by the same repo. If n repos map to one - * mirror, there is no point in making n trips to the same mirror. However, the effective/merged repo needs - * to account for possibly different policies of the original repos. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4190"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4190"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List artifacts = verifier.loadLines("target/artifacts.txt", "UTF-8"); - Collections.sort(artifacts); - - List expected = new ArrayList<>(); - expected.add("org.apache.maven.its.mng4190:a:jar:0.1"); - expected.add("org.apache.maven.its.mng4190:b:jar:0.1-SNAPSHOT"); - - assertEquals(expected, artifacts); - - Properties props = verifier.loadProperties("target/repo.properties"); - assertEquals("1", props.getProperty("project.remoteArtifactRepositories")); - - assertEquals("true", props.getProperty("project.remoteArtifactRepositories.0.releases.enabled")); - assertEquals("ignore", props.getProperty("project.remoteArtifactRepositories.0.releases.checksumPolicy")); - assertEquals("daily", props.getProperty("project.remoteArtifactRepositories.0.releases.updatePolicy")); - - assertEquals("true", props.getProperty("project.remoteArtifactRepositories.0.snapshots.enabled")); - assertEquals("ignore", props.getProperty("project.remoteArtifactRepositories.0.snapshots.checksumPolicy")); - assertEquals("always", props.getProperty("project.remoteArtifactRepositories.0.snapshots.updatePolicy")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4193UniqueRepoIdTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4193UniqueRepoIdTest.java deleted file mode 100644 index 1105a2767..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4193UniqueRepoIdTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4193. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4193UniqueRepoIdTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4193UniqueRepoIdTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Test that duplicate repository id cause a validation error during building. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4193"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Duplicate repository ids did not cause validation error"); - } catch (VerificationException e) { - // expected - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4196ExclusionOnPluginDepTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4196ExclusionOnPluginDepTest.java deleted file mode 100644 index 17f892761..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4196ExclusionOnPluginDepTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4196. - * - * @author John Casey - * - */ -public class MavenITmng4196ExclusionOnPluginDepTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4196ExclusionOnPluginDepTest() { - super("[2.0.9,)"); - } - - /** - * Verify that exclusions on a project-level plugin dependency are effective. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4196"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties pclProps = verifier.loadProperties("target/pcl.properties"); - assertNull(pclProps.getProperty("org.apache.maven.plugin.coreit.ClassA")); - assertNotNull(pclProps.getProperty("org.apache.maven.plugin.coreit.ClassB")); - assertNull(pclProps.getProperty("org/apache/maven/plugin/coreit/a.properties")); - assertNotNull(pclProps.getProperty("org/apache/maven/plugin/coreit/b.properties")); - - Properties tcclProps = verifier.loadProperties("target/tccl.properties"); - assertEquals(pclProps, tcclProps); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4199CompileMeetsRuntimeScopeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4199CompileMeetsRuntimeScopeTest.java deleted file mode 100644 index 365f61a67..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4199CompileMeetsRuntimeScopeTest.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4199. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng4199CompileMeetsRuntimeScopeTest extends AbstractMavenIntegrationTestCase { - - /* - * NOTE: Class path ordering is another issue (MNG-1412), so we merely check set containment here. - */ - - public MavenITmng4199CompileMeetsRuntimeScopeTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that the core properly handles goals with different requirements on dependency resolution. In particular - * verify that the different dependency scopes are not erroneously collapsed/combined into just a single scope. - * The problem is that scope "runtime" is not a superset of scope "compile". - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4199"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4199"); - verifier.filterFile("pom-template.xml", "pom.xml", "UTF-8"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List compileArtifacts = verifier.loadLines("target/compile-artifacts.txt", "UTF-8"); - assertTrue( - compileArtifacts.toString(), compileArtifacts.contains("org.apache.maven.its.mng4199:system:jar:0.1")); - assertTrue( - compileArtifacts.toString(), - compileArtifacts.contains("org.apache.maven.its.mng4199:provided:jar:0.1")); - assertTrue( - compileArtifacts.toString(), compileArtifacts.contains("org.apache.maven.its.mng4199:compile:jar:0.1")); - assertFalse( - compileArtifacts.toString(), compileArtifacts.contains("org.apache.maven.its.mng4199:runtime:jar:0.1")); - assertEquals(3, compileArtifacts.size()); - - List compileClassPath = verifier.loadLines("target/compile-cp.txt", "UTF-8"); - assertTrue(compileClassPath.toString(), compileClassPath.contains("system-0.1.jar")); - assertTrue(compileClassPath.toString(), compileClassPath.contains("provided-0.1.jar")); - assertTrue(compileClassPath.toString(), compileClassPath.contains("compile-0.1.jar")); - assertFalse(compileClassPath.toString(), compileClassPath.contains("runtime-0.1.jar")); - assertEquals(4, compileClassPath.size()); - - List runtimeArtifacts = verifier.loadLines("target/runtime-artifacts.txt", "UTF-8"); - assertFalse( - runtimeArtifacts.toString(), runtimeArtifacts.contains("org.apache.maven.its.mng4199:system:jar:0.1")); - assertFalse( - runtimeArtifacts.toString(), - runtimeArtifacts.contains("org.apache.maven.its.mng4199:provided:jar:0.1")); - assertTrue( - runtimeArtifacts.toString(), runtimeArtifacts.contains("org.apache.maven.its.mng4199:compile:jar:0.1")); - assertTrue( - runtimeArtifacts.toString(), runtimeArtifacts.contains("org.apache.maven.its.mng4199:runtime:jar:0.1")); - assertEquals(2, runtimeArtifacts.size()); - - List runtimeClassPath = verifier.loadLines("target/runtime-cp.txt", "UTF-8"); - assertFalse(runtimeClassPath.toString(), runtimeClassPath.contains("system-0.1.jar")); - assertFalse(runtimeClassPath.toString(), runtimeClassPath.contains("provided-0.1.jar")); - assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("compile-0.1.jar")); - assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("runtime-0.1.jar")); - assertEquals(3, runtimeClassPath.size()); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4203TransitiveDependencyExclusionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4203TransitiveDependencyExclusionTest.java deleted file mode 100644 index 494e8f21b..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4203TransitiveDependencyExclusionTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4203. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4203TransitiveDependencyExclusionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4203TransitiveDependencyExclusionTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that exclusions defined on a dependency apply to its transitive dependencies as well. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4203"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4203"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List artifacts = verifier.loadLines("target/artifacts.txt", "UTF-8"); - Collections.sort(artifacts); - - List expected = new ArrayList<>(); - expected.add("org.apache.maven.its.mng4203:b:jar:0.1"); - expected.add("org.apache.maven.its.mng4203:c:jar:0.1"); - - assertEquals(expected, artifacts); - - verifier.verifyArtifactNotPresent("org.apache.maven.its.mng4203", "a", "0.1", "pom"); - verifier.verifyArtifactNotPresent("org.apache.maven.its.mng4203", "a", "0.1", "jar"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4207PluginWithLog4JTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4207PluginWithLog4JTest.java deleted file mode 100644 index 0ba2ee009..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4207PluginWithLog4JTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4207. - * - * @author John Casey - */ -public class MavenITmng4207PluginWithLog4JTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4207PluginWithLog4JTest() { - super("[2.0.3,)"); - } - - /** - * Test that a plugin that depends on log4j and employs the artifact resolver does not die when using - * commons-http to resolve an artifact. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4207"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4207"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("initialize"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4208InterpolationPrefersCliOverProjectPropsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4208InterpolationPrefersCliOverProjectPropsTest.java deleted file mode 100644 index 0e01d707a..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4208InterpolationPrefersCliOverProjectPropsTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4208. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4208InterpolationPrefersCliOverProjectPropsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4208InterpolationPrefersCliOverProjectPropsTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that exclusions defined on a dependency apply to its transitive dependencies as well. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4208"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-DtestProperty=PASSED"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - assertEquals("PASSED", props.getProperty("project.properties.interpolatedProperty")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4214MirroredParentSearchReposTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4214MirroredParentSearchReposTest.java deleted file mode 100644 index 8816f951b..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4214MirroredParentSearchReposTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4214. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4214MirroredParentSearchReposTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4214MirroredParentSearchReposTest() { - super("[2.0.5,)"); - } - - /** - * Test parent POMs can be resolved from repos with different enabled policies that are matched by a single mirror. - * In other words, check that the one mirror is properly configured with a merged view of the potentially different - * policies from the original repos. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4214"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4214"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng4214", "parent", "0.1", "pom"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4231SnapshotUpdatePolicyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4231SnapshotUpdatePolicyTest.java deleted file mode 100644 index b5323a2af..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4231SnapshotUpdatePolicyTest.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Map; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4231. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4231SnapshotUpdatePolicyTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4231SnapshotUpdatePolicyTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test the update policy "always" for snapshot dependencies is respected. - * - * @throws Exception in case of failure - */ - @Test - public void testitAlways() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4231"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4231"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@updates@", "always"); - - filterProps.put("@repo@", "repo-1"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.setLogFileName("log-always-1.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - filterProps.put("@repo@", "repo-2"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.setLogFileName("log-always-2.txt"); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties checksums = verifier.loadProperties("target/checksum.properties"); - assertChecksum("db3f17644e813af768ae6e82a6d0a2f29aef8988", "a-0.1-SNAPSHOT.jar", checksums); - assertChecksum("5e3265f3ed55e8b217ff9db444fd8d888962a990", "b-0.1-SNAPSHOT.jar", checksums); - } - - /** - * Test the update policy "never" for snapshot dependencies is respected. - * - * @throws Exception in case of failure - */ - @Test - public void testitNever() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4231"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4231"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@updates@", "never"); - - filterProps.put("@repo@", "repo-1"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.setLogFileName("log-never-1.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - filterProps.put("@repo@", "repo-2"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.setLogFileName("log-never-2.txt"); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties checksums = verifier.loadProperties("target/checksum.properties"); - assertChecksum("ec6c9ea65766cc272df0ee26076240d6a93047d5", "a-0.1-SNAPSHOT.jar", checksums); - assertChecksum("", "b-0.1-SNAPSHOT.jar", checksums); - } - - private void assertChecksum(String checksum, String jar, Properties checksums) { - assertEquals(checksum, checksums.getProperty(jar, "").toLowerCase(java.util.Locale.ENGLISH)); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4233ReactorResolutionForManuallyCreatedArtifactTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4233ReactorResolutionForManuallyCreatedArtifactTest.java deleted file mode 100644 index cc7fddfa9..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4233ReactorResolutionForManuallyCreatedArtifactTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4233. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4233ReactorResolutionForManuallyCreatedArtifactTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4233ReactorResolutionForManuallyCreatedArtifactTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Verify that artifact instances created directly by plugins (i.e. via the artifact factory) can be resolved - * from the reactor. This case is a subtle variation of MNG-2877, namely not using @requiresDependencyResolution - * or artifact instances created by the Maven core. In short, reactor resolution should work for any artifact, - * regardless whether created by the core or a plugin. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4233"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("consumer/target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("consumer/target/artifact.properties"); - assertEquals( - new File(testDir.getCanonicalFile(), "producer/pom.xml"), - new File(props.getProperty("org.apache.maven.its.mng4233:producer:jar:1.0-SNAPSHOT")) - .getCanonicalFile()); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4235HttpAuthDeploymentChecksumsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4235HttpAuthDeploymentChecksumsTest.java deleted file mode 100644 index 2cc2e4f31..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4235HttpAuthDeploymentChecksumsTest.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.util.Deque; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.ConcurrentLinkedDeque; - -import org.apache.maven.it.utils.DeployedResource; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.codehaus.plexus.util.StringUtils; -import org.eclipse.jetty.security.ConstraintMapping; -import org.eclipse.jetty.security.ConstraintSecurityHandler; -import org.eclipse.jetty.security.HashLoginService; -import org.eclipse.jetty.security.UserStore; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.DefaultHandler; -import org.eclipse.jetty.server.handler.HandlerList; -import org.eclipse.jetty.server.handler.ResourceHandler; -import org.eclipse.jetty.util.resource.Resource; -import org.eclipse.jetty.util.security.Constraint; -import org.eclipse.jetty.util.security.Password; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; -import static org.eclipse.jetty.util.security.Constraint.__BASIC_AUTH; - -/** - * This is a test set for MNG-4235. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng4235HttpAuthDeploymentChecksumsTest extends AbstractMavenIntegrationTestCase { - private File testDir; - - private Server server; - - private int port; - - private final RepoHandler repoHandler = new RepoHandler(); - - public MavenITmng4235HttpAuthDeploymentChecksumsTest() { - super("[2.0.5,2.2.0),(2.2.0,)"); - } - - @BeforeEach - protected void setUp() throws Exception { - testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4235"); - - repoHandler.setResourceBase(testDir.getAbsolutePath()); - - Constraint constraint = new Constraint(); - constraint.setName(Constraint.__BASIC_AUTH); - constraint.setRoles(new String[] {"deployer"}); - constraint.setAuthenticate(true); - - ConstraintMapping constraintMapping = new ConstraintMapping(); - constraintMapping.setConstraint(constraint); - constraintMapping.setPathSpec("/*"); - - HashLoginService userRealm = new HashLoginService("TestRealm"); - UserStore userStore = new UserStore(); - userStore.addUser("testuser", new Password("testpass"), new String[] {"deployer"}); - userRealm.setUserStore(userStore); - - ConstraintSecurityHandler securityHandler = new ConstraintSecurityHandler(); - securityHandler.setLoginService(userRealm); - securityHandler.setAuthMethod(__BASIC_AUTH); - securityHandler.setConstraintMappings(new ConstraintMapping[] {constraintMapping}); - - HandlerList handlerList = new HandlerList(); - handlerList.addHandler(securityHandler); - handlerList.addHandler(repoHandler); - handlerList.addHandler(new DefaultHandler()); - - server = new Server(0); - server.setHandler(handlerList); - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + port); - } - - @AfterEach - protected void tearDown() throws Exception { - if (server != null) { - server.stop(); - server.join(); - } - } - - /** - * Test the creation of proper checksums during deployment to a secured HTTP repo. The pitfall with HTTP auth is - * that it might require double submission of the data, first during an initial PUT without credentials and second - * during a retried PUT with credentials in response to the auth challenge by the server. The checksum must - * nevertheless only be calculated on the non-doubled data stream. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - Map filterProps = new HashMap<>(); - filterProps.put("@port@", Integer.toString(port)); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.filterFile("pom-template.xml", "pom.xml", "UTF-8", filterProps); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4235"); - verifier.deleteDirectory("repo"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - assertHash(verifier, "repo/org/apache/maven/its/mng4235/test/0.1/test-0.1.jar", ".sha1", "SHA-1"); - assertHash(verifier, "repo/org/apache/maven/its/mng4235/test/0.1/test-0.1.jar", ".md5", "MD5"); - - assertHash(verifier, "repo/org/apache/maven/its/mng4235/test/0.1/test-0.1.pom", ".sha1", "SHA-1"); - assertHash(verifier, "repo/org/apache/maven/its/mng4235/test/0.1/test-0.1.pom", ".md5", "MD5"); - - assertHash(verifier, "repo/org/apache/maven/its/mng4235/test/maven-metadata.xml", ".sha1", "SHA-1"); - assertHash(verifier, "repo/org/apache/maven/its/mng4235/test/maven-metadata.xml", ".md5", "MD5"); - - for (DeployedResource deployedResource : repoHandler.deployedResources) { - if (StringUtils.equalsIgnoreCase("chunked", deployedResource.transferEncoding)) { - fail("deployedResource " + deployedResource - + " use chunked transfert encoding some http server doesn't support that"); - } - } - } - - private void assertHash(Verifier verifier, String dataFile, String hashExt, String algo) throws Exception { - String actualHash = ItUtils.calcHash(new File(verifier.getBasedir(), dataFile), algo); - - String expectedHash = - verifier.loadLines(dataFile + hashExt, "UTF-8").get(0).trim(); - - assertTrue("expected=" + expectedHash + ", actual=" + actualHash, expectedHash.equalsIgnoreCase(actualHash)); - } - - private static class RepoHandler extends ResourceHandler { - private final Deque deployedResources = new ConcurrentLinkedDeque<>(); - - @Override - public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) - throws IOException, ServletException { - System.out.println(request.getMethod() + " " + request.getRequestURI()); - - if ("PUT".equals(request.getMethod())) { - Resource resource = getResource(request.getPathInfo()); - - // NOTE: This can get called concurrently but File.mkdirs() isn't thread-safe in all JREs - File dir = resource.getFile().getParentFile(); - for (int i = 0; i < 10 && !dir.exists(); i++) { - dir.mkdirs(); - } - - Files.copy(request.getInputStream(), resource.getFile().toPath(), REPLACE_EXISTING); - - DeployedResource deployedResource = new DeployedResource(); - - deployedResource.httpMethod = request.getMethod(); - deployedResource.requestUri = request.getRequestURI(); - deployedResource.transferEncoding = request.getHeader("Transfer-Encoding"); - deployedResource.contentLength = request.getHeader("Content-Length"); - - deployedResources.add(deployedResource); - - response.setStatus(HttpServletResponse.SC_NO_CONTENT); - - ((Request) request).setHandled(true); - } else { - super.handle(target, baseRequest, request, response); - } - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4238ArtifactHandlerExtensionUsageTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4238ArtifactHandlerExtensionUsageTest.java deleted file mode 100644 index c91c43047..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4238ArtifactHandlerExtensionUsageTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.IOException; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3506. - * - * @author John Casey - * - */ -public class MavenITmng4238ArtifactHandlerExtensionUsageTest extends AbstractMavenIntegrationTestCase { - - private static final String GID = "org.apache.maven.its.mng4238"; - private static final String AID = "mng-4238"; - private static final String VERSION = "1"; - private static final String TYPE = "jar"; - private static final String BAD_TYPE = "coreit"; - - public MavenITmng4238ArtifactHandlerExtensionUsageTest() { - super("(2.2.0,)"); - } - - @Test - public void testProjectPackagingUsage() throws IOException, VerificationException { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4238"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - - verifier.deleteArtifacts(GID); - - verifier.addCliArgument("install"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - // Now, if everything worked, we have a .pom and a .jar in the local repo. - // IF IT DIDN'T, we have a .pom and a .coreit in the local repo... - - String path = verifier.getArtifactPath(GID, AID, VERSION, TYPE); - assertTrue(path + " should have been installed.", new File(path).exists()); - - path = verifier.getArtifactPath(GID, AID, VERSION, "pom"); - assertTrue(path + " should have been installed.", new File(path).exists()); - - path = verifier.getArtifactPath(GID, AID, VERSION, BAD_TYPE); - assertFalse(path + " should NOT have been installed.", new File(path).exists()); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4262MakeLikeReactorDottedPath370Test.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4262MakeLikeReactorDottedPath370Test.java deleted file mode 100644 index 50c19153e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4262MakeLikeReactorDottedPath370Test.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4262. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4262MakeLikeReactorDottedPath370Test extends AbstractMavenIntegrationTestCase { - - public MavenITmng4262MakeLikeReactorDottedPath370Test() { - super("[4.0.0-alpha-1,)"); - } - - private void clean(Verifier verifier) throws Exception { - verifier.deleteDirectory("target"); - verifier.deleteDirectory("../sub-a/target"); - } - - /** - * Verify that the project list can select the root project by its relative path ".". - * - * @throws Exception in case of failure - */ - @Test - public void testitMakeRoot() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4262"); - - Verifier verifier = newVerifier(new File(testDir, "parent").getAbsolutePath()); - verifier.setAutoclean(false); - clean(verifier); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("."); - verifier.setLogFileName("log-root.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch.txt"); - verifier.verifyFilePresent("../sub-a/target/touch.txt"); - } - - /** - * Verify that the project list can select a submodule by a relative path like {@code "../"}. - * - * @throws Exception in case of failure - */ - @Test - public void testitMakeModule() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4262"); - - Verifier verifier = newVerifier(new File(testDir, "parent").getAbsolutePath()); - verifier.setAutoclean(false); - clean(verifier); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("../sub-a"); - verifier.setLogFileName("log-module.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFileNotPresent("target/touch.txt"); - verifier.verifyFilePresent("../sub-a/target/touch.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4262MakeLikeReactorDottedPathTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4262MakeLikeReactorDottedPathTest.java deleted file mode 100644 index e6448d949..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4262MakeLikeReactorDottedPathTest.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4262. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4262MakeLikeReactorDottedPathTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4262MakeLikeReactorDottedPathTest() { - super("[3.0-alpha-3,4.0.0-alpha-1)"); - } - - private void clean(Verifier verifier) throws Exception { - verifier.deleteDirectory("target"); - verifier.deleteDirectory("../sub-a/target"); - } - - /** - * Verify that the project list can select the root project by its relative path ".". - * - * @throws Exception in case of failure - */ - @Test - public void testitMakeRoot() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4262"); - - Verifier verifier = newVerifier(new File(testDir, "parent").getAbsolutePath()); - verifier.setAutoclean(false); - clean(verifier); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("."); - verifier.setLogFileName("log-root.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch.txt"); - verifier.verifyFileNotPresent("../sub-a/target/touch.txt"); - } - - /** - * Verify that the project list can select a submodule by a relative path like {@code "../"}. - * - * @throws Exception in case of failure - */ - @Test - public void testitMakeModule() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4262"); - - Verifier verifier = newVerifier(new File(testDir, "parent").getAbsolutePath()); - verifier.setAutoclean(false); - clean(verifier); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("../sub-a"); - verifier.setLogFileName("log-module.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFileNotPresent("target/touch.txt"); - verifier.verifyFilePresent("../sub-a/target/touch.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4269BadReactorResolutionFromOutDirTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4269BadReactorResolutionFromOutDirTest.java deleted file mode 100644 index 6d884d64d..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4269BadReactorResolutionFromOutDirTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4269. - * - * @author Brian Fox - */ -public class MavenITmng4269BadReactorResolutionFromOutDirTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4269BadReactorResolutionFromOutDirTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that dependency resolution from the reactor is not too eager and does not resolve plugin artifacts from - * the build directory of their plugin project when the plugin project hasn't been built yet. The technical - * problem is that the mere existence of a project output directory like target/classes is no sufficient indicator - * that we can use that for artifact resolution. The project's output directory might just be a left over from a - * previous build and could be in any state, e.g. incomplete. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4269"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - // NOTE: It's a crucial prerequisite to create the output directory, i.e. the bad choice - new File(testDir, "target/classes").mkdirs(); - verifier.deleteArtifacts("org.apache.maven.its.mng4269"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - // This should use the previous installation/deployment from the repo, not the invalid output directory - verifier.addCliArgument("org.apache.maven.its.mng4269:maven-mng4269-plugin:0.1:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4270ArtifactHandlersFromPluginDepsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4270ArtifactHandlersFromPluginDepsTest.java deleted file mode 100644 index 7af19e1c5..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4270ArtifactHandlersFromPluginDepsTest.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.IOException; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4270. - * - * @author John Casey - * - */ -public class MavenITmng4270ArtifactHandlersFromPluginDepsTest extends AbstractMavenIntegrationTestCase { - - private static final String GID = "org.apache.maven.its.mng4270"; - - private static final String AID = "mng-4270"; - private static final String VERSION = "1"; - private static final String TYPE = "jar"; - - private static final String BAD_TYPE = "coreit"; - - public MavenITmng4270ArtifactHandlersFromPluginDepsTest() { - super("(2.2.0,)"); - } - - @Test - public void testProjectPackagingUsage() throws IOException, VerificationException { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/" + AID); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - - verifier.deleteArtifacts(GID); - - verifier.addCliArgument("install"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - // Now, if everything worked, we have .pom and a .jar in the local repo. - // IF IT DIDN'T, we have a .pom and a .coreit in the local repo... - - String path = verifier.getArtifactPath(GID, AID, VERSION, TYPE); - assertTrue(path + " should have been installed.", new File(path).exists()); - - path = verifier.getArtifactPath(GID, AID, VERSION, "pom"); - assertTrue(path + " should have been installed.", new File(path).exists()); - - path = verifier.getArtifactPath(GID, AID, VERSION, BAD_TYPE); - assertFalse(path + " should NOT have been installed.", new File(path).exists()); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4273RestrictedCoreRealmAccessForPluginTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4273RestrictedCoreRealmAccessForPluginTest.java deleted file mode 100644 index f2632bab1..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4273RestrictedCoreRealmAccessForPluginTest.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4273. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4273RestrictedCoreRealmAccessForPluginTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4273RestrictedCoreRealmAccessForPluginTest() { - super("[2.0.6,)"); - } - - /** - * Verify that internal utility/implementation classes used by the Maven core do not leak into the plugin realm. - * Otherwise, we risk linkage errors when a plugin creates a custom class loader with parent-first delegation on - * top of the plugin realm because the custom class loader will prefer potentially incompatible classes from the - * core realm over classes from itself. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4273"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/class.properties"); - - assertNull(props.getProperty("org.codehaus.plexus.util.FileUtils$FilterWrapper")); - - try { - // some IBM JRE's ship with Xerces (xml.jar) so a plugin can load this class from the bootstrap loader - ClassLoader.getSystemClassLoader().loadClass("org.apache.xerces.util.ParserConfigurationSettings"); - } catch (ClassNotFoundException e) { - // not provided by JRE, and must not be provided by Maven's core realm either - assertNull(props.getProperty("org.apache.xerces.util.ParserConfigurationSettings")); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4274PluginRealmArtifactsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4274PluginRealmArtifactsTest.java deleted file mode 100644 index 24336f7c6..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4274PluginRealmArtifactsTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4274. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4274PluginRealmArtifactsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4274PluginRealmArtifactsTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Verify that plugins with an undeclared dependency on plexus-utils that is brought in as a transitive dependency - * of some Maven core artifact get the proper version of plexus-utils. For clarity, the proper version is the - * version that the original core artifact specified as dependency, not the version shipped with the current core. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4274"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifact("org.apache.maven", "maven-core", "2.0.4274", "jar"); - verifier.deleteArtifact("org.apache.maven", "maven-core", "2.0.4274", "pom"); - verifier.deleteArtifact("org.codehaus.plexus", "plexus-utils", "1.1.4274", "jar"); - verifier.deleteArtifact("org.codehaus.plexus", "plexus-utils", "1.1.4274", "pom"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/class.properties"); - assertNotNull(props.getProperty("org.apache.maven.its.mng4274.CoreIt")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4275RelocationWarningTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4275RelocationWarningTest.java deleted file mode 100644 index 185ca523d..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4275RelocationWarningTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4275. - * - * @author John Casey - */ -public class MavenITmng4275RelocationWarningTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4275RelocationWarningTest() { - super("[2.0,2.0.9),[2.2.1,3.0-alpha-1),[3.0-alpha-3,)"); - } - - /** - * Verify that relocations are logged (at warning level). - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4275"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4275"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List lines = verifier.loadFile(new File(testDir, verifier.getLogFileName()), false); - boolean foundWarning = false; - for (String line : lines) { - if (foundWarning) { - assertTrue( - "Relocation target should have been logged right after warning.", - line.contains("This artifact has been relocated to org.apache.maven.its.mng4275:relocated:1")); - break; - } else if (line.startsWith("[WARNING] While downloading org.apache.maven.its.mng4275:relocation:1")) { - foundWarning = true; - } else if (line.matches( - "\\[WARNING\\].* org.apache.maven.its.mng4275:relocation:jar:1 .* org.apache.maven.its" - + ".mng4275:relocated:jar:1.*")) { - foundWarning = true; - break; - } - } - - assertTrue("Relocation warning should haven been logged.", foundWarning); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4276WrongTransitivePlexusUtilsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4276WrongTransitivePlexusUtilsTest.java deleted file mode 100644 index 9f8abe45d..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4276WrongTransitivePlexusUtilsTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4276. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4276WrongTransitivePlexusUtilsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4276WrongTransitivePlexusUtilsTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Verify that plugins that have a *transitive* dependency on plexus-utils:x.y get that version and not a random - * version injected by the core like 1.1. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4276"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4276"); - verifier.deleteArtifact("org.codehaus.plexus", "plexus-utils", "1.1.4276", "jar"); - verifier.deleteArtifact("org.codehaus.plexus", "plexus-utils", "1.1.4276", "pom"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/class.properties"); - assertNotNull(props.getProperty("org.apache.maven.its.mng4276.CoreIt")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4281PreferLocalSnapshotTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4281PreferLocalSnapshotTest.java deleted file mode 100644 index d9864f045..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4281PreferLocalSnapshotTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4281. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4281PreferLocalSnapshotTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4281PreferLocalSnapshotTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that remote snapshots are not preferred over snapshots that have just been locally built. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - // NOTE: It's crucial to build the two projects in isolation to disable reactor resolution - - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4281"); - - Verifier verifier = newVerifier(new File(testDir, "dependency").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4281"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng4281", "dependency", "0.1-SNAPSHOT", "jar"); - verifier.verifyArtifactPresent("org.apache.maven.its.mng4281", "dependency", "0.1-SNAPSHOT", "pom"); - - verifier = newVerifier(new File(testDir, "project").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties checksums = verifier.loadProperties("target/checksum.properties"); - assertChecksum("7c564b3fbeda6db61b62c35e58a8ef672e712400", checksums); - } - - private void assertChecksum(String checksum, Properties checksums) { - String actual = checksums.getProperty("dependency-0.1-SNAPSHOT.jar"); - assertEquals(checksum, actual.toLowerCase(java.util.Locale.ENGLISH)); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4283ParentPomPackagingTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4283ParentPomPackagingTest.java deleted file mode 100644 index d1a4a2b0c..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4283ParentPomPackagingTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4283. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4283ParentPomPackagingTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4283ParentPomPackagingTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that the model builder fails when a parent POM has not "pom" packaging. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4283"); - - Verifier verifier = newVerifier(new File(testDir, "sub").getAbsolutePath()); - verifier.setAutoclean(false); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Invalid packaging of parent POM did not fail the build."); - } catch (VerificationException e) { - // expected - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4291MojoRequiresOnlineModeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4291MojoRequiresOnlineModeTest.java deleted file mode 100644 index 775105d2e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4291MojoRequiresOnlineModeTest.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4291. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4291MojoRequiresOnlineModeTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4291MojoRequiresOnlineModeTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that the mojo annotation @requiresOnline is recognized. For a direct mojo invocation, this means to fail - * when Maven is in offline mode but the mojo requires online model. - * - * @throws Exception in case of failure - */ - @Test - public void testitDirectInvocation() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4291"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.setLogFileName("log-direct.txt"); - verifier.addCliArgument("--offline"); - try { - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-online:2.1-SNAPSHOT:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Request to execute online mojo during offline mode did not fail the build."); - } catch (VerificationException e) { - // expected - } - } - - /** - * Test that the mojo annotation @requiresOnline is recognized. For a mojo invocation bound to a lifecycle phase, - * this means to skip the mojo when Maven is in offline mode but the mojo requires online mode. - * - * @throws Exception in case of failure - */ - @Test - public void testitLifecycleInvocation() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4291"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.setLogFileName("log-lifecycle.txt"); - verifier.addCliArgument("--offline"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFileNotPresent("target/touch.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4292EnumTypeMojoParametersTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4292EnumTypeMojoParametersTest.java deleted file mode 100644 index a4c8f56b4..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4292EnumTypeMojoParametersTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4292. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4292EnumTypeMojoParametersTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4292EnumTypeMojoParametersTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Test that mojo parameters can be configured with enums. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4292"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/config.properties"); - assertEquals("HALF_EVEN", props.getProperty("listParam.0")); - assertEquals("RUNNABLE", props.getProperty("listParam.1")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4293RequiresCompilePlusRuntimeScopeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4293RequiresCompilePlusRuntimeScopeTest.java deleted file mode 100644 index 00b98b49f..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4293RequiresCompilePlusRuntimeScopeTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4293. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4293RequiresCompilePlusRuntimeScopeTest extends AbstractMavenIntegrationTestCase { - - /* - * NOTE: Class path ordering is another issue (MNG-1412), so we merely check set containment here. - */ - - public MavenITmng4293RequiresCompilePlusRuntimeScopeTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Test support of "@requiresDependencyResolution compile+runtime". - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4293"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4293"); - verifier.filterFile("pom-template.xml", "pom.xml", "UTF-8"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List compileClassPath = verifier.loadLines("target/compile-cp.txt", "UTF-8"); - assertTrue(compileClassPath.toString(), compileClassPath.contains("system-0.1.jar")); - assertTrue(compileClassPath.toString(), compileClassPath.contains("provided-0.1.jar")); - assertTrue(compileClassPath.toString(), compileClassPath.contains("compile-0.1.jar")); - assertFalse(compileClassPath.toString(), compileClassPath.contains("test-0.1.jar")); - - List runtimeClassPath = verifier.loadLines("target/runtime-cp.txt", "UTF-8"); - assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("compile-0.1.jar")); - assertTrue(runtimeClassPath.toString(), runtimeClassPath.contains("runtime-0.1.jar")); - assertFalse(runtimeClassPath.toString(), runtimeClassPath.contains("test-0.1.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4304ProjectDependencyArtifactsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4304ProjectDependencyArtifactsTest.java deleted file mode 100644 index 120b775a6..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4304ProjectDependencyArtifactsTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4304. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4304ProjectDependencyArtifactsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4304ProjectDependencyArtifactsTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that MavenProject.getDependencyArtifacts() is properly populated with the direct artifacts of the - * project. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4304"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List artifacts = verifier.loadLines("target/artifacts.txt", "UTF-8"); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its:maven-core-it-support:jar:1.4")); - assertEquals(1, artifacts.size()); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4305LocalRepoBasedirTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4305LocalRepoBasedirTest.java deleted file mode 100644 index 64e08c942..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4305LocalRepoBasedirTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4305. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4305LocalRepoBasedirTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4305LocalRepoBasedirTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that ${localRepository.basedir} delivers a proper filesystem path. In detail, the path should use the - * platform-specific file separator and have no trailing separator. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4305"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/basedir.properties"); - - // NOTE: This deliberately compares the paths on the String level, not via File.equals() - assertEquals( - new File(verifier.getLocalRepository()).getAbsolutePath(), props.getProperty("localRepositoryBasedir")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4309StrictChecksumValidationForMetadataTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4309StrictChecksumValidationForMetadataTest.java deleted file mode 100644 index ef62c11d5..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4309StrictChecksumValidationForMetadataTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.utils.io.FileUtils; -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4309. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4309StrictChecksumValidationForMetadataTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4309StrictChecksumValidationForMetadataTest() { - super("[3.0-beta-3,)"); - } - - /** - * Verify that strict checksum verification applies to metadata as well and in particular fails the build - * during deployment when the previous metadata is corrupt. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4309"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4309"); - FileUtils.copyDirectoryStructure(new File(testDir, "repo"), new File(testDir, "target/repo")); - verifier.addCliArgument("--strict-checksums"); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Checksum mismatch for metadata did not fail the build despite strict mode"); - } catch (VerificationException e) { - // expected - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4312TypeAwarePluginParameterExpressionInjectionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4312TypeAwarePluginParameterExpressionInjectionTest.java deleted file mode 100644 index cdc0c7c41..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4312TypeAwarePluginParameterExpressionInjectionTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4312. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4312TypeAwarePluginParameterExpressionInjectionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4312TypeAwarePluginParameterExpressionInjectionTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Verify that plugins that use magic parameter expressions like ${plugin} for ordinary system properties - * get properly configured and don't crash due to Maven trying to inject a type-incompatible magic value - * into the String-type mojo parameter. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4312"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/config.properties"); - - assertEquals("", props.getProperty("stringParam", "")); - assertEquals("", props.getProperty("aliasParam", "")); - assertEquals("maven-core-it", props.getProperty("defaultParam")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4314DirectInvocationOfAggregatorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4314DirectInvocationOfAggregatorTest.java deleted file mode 100644 index 51d598912..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4314DirectInvocationOfAggregatorTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4314. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4314DirectInvocationOfAggregatorTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4314DirectInvocationOfAggregatorTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that aggregator mojos invoked from the CLI run only once, namely at the top-level project. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4314"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("consumer/target"); - verifier.deleteDirectory("dependency/target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4314"); - verifier.addCliArguments( - "validate", "org.apache.maven.its.plugins:maven-it-plugin-all:2.1-SNAPSHOT:aggregator-dependencies"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch.txt"); - verifier.verifyFileNotPresent("consumer/target/touch.txt"); - verifier.verifyFileNotPresent("dependency/target/touch.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4317PluginVersionResolutionFromMultiReposTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4317PluginVersionResolutionFromMultiReposTest.java deleted file mode 100644 index 1cee67248..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4317PluginVersionResolutionFromMultiReposTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4317. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4317PluginVersionResolutionFromMultiReposTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4317PluginVersionResolutionFromMultiReposTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that the g:a level metadata files from different repositories are properly merged when trying to resolve - * a version for some plugin that was invoked with g:a:goal. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4317"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4317"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("org.apache.maven.its.mng4317:maven-mng4317-plugin:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4318ProjectExecutionRootTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4318ProjectExecutionRootTest.java deleted file mode 100644 index d74a86a30..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4318ProjectExecutionRootTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4318 and - * MNG-5014. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4318ProjectExecutionRootTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4318ProjectExecutionRootTest() { - super("[2.0.4,3.0-alpha-1),[3.0.3,)"); - } - - /** - * Verify that MavenProject.isExecutionRoot() is properly set within a reactor. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4318"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("sub-1/target"); - verifier.deleteDirectory("sub-2/target"); - verifier.deleteDirectory("sub-2/sub-3/target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props; - - props = verifier.loadProperties("target/project.properties"); - assertEquals("true", props.getProperty("project.executionRoot")); - - props = verifier.loadProperties("sub-1/target/project.properties"); - assertEquals("false", props.getProperty("project.executionRoot")); - assertEquals("true", props.getProperty("project.parent.executionRoot")); - - props = verifier.loadProperties("sub-2/target/project.properties"); - assertEquals("false", props.getProperty("project.executionRoot")); - assertEquals("true", props.getProperty("project.parent.executionRoot")); - - props = verifier.loadProperties("sub-2/sub-3/target/project.properties"); - assertEquals("false", props.getProperty("project.executionRoot")); - assertEquals("false", props.getProperty("project.parent.executionRoot")); - assertEquals("true", props.getProperty("project.parent.parent.executionRoot")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4319PluginExecutionGoalInterpolationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4319PluginExecutionGoalInterpolationTest.java deleted file mode 100644 index 18fd0ff10..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4319PluginExecutionGoalInterpolationTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4319. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4319PluginExecutionGoalInterpolationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4319PluginExecutionGoalInterpolationTest() { - super("[2.0,2.1.0),[2.2.2,)"); - } - - /** - * Test that goals in plugin executions can be interpolated. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4319"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4320AggregatorAndDependenciesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4320AggregatorAndDependenciesTest.java deleted file mode 100644 index 31f53fad7..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4320AggregatorAndDependenciesTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4320. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4320AggregatorAndDependenciesTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4320AggregatorAndDependenciesTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that for aggregator mojos invoked from the CLI that require dependency resolution the dependencies - * of all projects in the reactor are resolved and not only the dependencies of the top-level project. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4320"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4320"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution:aggregate-test"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List classpath; - - classpath = verifier.loadLines("target/sub-1.txt", "UTF-8"); - assertTrue(classpath.toString(), classpath.contains("a-0.1.jar")); - - classpath = verifier.loadLines("target/sub-2.txt", "UTF-8"); - assertTrue(classpath.toString(), classpath.contains("b-0.2.jar")); - - classpath = verifier.loadLines("target/aggregator.txt", "UTF-8"); - assertFalse(classpath.toString(), classpath.contains("a-0.1.jar")); - assertFalse(classpath.toString(), classpath.contains("b-0.2.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4321CliUsesPluginMgmtConfigTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4321CliUsesPluginMgmtConfigTest.java deleted file mode 100644 index 55093aa0b..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4321CliUsesPluginMgmtConfigTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4321. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4321CliUsesPluginMgmtConfigTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4321CliUsesPluginMgmtConfigTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that configuration from plugin management also applies to goals that are invoked directly from the - * CLI even when the invoked plugin is neither explicitly present in the build/plugins section nor part of - * the lifecycle mappings for the project's packaging. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4321"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-log-file:2.1-SNAPSHOT:reset"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/passed.log"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4326LocalSnapshotSuppressesRemoteCheckTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4326LocalSnapshotSuppressesRemoteCheckTest.java deleted file mode 100644 index cf69f32b0..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4326LocalSnapshotSuppressesRemoteCheckTest.java +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import java.io.File; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Date; -import java.util.Deque; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentLinkedDeque; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.server.Handler; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.AbstractHandler; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4326. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4326LocalSnapshotSuppressesRemoteCheckTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4326LocalSnapshotSuppressesRemoteCheckTest() { - super("[3.0-beta-1,)"); - } - - /** - * Verify that locally built/installed snapshot artifacts suppress remote update checks (as long as the local copy - * still satisfies the update policy configured for the remote repository). - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4326"); - - // setup: install a local snapshot - Verifier verifier = newVerifier(new File(testDir, "dependency").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4326"); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - final Deque uris = new ConcurrentLinkedDeque<>(); - - Handler repoHandler = new AbstractHandler() { - @Override - public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) - throws IOException { - PrintWriter writer = response.getWriter(); - - String uri = request.getRequestURI(); - - if (uri.startsWith("/repo/org/apache/maven/its/mng4326") - && !uri.endsWith(".md5") - && !uri.endsWith(".sha1")) { - uris.add(uri.substring(34)); - } - - if (uri.endsWith("dep/0.1-SNAPSHOT/maven-metadata.xml")) { - java.text.DateFormat fmt = new java.text.SimpleDateFormat("yyyyMMddHHmmss"); - fmt.setTimeZone(java.util.TimeZone.getTimeZone("UTC")); - String now = fmt.format(new Date(System.currentTimeMillis() + 3000)); - - response.setStatus(HttpServletResponse.SC_OK); - writer.println(""); - writer.println(" org.apache.maven.its.mng4326"); - writer.println(" dep"); - writer.println(" 0.1-SNAPSHOT"); - writer.println(" "); - writer.println(" "); - writer.println(" 20100329.235556"); - writer.println(" 1"); - writer.println(" "); - writer.println(" " + now + ""); - writer.println(" "); - writer.println(""); - } else if (uri.endsWith(".pom")) { - response.setStatus(HttpServletResponse.SC_OK); - writer.println(""); - writer.println(" 4.0.0"); - writer.println(" org.apache.maven.its.mng4326"); - writer.println(" dep"); - writer.println(" 0.1-SNAPSHOT"); - writer.println(""); - } else if (uri.endsWith(".jar")) { - response.setStatus(HttpServletResponse.SC_OK); - writer.println("empty"); - } else { - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - } - - ((Request) request).setHandled(true); - } - }; - - Server server = new Server(0); - server.setHandler(repoHandler); - - try { - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - int port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + port); - // test 1: resolve snapshot, just built local copy should suppress daily remote update check - verifier = newVerifier(new File(testDir, "test").getAbsolutePath()); - verifier.setAutoclean(false); - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@port@", Integer.toString(port)); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.setLogFileName("log-daily.txt"); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List cp = verifier.loadLines("target/classpath.txt", "UTF-8"); - assertTrue(cp.toString(), cp.contains("dep-0.1-SNAPSHOT.jar")); - - assertFalse(uris.toString(), uris.contains("/dep/0.1-SNAPSHOT/maven-metadata.xml")); - assertFalse(uris.toString(), uris.contains("/dep/0.1-SNAPSHOT/dep-0.1-20100329.235556-1.jar")); - - uris.clear(); - - // test 2: force snapshot updates, remote metadata and artifacts should be fetched - verifier.addCliArgument("-U"); - verifier.setLogFileName("log-force.txt"); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - cp = verifier.loadLines("target/classpath.txt", "UTF-8"); - assertTrue(cp.toString(), cp.contains("dep-0.1-SNAPSHOT.jar")); - - assertTrue(uris.toString(), uris.contains("/dep/0.1-SNAPSHOT/maven-metadata.xml")); - assertTrue(uris.toString(), uris.contains("/dep/0.1-SNAPSHOT/dep-0.1-20100329.235556-1.jar")); - } finally { - server.stop(); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4327ExcludeForkingMojoFromForkedLifecycleTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4327ExcludeForkingMojoFromForkedLifecycleTest.java deleted file mode 100644 index 560f124f2..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4327ExcludeForkingMojoFromForkedLifecycleTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4327. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4327ExcludeForkingMojoFromForkedLifecycleTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4327ExcludeForkingMojoFromForkedLifecycleTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that lifecycle forking mojos are excluded from the lifecycles that have directly or indirectly forked - * by them. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4327"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("generate-sources"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List log = verifier.loadLines("target/fork-lifecycle.txt", "UTF-8"); - assertEquals(1, log.size()); - assertTrue(log.toString(), log.contains("fork-lifecycle.txt")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4328PrimitiveMojoParameterConfigurationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4328PrimitiveMojoParameterConfigurationTest.java deleted file mode 100644 index 17b98af6d..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4328PrimitiveMojoParameterConfigurationTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4328. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4328PrimitiveMojoParameterConfigurationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4328PrimitiveMojoParameterConfigurationTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that plugin parameters that are of primitive types like boolean (not java.lang.Boolean) can be populated - * from expressions. In other words, the subtle difference between the runtime type of the expression value (which - * will always be a primitive wrapper class due to reflection) and the actual parameter type should not matter. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4328"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("--offline"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props; - - props = verifier.loadProperties("target/config1.properties"); - assertEquals("true", props.getProperty("primitiveBooleanParam")); - - props = verifier.loadProperties("target/config2.properties"); - assertEquals("true", props.getProperty("primitiveBooleanParam")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4331DependencyCollectionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4331DependencyCollectionTest.java deleted file mode 100644 index 1e43cf3ea..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4331DependencyCollectionTest.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4331. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4331DependencyCollectionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4331DependencyCollectionTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Test that @requiresDependencyCollection works for a goal that is bound into a very early lifecycle phase - * like "validate" where none of the reactor projects have an artifact file. The Enforcer Plugin is the - * real world example for this use case. - * - * @throws Exception in case of failure - */ - @Test - public void testitEarlyLifecyclePhase() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4331"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4331"); - verifier.deleteDirectory("sub-2/target"); - verifier.setLogFileName("log-lifecycle.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List artifacts = verifier.loadLines("sub-2/target/compile.txt", "UTF-8"); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng4331:sub-1:jar:0.1")); - assertEquals(1, artifacts.size()); - } - - /** - * Test that @requiresDependencyCollection works for an aggregator goal that is invoked from the command line. - * The Release Plugin is the real world example for this use case. - * - * @throws Exception in case of failure - */ - @Test - public void testitCliAggregator() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4331"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4331"); - verifier.addCliArgument("-Ddepres.projectArtifacts=target/@artifactId@.txt"); - verifier.setLogFileName("log-aggregator.txt"); - verifier.addCliArgument( - "org.apache.maven.its.plugins:maven-it-plugin-dependency-collection:2.1-SNAPSHOT:aggregate-test"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List artifacts = verifier.loadLines("target/sub-2.txt", "UTF-8"); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng4331:sub-1:jar:0.1")); - assertEquals(1, artifacts.size()); - - artifacts = verifier.loadLines("target/sub-1.txt", "UTF-8"); - assertEquals(0, artifacts.size()); - - artifacts = verifier.loadLines("target/test.txt", "UTF-8"); - assertEquals(0, artifacts.size()); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4332DefaultPluginExecutionOrderTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4332DefaultPluginExecutionOrderTest.java deleted file mode 100644 index 54be0b604..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4332DefaultPluginExecutionOrderTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Arrays; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4332. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4332DefaultPluginExecutionOrderTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4332DefaultPluginExecutionOrderTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that default plugin executions contributed by the packaging are executed before user-defined - * executions from the POM's build section, regardless whether the executions are defined in the regular - * plugins section or the plugin management section. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4332"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("process-resources"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List lines = verifier.loadLines("target/resources-resources.txt", "UTF-8"); - assertEquals(Arrays.asList(new String[] {"default", "test-1", "test-2"}), lines); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4335SettingsOfflineModeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4335SettingsOfflineModeTest.java deleted file mode 100644 index 7dae138fb..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4335SettingsOfflineModeTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4335. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4335SettingsOfflineModeTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4335SettingsOfflineModeTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that offline mode is enabled when specified in the settings.xml - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4335"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4335"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Build did not fail to resolve missing dependency although Maven ought to work offline!"); - } catch (VerificationException e) { - // expected, should fail - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4338OptionalMojosTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4338OptionalMojosTest.java deleted file mode 100644 index 4696572f5..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4338OptionalMojosTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4338. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4338OptionalMojosTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4338OptionalMojosTest() { - super("[3.0,4.0.0-alpha-1)"); - } - - /** - * Test that the {@code } element in custom lifecycle mappings is recognized and does not cause - * a configuration failure when loading the lifecycle. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4338"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4341PluginExecutionOrderTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4341PluginExecutionOrderTest.java deleted file mode 100644 index d943d4597..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4341PluginExecutionOrderTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Arrays; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4341. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4341PluginExecutionOrderTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4341PluginExecutionOrderTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that plugins bound to the same phase get executed in POM order even if one of the plugins participates - * in the default lifecycle bindings for the project's packaging. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4341"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List lines = verifier.loadLines("target/log.txt", "UTF-8"); - assertEquals(Arrays.asList(new String[] {"first", "second"}), lines); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4342IndependentMojoParameterDefaultValuesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4342IndependentMojoParameterDefaultValuesTest.java deleted file mode 100644 index 7b6658ee3..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4342IndependentMojoParameterDefaultValuesTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4342. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4342IndependentMojoParameterDefaultValuesTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4342IndependentMojoParameterDefaultValuesTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that multiple goals within a single execution get their default configuration properly injected. In - * particular, the default values for one goal should not influence the default values of the other goal. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4342"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props1 = verifier.loadProperties("target/config1.properties"); - assertEquals("maven-core-it", props1.getProperty("defaultParam")); - - Properties props2 = verifier.loadProperties("target/config2.properties"); - assertEquals("test", props2.getProperty("defaultParam")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4343MissingReleaseUpdatePolicyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4343MissingReleaseUpdatePolicyTest.java deleted file mode 100644 index b1cb5c3fb..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4343MissingReleaseUpdatePolicyTest.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import java.io.File; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Deque; -import java.util.Map; -import java.util.concurrent.ConcurrentLinkedDeque; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.server.Handler; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.AbstractHandler; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4343. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng4343MissingReleaseUpdatePolicyTest extends AbstractMavenIntegrationTestCase { - private Server server; - - private Deque requestedUris; - - private volatile boolean blockAccess; - - private int port; - - public MavenITmng4343MissingReleaseUpdatePolicyTest() { - super("[3.0-alpha-3,)"); - } - - @BeforeEach - protected void setUp() throws Exception { - Handler repoHandler = new AbstractHandler() { - @Override - public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) - throws IOException { - System.out.println("Handling " + request.getMethod() + " " + request.getRequestURL()); - - if (request.getRequestURI().startsWith("/org/apache/maven/its/mng4343")) { - requestedUris.add(request.getRequestURI().substring(29)); - } - - if (blockAccess) { - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - } else { - PrintWriter writer = response.getWriter(); - - response.setStatus(HttpServletResponse.SC_OK); - - if (request.getRequestURI().endsWith(".pom")) { - writer.println(""); - writer.println(" 4.0.0"); - writer.println(" org.apache.maven.its.mng4343"); - writer.println(" dep"); - writer.println(" 0.1"); - writer.println(""); - } else if (request.getRequestURI().endsWith(".jar")) { - writer.println("empty"); - } else if (request.getRequestURI().endsWith(".md5") - || request.getRequestURI().endsWith(".sha1")) { - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - } - } - - ((Request) request).setHandled(true); - } - }; - - server = new Server(0); - server.setHandler(repoHandler); - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + port); - requestedUris = new ConcurrentLinkedDeque<>(); - } - - @AfterEach - protected void tearDown() throws Exception { - if (server != null) { - server.stop(); - server.join(); - } - } - - /** - * Verify that checking for *missing* release artifacts respects the update policy that is configured in the - * release section for the respective repository, in this case "always". - * - * @throws Exception in case of failure - */ - @Test - public void testitAlways() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4343"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4343"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@updates@", "always"); - filterProps.put("@port@", Integer.toString(port)); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - - blockAccess = true; - - verifier.setLogFileName("log-always-1.txt"); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Build succeeded despite missing dependency"); - } catch (VerificationException e) { - // expected - } - - assertTrue( - requestedUris.toString(), - requestedUris.contains("/dep/0.1/dep-0.1.jar") || requestedUris.contains("/dep/0.1/dep-0.1.pom")); - requestedUris.clear(); - - blockAccess = false; - - verifier.setLogFileName("log-always-2.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - assertTrue(requestedUris.toString(), requestedUris.contains("/dep/0.1/dep-0.1.jar")); - assertTrue(requestedUris.toString(), requestedUris.contains("/dep/0.1/dep-0.1.pom")); - verifier.verifyArtifactPresent("org.apache.maven.its.mng4343", "dep", "0.1", "jar"); - verifier.verifyArtifactPresent("org.apache.maven.its.mng4343", "dep", "0.1", "pom"); - } - - /** - * Verify that checking for *missing* release artifacts respects the update policy that is configured in the - * release section for the respective repository, in this case "never", unless overridden from the CLI via -U. - * - * @throws Exception in case of failure - */ - @Test - public void testitNever() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4343"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4343"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@updates@", "never"); - filterProps.put("@port@", Integer.toString(port)); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - - blockAccess = true; - - verifier.setLogFileName("log-never-1.txt"); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Build succeeded despite missing dependency"); - } catch (VerificationException e) { - // expected - } - - assertTrue( - requestedUris.toString(), - requestedUris.contains("/dep/0.1/dep-0.1.jar") || requestedUris.contains("/dep/0.1/dep-0.1.pom")); - requestedUris.clear(); - - blockAccess = false; - - verifier.setLogFileName("log-never-2.txt"); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Remote repository was accessed despite updatePolicy=never"); - } catch (VerificationException e) { - // expected - } - - //noinspection unchecked - assertTrue(requestedUris.isEmpty()); - verifier.verifyArtifactNotPresent("org.apache.maven.its.mng4343", "dep", "0.1", "jar"); - verifier.verifyArtifactNotPresent("org.apache.maven.its.mng4343", "dep", "0.1", "pom"); - - verifier.setLogFileName("log-never-3.txt"); - verifier.addCliArgument("-U"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - assertTrue(requestedUris.contains("/dep/0.1/dep-0.1.jar")); - assertTrue(requestedUris.contains("/dep/0.1/dep-0.1.pom")); - verifier.verifyArtifactPresent("org.apache.maven.its.mng4343", "dep", "0.1", "jar"); - verifier.verifyArtifactPresent("org.apache.maven.its.mng4343", "dep", "0.1", "pom"); - - requestedUris.clear(); - - verifier.setLogFileName("log-never-4.txt"); - verifier.addCliArgument("-U"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - //noinspection unchecked - assertTrue(requestedUris.isEmpty()); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4344ManagedPluginExecutionOrderTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4344ManagedPluginExecutionOrderTest.java deleted file mode 100644 index aeefb9758..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4344ManagedPluginExecutionOrderTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Arrays; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4344. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4344ManagedPluginExecutionOrderTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4344ManagedPluginExecutionOrderTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that custom executions from managed plugins which are part of the default lifecycle bindings get - * executed after executions from plugins that are defined in the regular build section and bound to the - * same phase. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4344"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("process-resources"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List lines = verifier.loadLines("target/log.txt", "UTF-8"); - assertEquals(Arrays.asList(new String[] {"first", "second"}), lines); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4345DefaultPluginExecutionOrderTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4345DefaultPluginExecutionOrderTest.java deleted file mode 100644 index c7ad9a183..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4345DefaultPluginExecutionOrderTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Arrays; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4345. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4345DefaultPluginExecutionOrderTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4345DefaultPluginExecutionOrderTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that plugin executions contributed by default lifecycle mappings always execute first in the targeted - * lifecycle phase regardless of other plugin executions bound to the same phase and regardless of the POM - * order of plugin declarations. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4345"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("process-resources"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List lines = verifier.loadLines("target/log.txt", "UTF-8"); - assertEquals(Arrays.asList(new String[] {"first", "second"}), lines); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4347ImportScopeWithSettingsProfilesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4347ImportScopeWithSettingsProfilesTest.java deleted file mode 100644 index 849ed20e1..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4347ImportScopeWithSettingsProfilesTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4347. - * - * @author John Casey - */ -public class MavenITmng4347ImportScopeWithSettingsProfilesTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4347ImportScopeWithSettingsProfilesTest() { - super("(2.2.1,]"); - } - - /** - * Test that profiles from settings.xml will be used to resolve import-scoped dependency POMs. - * In this case, the settings profile enables snapshot resolution on the central repository, which - * is required to resolve the import-scoped POM with a SNAPSHOT version. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4347"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4347"); - - verifier.setAutoclean(false); - - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - - verifier.addCliArgument("validate"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4348NoUnnecessaryRepositoryAccessTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4348NoUnnecessaryRepositoryAccessTest.java deleted file mode 100644 index e3e655a93..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4348NoUnnecessaryRepositoryAccessTest.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import java.io.File; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.server.Handler; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.AbstractHandler; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4348. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng4348NoUnnecessaryRepositoryAccessTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4348NoUnnecessaryRepositoryAccessTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that the (remote) repos are not accessed during execution of a mojo that does not require dependency - * resolution. In detail, Maven should neither touch POMs, JARs nor metadata. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4348"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - - final List requestedUris = Collections.synchronizedList(new ArrayList<>()); - - Handler repoHandler = new AbstractHandler() { - @Override - public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { - System.out.println("Handling " + request.getMethod() + " " + request.getRequestURL()); - - // NOTE: Old Maven versions use the test repo also to check for plugin updates so we need to filter - if (request.getRequestURI().startsWith("/org/apache/maven/its/mng4348")) { - requestedUris.add(request.getRequestURI()); - } - - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - - ((Request) request).setHandled(true); - } - }; - - Server server = new Server(0); - server.setHandler(repoHandler); - - try { - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - int port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + port); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4348"); - verifier.deleteDirectory("target"); - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@port@", Integer.toString(port)); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } finally { - server.stop(); - server.join(); - } - - verifier.verifyFilePresent("target/touch.txt"); - assertEquals(new ArrayList(), requestedUris); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4349RelocatedArtifactWithInvalidPomTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4349RelocatedArtifactWithInvalidPomTest.java deleted file mode 100644 index d3ebea5c5..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4349RelocatedArtifactWithInvalidPomTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4349. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng4349RelocatedArtifactWithInvalidPomTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4349RelocatedArtifactWithInvalidPomTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that relocation to an artifact with an invalid POM fails gracefully and still uses the relocated JAR - * (instead of the JAR for the unrelocated artifact). - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4349"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4349"); - verifier.deleteDirectory("target"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List classpath = verifier.loadLines("target/classpath.txt", "UTF-8"); - assertTrue(classpath.toString(), classpath.contains("new-0.1.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4350LifecycleMappingExecutionOrderTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4350LifecycleMappingExecutionOrderTest.java deleted file mode 100644 index 5c59ed546..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4350LifecycleMappingExecutionOrderTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Arrays; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4350. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4350LifecycleMappingExecutionOrderTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4350LifecycleMappingExecutionOrderTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that multiple goals bound to the same phase by a lifecycle mapping execute in the order given by - * the lifecycle mapping. In particular, the order of plugin declarations in the POM should have no influence - * on the lifecycle mappings specified by the packaging. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4350"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("process-resources"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List lines = verifier.loadLines("target/log.txt", "UTF-8"); - assertEquals(Arrays.asList(new String[] {"first", "second"}), lines); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4353PluginDependencyResolutionFromPomRepoTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4353PluginDependencyResolutionFromPomRepoTest.java deleted file mode 100644 index 2957da278..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4353PluginDependencyResolutionFromPomRepoTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Map; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4353. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4353PluginDependencyResolutionFromPomRepoTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4353PluginDependencyResolutionFromPomRepoTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that repos given in a plugin's POM are considered while resolving the plugin dependencies. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4353") - .getCanonicalFile(); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4353"); - Map filterProps = verifier.newDefaultFilterMap(); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.filterFile( - "repo-1/org/apache/maven/its/mng4353/maven-mng4353-plugin/0.1/template.pom", - "repo-1/org/apache/maven/its/mng4353/maven-mng4353-plugin/0.1/maven-mng4353-plugin-0.1" + ".pom", - "UTF-8", - filterProps); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/touch.properties"); - assertEquals("passed", props.getProperty("test")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4355ExtensionAutomaticVersionResolutionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4355ExtensionAutomaticVersionResolutionTest.java deleted file mode 100644 index 965ff38f8..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4355ExtensionAutomaticVersionResolutionTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4355. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4355ExtensionAutomaticVersionResolutionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4355ExtensionAutomaticVersionResolutionTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that extension declarations in the POM without an explicit version get resolved to the last release - * version of the extension artifact. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4355"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4355"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4356NoNeedlessRelookupFromActiveCollectionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4356NoNeedlessRelookupFromActiveCollectionTest.java deleted file mode 100644 index 8db8694de..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4356NoNeedlessRelookupFromActiveCollectionTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4356. - * - * @author Benjamin Bentmann - */ -@Tag("disabled") -public class MavenITmng4356NoNeedlessRelookupFromActiveCollectionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4356NoNeedlessRelookupFromActiveCollectionTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that read operations on active collections of components do not cause a re-lookup of the components from - * the container which would prevent usage of stateful components that are usually instantiated per lookup. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4356"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/component.properties"); - assertEquals("2", props.getProperty("count")); - // the proper behavior of the collections is actually checked by the IT plugin, we merely check it was run - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4357LifecycleMappingDiscoveryInReactorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4357LifecycleMappingDiscoveryInReactorTest.java deleted file mode 100644 index 1375f4be6..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4357LifecycleMappingDiscoveryInReactorTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4357. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4357LifecycleMappingDiscoveryInReactorTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4357LifecycleMappingDiscoveryInReactorTest() { - super("[2.1.0,)"); - } - - /** - * Test that different projects in a reactor build can use different versions of the same extension. - * This should still hold true if the two versions of the extension provide the same set of components. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4357"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("mod-a/target"); - verifier.deleteDirectory("mod-b/target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4357"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("mod-a/target/old.txt"); - verifier.verifyFileNotPresent("mod-a/target/new.txt"); - - verifier.verifyFileNotPresent("mod-b/target/old.txt"); - verifier.verifyFilePresent("mod-b/target/new.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4359LocallyReachableParentOutsideOfReactorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4359LocallyReachableParentOutsideOfReactorTest.java deleted file mode 100644 index a7be6cc96..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4359LocallyReachableParentOutsideOfReactorTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4359. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4359LocallyReachableParentOutsideOfReactorTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4359LocallyReachableParentOutsideOfReactorTest() { - super("[2.0.7,)"); - } - - /** - * Verify that locally reachable parent POMs of projects in the reactor can be resolved during dependency - * resolution even if a parent itself is not part of the reactor. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4359"); - testDir = new File(testDir, "reactor-parent"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("mod-c/target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4359"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List cp = verifier.loadLines("mod-c/target/classpath.txt", "UTF-8"); - assertTrue(cp.toString(), cp.contains("mod-b/pom.xml")); - assertTrue(cp.toString(), cp.contains("mod-a/pom.xml")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4360WebDavSupportTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4360WebDavSupportTest.java deleted file mode 100644 index 4f2e43a00..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4360WebDavSupportTest.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import java.io.File; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.List; -import java.util.Map; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.server.Handler; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.AbstractHandler; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4360. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng4360WebDavSupportTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4360WebDavSupportTest() { - super("[2.1.0-M1,)"); - } - - /** - * Verify that WebDAV works in principle. This test is not actually concerned about proper transfers but more - * that the Jackrabbit based wagon can be properly loaded and doesn't die due to some class realm issue. - * - * @throws Exception in case of failure - */ - @Test - public void testitJackrabbitBasedImpl() throws Exception { - test("jackrabbit"); - } - - /** - * Verify that WebDAV works in principle. This test is not actually concerned about proper transfers but more - * that the Slide based wagon can be properly loaded and doesn't die due to some class realm issue. - * - * @throws Exception in case of failure - */ - @Test - public void testitSlideBasedImpl() throws Exception { - test("slide"); - } - - private void test(String project) throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4360"); - - testDir = new File(testDir, project); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - - Handler repoHandler = new AbstractHandler() { - @Override - public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) - throws IOException { - System.out.println("Handling " + request.getMethod() + " " + request.getRequestURL()); - - PrintWriter writer = response.getWriter(); - - response.setStatus(HttpServletResponse.SC_OK); - - if (request.getRequestURI().endsWith(".pom")) { - writer.println(""); - writer.println(" 4.0.0"); - writer.println(" org.apache.maven.its.mng4360"); - writer.println(" dep"); - writer.println(" 0.1"); - writer.println(""); - } else if (request.getRequestURI().endsWith(".jar")) { - writer.println("empty"); - } else if (request.getRequestURI().endsWith(".md5") - || request.getRequestURI().endsWith(".sha1")) { - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - } - - ((Request) request).setHandled(true); - } - }; - - Server server = new Server(0); - server.setHandler(repoHandler); - - try { - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - int port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + port); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4360"); - verifier.deleteDirectory("target"); - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@port@", Integer.toString(port)); - verifier.filterFile("../settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } finally { - server.stop(); - server.join(); - } - - List cp = verifier.loadLines("target/classpath.txt", "UTF-8"); - assertTrue(cp.toString(), cp.contains("dep-0.1.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4361ForceDependencySnapshotUpdateTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4361ForceDependencySnapshotUpdateTest.java deleted file mode 100644 index 3915c26a4..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4361ForceDependencySnapshotUpdateTest.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Map; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4361. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4361ForceDependencySnapshotUpdateTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4361ForceDependencySnapshotUpdateTest() { - super("[2.0,3.0-alpha-1),[3.0-alpha-4,)"); - } - - /** - * Verify that snapshot updates of dependencies can be forced from the command line via "-U". In more detail, - * this means updating the JAR and its accompanying hierarchy of POMs. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4361"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4361"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - - Map filterProps = verifier.newDefaultFilterMap(); - - filterProps.put("@repo@", "repo-1"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.setLogFileName("log-force-1.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - assertNull(verifier.loadProperties("target/checksum.properties").getProperty("b-0.1-SNAPSHOT.jar")); - - filterProps.put("@repo@", "repo-2"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.setLogFileName("log-force-2.txt"); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-U"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties checksums = verifier.loadProperties("target/checksum.properties"); - assertChecksum("2a22eeca91211193e927ea3b2ecdf56481585064", "a-0.1-SNAPSHOT.jar", checksums); - assertChecksum("ae352eb0047059b2e47fae397eb8ae6bd5b1c8ea", "b-0.1-SNAPSHOT.jar", checksums); - assertChecksum("6e6ef8590f166bcf610965c74c165128776214b9", "c-0.1-SNAPSHOT.jar", checksums); - } - - private void assertChecksum(String checksum, String jar, Properties checksums) { - assertEquals(checksum, checksums.getProperty(jar, "").toLowerCase(java.util.Locale.ENGLISH)); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4363DynamicAdditionOfDependencyArtifactTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4363DynamicAdditionOfDependencyArtifactTest.java deleted file mode 100644 index 6243cf991..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4363DynamicAdditionOfDependencyArtifactTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4363. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4363DynamicAdditionOfDependencyArtifactTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4363DynamicAdditionOfDependencyArtifactTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that plugins can dynamically add dependency artifacts to the project. Those added artifacts need to - * be resolved and added to the affected class paths for later goal executions. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4363"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4363"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("generate-sources"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List classpath = verifier.loadLines("target/classpath.txt", "UTF-8"); - assertTrue(classpath.toString(), classpath.contains("a-0.1.jar")); - assertTrue(classpath.toString(), classpath.contains("b-0.1.jar")); - assertTrue(classpath.toString(), classpath.contains("c-0.1.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4365XmlMarkupInAttributeValueTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4365XmlMarkupInAttributeValueTest.java deleted file mode 100644 index c142568c0..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4365XmlMarkupInAttributeValueTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4365. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4365XmlMarkupInAttributeValueTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4365XmlMarkupInAttributeValueTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that the POM parser doesn't choke on attribute values that contain entities which resolve to markup. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4365"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4367LayoutAwareMirrorSelectionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4367LayoutAwareMirrorSelectionTest.java deleted file mode 100644 index eb15cc870..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4367LayoutAwareMirrorSelectionTest.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Map; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4367. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4367LayoutAwareMirrorSelectionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4367LayoutAwareMirrorSelectionTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Test that mirror selection considers the repo layout if specified for the mirror. If {@code } is - * unspecified, should match any layout. - * - * @throws Exception in case of failure - */ - @Test - public void testitNoLayout() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4367"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4367"); - - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@repourl@", filterProps.get("@baseurl@") + "/void"); - filterProps.put("@mirrorurl@", filterProps.get("@baseurl@") + "/repo"); - filterProps.put("@layouts@", ""); - - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings-a.xml"); - verifier.filterFile("settings-template.xml", "settings-a.xml", "UTF-8", filterProps); - verifier.setLogFileName("log-a.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng4367", "dep", "0.1", "jar"); - } - - /** - * Test that mirror selection considers the repo layout if specified for the mirror. - * - * @throws Exception in case of failure - */ - @Test - public void testitSpecificLayouts() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4367"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4367"); - - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@repourl@", filterProps.get("@baseurl@") + "/void"); - filterProps.put("@mirrorurl@", filterProps.get("@baseurl@") + "/repo"); - filterProps.put("@layouts@", "default,legacy"); - - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings-b.xml"); - verifier.filterFile("settings-template.xml", "settings-b.xml", "UTF-8", filterProps); - verifier.setLogFileName("log-b.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng4367", "dep", "0.1", "jar"); - } - - /** - * Test that mirror selection considers the repo layout if specified for the mirror. - * - * @throws Exception in case of failure - */ - @Test - public void testitNonMatchingLayout() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4367"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4367"); - - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@repourl@", filterProps.get("@baseurl@") + "/repo"); - filterProps.put("@mirrorurl@", filterProps.get("@baseurl@") + "/void"); - filterProps.put("@layouts@", "foo"); - - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings-c.xml"); - verifier.filterFile("settings-template.xml", "settings-c.xml", "UTF-8", filterProps); - verifier.setLogFileName("log-c.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng4367", "dep", "0.1", "jar"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4368TimestampAwareArtifactInstallerTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4368TimestampAwareArtifactInstallerTest.java deleted file mode 100644 index b58ea201a..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4368TimestampAwareArtifactInstallerTest.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.utils.io.FileUtils; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4368. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4368TimestampAwareArtifactInstallerTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4368TimestampAwareArtifactInstallerTest() { - super("[2.0.3,3.0-alpha-1),[3.0-alpha-6,)"); - } - - /** - * Verify that the artifact installer copies POMs to the local repo even if they have an older timestamp as the - * copy in the local repo. - * - * @throws Exception in case of failure - */ - @Test - public void testitPomPackaging() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4368/pom"); - - File aDir = new File(testDir, "branch-a"); - File aPom = new File(aDir, "pom.xml"); - File bDir = new File(testDir, "branch-b"); - File bPom = new File(bDir, "pom.xml"); - - aPom.setLastModified(System.currentTimeMillis()); - bPom.setLastModified(aPom.lastModified() - 1000 * 60); - - Verifier verifier = newVerifier(aDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4368"); - verifier.addCliArgument("initialize"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - File installedPom = - new File(verifier.getArtifactPath("org.apache.maven.its.mng4368", "test", "0.1-SNAPSHOT", "pom")); - - String pom = FileUtils.fileRead(installedPom, "UTF-8"); - assertTrue(pom.indexOf("Branch-A") > 0); - assertFalse(pom.contains("Branch-B")); - - assertEquals(aPom.length(), bPom.length()); - assertTrue(aPom.lastModified() > bPom.lastModified()); - assertTrue(installedPom.lastModified() > bPom.lastModified()); - - verifier = newVerifier(bDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("initialize"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - pom = FileUtils.fileRead(installedPom, "UTF-8"); - assertFalse(pom.contains("Branch-A")); - assertTrue(pom.indexOf("Branch-B") > 0); - } - - /** - * Verify that the artifact installer copies files to the local repo only if their timestamp differs from the copy - * already in the local repo. - * - * @throws Exception in case of failure - */ - @Test - public void testitJarPackaging() throws Exception { - requiresMavenVersion("[2.2.2,3.0-alpha-1),[3.0-alpha-6,)"); - - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4368/jar"); - - File aDir = new File(testDir, "branch-a"); - File aArtifact = new File(aDir, "artifact.jar"); - File bDir = new File(testDir, "branch-b"); - File bArtifact = new File(bDir, "artifact.jar"); - - FileUtils.fileWrite(aArtifact.getPath(), "UTF-8", "from Branch-A"); - aArtifact.setLastModified(System.currentTimeMillis()); - FileUtils.fileWrite(bArtifact.getPath(), "UTF-8", "from Branch-B"); - bArtifact.setLastModified(aArtifact.lastModified() - 1000 * 60); - - Verifier verifier = newVerifier(aDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4368"); - verifier.addCliArgument("initialize"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - File installedArtifact = - new File(verifier.getArtifactPath("org.apache.maven.its.mng4368", "test", "0.1-SNAPSHOT", "jar")); - - String data = FileUtils.fileRead(installedArtifact, "UTF-8"); - assertTrue(data.indexOf("Branch-A") > 0); - assertFalse(data.contains("Branch-B")); - - assertEquals(aArtifact.length(), bArtifact.length()); - assertTrue(aArtifact.lastModified() > bArtifact.lastModified()); - assertTrue(installedArtifact.lastModified() > bArtifact.lastModified()); - - verifier = newVerifier(bDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("initialize"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - data = FileUtils.fileRead(installedArtifact, "UTF-8"); - assertFalse(data.contains("Branch-A")); - assertTrue(data.indexOf("Branch-B") > 0); - - long lastModified = installedArtifact.lastModified(); - FileUtils.fileWrite(installedArtifact.getPath(), "UTF-8", "from Branch-C"); - installedArtifact.setLastModified(lastModified); - - verifier = newVerifier(bDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.setLogFileName("log-b.txt"); - verifier.addCliArgument("initialize"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - data = FileUtils.fileRead(installedArtifact, "UTF-8"); - assertFalse(data.contains("Branch-B")); - assertTrue(data.indexOf("Branch-C") > 0); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4379TransitiveSystemPathInterpolatedWithEnvVarTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4379TransitiveSystemPathInterpolatedWithEnvVarTest.java deleted file mode 100644 index 733eeb80b..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4379TransitiveSystemPathInterpolatedWithEnvVarTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4379. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4379TransitiveSystemPathInterpolatedWithEnvVarTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4379TransitiveSystemPathInterpolatedWithEnvVarTest() { - super("[2.0.3,2.1.0),[3.0-alpha-6,)"); - } - - /** - * Test that the path of a system-scope dependency gets interpolated using environment variables during - * transitive dependency resolution. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4379"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4379"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.setEnvironmentVariable("MNG_4379_HOME", testDir.getAbsolutePath()); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArguments("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List classpath = verifier.loadLines("target/classpath.txt", "UTF-8"); - assertTrue(classpath.toString(), classpath.contains("pom.xml")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4381ExtensionSingletonComponentTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4381ExtensionSingletonComponentTest.java deleted file mode 100644 index 31144f85d..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4381ExtensionSingletonComponentTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4381. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4381ExtensionSingletonComponentTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4381ExtensionSingletonComponentTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Test that extension plugins can contribute non-core components that can be accessed by other plugins in the same - * project and in projects with the same extension. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4381"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("sub-a/target"); - verifier.deleteDirectory("sub-b/target"); - verifier.addCliArgument("initialize"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("sub-b/target/singleton.properties"); - assertEquals("called", props.getProperty("sub-a-provider")); - assertEquals("called", props.getProperty("sub-a-consumer")); - assertEquals("called", props.getProperty("sub-b-provider")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4383ValidDependencyVersionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4383ValidDependencyVersionTest.java deleted file mode 100644 index b697ad3fd..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4383ValidDependencyVersionTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4383. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4383ValidDependencyVersionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4383ValidDependencyVersionTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Test that non-interpolated dependency versions cause a validation error during building. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4383"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Invalid dependency version did not cause validation error"); - } catch (VerificationException e) { - // expected - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4385LifecycleMappingFromExtensionInReactorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4385LifecycleMappingFromExtensionInReactorTest.java deleted file mode 100644 index 1089773e5..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4385LifecycleMappingFromExtensionInReactorTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4385. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4385LifecycleMappingFromExtensionInReactorTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4385LifecycleMappingFromExtensionInReactorTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that custom lifecycle mappings contributed by build extensions of one project do not leak into other - * projects in the reactor. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4385"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Build leaked lifecycle mapping from extension of first project into second project!"); - } catch (VerificationException e) { - // expected, should fail - String msg = e.getMessage(); - - assertTrue("Failure should be due to unknown packaging", msg.contains("Unknown packaging: it-packaging")); - assertTrue( - "Failure should be due to sub-b project", - msg.contains("The project org.apache.maven.its.mng4385:sub-b:0.1")); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4386DebugLoggingTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4386DebugLoggingTest.java deleted file mode 100644 index acdde6da2..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4386DebugLoggingTest.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4386. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4386DebugLoggingTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4386DebugLoggingTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that the CLI flag -X enables debug logging. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4386"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-X"); - verifier.setLogFileName("log.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List lines = verifier.loadLines("log.txt", "UTF-8"); - - boolean debug = false; - for (String line : lines) { - if (line.startsWith("[DEBUG")) { - debug = true; - break; - } - } - - assertTrue(lines.toString(), debug); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4387QuietLoggingTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4387QuietLoggingTest.java deleted file mode 100644 index dcedb6180..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4387QuietLoggingTest.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4387. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4387QuietLoggingTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4387QuietLoggingTest() { - super("[2.0.5,)"); - } - - /** - * Test that the CLI flag -q enables quiet logging, i.e. suppresses log levels below ERROR. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4387"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("-q"); - verifier.setLogFileName("log.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List lines = verifier.loadLines("log.txt", "UTF-8"); - - for (Iterator it = lines.iterator(); it.hasNext(); ) { - String line = it.next(); - if (line.startsWith("+") || line.startsWith("EMMA")) { - it.remove(); - } - } - - assertEquals(Collections.EMPTY_LIST, lines); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4393ParseExternalParenPomLenientTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4393ParseExternalParenPomLenientTest.java deleted file mode 100644 index d68acfef8..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4393ParseExternalParenPomLenientTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4393. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4393ParseExternalParenPomLenientTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4393ParseExternalParenPomLenientTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that parent POMs get parsed in lenient mode when resolved from the repository. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4393"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4393"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4396AntBased20xMojoSupportTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4396AntBased20xMojoSupportTest.java deleted file mode 100644 index 4e8ee0661..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4396AntBased20xMojoSupportTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4396. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4396AntBased20xMojoSupportTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4396AntBased20xMojoSupportTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that plugins whose mojos are implemented as Ant scripts and use the Maven 2.0.x Ant support can be - * invoked. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4396"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/ant.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4400RepositoryOrderTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4400RepositoryOrderTest.java deleted file mode 100644 index 4b7d26dd8..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4400RepositoryOrderTest.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4400. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4400RepositoryOrderTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4400RepositoryOrderTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that repositories declared in the settings.xml are accessed in their declaration order. - * - * @throws Exception in case of failure - */ - @Test - public void testitSettingsRepos() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4400"); - - Verifier verifier = newVerifier(new File(testDir, "settings").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4400"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties checksums = verifier.loadProperties("target/checksum.properties"); - assertChecksum("d0a4998ff37a55f8de1dffccdff826eca365400f", checksums); - } - - /** - * Verify that repositories declared in the POM are accessed in their declaration order. - * - * @throws Exception in case of failure - */ - @Test - public void testitPomRepos() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4400"); - - Verifier verifier = newVerifier(new File(testDir, "pom").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4400"); - verifier.filterFile("pom-template.xml", "pom.xml", "UTF-8"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties checksums = verifier.loadProperties("target/checksum.properties"); - assertChecksum("d0a4998ff37a55f8de1dffccdff826eca365400f", checksums); - } - - private void assertChecksum(String checksum, Properties checksums) { - assertEquals(checksum, checksums.getProperty("dep-0.1.jar").toLowerCase(java.util.Locale.ENGLISH)); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4401RepositoryOrderForParentPomTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4401RepositoryOrderForParentPomTest.java deleted file mode 100644 index 751fc3d8e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4401RepositoryOrderForParentPomTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4401. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4401RepositoryOrderForParentPomTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4401RepositoryOrderForParentPomTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that the implicit default repo (central) is tried after explicitly declared repos during parent POM - * resolution. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4401"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4401"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/passed.txt"); - verifier.verifyFileNotPresent("target/failed.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4402DuplicateChildModuleTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4402DuplicateChildModuleTest.java deleted file mode 100644 index c24130de0..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4402DuplicateChildModuleTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4402. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4402DuplicateChildModuleTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4402DuplicateChildModuleTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Verify that duplicate declarations of child modules cause a model validation error during project building. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4402"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-N"); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Duplicate child module did not cause validation error"); - } catch (VerificationException e) { - // expected - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4403LenientDependencyPomParsingTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4403LenientDependencyPomParsingTest.java deleted file mode 100644 index bafcb7440..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4403LenientDependencyPomParsingTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4403. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4403LenientDependencyPomParsingTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4403LenientDependencyPomParsingTest() { - super("[2.0.3,3.0-alpha-1),[3.0-beta-2,)"); - } - - /** - * Test that dependency POMs are only subject to minimal validation during metadata retrieval, i.e. Maven should - * ignore most kinds of badness and make a best effort at getting the metadata. Of particular interest is also, - * how Maven deals with duplicate dependency declarations. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4403"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4403"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List artifacts = verifier.loadLines("target/artifacts.txt", "UTF-8"); - Collections.sort(artifacts); - - List expected = new ArrayList<>(); - expected.add("org.apache.maven.its.mng4403:a:jar:0.1"); - expected.add("org.apache.maven.its.mng4403:b:jar:0.1"); - expected.add("org.apache.maven.its.mng4403:c:jar:0.1"); - - assertEquals(expected, artifacts); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4404UniqueProfileIdTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4404UniqueProfileIdTest.java deleted file mode 100644 index 246e21744..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4404UniqueProfileIdTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4404. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4404UniqueProfileIdTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4404UniqueProfileIdTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Verify that non-unique profile ids cause a model validation error during project building. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4404"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Duplicate profile id did not cause validation error"); - } catch (VerificationException e) { - // expected - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4405ValidPluginVersionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4405ValidPluginVersionTest.java deleted file mode 100644 index 7470977e7..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4405ValidPluginVersionTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4405. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4405ValidPluginVersionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4405ValidPluginVersionTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Test that non-interpolated plugin versions cause a validation error during building. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4405"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Invalid plugin version did not cause validation error"); - } catch (VerificationException e) { - // expected - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4408NonExistentSettingsFileTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4408NonExistentSettingsFileTest.java deleted file mode 100644 index 450ae9cde..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4408NonExistentSettingsFileTest.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4408. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4408NonExistentSettingsFileTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4408NonExistentSettingsFileTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Verify that the build fails when the user specifies a non-existing user settings file on the CLI. - * - * @throws Exception in case of failure - */ - @Test - public void testitUserSettings() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4408"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.setLogFileName("log-user.txt"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("non-existing-settings.xml"); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Missing settings file did not cause build error"); - } catch (VerificationException e) { - // expected - } - } - - /** - * Verify that the build fails when the user specifies a non-existing global settings file on the CLI. - * - * @throws Exception in case of failure - */ - @Test - public void testitGlobalSettings() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4408"); - - Verifier verifier = new Verifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.setLogFileName("log-global.txt"); - verifier.addCliArgument("--global-settings"); - verifier.addCliArgument("non-existing-settings.xml"); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Missing settings file did not cause build error"); - } catch (VerificationException e) { - // expected - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4410UsageHelpTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4410UsageHelpTest.java deleted file mode 100644 index a583088f0..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4410UsageHelpTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4410. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4410UsageHelpTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4410UsageHelpTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that "mvn --help" outputs the usage help and stops the execution after that. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4410"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("--help"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyTextInLog("--version"); - verifier.verifyTextInLog("--debug"); - verifier.verifyTextInLog("--batch-mode"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4411VersionInfoTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4411VersionInfoTest.java deleted file mode 100644 index 202605539..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4411VersionInfoTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4411. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4411VersionInfoTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4411VersionInfoTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that "mvn --version" outputs the Maven version and stops the execution after that. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4411"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("--version"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyTextInLog("Maven"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4412OfflineModeInPluginTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4412OfflineModeInPluginTest.java deleted file mode 100644 index ba09fe6eb..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4412OfflineModeInPluginTest.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4412. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4412OfflineModeInPluginTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4412OfflineModeInPluginTest() { - super("[2.0,3.0-alpha-1),[3.0-alpha-4,)"); - } - - /** - * Verify that plugins using the 2.x style artifact resolver directly are subject to the offline mode of the - * current Maven session. - * - * @throws Exception in case of failure - */ - @Test - public void testitResolver() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4412"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4412"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("-Presolver"); - verifier.addCliArgument("--offline"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.setLogFileName("log-resolver.txt"); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Plugin could resolve artifact from remote repository despite Maven being offline"); - } catch (VerificationException e) { - // expected - } - } - - /** - * Verify that plugins using the 2.x style artifact collector directly are subject to the offline mode of the - * current Maven session. - * - * @throws Exception in case of failure - */ - @Test - public void testitCollector() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4412"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4412"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("-Pcollector"); - verifier.addCliArgument("--offline"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.setLogFileName("log-collector.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactNotPresent("org.apache.maven.its.mng4412", "dep", "0.1", "pom"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4413MirroringOfDependencyRepoTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4413MirroringOfDependencyRepoTest.java deleted file mode 100644 index 00e36f68e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4413MirroringOfDependencyRepoTest.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Map; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.security.ConstraintMapping; -import org.eclipse.jetty.security.ConstraintSecurityHandler; -import org.eclipse.jetty.security.HashLoginService; -import org.eclipse.jetty.security.UserStore; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.DefaultHandler; -import org.eclipse.jetty.server.handler.HandlerList; -import org.eclipse.jetty.server.handler.ResourceHandler; -import org.eclipse.jetty.util.security.Constraint; -import org.eclipse.jetty.util.security.Password; -import org.junit.jupiter.api.Test; - -import static org.eclipse.jetty.util.security.Constraint.__BASIC_AUTH; - -/** - * This is a test set for MNG-4413. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4413MirroringOfDependencyRepoTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4413MirroringOfDependencyRepoTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that repositories contributed by dependency POMs during transitive dependency resolution are subject to - * mirror and authentication configuration. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4413"); - - Constraint constraint = new Constraint(); - constraint.setName(Constraint.__BASIC_AUTH); - constraint.setRoles(new String[] {"user"}); - constraint.setAuthenticate(true); - - ConstraintMapping constraintMapping = new ConstraintMapping(); - constraintMapping.setConstraint(constraint); - constraintMapping.setPathSpec("/*"); - - HashLoginService userRealm = new HashLoginService("TestRealm"); - UserStore userStore = new UserStore(); - userStore.addUser("testuser", new Password("testtest"), new String[] {"user"}); - userRealm.setUserStore(userStore); - - Server server = new Server(0); - ConstraintSecurityHandler securityHandler = new ConstraintSecurityHandler(); - securityHandler.setLoginService(userRealm); - securityHandler.setAuthMethod(__BASIC_AUTH); - securityHandler.setConstraintMappings(new ConstraintMapping[] {constraintMapping}); - - ResourceHandler repoHandler = new ResourceHandler(); - repoHandler.setResourceBase(new File(testDir, "repo-a").getAbsolutePath()); - - HandlerList handlerList = new HandlerList(); - handlerList.addHandler(securityHandler); - handlerList.addHandler(repoHandler); - handlerList.addHandler(new DefaultHandler()); - - server.setHandler(handlerList); - - try { - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - int port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + port); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4413"); - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@port@", Integer.toString(port)); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng4413", "a", "0.1", "jar"); - } finally { - server.stop(); - server.join(); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4415InheritedPluginOrderTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4415InheritedPluginOrderTest.java deleted file mode 100644 index 626c1f3cf..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4415InheritedPluginOrderTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4415. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4415InheritedPluginOrderTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4415InheritedPluginOrderTest() { - super("[2.0.5,)"); - } - - /** - * Test that merging of plugins during inheritance follows these rules regarding ordering: - * {@code parent: X -> A -> B -> D -> E - * child: Y -> A -> C -> D -> F - * result: X -> Y -> A -> B -> C -> D -> E -> F} - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4415"); - - Verifier verifier = newVerifier(new File(testDir, "sub").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/it.properties"); - assertNotNull(props.getProperty("project.build.plugins")); - - List expected = new ArrayList<>(); - expected.add("maven-it-plugin-error"); - expected.add("maven-it-plugin-configuration"); - expected.add("maven-it-plugin-dependency-resolution"); - expected.add("maven-it-plugin-packaging"); - expected.add("maven-it-plugin-log-file"); - expected.add("maven-it-plugin-expression"); - expected.add("maven-it-plugin-fork"); - expected.add("maven-it-plugin-touch"); - - List actual = new ArrayList<>(); - - int count = Integer.parseInt(props.getProperty("project.build.plugins")); - for (int i = 0; i < count; i++) { - actual.add(props.getProperty("project.build.plugins." + i + ".artifactId")); - } - - actual.retainAll(expected); - - assertEquals(actual, expected); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4416PluginOrderAfterProfileInjectionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4416PluginOrderAfterProfileInjectionTest.java deleted file mode 100644 index 32f1b0df7..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4416PluginOrderAfterProfileInjectionTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4416. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4416PluginOrderAfterProfileInjectionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4416PluginOrderAfterProfileInjectionTest() { - super("[2.0.5,)"); - } - - /** - * Test that merging of plugins during profile injection follows these rules regarding ordering: - * {@code model: X -> A -> B -> D -> E - * profile: Y -> A -> C -> D -> F - * result: X -> Y -> A -> B -> C -> D -> E -> F} - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4416"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/it.properties"); - assertNotNull(props.getProperty("project.build.plugins")); - - List expected = new ArrayList<>(); - expected.add("maven-it-plugin-error"); - expected.add("maven-it-plugin-configuration"); - expected.add("maven-it-plugin-dependency-resolution"); - expected.add("maven-it-plugin-packaging"); - expected.add("maven-it-plugin-log-file"); - expected.add("maven-it-plugin-expression"); - expected.add("maven-it-plugin-fork"); - expected.add("maven-it-plugin-touch"); - - List actual = new ArrayList<>(); - - int count = Integer.parseInt(props.getProperty("project.build.plugins")); - for (int i = 0; i < count; i++) { - actual.add(props.getProperty("project.build.plugins." + i + ".artifactId")); - } - - actual.retainAll(expected); - - assertEquals(actual, expected); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4421DeprecatedPomInterpolationExpressionsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4421DeprecatedPomInterpolationExpressionsTest.java deleted file mode 100644 index 9248b3cb1..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4421DeprecatedPomInterpolationExpressionsTest.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4421. - * - * But MNG-7244 removes the deprecation of - * pom.X. - * See {@link MavenITmng7244IgnorePomPrefixInExpressions}. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4421DeprecatedPomInterpolationExpressionsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4421DeprecatedPomInterpolationExpressionsTest() { - super("[3.0-alpha-3,4.0.0-alpha-1)"); - } - - /** - * Test that expressions of the form ${pom.*} and {*} referring to the model cause build warnings. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4421"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - assertEquals("0.1", props.getProperty("project.properties.property1")); - assertEquals("0.1", props.getProperty("project.properties.property2")); - - List lines = verifier.loadLines("log.txt", null); - - boolean warnedPomPrefix = false; - boolean warnedEmptyPrefix = false; - - for (String line : lines) { - if (line.startsWith("[WARN")) { - if (line.contains("${pom.version}")) { - warnedPomPrefix = true; - } - if (line.contains("${version}")) { - warnedEmptyPrefix = true; - } - } - } - - assertTrue(warnedPomPrefix); - assertTrue(warnedEmptyPrefix); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4422PluginExecutionPhaseInterpolationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4422PluginExecutionPhaseInterpolationTest.java deleted file mode 100644 index 805e6b6b7..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4422PluginExecutionPhaseInterpolationTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4422. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4422PluginExecutionPhaseInterpolationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4422PluginExecutionPhaseInterpolationTest() { - super("[2.0,2.1.0),[2.2.2,)"); - } - - /** - * Test that the phase of plugin executions can be interpolated. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4422"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4423SessionDataFromPluginParameterExpressionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4423SessionDataFromPluginParameterExpressionTest.java deleted file mode 100644 index c2f018fc7..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4423SessionDataFromPluginParameterExpressionTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4423. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4423SessionDataFromPluginParameterExpressionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4423SessionDataFromPluginParameterExpressionTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Test that plugin parameter expressions like ${session.*} work and not only ${session}. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4423"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.getSystemProperties().setProperty("mng4423", "PASSED"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/config.properties"); - assertEquals("PASSED", props.getProperty("propertiesParam.mng4423")); - assertNotNull(props.getProperty("propertiesParam.java.home")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4428FollowHttpRedirectTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4428FollowHttpRedirectTest.java deleted file mode 100644 index ea36daf04..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4428FollowHttpRedirectTest.java +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import java.io.File; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.List; -import java.util.Map; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.server.Connector; -import org.eclipse.jetty.server.HttpConfiguration; -import org.eclipse.jetty.server.HttpConnectionFactory; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.SecureRequestCustomizer; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.ServerConnector; -import org.eclipse.jetty.server.SslConnectionFactory; -import org.eclipse.jetty.server.handler.AbstractHandler; -import org.eclipse.jetty.util.ssl.SslContextFactory; -import org.junit.jupiter.api.Test; - -import static org.eclipse.jetty.http.HttpVersion.HTTP_1_1; - -/** - * This is a test set for MNG-4428. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng4428FollowHttpRedirectTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4428FollowHttpRedirectTest() { - super("[2.0.3,3.0-alpha-1),(3.0-alpha-1,)"); - } - - /** - * Verify that redirects from HTTP to HTTP are getting followed. - * - * @throws Exception in case of failure - */ - @Test - public void testitHttpToHttp() throws Exception { - testit(true, true); - } - - /** - * Verify that redirects from HTTPS to HTTPS are getting followed. - * - * @throws Exception in case of failure - */ - @Test - public void testitHttpsToHttps() throws Exception { - testit(false, false); - } - - /** - * Verify that redirects using a relative location URL are getting followed. While a relative URL violates the - * HTTP spec, popular HTTP clients do support them so we better do, too. - * - * @throws Exception in case of failure - */ - @Test - public void testitRelativeLocation() throws Exception { - testit(true, true, true); - } - - private void testit(boolean fromHttp, boolean toHttp) throws Exception { - testit(fromHttp, toHttp, false); - } - - private void testit(boolean fromHttp, boolean toHttp, boolean relativeLocation) throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4428"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - - // NOTE: trust store cannot be reliably configured for the current JVM - verifier.setForkJvm(true); - - // keytool -genkey -alias localhost -keypass key-passwd -keystore keystore -storepass store-passwd \ - // -validity 4096 -dname "cn=localhost, ou=None, L=Seattle, ST=Washington, o=ExampleOrg, c=US" -keyalg RSA - String storePath = new File(testDir, "keystore").getAbsolutePath(); - String storePwd = "store-passwd"; - String keyPwd = "key-passwd"; - - Server server = new Server(0); - addHttpsConnector(server, storePath, storePwd, keyPwd); - Connector from = server.getConnectors()[fromHttp ? 0 : 1]; - Connector to = server.getConnectors()[toHttp ? 0 : 1]; - server.setHandler( - new RedirectHandler(toHttp ? "http" : "https", relativeLocation ? null : (NetworkConnector) to)); - - try { - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4428"); - verifier.deleteDirectory("target"); - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@protocol@", fromHttp ? "http" : "https"); - filterProps.put("@port@", Integer.toString(((NetworkConnector) from).getLocalPort())); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.addCliArgument("-X"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.setEnvironmentVariable( - "MAVEN_OPTS", - "-Djavax.net.ssl.trustStore=" + storePath + " -Djavax.net.ssl.trustStorePassword=" + storePwd); - verifier.setLogFileName("log-" + getName().substring(6) + ".txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } finally { - server.stop(); - server.join(); - } - - List cp = verifier.loadLines("target/classpath.txt", "UTF-8"); - assertTrue(cp.toString(), cp.contains("dep-0.1.jar")); - } - - private void addHttpsConnector(Server server, String keyStorePath, String keyStorePassword, String keyPassword) { - SslContextFactory sslContextFactory = new SslContextFactory(keyStorePath); - sslContextFactory.setKeyStorePassword(keyStorePassword); - sslContextFactory.setKeyManagerPassword(keyPassword); - HttpConfiguration httpConfiguration = new HttpConfiguration(); - httpConfiguration.setSecureScheme("https"); - HttpConfiguration httpsConfiguration = new HttpConfiguration(httpConfiguration); - httpsConfiguration.addCustomizer(new SecureRequestCustomizer()); - ServerConnector httpsConnector = new ServerConnector( - server, - new SslConnectionFactory(sslContextFactory, HTTP_1_1.asString()), - new HttpConnectionFactory(httpsConfiguration)); - server.addConnector(httpsConnector); - } - - static class RedirectHandler extends AbstractHandler { - private final String protocol; - - private final NetworkConnector connector; - - RedirectHandler(String protocol, NetworkConnector connector) { - this.protocol = protocol; - this.connector = connector; - } - - public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) - throws IOException { - System.out.println("Handling " + request.getMethod() + " " + request.getRequestURL()); - - PrintWriter writer = response.getWriter(); - - String uri = request.getRequestURI(); - if (uri.startsWith("/repo/")) { - String location = "/redirected/" + uri.substring(6); - if (protocol != null && connector != null) { - location = protocol + "://localhost:" + connector.getLocalPort() + location; - } - if (uri.endsWith(".pom")) { - response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY); - } else { - response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY); - } - response.setHeader("Location", location); - } else if (uri.endsWith(".pom")) { - writer.println(""); - writer.println(" 4.0.0"); - writer.println(" org.apache.maven.its.mng4428"); - writer.println(" dep"); - writer.println(" 0.1"); - writer.println(""); - response.setStatus(HttpServletResponse.SC_OK); - } else if (uri.endsWith(".jar")) { - writer.println("empty"); - response.setStatus(HttpServletResponse.SC_OK); - } else { - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - } - - ((Request) request).setHandled(true); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4429CompRequirementOnNonDefaultImplTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4429CompRequirementOnNonDefaultImplTest.java deleted file mode 100644 index 09a94107c..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4429CompRequirementOnNonDefaultImplTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4429. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4429CompRequirementOnNonDefaultImplTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4429CompRequirementOnNonDefaultImplTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that a component requirement can be satisfied from an implementation that does not have the "default" hint. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4429"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/comp.properties"); - assertEquals("concrete", props.getProperty("id")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4430DistributionManagementStatusTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4430DistributionManagementStatusTest.java deleted file mode 100644 index 29efcd5df..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4430DistributionManagementStatusTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4430. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4430DistributionManagementStatusTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4430DistributionManagementStatusTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Test that presence of status field in distribution management of a local project POM causes a validation error, - * this field is only allowed for POMs from the repo. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4430"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Distribution management status did not cause validation error"); - } catch (VerificationException e) { - // expected - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4433ForceParentSnapshotUpdateTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4433ForceParentSnapshotUpdateTest.java deleted file mode 100644 index 6d64a57e6..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4433ForceParentSnapshotUpdateTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Map; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4433. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4433ForceParentSnapshotUpdateTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4433ForceParentSnapshotUpdateTest() { - super("[2.0,3.0-alpha-1),[3.0-alpha-4,)"); - } - - /** - * Verify that snapshot updates of parent POMs can be forced from the command line via "-U". - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4433"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4433"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - - Map filterProps = verifier.newDefaultFilterMap(); - - filterProps.put("@repo@", "repo-1"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.setLogFileName("log-force-1.txt"); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/old.txt"); - verifier.verifyFileNotPresent("target/new.txt"); - - filterProps.put("@repo@", "repo-2"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.setLogFileName("log-force-2.txt"); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-U"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFileNotPresent("target/old.txt"); - verifier.verifyFilePresent("target/new.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4436SingletonComponentLookupTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4436SingletonComponentLookupTest.java deleted file mode 100644 index c0fc80c97..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4436SingletonComponentLookupTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4436. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4436SingletonComponentLookupTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4436SingletonComponentLookupTest() { - super("[3.0-alpha-4,)"); - } - - /** - * Test that lookup of a singleton component works reliably. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4436"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/comp.properties"); - - assertTrue(props.getProperty("id.0", "").length() > 0); - - assertEquals(props.getProperty("id.0"), props.getProperty("id.1")); - assertEquals(props.getProperty("id.1"), props.getProperty("id.2")); - assertEquals(props.getProperty("id.2"), props.getProperty("id.3")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4450StubModelForMissingDependencyPomTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4450StubModelForMissingDependencyPomTest.java deleted file mode 100644 index 60aa1db9c..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4450StubModelForMissingDependencyPomTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4450. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4450StubModelForMissingDependencyPomTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4450StubModelForMissingDependencyPomTest() { - super("[2.0.3,3.0-alpha-1),[3.0-alpha-5,)"); - } - - /** - * Verify that building missing POMs for dependencies fails gracefully with a stub model. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4450"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4450"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - - // NOTE: Some Maven versions generate faulty packaging for the stub model (always "pom"), not our business here - assertEquals( - "org.apache.maven.its.mng4450:missing:jar:0.1", - props.getProperty("org.apache.maven.its.mng4450:missing:jar:0.1.project.id") - .replaceAll("pom", "jar")); - assertEquals( - "org.apache.maven.its.mng4450:missing:jar:0.1", - props.getProperty("org.apache.maven.its.mng4450:missing:jar:0.1.artifact.id") - .replaceAll("pom", "jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4452ResolutionOfSnapshotWithClassifierTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4452ResolutionOfSnapshotWithClassifierTest.java deleted file mode 100644 index f37242ff3..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4452ResolutionOfSnapshotWithClassifierTest.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4452. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4452ResolutionOfSnapshotWithClassifierTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4452ResolutionOfSnapshotWithClassifierTest() { - super("[3.0-beta-4,)"); - } - - /** - * Test that snapshot artifacts with classifiers can be successfully resolved from remote repos with (unique - * snapshots) when the last deployment to that repo didn't include that particular classifier. In other words, - * the metadata in the repository needs to properly keep track of all snapshots and not just the last deployed - * one. The same goes for snapshots that differ only by file extension. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4452"); - - Verifier verifier = newVerifier(new File(testDir, "producer").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4452"); - verifier.addCliArgument("-Dmng4452.type=jar"); - verifier.addCliArgument("-Dmng4452.classifier=unix"); - verifier.setLogFileName("log-1.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - verifier.addCliArgument("-Dmng4452.type=jar"); - verifier.addCliArgument("-Dmng4452.classifier=win"); - verifier.setLogFileName("log-2.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - verifier.addCliArgument("-Dmng4452.type=war"); - verifier.addCliArgument("-Dmng4452.classifier=win"); - verifier.setLogFileName("log-3.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(new File(testDir, "consumer").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4452"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List artifacts = verifier.loadLines("target/artifacts.txt", "UTF-8"); - assertTrue( - artifacts.toString(), - artifacts.contains("org.apache.maven.its.mng4452:producer:jar:unix:0.1-SNAPSHOT")); - assertTrue( - artifacts.toString(), artifacts.contains("org.apache.maven.its.mng4452:producer:jar:win:0.1-SNAPSHOT")); - assertTrue( - artifacts.toString(), artifacts.contains("org.apache.maven.its.mng4452:producer:war:win:0.1-SNAPSHOT")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4453PluginVersionFromLifecycleMappingTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4453PluginVersionFromLifecycleMappingTest.java deleted file mode 100644 index 1358df786..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4453PluginVersionFromLifecycleMappingTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4453. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4453PluginVersionFromLifecycleMappingTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4453PluginVersionFromLifecycleMappingTest() { - super("[2.0.3,3.0-alpha-1),[3.0-beta-1,)"); - } - - /** - * Verify that plugin versions given by the lifecycle mapping are respected, even if those differ from the version - * defined in the plugin management section inherited from the super POM. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4453"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("process-resources"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/resources-resources.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4459InMemorySettingsKeptEncryptedTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4459InMemorySettingsKeptEncryptedTest.java deleted file mode 100644 index 20cbe8eec..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4459InMemorySettingsKeptEncryptedTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4459. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4459InMemorySettingsKeptEncryptedTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4459InMemorySettingsKeptEncryptedTest() { - super("[2.1.0,3.0-alpha-1),[3.0-alpha-5,)"); - } - - /** - * Verify that encrypted passwords in the settings stay encrypted in the settings model visible to - * plugins. In other words, the passwords should only be decrypted at the transport layer. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4459"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.getSystemProperties() - .setProperty("settings.security", new File(testDir, "settings-security.xml").getAbsolutePath()); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/settings.properties"); - assertEquals( - "{BteqUEnqHecHM7MZfnj9FwLcYbdInWxou1C929Txa0A=}", props.getProperty("settings.servers.0.password", "")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4461ArtifactUploadMonitorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4461ArtifactUploadMonitorTest.java deleted file mode 100644 index d44b9daba..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4461ArtifactUploadMonitorTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4461. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4461ArtifactUploadMonitorTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4461ArtifactUploadMonitorTest() { - super("[2.0.3.0,3.0-alpha-1),[3.0-alpha-5,)"); - } - - /** - * Test that deployment of an artifact gets logged via the transfer monitor. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4461"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.setEnvironmentVariable("CI", "false"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyTextInLog("/target/repo/org/apache/maven/its/mng4461/release/1.0/release-1.0.jar"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4463DependencyManagementImportVersionRanges.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4463DependencyManagementImportVersionRanges.java deleted file mode 100644 index 0cfc5a379..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4463DependencyManagementImportVersionRanges.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; -import java.util.regex.Pattern; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * Integration tests for MNG-4463. - * - * @author Christian Schulte - */ -public class MavenITmng4463DependencyManagementImportVersionRanges extends AbstractMavenIntegrationTestCase { - - public MavenITmng4463DependencyManagementImportVersionRanges() { - super("[4.0.0-alpha-1,)"); - } - - @Test - public void testInclusiveUpperBoundResolvesToHighestVersion() throws Exception { - final File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4463/inclusive-upper-bound"); - final Verifier verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - final List artifacts = verifier.loadLines("target/compile.txt", "UTF-8"); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven:maven-plugin-api:jar:3.0")); - } - - @Test - public void testExclusiveUpperBoundResolvesToHighestVersion() throws Exception { - final File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4463/exclusive-upper-bound"); - final Verifier verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List artifacts = verifier.loadLines("target/compile.txt", "UTF-8"); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven:maven-plugin-api:jar:3.0")); - } - - @Test - public void testFailureWithoutUpperBound() throws Exception { - final File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4463/no-upper-bound"); - final Verifier verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - - try { - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - fail("Expected 'VerificationException' not thrown."); - } catch (final VerificationException e) { - final List lines = verifier.loadFile(new File(testDir, "log.txt"), false); - assertTrue( - "Expected error message not found.", - indexOf(lines, ".*dependency version range.*does not specify an upper bound.*") >= 0); - } - } - - private static int indexOf(final List logLines, final String regex) { - final Pattern pattern = Pattern.compile(regex); - - for (int i = 0, l0 = logLines.size(); i < l0; i++) { - if (pattern.matcher(logLines.get(i)).matches()) { - return i; - } - } - - return -1; - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4464PlatformIndependentFileSeparatorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4464PlatformIndependentFileSeparatorTest.java deleted file mode 100644 index e79cf46e0..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4464PlatformIndependentFileSeparatorTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4464. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4464PlatformIndependentFileSeparatorTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4464PlatformIndependentFileSeparatorTest() { - super("[3.0-alpha-7,)"); - } - - /** - * Test that Maven recognizes both the forward and the backward slash as file separators, regardless of the - * underlying filesystem (i.e. even on Unix). - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4464"); - - Verifier verifier = newVerifier(new File(testDir, "aggregator").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("../sub/target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4464"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("../sub/target/path.properties"); - Properties props = verifier.loadProperties("../sub/target/path.properties"); - assertPath(props, "project.build.resources.0.directory", "src/main/res"); - assertPath(props, "project.build.testResources.0.directory", "src/test/res"); - assertPath(props, "project.build.sourceDirectory", "src/main/j"); - assertPath(props, "project.build.testSourceDirectory", "src/test/j"); - assertPath(props, "project.build.directory", "target/it"); - assertPath(props, "project.build.outputDirectory", "target/it/classes"); - assertPath(props, "project.build.testOutputDirectory", "target/it/test-classes"); - } - - private void assertPath(Properties props, String key, String path) { - String actual = props.getProperty(key, ""); - assertTrue(actual, actual.endsWith(path.replace('/', File.separatorChar))); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4465PluginPrefixFromLocalCacheOfDownRepoTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4465PluginPrefixFromLocalCacheOfDownRepoTest.java deleted file mode 100644 index 7b50fadf8..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4465PluginPrefixFromLocalCacheOfDownRepoTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Collections; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4465. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4465PluginPrefixFromLocalCacheOfDownRepoTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4465PluginPrefixFromLocalCacheOfDownRepoTest() { - super("[2.1.0,3.0-alpha-1),[3.0-alpha-6,)"); - } - - /** - * Verify that locally cached metadata of non-accessible remote repos is still considered when resolving - * plugin prefixes. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4465"); - - // phase 1: get the metadata into the local repo - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4465"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.setLogFileName("log1.txt"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("mng4465:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch.properties"); - - // phase 2: re-try with the remote repo being inaccessible (due to bad URL) - - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.filterFile( - "settings-template.xml", - "settings.xml", - "UTF-8", - Collections.singletonMap("@baseurl@", "bad://localhost:63412")); - verifier.setLogFileName("log2.txt"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("mng4465:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch.properties"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4469AuthenticatedDeploymentToCustomRepoTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4469AuthenticatedDeploymentToCustomRepoTest.java deleted file mode 100644 index 183049df4..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4469AuthenticatedDeploymentToCustomRepoTest.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.security.ConstraintMapping; -import org.eclipse.jetty.security.ConstraintSecurityHandler; -import org.eclipse.jetty.security.HashLoginService; -import org.eclipse.jetty.security.UserStore; -import org.eclipse.jetty.server.Handler; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.AbstractHandler; -import org.eclipse.jetty.server.handler.HandlerList; -import org.eclipse.jetty.util.security.Constraint; -import org.eclipse.jetty.util.security.Password; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.eclipse.jetty.util.security.Constraint.__BASIC_AUTH; - -/** - * This is a test set for MNG-4469. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng4469AuthenticatedDeploymentToCustomRepoTest extends AbstractMavenIntegrationTestCase { - private Server server; - - private int port; - - private volatile boolean deployed; - - public MavenITmng4469AuthenticatedDeploymentToCustomRepoTest() { - super("[2.0.3,3.0-alpha-3),[3.0-alpha-6,)"); - } - - @BeforeEach - protected void setUp() throws Exception { - Handler repoHandler = new AbstractHandler() { - @Override - public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { - System.out.println("Handling " + request.getMethod() + " " + request.getRequestURL()); - - if ("PUT".equalsIgnoreCase(request.getMethod())) { - response.setStatus(HttpServletResponse.SC_OK); - deployed = true; - } else { - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - } - - ((Request) request).setHandled(true); - } - }; - - Constraint constraint = new Constraint(); - constraint.setName(Constraint.__BASIC_AUTH); - constraint.setRoles(new String[] {"deployer"}); - constraint.setAuthenticate(true); - - ConstraintMapping constraintMapping = new ConstraintMapping(); - constraintMapping.setConstraint(constraint); - constraintMapping.setPathSpec("/*"); - - HashLoginService userRealm = new HashLoginService("TestRealm"); - UserStore userStore = new UserStore(); - userStore.addUser("testuser", new Password("testtest"), new String[] {"deployer"}); - userRealm.setUserStore(userStore); - - server = new Server(0); - ConstraintSecurityHandler securityHandler = new ConstraintSecurityHandler(); - securityHandler.setLoginService(userRealm); - securityHandler.setAuthMethod(__BASIC_AUTH); - securityHandler.setConstraintMappings(new ConstraintMapping[] {constraintMapping}); - - HandlerList handlerList = new HandlerList(); - handlerList.addHandler(securityHandler); - handlerList.addHandler(repoHandler); - - server.setHandler(handlerList); - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + port); - deployed = false; - } - - @AfterEach - protected void tearDown() throws Exception { - if (server != null) { - server.stop(); - server.join(); - } - } - - /** - * Test that deployment to a custom repository (i.e. created by a plugin) that requires authentification works. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4469"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("-Dfile=settings.xml"); - verifier.addCliArgument("-DgroupId=org.apache.maven.its.mng4469"); - verifier.addCliArgument("-DartifactId=it"); - verifier.addCliArgument("-Dversion=0.1"); - verifier.addCliArgument("-DrepositoryId=mng4469"); - verifier.addCliArgument("-DrepositoryUrl=http://localhost:" + port + "/repo"); - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-artifact:2.1-SNAPSHOT:deploy-file"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - assertTrue(deployed); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4470AuthenticatedDeploymentToProxyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4470AuthenticatedDeploymentToProxyTest.java deleted file mode 100644 index c56d06536..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4470AuthenticatedDeploymentToProxyTest.java +++ /dev/null @@ -1,222 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import java.io.File; -import java.nio.charset.StandardCharsets; -import java.util.Base64; -import java.util.Collections; -import java.util.Deque; -import java.util.concurrent.ConcurrentLinkedDeque; - -import org.apache.maven.it.utils.DeployedResource; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.codehaus.plexus.util.StringUtils; -import org.eclipse.jetty.security.ConstraintMapping; -import org.eclipse.jetty.security.ConstraintSecurityHandler; -import org.eclipse.jetty.security.HashLoginService; -import org.eclipse.jetty.security.UserStore; -import org.eclipse.jetty.server.Handler; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.AbstractHandler; -import org.eclipse.jetty.server.handler.HandlerList; -import org.eclipse.jetty.util.security.Constraint; -import org.eclipse.jetty.util.security.Password; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.eclipse.jetty.util.security.Constraint.__BASIC_AUTH; - -/** - * This is a test set for MNG-4470. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng4470AuthenticatedDeploymentToProxyTest extends AbstractMavenIntegrationTestCase { - private Server server; - - private int port; - - private volatile boolean deployed; - - private final Deque deployedResources = new ConcurrentLinkedDeque<>(); - - public MavenITmng4470AuthenticatedDeploymentToProxyTest() { - super("[2.0.3,3.0-alpha-1),[3.0-alpha-6,)"); - } - - @BeforeEach - protected void setUp() throws Exception { - Handler proxyHandler = new AbstractHandler() { - @Override - public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { - String tn = Thread.currentThread().getName(); - System.out.println(tn + " Handling (proxy) " + request.getMethod() + " " + request.getRequestURL()); - - String auth = request.getHeader("Proxy-Authorization"); - if (auth != null) { - auth = auth.substring(auth.indexOf(' ') + 1).trim(); - auth = new String(Base64.getDecoder().decode(auth), StandardCharsets.US_ASCII); - } - System.out.println(tn + " Proxy-Authorization: " + auth); - - if (!"proxyuser:proxypass".equals(auth)) { - response.setStatus(HttpServletResponse.SC_PROXY_AUTHENTICATION_REQUIRED); - response.addHeader("Proxy-Authenticate", "Basic realm=\"Squid proxy-caching web server\""); - ((Request) request).setHandled(true); - } - - DeployedResource deployedResource = new DeployedResource(); - - deployedResource.httpMethod = request.getMethod(); - deployedResource.requestUri = request.getRequestURI(); - deployedResource.transferEncoding = request.getHeader("Transfer-Encoding"); - deployedResource.contentLength = request.getHeader("Content-Length"); - - deployedResources.add(deployedResource); - System.out.println(tn + " Done (proxy) " + request.getMethod() + " " + request.getRequestURL()); - } - }; - - Handler repoHandler = new AbstractHandler() { - @Override - public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { - String tn = Thread.currentThread().getName(); - System.out.println(tn + " Handling (repos) " + request.getMethod() + " " + request.getRequestURL()); - - if ("PUT".equalsIgnoreCase(request.getMethod())) { - response.setStatus(HttpServletResponse.SC_OK); - deployed = true; - } else { - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - } - - ((Request) request).setHandled(true); - - DeployedResource deployedResource = new DeployedResource(); - - deployedResource.httpMethod = request.getMethod(); - deployedResource.requestUri = request.getRequestURI(); - deployedResource.transferEncoding = request.getHeader("Transfer-Encoding"); - deployedResource.contentLength = request.getHeader("Content-Length"); - - deployedResources.add(deployedResource); - System.out.println(tn + " Done (repos) " + request.getMethod() + " " + request.getRequestURL()); - } - }; - - Constraint constraint = new Constraint(); - constraint.setName(Constraint.__BASIC_AUTH); - constraint.setRoles(new String[] {"deployer"}); - constraint.setAuthenticate(true); - - ConstraintMapping constraintMapping = new ConstraintMapping(); - constraintMapping.setConstraint(constraint); - constraintMapping.setPathSpec("/*"); - - HashLoginService userRealm = new HashLoginService("TestRealm"); - UserStore userStore = new UserStore(); - userStore.addUser("testuser", new Password("testtest"), new String[] {"deployer"}); - userRealm.setUserStore(userStore); - - server = new Server(0); - ConstraintSecurityHandler securityHandler = new ConstraintSecurityHandler(); - securityHandler.setLoginService(userRealm); - securityHandler.setAuthMethod(__BASIC_AUTH); - securityHandler.setConstraintMappings(new ConstraintMapping[] {constraintMapping}); - - HandlerList handlerList = new HandlerList(); - handlerList.addHandler(proxyHandler); - handlerList.addHandler(securityHandler); - handlerList.addHandler(repoHandler); - - server.setHandler(handlerList); - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + port); - deployed = false; - } - - @AfterEach - protected void tearDown() throws Exception { - if (server != null) { - server.stop(); - server.join(); - } - } - - /** - * Test that deployment (of a release) to a proxy that requires authentication works. - * - * @throws Exception in case of failure - */ - @Test - public void testitRelease() throws Exception { - testit("release"); - } - - /** - * Test that deployment (of a snapshot) to a proxy that requires authentication works. - * - * @throws Exception in case of failure - */ - @Test - public void testitSnapshot() throws Exception { - testit("snapshot"); - } - - private void testit(String project) throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4470/" + project); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.filterFile( - "settings-template.xml", - "settings.xml", - "UTF-8", - Collections.singletonMap("@port@", Integer.toString(port))); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - for (DeployedResource deployedResource : deployedResources) { - if (StringUtils.equalsIgnoreCase("chunked", deployedResource.transferEncoding)) { - fail("deployedResource " + deployedResource - + " use chunked transfert encoding some http server doesn't support that"); - } - } - - assertTrue(deployed); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4474PerLookupWagonInstantiationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4474PerLookupWagonInstantiationTest.java deleted file mode 100644 index a95451abd..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4474PerLookupWagonInstantiationTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4474. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4474PerLookupWagonInstantiationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4474PerLookupWagonInstantiationTest() { - super("[2.0.5,3.0-alpha-1),[3.0-alpha-6,)"); - } - - /** - * Verify that the wagon manager does not erroneously cache/reuse wagon instances that use per-lookup instantiation. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4474"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/wagon.properties"); - String hash1 = props.getProperty("coreit://one.hash"); - assertNotNull(hash1); - String hash2 = props.getProperty("coreit://two.hash"); - assertNotNull(hash2); - assertNotEquals(hash1, hash2); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4482ForcePluginSnapshotUpdateTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4482ForcePluginSnapshotUpdateTest.java deleted file mode 100644 index a537750a0..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4482ForcePluginSnapshotUpdateTest.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Map; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4482. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4482ForcePluginSnapshotUpdateTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4482ForcePluginSnapshotUpdateTest() { - super("[2.0.3,3.0-alpha-1),[3.0-alpha-6,)"); - } - - /** - * Verify that snapshot updates of plugins/extensions can be forced from the command line via "-U". - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4482"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4482"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - - /* - * NOTE: The update of the extension plugin while still being referenced by a class loader from the first test - * run make this test intermittently fail on *nix boxes, hence we enforce forking. - */ - verifier.setForkJvm(true); - - Map filterProps = verifier.newDefaultFilterMap(); - - filterProps.put("@repo@", "repo-1"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.setLogFileName("log-force-1.txt"); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props1 = verifier.loadProperties("target/touch.properties"); - assertEquals("old", props1.getProperty("one")); - assertNull(props1.getProperty("two")); - - filterProps.put("@repo@", "repo-2"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.setLogFileName("log-force-2.txt"); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-X"); - verifier.addCliArgument("-U"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props2 = verifier.loadProperties("target/touch.properties"); - assertEquals("new", props2.getProperty("two")); - assertNull(props2.getProperty("one")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4488ValidateExternalParenPomLenientTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4488ValidateExternalParenPomLenientTest.java deleted file mode 100644 index f69052fbb..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4488ValidateExternalParenPomLenientTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4488. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4488ValidateExternalParenPomLenientTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4488ValidateExternalParenPomLenientTest() { - super("[2.0.3,3.0-alpha-1),[3.0-alpha-6,)"); - } - - /** - * Verify that parent POMs get validated in lenient mode when resolved from the repository. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4488"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4488"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4489MirroringOfExtensionRepoTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4489MirroringOfExtensionRepoTest.java deleted file mode 100644 index 1931e45d2..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4489MirroringOfExtensionRepoTest.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Map; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.security.ConstraintMapping; -import org.eclipse.jetty.security.ConstraintSecurityHandler; -import org.eclipse.jetty.security.HashLoginService; -import org.eclipse.jetty.security.UserStore; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.DefaultHandler; -import org.eclipse.jetty.server.handler.HandlerList; -import org.eclipse.jetty.server.handler.ResourceHandler; -import org.eclipse.jetty.util.security.Constraint; -import org.eclipse.jetty.util.security.Password; -import org.junit.jupiter.api.Test; - -import static org.eclipse.jetty.util.security.Constraint.__BASIC_AUTH; - -/** - * This is a test set for MNG-4489. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4489MirroringOfExtensionRepoTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4489MirroringOfExtensionRepoTest() { - super("[2.0.3,3.0-alpha-1),[3.0-alpha-6,)"); - } - - /** - * Test that repositories contributed by extension POMs during transitive dependency resolution are subject to - * mirror and authentication configuration. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4489"); - - Constraint constraint = new Constraint(); - constraint.setName(Constraint.__BASIC_AUTH); - constraint.setRoles(new String[] {"user"}); - constraint.setAuthenticate(true); - - ConstraintMapping constraintMapping = new ConstraintMapping(); - constraintMapping.setConstraint(constraint); - constraintMapping.setPathSpec("/*"); - - HashLoginService userRealm = new HashLoginService("TestRealm"); - UserStore userStore = new UserStore(); - userStore.addUser("testuser", new Password("testtest"), new String[] {"user"}); - userRealm.setUserStore(userStore); - - Server server = new Server(0); - ConstraintSecurityHandler securityHandler = new ConstraintSecurityHandler(); - securityHandler.setLoginService(userRealm); - securityHandler.setAuthMethod(__BASIC_AUTH); - securityHandler.setConstraintMappings(new ConstraintMapping[] {constraintMapping}); - - ResourceHandler repoHandler = new ResourceHandler(); - repoHandler.setResourceBase(testDir.getAbsolutePath()); - - HandlerList handlerList = new HandlerList(); - handlerList.addHandler(securityHandler); - handlerList.addHandler(repoHandler); - handlerList.addHandler(new DefaultHandler()); - - server.setHandler(handlerList); - - try { - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - int port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + port); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4489"); - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@port@", Integer.toString(port)); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng4489", "ext-dep", "0.1", "jar"); - verifier.verifyArtifactPresent("org.apache.maven.its.mng4489", "ext-dep", "0.1", "pom"); - } finally { - server.stop(); - server.join(); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4498IgnoreBrokenMetadataTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4498IgnoreBrokenMetadataTest.java deleted file mode 100644 index 9289c3209..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4498IgnoreBrokenMetadataTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4498. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4498IgnoreBrokenMetadataTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4498IgnoreBrokenMetadataTest() { - super("[3.0-alpha-6,)"); - } - - /** - * Test that unreadable metadata from one repository does not fail the entire dependency resolution. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4498"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4498"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List classpath = verifier.loadLines("target/classpath.txt", "UTF-8"); - assertTrue(classpath.toString(), classpath.contains("dep-0.1-SNAPSHOT.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4500NoUpdateOfTimestampedSnapshotsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4500NoUpdateOfTimestampedSnapshotsTest.java deleted file mode 100644 index ab0ad0cc5..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4500NoUpdateOfTimestampedSnapshotsTest.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import java.io.File; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.AbstractHandler; -import org.eclipse.jetty.server.handler.DefaultHandler; -import org.eclipse.jetty.server.handler.HandlerList; -import org.eclipse.jetty.server.handler.ResourceHandler; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4500. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4500NoUpdateOfTimestampedSnapshotsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4500NoUpdateOfTimestampedSnapshotsTest() { - super("[2.0.3,3.0-alpha-1),[3.0-alpha-6,)"); - } - - /** - * Test that timestamped snapshots are treated as immutable, i.e. Maven should never check for updates of them - * once downloaded from a remote repo regardless of the update policy. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4500"); - - String pomUri = "/repo/org/apache/maven/its/mng4500/dep/0.1-SNAPSHOT/dep-0.1-20091219.230823-1.pom"; - String jarUri = "/repo/org/apache/maven/its/mng4500/dep/0.1-SNAPSHOT/dep-0.1-20091219.230823-1.jar"; - - final List requestedUris = Collections.synchronizedList(new ArrayList<>()); - - AbstractHandler logHandler = new AbstractHandler() { - @Override - public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { - requestedUris.add(request.getRequestURI()); - } - }; - - ResourceHandler repoHandler = new ResourceHandler(); - repoHandler.setResourceBase(testDir.getAbsolutePath()); - - HandlerList handlerList = new HandlerList(); - handlerList.addHandler(logHandler); - handlerList.addHandler(repoHandler); - handlerList.addHandler(new DefaultHandler()); - - Server server = new Server(0); - server.setHandler(handlerList); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - try { - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - int port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + port); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4500"); - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@port@", Integer.toString(port)); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - - verifier.setLogFileName("log-1.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List classpath = verifier.loadLines("target/classpath.txt", "UTF-8"); - assertTrue(classpath.toString(), classpath.contains("dep-0.1-SNAPSHOT.jar")); - assertTrue(requestedUris.toString(), requestedUris.contains(pomUri)); - assertTrue(requestedUris.toString(), requestedUris.contains(jarUri)); - - requestedUris.clear(); - - verifier.setLogFileName("log-2.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - classpath = verifier.loadLines("target/classpath.txt", "UTF-8"); - assertTrue(classpath.toString(), classpath.contains("dep-0.1-SNAPSHOT.jar")); - assertFalse(requestedUris.toString(), requestedUris.contains(pomUri)); - assertFalse(requestedUris.toString(), requestedUris.contains(jarUri)); - } finally { - server.stop(); - server.join(); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4522FailUponMissingDependencyParentPomTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4522FailUponMissingDependencyParentPomTest.java deleted file mode 100644 index a46f800a3..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4522FailUponMissingDependencyParentPomTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4522. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4522FailUponMissingDependencyParentPomTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4522FailUponMissingDependencyParentPomTest() { - super("[2.0.3,3.0-alpha-1),[3.0-alpha-7,)"); - } - - /** - * Test that dependency resolution fails/aborts in case a dependency has a POM that inherits from a missing parent. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4522"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4522"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Missing parent POM of dependency did not fail the build."); - } catch (VerificationException e) { - // expected - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4526MavenProjectArtifactsScopeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4526MavenProjectArtifactsScopeTest.java deleted file mode 100644 index 8642583c9..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4526MavenProjectArtifactsScopeTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4526. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4526MavenProjectArtifactsScopeTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4526MavenProjectArtifactsScopeTest() { - super("[2.0.3,3.0-alpha-1),[3.0-alpha-7,)"); - } - - /** - * Test that MavenProject.getArtifacts() only holds artifacts matching the scope requested by a mojo. This - * must also be the case when previously already artifacts from a wider scope were resolved. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4526"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4526"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("generate-sources"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List artifacts; - - artifacts = verifier.loadLines("target/compile.txt", "UTF-8"); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng4526:a:jar:0.1")); - assertFalse(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng4526:b:jar:0.1")); - assertFalse(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng4526:c:jar:0.1")); - - artifacts = verifier.loadLines("target/runtime.txt", "UTF-8"); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng4526:a:jar:0.1")); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng4526:b:jar:0.1")); - assertFalse(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng4526:c:jar:0.1")); - - artifacts = verifier.loadLines("target/test.txt", "UTF-8"); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng4526:a:jar:0.1")); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng4526:b:jar:0.1")); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng4526:c:jar:0.1")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4528ExcludeWagonsFromMavenCoreArtifactsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4528ExcludeWagonsFromMavenCoreArtifactsTest.java deleted file mode 100644 index a68b9b86a..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4528ExcludeWagonsFromMavenCoreArtifactsTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4528. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4528ExcludeWagonsFromMavenCoreArtifactsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4528ExcludeWagonsFromMavenCoreArtifactsTest() { - super("[2.0.5,3.0-alpha-1),[3.0-alpha-7,4.0.0-alpha-1)"); - } - - /** - * Test that wagon providers pulled in via transitive dependencies of Maven core artifacts get excluded from - * plugin realms (in favor of potentially newer wagons bundled with the core). This requirement is mostly a - * hack to compensate for the historic slip of Maven core artifacts depending on wagon providers. Those old - * wagon providers conflict with the usually newer wagons bundled with the core distro and cause grief under - * a class loader hierarchy where wagons are loaded from the plugin realm (if available) like in Maven 3. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4528"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/wagon.properties"); - String version = props.getProperty("version", ""); - assertNotEquals("Bad wagon version used: " + version, "1.0-alpha-6", version); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4536RequiresNoProjectForkingMojoTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4536RequiresNoProjectForkingMojoTest.java deleted file mode 100644 index 321f45dd1..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4536RequiresNoProjectForkingMojoTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4536. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4536RequiresNoProjectForkingMojoTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4536RequiresNoProjectForkingMojoTest() { - super("[2.0.3,3.0-alpha-1),[3.0-alpha-7,)"); - } - - /** - * Test that forking mojos that require no project only fork the current project and not the entire reactor. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4536"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("mod-a/target"); - verifier.deleteDirectory("mod-b/target"); - verifier.addCliArgument("generate-sources"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - assertEquals(2, verifier.loadLines("mod-a/target/touch.log", "UTF-8").size()); - assertEquals(2, verifier.loadLines("mod-b/target/touch.log", "UTF-8").size()); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4544ActiveComponentCollectionThreadSafeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4544ActiveComponentCollectionThreadSafeTest.java deleted file mode 100644 index 81fa5879f..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4544ActiveComponentCollectionThreadSafeTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4544. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4544ActiveComponentCollectionThreadSafeTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4544ActiveComponentCollectionThreadSafeTest() { - super("[2.0.3,3.0-alpha-1),[3.0-alpha-7,)"); - } - - /** - * Test that concurrent access to active component collections is thread-safe. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4544"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/thread.properties"); - assertEquals(0, Integer.parseInt(props.getProperty("exceptions"))); - assertEquals(2, Integer.parseInt(props.getProperty("components"))); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4553CoreArtifactFilterConsidersGroupIdTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4553CoreArtifactFilterConsidersGroupIdTest.java deleted file mode 100644 index bf7822730..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4553CoreArtifactFilterConsidersGroupIdTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4553. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4553CoreArtifactFilterConsidersGroupIdTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4553CoreArtifactFilterConsidersGroupIdTest() { - super("[3.0-alpha-7,)"); - } - - /** - * Verify that the core artifact filter considers both artifact id and group id. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4553"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4553"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties pclProps = verifier.loadProperties("target/pcl.properties"); - assertNotNull(pclProps.getProperty("mng4553.properties")); - assertEquals("1", pclProps.getProperty("mng4553.properties.count")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4554PluginPrefixMappingUpdateTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4554PluginPrefixMappingUpdateTest.java deleted file mode 100644 index fefed4676..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4554PluginPrefixMappingUpdateTest.java +++ /dev/null @@ -1,298 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -import org.apache.maven.shared.utils.io.FileUtils; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.AbstractHandler; -import org.eclipse.jetty.server.handler.DefaultHandler; -import org.eclipse.jetty.server.handler.HandlerList; -import org.eclipse.jetty.server.handler.ResourceHandler; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4554. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4554PluginPrefixMappingUpdateTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4554PluginPrefixMappingUpdateTest() { - super("[2.0.3,3.0-alpha-1),[3.0-alpha-7,)"); - } - - /** - * Test that the metadata holding the plugin prefix mapping is cached and not redownloaded upon each - * Maven invocation. - * - * @throws Exception in case of failure - */ - @Test - public void testitCached() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4554"); - - String metadataUri = "/repo-1/org/apache/maven/its/mng4554/maven-metadata.xml"; - - final List requestedUris = Collections.synchronizedList(new ArrayList<>()); - - AbstractHandler logHandler = new AbstractHandler() { - @Override - public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { - requestedUris.add(request.getRequestURI()); - } - }; - - ResourceHandler repoHandler = new ResourceHandler(); - repoHandler.setResourceBase(testDir.getAbsolutePath()); - - HandlerList handlerList = new HandlerList(); - handlerList.addHandler(logHandler); - handlerList.addHandler(repoHandler); - handlerList.addHandler(new DefaultHandler()); - - Server server = new Server(0); - server.setHandler(handlerList); - server.start(); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - try { - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - try { - verifier.deleteArtifacts("org.apache.maven.its.mng4554"); - } catch (IOException e) { - // expected when running test on Windows using embedded Maven (JAR files locked by plugin class realm) - assertFalse(new File(verifier.getArtifactMetadataPath( - "org.apache.maven.its.mng4554", null, null, "maven-metadata-mng4554.xml")) - .exists()); - } - Map filterProps = verifier.newDefaultFilterMap(); - NetworkConnector connector = (NetworkConnector) server.getConnectors()[0]; - filterProps.put("@port@", Integer.toString(connector.getLocalPort())); - filterProps.put("@repo@", "repo-1"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - - verifier.setLogFileName("log-cached-1.txt"); - verifier.addCliArgument("a:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch.txt"); - assertTrue(requestedUris.toString(), requestedUris.contains(metadataUri)); - - requestedUris.clear(); - - verifier.setLogFileName("log-cached-2.txt"); - verifier.addCliArgument("a:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - assertFalse(requestedUris.toString(), requestedUris.contains(metadataUri)); - } finally { - server.stop(); - server.join(); - } - } - - /** - * Test that the local metadata holding the plugin prefix mapping can be forcefully updated via the command - * line flag -U. - * - * @throws Exception in case of failure - */ - @Test - public void testitForcedUpdate() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4554"); - - String metadataUri = "/repo-1/org/apache/maven/its/mng4554/maven-metadata.xml"; - - final List requestedUris = Collections.synchronizedList(new ArrayList<>()); - - AbstractHandler logHandler = new AbstractHandler() { - @Override - public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { - requestedUris.add(request.getRequestURI()); - } - }; - - ResourceHandler repoHandler = new ResourceHandler(); - repoHandler.setResourceBase(testDir.getAbsolutePath()); - - HandlerList handlerList = new HandlerList(); - handlerList.addHandler(logHandler); - handlerList.addHandler(repoHandler); - handlerList.addHandler(new DefaultHandler()); - - Server server = new Server(0); - server.setHandler(handlerList); - server.start(); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - try { - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - try { - verifier.deleteArtifacts("org.apache.maven.its.mng4554"); - } catch (IOException e) { - // expected when running test on Windows using embedded Maven (JAR files locked by plugin class realm) - assertFalse(new File(verifier.getArtifactMetadataPath( - "org.apache.maven.its.mng4554", null, null, "maven-metadata-mng4554.xml")) - .exists()); - } - Map filterProps = verifier.newDefaultFilterMap(); - NetworkConnector connector = (NetworkConnector) server.getConnectors()[0]; - filterProps.put("@port@", Integer.toString(connector.getLocalPort())); - filterProps.put("@repo@", "repo-1"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.addCliArgument("-U"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - - verifier.setLogFileName("log-forced-1.txt"); - verifier.addCliArgument("a:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch.txt"); - assertTrue(requestedUris.toString(), requestedUris.contains(metadataUri)); - - requestedUris.clear(); - - verifier.setLogFileName("log-forced-2.txt"); - verifier.addCliArgument("a:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - assertTrue(requestedUris.toString(), requestedUris.contains(metadataUri)); - } finally { - server.stop(); - server.join(); - } - } - - /** - * Test that the local metadata holding the plugin prefix mapping is automatically refetched from the remote - * repositories if the local metadata fails to resolve a new/other plugin prefix. - * - * @throws Exception in case of failure - */ - @Test - public void testitRefetched() throws Exception { - requiresMavenVersion("[3.0-alpha-3,)"); - - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4554"); - - String metadataUri = "/repo-it/org/apache/maven/its/mng4554/maven-metadata.xml"; - - final List requestedUris = Collections.synchronizedList(new ArrayList<>()); - - AbstractHandler logHandler = new AbstractHandler() { - @Override - public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { - requestedUris.add(request.getRequestURI()); - } - }; - - ResourceHandler repoHandler = new ResourceHandler(); - repoHandler.setResourceBase(testDir.getAbsolutePath()); - - HandlerList handlerList = new HandlerList(); - handlerList.addHandler(logHandler); - handlerList.addHandler(repoHandler); - handlerList.addHandler(new DefaultHandler()); - - Server server = new Server(0); - server.setHandler(handlerList); - server.start(); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - try { - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - try { - verifier.deleteArtifacts("org.apache.maven.its.mng4554"); - } catch (IOException e) { - // expected when running test on Windows using embedded Maven (JAR files locked by plugin class realm) - assertFalse(new File(verifier.getArtifactMetadataPath( - "org.apache.maven.its.mng4554", null, null, "maven-metadata-mng4554.xml")) - .exists()); - } - Map filterProps = verifier.newDefaultFilterMap(); - NetworkConnector connector = (NetworkConnector) server.getConnectors()[0]; - filterProps.put("@port@", Integer.toString(connector.getLocalPort())); - filterProps.put("@repo@", "repo-it"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - - FileUtils.copyDirectoryStructure(new File(testDir, "repo-1"), new File(testDir, "repo-it")); - - verifier.setLogFileName("log-refetched-1.txt"); - verifier.addCliArgument("a:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch.txt"); - assertTrue(requestedUris.toString(), requestedUris.contains(metadataUri)); - - requestedUris.clear(); - - // simulate deployment of new plugin which updates the prefix mapping in the remote repo - FileUtils.copyDirectoryStructure(new File(testDir, "repo-2"), new File(testDir, "repo-it")); - - verifier.setLogFileName("log-refetched-2.txt"); - verifier.addCliArgument("b:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - assertTrue(requestedUris.toString(), requestedUris.contains(metadataUri)); - } finally { - server.stop(); - server.join(); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4555MetaversionResolutionOfflineTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4555MetaversionResolutionOfflineTest.java deleted file mode 100644 index cf850acaf..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4555MetaversionResolutionOfflineTest.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import java.io.File; -import java.util.Deque; -import java.util.Map; -import java.util.concurrent.ConcurrentLinkedDeque; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.server.Handler; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.AbstractHandler; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4555. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4555MetaversionResolutionOfflineTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4555MetaversionResolutionOfflineTest() { - super("[2.0.3,3.0-alpha-1),[3.0-beta-1,)"); - } - - /** - * Verify that resolution of the metaversion RELEASE respects offline mode. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4555"); - - final Deque uris = new ConcurrentLinkedDeque<>(); - - Handler repoHandler = new AbstractHandler() { - @Override - public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { - String uri = request.getRequestURI(); - - if (uri.startsWith("/repo/org/apache/maven/its/mng4555")) { - uris.add(uri.substring(34)); - } - - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - ((Request) request).setHandled(true); - } - }; - - Server server = new Server(0); - server.setHandler(repoHandler); - server.start(); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4555"); - try { - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - int port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + port); - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@port@", Integer.toString(port)); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.addCliArgument("--offline"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - } catch (VerificationException e) { - // expected - } finally { - server.stop(); - server.join(); - } - - assertTrue(uris.toString(), uris.isEmpty()); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4561MirroringOfPluginRepoTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4561MirroringOfPluginRepoTest.java deleted file mode 100644 index d9e9dcc4a..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4561MirroringOfPluginRepoTest.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Map; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.security.ConstraintMapping; -import org.eclipse.jetty.security.ConstraintSecurityHandler; -import org.eclipse.jetty.security.HashLoginService; -import org.eclipse.jetty.security.UserStore; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.DefaultHandler; -import org.eclipse.jetty.server.handler.HandlerList; -import org.eclipse.jetty.server.handler.ResourceHandler; -import org.eclipse.jetty.util.security.Constraint; -import org.eclipse.jetty.util.security.Password; -import org.junit.jupiter.api.Test; - -import static org.eclipse.jetty.util.security.Constraint.__BASIC_AUTH; - -/** - * This is a test set for MNG-4561. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4561MirroringOfPluginRepoTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4561MirroringOfPluginRepoTest() { - super("[2.0.3,3.0-alpha-1),[3.0-alpha-7,)"); - } - - /** - * Test that repositories contributed by plugin POMs during transitive dependency resolution are subject to - * mirror, proxy and authentication configuration. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4561"); - - Constraint constraint = new Constraint(); - constraint.setName(Constraint.__BASIC_AUTH); - constraint.setRoles(new String[] {"user"}); - constraint.setAuthenticate(true); - - ConstraintMapping constraintMapping = new ConstraintMapping(); - constraintMapping.setConstraint(constraint); - constraintMapping.setPathSpec("/*"); - - HashLoginService userRealm = new HashLoginService("TestRealm"); - UserStore userStore = new UserStore(); - userStore.addUser("testuser", new Password("testtest"), new String[] {"user"}); - userRealm.setUserStore(userStore); - - Server server = new Server(0); - ConstraintSecurityHandler securityHandler = new ConstraintSecurityHandler(); - securityHandler.setLoginService(userRealm); - securityHandler.setAuthMethod(__BASIC_AUTH); - securityHandler.setConstraintMappings(new ConstraintMapping[] {constraintMapping}); - - ResourceHandler repoHandler = new ResourceHandler(); - repoHandler.setResourceBase(testDir.getAbsolutePath()); - - HandlerList handlerList = new HandlerList(); - handlerList.addHandler(securityHandler); - handlerList.addHandler(repoHandler); - handlerList.addHandler(new DefaultHandler()); - - server.setHandler(handlerList); - server.start(); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - try { - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - int port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + port); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4561"); - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@port@", Integer.toString(port)); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng4561", "plugin-dep", "0.1", "jar"); - verifier.verifyArtifactPresent("org.apache.maven.its.mng4561", "plugin-dep", "0.1", "pom"); - verifier.verifyFilePresent("target/touch.txt"); - } finally { - server.stop(); - server.join(); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4565MultiConditionProfileActivationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4565MultiConditionProfileActivationTest.java deleted file mode 100644 index faaf8559e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4565MultiConditionProfileActivationTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-3106: - * - * When multiple activators are present in a profile they should be AND'd. All activator must - * conditions must be satisfied in order for the profile to be activated. - */ -@Tag("disabled") -public class MavenITmng4565MultiConditionProfileActivationTest extends AbstractMavenIntegrationTestCase { - public MavenITmng4565MultiConditionProfileActivationTest() { - super("(3.2.2,)"); - } - - /** - * Test build with two profiles, each with more than one activator. - * The profiles should be activated even though only one of the activators - * returns true. - * - * @throws Exception in case of failure - */ - @Test - public void testProfilesWithMultipleActivators() throws Exception { - File testDir = - ResourceExtractor.simpleExtractResources(getClass(), "/mng-4565-multi-condition-profile-activation"); - - Verifier verifier; - - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-Dprofile1.on=true"); - verifier.addCliArgument("validate"); - verifier.execute(); - - // - // The property profile1.on = true so only profile1 should be activated. The profile2.on property is not true so - // profile2 - // should not be activated. Only the profile1/touch.txt file should be generated. - // - verifier.verifyErrorFreeLog(); - verifier.verifyFilePresent("target/profile1/touch.txt"); - verifier.verifyFileNotPresent("target/profile2/touch.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4572ModelVersionSurroundedByWhitespaceTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4572ModelVersionSurroundedByWhitespaceTest.java deleted file mode 100644 index 4f80fb15f..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4572ModelVersionSurroundedByWhitespaceTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4572. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4572ModelVersionSurroundedByWhitespaceTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4572ModelVersionSurroundedByWhitespaceTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Test that the model parser doesn't choke when the modelVersion is surrounded by whitespace. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4572"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4580ProjectLevelPluginDepUsedForCliInvocInReactorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4580ProjectLevelPluginDepUsedForCliInvocInReactorTest.java deleted file mode 100644 index 3321705c9..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4580ProjectLevelPluginDepUsedForCliInvocInReactorTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4580. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4580ProjectLevelPluginDepUsedForCliInvocInReactorTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4580ProjectLevelPluginDepUsedForCliInvocInReactorTest() { - super("[3.0-beta-1,)"); - } - - /** - * Verify that project-level plugin dependencies of submodules are still considered when a plugin is invoked - * directly from command line at the reactor root. In other words, the plugin realm used for a mojo execution - * should match the plugin dependencies as given by the current project. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4580"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("sub/target"); - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-class-loader:load"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties pclProps; - - pclProps = verifier.loadProperties("target/pcl.properties"); - assertNotNull(pclProps.getProperty("org.apache.maven.plugin.coreit.ClassA")); - assertNotNull(pclProps.getProperty("org/apache/maven/plugin/coreit/a.properties")); - - pclProps = verifier.loadProperties("sub/target/pcl.properties"); - assertNull(pclProps.getProperty("org.apache.maven.plugin.coreit.ClassA")); - assertNull(pclProps.getProperty("org/apache/maven/plugin/coreit/a.properties")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4586PluginPrefixResolutionFromVersionlessPluginMgmtTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4586PluginPrefixResolutionFromVersionlessPluginMgmtTest.java deleted file mode 100644 index 2d2ed4f2f..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4586PluginPrefixResolutionFromVersionlessPluginMgmtTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4586. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4586PluginPrefixResolutionFromVersionlessPluginMgmtTest - extends AbstractMavenIntegrationTestCase { - - public MavenITmng4586PluginPrefixResolutionFromVersionlessPluginMgmtTest() { - super("[3.0-beta-1,)"); - } - - /** - * Verify that plugin prefixes can be resolved from the POM's plugin management even if the POM - * does not specify the plugin version. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4586"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4586"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("mng4586:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4590ImportedPomUsesSystemAndUserPropertiesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4590ImportedPomUsesSystemAndUserPropertiesTest.java deleted file mode 100644 index 49419ed81..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4590ImportedPomUsesSystemAndUserPropertiesTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4590. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4590ImportedPomUsesSystemAndUserPropertiesTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4590ImportedPomUsesSystemAndUserPropertiesTest() { - super("[2.0.9,3.0-alpha-1),[3.0-beta-1,)"); - } - - /** - * Verify that imported POMs are processed using the same system/user properties as the importing POM. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4590"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4590"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.setEnvironmentVariable("MAVEN_OPTS", "-Dtest.file=pom.xml"); - verifier.addCliArgument("-Dtest.dir=" + testDir.getAbsolutePath()); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - assertEquals("1", props.getProperty("project.dependencyManagement.dependencies")); - assertEquals("dep-a", props.getProperty("project.dependencyManagement.dependencies.0.artifactId")); - assertEquals( - new File(testDir, "pom.xml").getAbsoluteFile(), - new File(props.getProperty("project.dependencyManagement.dependencies.0.systemPath"))); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4600DependencyOptionalFlagManagementTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4600DependencyOptionalFlagManagementTest.java deleted file mode 100644 index d8da02c1d..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4600DependencyOptionalFlagManagementTest.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4600. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4600DependencyOptionalFlagManagementTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4600DependencyOptionalFlagManagementTest() { - super("[2.0.3,3.0-alpha-1),[3.0-beta-1,)"); - } - - /** - * Verify that a dependency's optional flag is not subject to dependency management. This part of the test checks - * the effective model. - * - * @throws Exception in case of failure - */ - @Test - public void testitModel() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4600/model"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - assertEquals("dep", props.getProperty("project.dependencies.0.artifactId")); - assertEquals("false", props.getProperty("project.dependencies.0.optional")); - } - - /** - * Verify that a transitive dependency's optional flag is not subject to dependency management of the root artifact. - * This part of the test checks the artifact collector. - * - * @throws Exception in case of failure - */ - @Test - public void testitResolution() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4600/resolution"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4600"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List classpath = verifier.loadLines("target/classpath.txt", "UTF-8"); - assertTrue(classpath.toString(), classpath.contains("direct-0.2.jar")); - assertTrue(classpath.toString(), classpath.contains("transitive-0.1.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4615ValidateRequiredPluginParameterTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4615ValidateRequiredPluginParameterTest.java deleted file mode 100644 index 90b96cdef..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4615ValidateRequiredPluginParameterTest.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4615. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4615ValidateRequiredPluginParameterTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4615ValidateRequiredPluginParameterTest() { - super("[2.0.3,3.0-alpha-1),[3.0-beta-2,)"); - } - - /** - * Verify that Maven validates required mojo parameters (and doesn't just have the plugins die with NPEs). - * This scenario checks the case of all required parameters being set via plugin configuration. - * - * @throws Exception in case of failure - */ - @Test - public void testitAllSet() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4615/test-0"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/config.properties"); - assertEquals("one", props.get("requiredParam")); - assertEquals("two", props.get("requiredParamWithDefault")); - } - - /** - * Verify that Maven validates required mojo parameters (and doesn't just have the plugins die with NPEs). - * This scenario checks the case of a parameter missing its backing system property. - * - * @throws Exception in case of failure - */ - @Test - public void testitExprMissing() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4615/test-1"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.setLogFileName("log-a.txt"); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Build did not fail despite required plugin parameter missing"); - } catch (VerificationException e) { - // expected - } - } - - /** - * Verify that Maven validates required mojo parameters (and doesn't just have the plugins die with NPEs). - * This scenario checks the case of a parameter having its backing user property set. - * - * @throws Exception in case of failure - */ - @Test - public void testitExprSet() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4615/test-1"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-Dconfig.requiredParam=CLI"); - verifier.setLogFileName("log-b.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/config.properties"); - assertEquals("CLI", props.get("requiredParam")); - assertEquals("two", props.get("requiredParamWithDefault")); - } - - /** - * Verify that Maven validates required mojo parameters (and doesn't just have the plugins die with NPEs). - * This scenario checks the case of a parameter missing its backing POM value. - * - * @throws Exception in case of failure - */ - @Test - public void testitPomValMissing() throws Exception { - // cf. MNG-4764 - requiresMavenVersion("[3.0-beta-2,)"); - - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4615/test-2a"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Build did not fail despite required plugin parameter missing"); - } catch (VerificationException e) { - // expected - } - } - - /** - * Verify that Maven validates required mojo parameters (and doesn't just have the plugins die with NPEs). - * This scenario checks the case of a parameter having its backing POM value set. - * - * @throws Exception in case of failure - */ - @Test - public void testitPomValSet() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4615/test-2b"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/config.properties"); - assertEquals("one", props.get("requiredParam")); - assertEquals("http://foo.bar/", props.get("requiredParamWithDefault")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4618AggregatorBuiltAfterModulesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4618AggregatorBuiltAfterModulesTest.java deleted file mode 100644 index a9b7ac999..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4618AggregatorBuiltAfterModulesTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Arrays; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4618. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4618AggregatorBuiltAfterModulesTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4618AggregatorBuiltAfterModulesTest() { - super("[2.0.3,3.0-alpha-1),[3.0-beta-1,)"); - } - - /** - * Verify that aggregator-only projects (i.e. not used as parent for inheritance) get built after their modules. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4618"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List mods = verifier.loadLines("target/log.txt", "UTF-8"); - assertEquals(Arrays.asList(new String[] {"mod-a", "mod-b", "mod-c", "aggregator"}), mods); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4625SettingsXmlInterpolationWithXmlMarkupTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4625SettingsXmlInterpolationWithXmlMarkupTest.java deleted file mode 100644 index 9c9422768..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4625SettingsXmlInterpolationWithXmlMarkupTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.codehaus.plexus.util.Os; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4625. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4625SettingsXmlInterpolationWithXmlMarkupTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4625SettingsXmlInterpolationWithXmlMarkupTest() { - super("[3.0-beta-1,)"); - } - - /** - * Verify that interpolation of the settings.xml doesn't fail if an expression's value contains - * XML special characters. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4625"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - - // http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6468220 - // A lot of bugs related to Windows arguments and quoting - // Directly called from commandline succeeds, indirect often fails - if (Os.isFamily(Os.FAMILY_WINDOWS) && !System.getProperties().contains("CLASSWORLDS_LAUNCHER")) { - verifier.addCliArgument("-Dtest.prop=\"&x=y<>\""); - verifier.setForkJvm(true); // force forked JVM, since the workaround expects forked run - } else { - verifier.addCliArgument("-Dtest.prop=&x=y<>"); - } - - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - assertEquals("&x=y<>", props.getProperty("project.properties.jdbcUrl")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4629NoPomValidationErrorUponMissingSystemDepTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4629NoPomValidationErrorUponMissingSystemDepTest.java deleted file mode 100644 index 501fb6b7c..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4629NoPomValidationErrorUponMissingSystemDepTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4629. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4629NoPomValidationErrorUponMissingSystemDepTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4629NoPomValidationErrorUponMissingSystemDepTest() { - super("[2.0.3,)"); - } - - /** - * Verify that mere POM validation does not fail upon a system-scope dependency that refers to a non-existing - * file (the error is deferred to actual dependency resolution). - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4629"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4633DualCompilerExecutionsWeaveModeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4633DualCompilerExecutionsWeaveModeTest.java deleted file mode 100644 index cf840937a..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4633DualCompilerExecutionsWeaveModeTest.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/** - * This is a test set for MNG-4633. - * - * - * @author Kristian Rosenvold - */ -@Disabled -public class MavenITmng4633DualCompilerExecutionsWeaveModeTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4633DualCompilerExecutionsWeaveModeTest() { - super("[3.0-beta-2,)"); - } - - /** - * Submodule2 depends on compiler output from submodule1, but dependency is in generate-resources phase in - * submodule2. This effectively tests the module-locking of the project artifact. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4633"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - verifier.setAutoclean(false); - verifier.addCliArgument("-T"); - verifier.addCliArgument("2W"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4644StrictPomParsingRejectsMisplacedTextTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4644StrictPomParsingRejectsMisplacedTextTest.java deleted file mode 100644 index 0e6f1b73c..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4644StrictPomParsingRejectsMisplacedTextTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4644. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4644StrictPomParsingRejectsMisplacedTextTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4644StrictPomParsingRejectsMisplacedTextTest() { - super("[3.0-alpha-7,)"); - } - - /** - * Verify that misplaced text inside the project element of a POM causes a parser error during reactor builds. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4644"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - fail("Should fail to validate the POM syntax due to misplaced text in element."); - } catch (VerificationException e) { - // expected - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4654ArtifactHandlerForMainArtifactTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4654ArtifactHandlerForMainArtifactTest.java deleted file mode 100644 index 5d0c06a36..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4654ArtifactHandlerForMainArtifactTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4654. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4654ArtifactHandlerForMainArtifactTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4654ArtifactHandlerForMainArtifactTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Test that the artifact handler for the project main artifact is selected via the handler's type/roleHint - * and not via the handler's packaging (the packaging only applies to the legacy repo layout). - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4654"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4654"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFileNotPresent("target/repo/org/apache/maven/its/mng4654/test/1.0/test-1.0.mng4654"); - verifier.verifyFilePresent("target/repo/org/apache/maven/its/mng4654/test/1.0/test-1.0.jar"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java deleted file mode 100644 index e76130a87..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.IOException; -import java.nio.file.FileVisitResult; -import java.nio.file.FileVisitor; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.attribute.BasicFileAttributes; - -import org.apache.maven.shared.utils.io.FileUtils; -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -import static java.nio.file.FileVisitResult.CONTINUE; - -/** - * This is a test case for a new check introduced with MNG-4660. - * That check verifies if a packaged artifact within the Reactor is up-to-date with the outputDirectory of the same project. - * - * @author Maarten Mulders - * @author Martin Kanters - */ -public class MavenITmng4660OutdatedPackagedArtifact extends AbstractMavenIntegrationTestCase { - public MavenITmng4660OutdatedPackagedArtifact() { - super("[4.0.0-alpha-1,)"); - } - - /** - * Test that Maven logs a warning when a packaged artifact is found that is older than the outputDirectory of the - * same artifact. - * - * @throws Exception in case of failure - */ - @Test - public void testShouldWarnWhenPackagedArtifactIsOutdated() throws Exception { - final File testDir = - ResourceExtractor.simpleExtractResources(getClass(), "/mng-4660-outdated-packaged-artifact"); - - // 1. Package the whole project - final Verifier verifier1 = newVerifier(testDir.getAbsolutePath()); - verifier1.deleteDirectory("target"); - verifier1.deleteArtifacts("org.apache.maven.its.mng4660"); - - verifier1.addCliArgument("package"); - verifier1.execute(); - - Path module1Jar = - testDir.toPath().resolve("module-a/target/module-a-1.0.jar").toAbsolutePath(); - verifier1.verifyErrorFreeLog(); - verifier1.verifyFilePresent(module1Jar.toString()); - - if (System.getProperty("java.version", "").startsWith("1.")) { - // Simulating the delay between two invocations. It also makes sure we're not hit by tests that run so fast, - // that the difference in file modification time (see below) is too small to observe. Java 8 on Linux and - // macOS returns that value with "just" second precision, which is not detailed enough. - Thread.sleep(1_000); - } - - // 2. Create a properties file with some content and compile only that module (module A). - final Verifier verifier2 = newVerifier(testDir.getAbsolutePath()); - final Path resourcesDirectory = - Files.createDirectories(Paths.get(testDir.toString(), "module-a", "src", "main", "resources")); - final Path fileToWrite = resourcesDirectory.resolve("example.properties"); - FileUtils.fileWrite(fileToWrite.toString(), "x=42"); - - verifier2.setAutoclean(false); - verifier2.addCliArgument("--projects"); - verifier2.addCliArgument(":module-a"); - verifier2.addCliArgument("compile"); - verifier2.execute(); - - Path module1PropertiesFile = testDir.toPath() - .resolve("module-a/target/classes/example.properties") - .toAbsolutePath(); - - verifier2.verifyFilePresent(module1PropertiesFile.toString()); - assertTrue( - Files.getLastModifiedTime(module1PropertiesFile).compareTo(Files.getLastModifiedTime(module1Jar)) >= 0); - - Path module1Class = testDir.toPath() - .resolve("module-a/target/classes/org/apache/maven/it/Example.class") - .toAbsolutePath(); - verifier2.verifyErrorFreeLog(); - verifier2.verifyFilePresent(module1Class.toString()); - - // 3. Resume project build from module B, that depends on module A we just touched. Its packaged artifact - // is no longer in sync with its compiled artifacts. - final Verifier verifier3 = newVerifier(testDir.getAbsolutePath()); - verifier3.setAutoclean(false); - verifier3.addCliArgument("--resume-from"); - verifier3.addCliArgument(":module-b"); - verifier3.addCliArgument("compile"); - verifier3.execute(); - - verifier3.verifyErrorFreeLog(); - try { - verifier3.verifyTextInLog( - "File '" - + Paths.get("module-a", "target", "classes", "example.properties") - + "' is more recent than the packaged artifact for 'module-a', please run a full `mvn package` build"); - } catch (VerificationException e) { - final StringBuilder message = new StringBuilder(e.getMessage()); - message.append(System.lineSeparator()); - - message.append(" ") - .append(module1Jar.toAbsolutePath()) - .append(" -> ") - .append(Files.getLastModifiedTime(module1Jar)) - .append(System.lineSeparator()); - - message.append(System.lineSeparator()); - - Path outputDirectory = Paths.get(testDir.toString(), "module-a", "target", "classes"); - - Files.walkFileTree(outputDirectory, new FileVisitor() { - @Override - public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) { - return CONTINUE; - } - - @Override - public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { - message.append(" ") - .append(file.toAbsolutePath()) - .append(" -> ") - .append(attrs.lastModifiedTime()) - .append(System.lineSeparator()); - return CONTINUE; - } - - @Override - public FileVisitResult visitFileFailed(Path file, IOException exc) { - return CONTINUE; - } - - @Override - public FileVisitResult postVisitDirectory(Path dir, IOException exc) { - return CONTINUE; - } - }); - - throw new VerificationException(message.toString(), e.getCause()); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java deleted file mode 100644 index 11af77df2..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test case for MNG-4660. - * - * @author Maarten Mulders - * @author Martin Kanters - */ -public class MavenITmng4660ResumeFromTest extends AbstractMavenIntegrationTestCase { - public MavenITmng4660ResumeFromTest() { - super("[4.0.0-alpha-1,)"); - } - - /** - * Test that the --resume-from flag resolves dependencies inside the same Maven project - * without having them installed first. - * This test case uses the target/classes directory of module-a, for the situation where - * module-a has not been packaged. - * - * @throws Exception in case of failure - */ - @Test - public void testShouldResolveOutputDirectoryFromEarlierBuild() throws Exception { - final File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4660-resume-from"); - - final Verifier verifier1 = newVerifier(testDir.getAbsolutePath()); - verifier1.deleteDirectory("target"); - verifier1.deleteArtifacts("org.apache.maven.its.mng4660"); - - try { - verifier1.addCliArgument("test"); // The test goal will not create a packaged artifact - verifier1.execute(); - fail("Expected this invocation to fail"); // See TestCase.java - } catch (final VerificationException ve) { - verifier1.verifyTextInLog("Deliberately fail test case"); - } - - final Verifier verifier2 = newVerifier(testDir.getAbsolutePath()); - verifier2.setAutoclean(false); - verifier2.addCliArgument("--resume-from"); - verifier2.addCliArgument(":module-b"); - verifier2.addCliArgument("compile"); - verifier2.execute(); // to prevent the unit test from failing (again) - - verifier2.verifyErrorFreeLog(); - } - - /** - * Test that the --resume-from flag resolves dependencies inside the same Maven project - * without having them installed first. - * This test case uses the packaged artifact of module-a. - * - * @throws Exception in case of failure - */ - @Test - public void testShouldResolvePackagedArtifactFromEarlierBuild() throws Exception { - final File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4660-resume-from"); - - final Verifier verifier1 = newVerifier(testDir.getAbsolutePath()); - verifier1.deleteDirectory("target"); - verifier1.deleteArtifacts("org.apache.maven.its.mng4660"); - - try { - verifier1.addCliArgument("verify"); // The verify goal will create a packaged artifact - verifier1.execute(); - fail("Expected this invocation to fail"); // See TestCase.java - } catch (final VerificationException ve) { - verifier1.verifyTextInLog("Deliberately fail test case"); - } - - final Verifier verifier2 = newVerifier(testDir.getAbsolutePath()); - verifier2.setAutoclean(false); - verifier2.addCliArgument("--resume-from"); - verifier2.addCliArgument(":module-b"); - verifier2.addCliArgument("compile"); // to prevent the unit test from failing (again) - verifier2.execute(); - - verifier2.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4666CoreRealmImportTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4666CoreRealmImportTest.java deleted file mode 100644 index b7f592b1e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4666CoreRealmImportTest.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4666. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4666CoreRealmImportTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4666CoreRealmImportTest() { - super("[2.0.11,2.0.99),[2.1.0,3.0-alpha-1),[3.0-beta-2,)"); - } - - /** - * Verify that API types from the Maven core realm are shared/imported into the plugin realm despite the plugin - * declaring conflicting dependencies. For the core artifact filter, this boils down to the filter properly - * recognizing such a conflicting dependency, i.e. knowing the relevant groupId:artifactId's. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4666"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven", "maven-model", "0.1-stub"); - verifier.deleteArtifacts("org.apache.maven", "maven-settings", "0.1-stub"); - verifier.deleteArtifacts("org.apache.maven", "maven-project", "0.1-stub"); - verifier.deleteArtifacts("org.apache.maven", "maven-artifact", "0.1-stub"); - verifier.deleteArtifacts("org.apache.maven", "maven-core", "0.1-stub"); - verifier.deleteArtifacts("org.apache.maven", "maven-plugin-api", "0.1-stub"); - verifier.deleteArtifacts("org.apache.maven", "maven-plugin-descriptor", "0.1-stub"); - verifier.deleteArtifacts("plexus", "plexus-container-default", "0.1-stub"); - verifier.deleteArtifacts("org.codehaus.plexus", "plexus-container-default", "0.1-stub"); - verifier.deleteArtifacts("org.codehaus.plexus", "plexus-component-api", "0.1-stub"); - verifier.deleteArtifacts("org.codehaus.plexus", "plexus-utils", "0.1-stub"); - verifier.deleteArtifacts("org.codehaus.plexus", "plexus-classworlds", "0.1-stub"); - verifier.deleteArtifacts("org.sonatype.aether", "aether-api", "0.1-stub"); - verifier.deleteArtifacts("org.sonatype.aether", "aether-spi", "0.1-stub"); - verifier.deleteArtifacts("org.sonatype.aether", "aether-impl", "0.1-stub"); - verifier.deleteArtifacts("org.sonatype.sisu", "sisu-inject-plexus", "0.1-stub"); - verifier.deleteArtifacts("org.sonatype.spice", "spice-inject-plexus", "0.1-stub"); - verifier.deleteArtifacts("classworlds", "classworlds", "0.1-stub"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/type.properties"); - List types = getTypes(props); - if (!matchesVersionRange("[3.0-beta-4,)")) { - // MNG-4725, MNG-4807 - types.remove("org.codehaus.plexus.configuration.PlexusConfiguration"); - types.remove("org.codehaus.plexus.logging.Logger"); - } - assertFalse(types.isEmpty()); - for (String type : types) { - assertEquals(type, props.get("plugin." + type), props.get("core." + type)); - } - } - - private List getTypes(Properties props) { - List types = new ArrayList<>(); - for (Object o : props.keySet()) { - String key = o.toString(); - if (key.startsWith("core.")) { - String type = key.substring(5); - if (props.getProperty(key, "").length() > 0) { - // types not in the core realm can't be exported/shared, so ignore those - types.add(type); - } - } - } - return types; - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4677DisabledPluginConfigInheritanceTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4677DisabledPluginConfigInheritanceTest.java deleted file mode 100644 index 3b5f237a7..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4677DisabledPluginConfigInheritanceTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Arrays; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4677. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4677DisabledPluginConfigInheritanceTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4677DisabledPluginConfigInheritanceTest() { - super("[2.0.3,3.0-alpha-1),[3.0-beta-2,)"); - } - - /** - * Verify that the plugin-level configuration is not inherited if inherited=false is set. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4677"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("child-1/target"); - verifier.deleteDirectory("child-2/target"); - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-log-file:2.1-SNAPSHOT:log-string"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List log = verifier.loadLines("target/log.txt", "UTF-8"); - assertEquals(Arrays.asList(new String[] {"parent-only"}), log); - - log = verifier.loadLines("child-1/target/log.txt", "UTF-8"); - assertEquals(Arrays.asList(new String[] {"managed"}), log); - - log = verifier.loadLines("child-2/target/log.txt", "UTF-8"); - assertEquals(Arrays.asList(new String[] {"managed"}), log); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4679SnapshotUpdateInPluginTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4679SnapshotUpdateInPluginTest.java deleted file mode 100644 index 6ed35c03e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4679SnapshotUpdateInPluginTest.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Map; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4679. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4679SnapshotUpdateInPluginTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4679SnapshotUpdateInPluginTest() { - super("[2.0.3,3.0-alpha-1),[3.0-beta-2,)"); - } - - /** - * Verify that plugins using the 2.x style artifact resolver/collector directly are subject to the snapshot update - * mode of the current Maven session. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4679"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4679"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - - Map filterProps = verifier.newDefaultFilterMap(); - - filterProps.put("@repo@", "repo-1"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.setLogFileName("log-force-1.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - assertChecksum(verifier, "jar", "2ea5c3d713bbaba7b87746449b91cd00e876703d"); - assertChecksum(verifier, "pom", "0b58dbbc61f81b85a70692ffdce88cf1892a8da4"); - - filterProps.put("@repo@", "repo-2"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.setLogFileName("log-force-2.txt"); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-U"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - assertChecksum(verifier, "jar", "f3d46277c2ab45ff9bbd97605c942bed7fc27f97"); - assertChecksum(verifier, "pom", "127f0dc26035352bb54890315ad7d2ada067756a"); - } - - private void assertChecksum(Verifier verifier, String ext, String checksum) throws Exception { - String path = verifier.getArtifactPath("org.apache.maven.its.mng4679", "dep", "0.1-SNAPSHOT", ext); - String actual = ItUtils.calcHash(new File(path), "SHA-1"); - assertEquals(checksum, actual); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4684DistMgmtOverriddenByProfileTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4684DistMgmtOverriddenByProfileTest.java deleted file mode 100644 index e41e9b0dd..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4684DistMgmtOverriddenByProfileTest.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4684. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4684DistMgmtOverriddenByProfileTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4684DistMgmtOverriddenByProfileTest() { - super("[2.0.3,3.0-alpha-1),[3.0-beta-2,)"); - } - - /** - * Verify that active profiles can override distribution management settings. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4684"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-Pmng4684"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - - assertEquals("pr", props.getProperty("project.distributionManagement.repository.id")); - assertEquals("http://localhost/r", props.getProperty("project.distributionManagement.repository.url")); - assertEquals("", props.getProperty("project.distributionManagement.repository.name", "")); - assertEquals("default", props.getProperty("project.distributionManagement.repository.layout")); - assertEquals("true", props.getProperty("project.distributionManagement.repository.uniqueVersion")); - - assertEquals("psr", props.getProperty("project.distributionManagement.snapshotRepository.id")); - assertEquals("http://localhost/sr", props.getProperty("project.distributionManagement.snapshotRepository.url")); - assertEquals("", props.getProperty("project.distributionManagement.snapshotRepository.name", "")); - assertEquals("default", props.getProperty("project.distributionManagement.snapshotRepository.layout")); - assertEquals("true", props.getProperty("project.distributionManagement.snapshotRepository.uniqueVersion")); - - assertEquals("ps", props.getProperty("project.distributionManagement.site.id")); - assertEquals("http://localhost/s", props.getProperty("project.distributionManagement.site.url")); - assertEquals("passed", props.getProperty("project.distributionManagement.site.name")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4690InterdependentConflictResolutionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4690InterdependentConflictResolutionTest.java deleted file mode 100644 index f4ca2e088..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4690InterdependentConflictResolutionTest.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4690. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4690InterdependentConflictResolutionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4690InterdependentConflictResolutionTest() { - super("[2.0.9,)"); - } - - // Ideally, all six permutations of the three direct dependencies should yield the same result... - - @Test - public void testitADX() throws Exception { - requiresMavenVersion("[3.0-beta-3,)"); - testit("test-adx"); - } - - @Test - public void testitAXD() throws Exception { - testit("test-axd"); - } - - @Test - public void testitDAX() throws Exception { - requiresMavenVersion("[3.0-beta-3,)"); - testit("test-dax"); - } - - @Test - public void testitDXA() throws Exception { - testit("test-dxa"); - } - - @Test - public void testitXAD() throws Exception { - testit("test-xad"); - } - - @Test - public void testitXDA() throws Exception { - testit("test-xda"); - } - - /** - * Verify that conflict resolution doesn't depend on the declaration order of dependencies (from distinct tree - * levels) when the resolution of one conflict influences another conflict. - */ - private void testit(String test) throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4690"); - - Verifier verifier = newVerifier(new File(testDir, test).getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4690"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("../settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List classpath = verifier.loadLines("target/classpath.txt", "UTF-8"); - - assertTrue(test + " > " + classpath.toString(), classpath.contains("a-1.jar")); - assertTrue(test + " > " + classpath.toString(), classpath.contains("b-1.jar")); - assertTrue(test + " > " + classpath.toString(), classpath.contains("c-1.jar")); - assertTrue(test + " > " + classpath.toString(), classpath.contains("d-1.jar")); - - assertTrue(test + " > " + classpath.toString(), classpath.contains("x-1.jar")); - assertTrue(test + " > " + classpath.toString(), classpath.contains("y-2.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4696MavenProjectDependencyArtifactsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4696MavenProjectDependencyArtifactsTest.java deleted file mode 100644 index bf3b08d38..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4696MavenProjectDependencyArtifactsTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.HashSet; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4696. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4696MavenProjectDependencyArtifactsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4696MavenProjectDependencyArtifactsTest() { - super("[2.0.3,3.0-alpha-1),[3.0-beta-2,)"); - } - - /** - * Verify that MavenProject.getDependencyArtifacts() returns all direct dependencies regardless of their scope. - * In other words, getDependencyArtifacts() is in general not a subset of MavenProject.getArtifacts() as the - * latter is subject to scope filtering as requested by plugins. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4696"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4696"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("initialize"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/artifact.properties"); - assertEquals("3", props.getProperty("project.dependencyArtifacts.size")); - - HashSet ids = new HashSet<>(); - ids.add(props.getProperty("project.dependencyArtifacts.0.artifactId")); - ids.add(props.getProperty("project.dependencyArtifacts.1.artifactId")); - ids.add(props.getProperty("project.dependencyArtifacts.2.artifactId")); - assertTrue(ids.toString(), ids.contains("b")); - assertTrue(ids.toString(), ids.contains("c")); - assertTrue(ids.toString(), ids.contains("d")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4720DependencyManagementExclusionMergeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4720DependencyManagementExclusionMergeTest.java deleted file mode 100644 index 34810b4b3..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4720DependencyManagementExclusionMergeTest.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4720. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4720DependencyManagementExclusionMergeTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4720DependencyManagementExclusionMergeTest() { - super("[2.0.6,)"); - } - - /** - * Verify the effective exclusions applied during transitive dependency resolution when both the regular - * dependency section and dependency management declare exclusions for a particular dependency. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4720"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4720"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List classpath = verifier.loadLines("target/classpath.txt", "UTF-8"); - - assertTrue(classpath.toString(), classpath.contains("a-0.1.jar")); - assertTrue(classpath.toString(), classpath.contains("c-0.1.jar")); - - assertFalse(classpath.toString(), classpath.contains("b-0.1.jar")); - - // should better have been excluded as well, now it's a matter of backward-compat - assertTrue(classpath.toString(), classpath.contains("d-0.1.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4721OptionalPluginDependencyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4721OptionalPluginDependencyTest.java deleted file mode 100644 index eb2f2e984..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4721OptionalPluginDependencyTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4721. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4721OptionalPluginDependencyTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4721OptionalPluginDependencyTest() { - super("[2.0.3,)"); - } - - /** - * Verify the handling of direct/transitive optional plugin dependencies. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4721"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4721"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pcl.properties"); - assertEquals("1", props.get("org/apache/maven/plugin/coreit/c.properties.count")); - assertEquals("1", props.get("mng4721a.properties.count")); - assertEquals("0", props.get("mng4721b.properties.count")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4729MirrorProxyAuthUsedByProjectBuilderTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4729MirrorProxyAuthUsedByProjectBuilderTest.java deleted file mode 100644 index 370fde08e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4729MirrorProxyAuthUsedByProjectBuilderTest.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Map; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.security.ConstraintMapping; -import org.eclipse.jetty.security.ConstraintSecurityHandler; -import org.eclipse.jetty.security.HashLoginService; -import org.eclipse.jetty.security.UserStore; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.DefaultHandler; -import org.eclipse.jetty.server.handler.HandlerList; -import org.eclipse.jetty.server.handler.ResourceHandler; -import org.eclipse.jetty.util.security.Constraint; -import org.eclipse.jetty.util.security.Password; -import org.junit.jupiter.api.Test; - -import static org.eclipse.jetty.util.security.Constraint.__BASIC_AUTH; - -/** - * This is a test set for MNG-4729. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4729MirrorProxyAuthUsedByProjectBuilderTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4729MirrorProxyAuthUsedByProjectBuilderTest() { - super("[2.0.3,3.0-alpha-1),[3.0-beta-2,)"); - } - - /** - * Test that the 2.x project builder obeys the network settings (mirror, proxy, auth) when building remote POMs - * and discovering additional repositories. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4729"); - - Constraint constraint = new Constraint(); - constraint.setName(Constraint.__BASIC_AUTH); - constraint.setRoles(new String[] {"user"}); - constraint.setAuthenticate(true); - - ConstraintMapping constraintMapping = new ConstraintMapping(); - constraintMapping.setConstraint(constraint); - constraintMapping.setPathSpec("/*"); - - HashLoginService userRealm = new HashLoginService("TestRealm"); - UserStore userStore = new UserStore(); - userStore.addUser("testuser", new Password("testtest"), new String[] {"user"}); - userRealm.setUserStore(userStore); - - Server server = new Server(0); - ConstraintSecurityHandler securityHandler = new ConstraintSecurityHandler(); - securityHandler.setLoginService(userRealm); - securityHandler.setAuthMethod(__BASIC_AUTH); - securityHandler.setConstraintMappings(new ConstraintMapping[] {constraintMapping}); - - ResourceHandler repoHandler = new ResourceHandler(); - repoHandler.setResourceBase(testDir.getAbsolutePath()); - - HandlerList handlerList = new HandlerList(); - handlerList.addHandler(securityHandler); - handlerList.addHandler(repoHandler); - handlerList.addHandler(new DefaultHandler()); - - server.setHandler(handlerList); - server.start(); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - try { - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - int port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + port); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4729"); - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@port@", Integer.toString(port)); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - assertEquals("PASSED", props.get("org.apache.maven.its.mng4729:a:jar:0.1.project.name")); - } finally { - server.stop(); - server.join(); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4745PluginVersionUpdateTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4745PluginVersionUpdateTest.java deleted file mode 100644 index 70ca53e14..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4745PluginVersionUpdateTest.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Map; -import java.util.Properties; - -import org.apache.maven.shared.utils.io.FileUtils; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4745. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4745PluginVersionUpdateTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4745PluginVersionUpdateTest() { - super("[2.0.3,3.0-alpha-1),[3.0-beta-2,)"); - } - - /** - * Verify that the update policy of a (plugin) repository affects the check for newer plugin versions. - * - * @throws Exception in case of failure - */ - @Test - public void testitRepoPolicyAlways() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4745"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.setForkJvm(true); - verifier.deleteArtifacts("org.apache.maven.its.mng4745"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@updates@", "always"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - - writeMetadata(testDir, "1.0", "20100729123455"); - verifier.setLogFileName("log-1a.txt"); - verifier.addCliArgument("org.apache.maven.its.mng4745:maven-it-plugin:touch"); - verifier.execute(); - - writeMetadata(testDir, "1.1", "20100730123456"); - verifier.setLogFileName("log-1b.txt"); - verifier.addCliArgument("org.apache.maven.its.mng4745:maven-it-plugin:touch"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/plugin.properties"); - assertEquals("1.1", props.get("plugin.version")); - } - - /** - * Verify that the update policy of a (plugin) repository affects the check for newer plugin versions. - * - * @throws Exception in case of failure - */ - @Test - public void testitRepoPolicyNever() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4745"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.setForkJvm(true); - verifier.deleteArtifacts("org.apache.maven.its.mng4745"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@updates@", "never"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - - writeMetadata(testDir, "1.0", "20100729123455"); - verifier.setLogFileName("log-2a.txt"); - verifier.addCliArgument("org.apache.maven.its.mng4745:maven-it-plugin:touch"); - verifier.execute(); - - writeMetadata(testDir, "1.1", "20100730123456"); - verifier.setLogFileName("log-2b.txt"); - verifier.addCliArgument("org.apache.maven.its.mng4745:maven-it-plugin:touch"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/plugin.properties"); - assertEquals("1.0", props.get("plugin.version")); - } - - /** - * Verify that the CLI's force update flag affects the check for newer plugin versions. - * - * @throws Exception in case of failure - */ - @Test - public void testitForceUpdate() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4745"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.setForkJvm(true); - verifier.deleteArtifacts("org.apache.maven.its.mng4745"); - verifier.addCliArgument("-U"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@updates@", "never"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - - writeMetadata(testDir, "1.0", "20100729123455"); - verifier.setLogFileName("log-3a.txt"); - verifier.addCliArgument("org.apache.maven.its.mng4745:maven-it-plugin:touch"); - verifier.execute(); - - writeMetadata(testDir, "1.1", "20100730123456"); - verifier.setLogFileName("log-3b.txt"); - verifier.addCliArgument("org.apache.maven.its.mng4745:maven-it-plugin:touch"); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/plugin.properties"); - assertEquals("1.1", props.get("plugin.version")); - } - - private static void writeMetadata(File testdir, String version, String timestamp) throws Exception { - StringBuilder content = new StringBuilder(1024); - content.append("\n"); - content.append("\n"); - content.append(" org.apache.maven.its.mng4745\n"); - content.append(" maven-it-plugin\n"); - content.append(" \n"); - content.append(" " + version + "\n"); - content.append(" " + version + "\n"); - content.append(" \n"); - content.append(" 1.0\n"); - content.append(" \n"); - content.append(" " + timestamp + "\n"); - content.append(" \n"); - content.append("\n"); - - File metadata = new File(testdir, "repo/org/apache/maven/its/mng4745/maven-it-plugin/maven-metadata.xml"); - metadata.getParentFile().mkdirs(); - FileUtils.fileWrite(metadata.getAbsolutePath(), "UTF-8", content.toString()); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4747JavaAgentUsedByPluginTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4747JavaAgentUsedByPluginTest.java deleted file mode 100644 index b5eb4cd93..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4747JavaAgentUsedByPluginTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4747. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4747JavaAgentUsedByPluginTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4747JavaAgentUsedByPluginTest() { - super("[2.0.3,3.0-alpha-1),[3.0-beta-2,)"); - } - - /** - * Verify that classes from JRE agents can be loaded from plugins. Agents are loaded into the system class loader - * and hence plugins must have access to the system class loader. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - requiresJavaVersion("[1.5,)"); - - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4747"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.setEnvironmentVariable("MAVEN_OPTS", "-javaagent:agent.jar"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props1 = verifier.loadProperties("target/agent.properties"); - Properties props2 = verifier.loadProperties("target/plugin.properties"); - assertNotNull(props1.get("Mng4747Agent")); - assertEquals(props1.get("Mng4747Agent"), props2.get("Mng4747Agent")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4750ResolvedMavenProjectDependencyArtifactsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4750ResolvedMavenProjectDependencyArtifactsTest.java deleted file mode 100644 index 105437f1a..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4750ResolvedMavenProjectDependencyArtifactsTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4750 and - * MNG-4845. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4750ResolvedMavenProjectDependencyArtifactsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4750ResolvedMavenProjectDependencyArtifactsTest() { - super("[2.0.3,3.0-alpha-1),[3.0,)"); - } - - /** - * Verify that MavenProject.getDependencyArtifacts() returns resolved artifacts (once dependency resolution - * was requested). - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4750"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4750"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("initialize"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/artifact.properties"); - assertEquals("1", props.getProperty("project.dependencyArtifacts.size")); - - String path = props.getProperty("project.dependencyArtifacts.0.file"); - assertNotNull(path); - assertTrue(path, new File(path).isFile()); - - String version = props.getProperty("project.dependencyArtifacts.0.version"); - assertEquals("0.1", version); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4755FetchRemoteMetadataForVersionRangeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4755FetchRemoteMetadataForVersionRangeTest.java deleted file mode 100644 index 513b016a9..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4755FetchRemoteMetadataForVersionRangeTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4755. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4755FetchRemoteMetadataForVersionRangeTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4755FetchRemoteMetadataForVersionRangeTest() { - super("[2.0.3,3.0-alpha-1),[3.0-beta-3,)"); - } - - /** - * Verify that locally installed artifacts don't suppress fetching of g:a-level remote metadata which is required - * to locate alternative version (as required by version ranges). - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4755"); - - // setup: install a local version - Verifier verifier = newVerifier(new File(testDir, "dependency").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4755"); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // test: resolve remote version - verifier = newVerifier(new File(testDir, "test").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List cp = verifier.loadLines("target/classpath.txt", "UTF-8"); - assertTrue(cp.toString(), cp.contains("dep-1.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4761PluginLevelDependencyScopesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4761PluginLevelDependencyScopesTest.java deleted file mode 100644 index 9b282653f..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4761PluginLevelDependencyScopesTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4761. - * - * @author jdcasey - */ -@Tag("disabled") -public class MavenITmng4761PluginLevelDependencyScopesTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4761PluginLevelDependencyScopesTest() { - super("(2.2.1,2.99)(3.0-beta-2,)"); - } - - /** - * Verify that plugin-level dependencies specified in a user's pom.xml DO NOT use compile scope. - * Using any scope other than runtime for plugin dependencies may favor them and their transitive - * dependencies inappropriately, leading to unpredictable results. - * - * Plugin-dependency scope should be DISREGARDED, and runtime scope should be forced. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - final File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4761"); - - final Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4761"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4765LocalPomProjectBuilderTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4765LocalPomProjectBuilderTest.java deleted file mode 100644 index 9295741a2..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4765LocalPomProjectBuilderTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4765. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4765LocalPomProjectBuilderTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4765LocalPomProjectBuilderTest() { - super("[2.0.3,3.0-alpha-1),[3.0-beta-3,)"); - } - - /** - * Test that the 2.x project builder can be invoked directly by plugins and can access the session state. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4765"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-Duser.prop=OK"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - assertEquals("PASSED - OK", props.get("test.xml.project.name")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4768NearestMatchConflictResolutionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4768NearestMatchConflictResolutionTest.java deleted file mode 100644 index 07a17c46d..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4768NearestMatchConflictResolutionTest.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4768. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4768NearestMatchConflictResolutionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4768NearestMatchConflictResolutionTest() { - super("[2.0.9,)"); - } - - // Ideally, all six permutations of the three direct dependencies should yield the same result... - - @Test - public void testitABD() throws Exception { - testit("test-abd"); - } - - @Test - public void testitADB() throws Exception { - requiresMavenVersion("[3.0-beta-3,)"); - testit("test-adb"); - } - - @Test - public void testitBAD() throws Exception { - testit("test-bad"); - } - - @Test - public void testitBDA() throws Exception { - testit("test-bda"); - } - - @Test - public void testitDAB() throws Exception { - requiresMavenVersion("[3.0-beta-3,)"); - testit("test-dab"); - } - - @Test - public void testitDBA() throws Exception { - testit("test-dba"); - } - - /** - * Verify that conflict resolution picks the nearest version that matches all hard constraints given by ranges. - * And for conflicting dependencies on distinct tree levels, "nearest" shouldn't be subject to the dependency - * order. - */ - private void testit(String test) throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4768"); - - Verifier verifier = newVerifier(new File(testDir, test).getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4768"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("../settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List classpath = verifier.loadLines("target/classpath.txt", "UTF-8"); - - assertTrue(test + " > " + classpath.toString(), classpath.contains("a-2.0.jar")); - assertTrue(test + " > " + classpath.toString(), classpath.contains("b-0.1.jar")); - assertTrue(test + " > " + classpath.toString(), classpath.contains("c-0.1.jar")); - assertTrue(test + " > " + classpath.toString(), classpath.contains("d-0.1.jar")); - - assertFalse(test + " > " + classpath.toString(), classpath.contains("a-2.1.jar")); - assertFalse(test + " > " + classpath.toString(), classpath.contains("a-1.0.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4771PluginPrefixResolutionDoesntTouchDisabledRepoTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4771PluginPrefixResolutionDoesntTouchDisabledRepoTest.java deleted file mode 100644 index 1de286411..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4771PluginPrefixResolutionDoesntTouchDisabledRepoTest.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import java.io.File; -import java.util.Deque; -import java.util.Map; -import java.util.concurrent.ConcurrentLinkedDeque; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.AbstractHandler; -import org.eclipse.jetty.server.handler.DefaultHandler; -import org.eclipse.jetty.server.handler.HandlerList; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4771. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4771PluginPrefixResolutionDoesntTouchDisabledRepoTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4771PluginPrefixResolutionDoesntTouchDisabledRepoTest() { - super("[2.0.3,3.0-alpha-1),[3.0-beta-3,)"); - } - - /** - * Verify that repositories which have both releases and snapshots disabled aren't touched when looking for - * plugin prefix mappings. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4771"); - - final Deque requestedUris = new ConcurrentLinkedDeque<>(); - - AbstractHandler logHandler = new AbstractHandler() { - @Override - public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { - requestedUris.add(request.getRequestURI()); - } - }; - - HandlerList handlerList = new HandlerList(); - handlerList.addHandler(logHandler); - handlerList.addHandler(new DefaultHandler()); - - Server server = new Server(0); - server.setHandler(handlerList); - server.start(); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - try { - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - int port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + port); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@port@", Integer.toString(port)); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.addCliArgument("-U"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("mng4771:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Build should have failed to resolve unknown prefix"); - } catch (VerificationException e) { - // expected - } finally { - server.stop(); - server.join(); - } - - assertTrue(requestedUris.toString(), requestedUris.isEmpty()); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4772PluginVersionResolutionDoesntTouchDisabledRepoTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4772PluginVersionResolutionDoesntTouchDisabledRepoTest.java deleted file mode 100644 index aea30bd82..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4772PluginVersionResolutionDoesntTouchDisabledRepoTest.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import java.io.File; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.AbstractHandler; -import org.eclipse.jetty.server.handler.DefaultHandler; -import org.eclipse.jetty.server.handler.HandlerList; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4772. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4772PluginVersionResolutionDoesntTouchDisabledRepoTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4772PluginVersionResolutionDoesntTouchDisabledRepoTest() { - super("[2.0.3,3.0-alpha-1),[3.0-beta-3,)"); - } - - /** - * Verify that repositories which have both releases and snapshots disabled aren't touched when looking for - * the latest plugin version. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4772"); - - final List requestedUris = Collections.synchronizedList(new ArrayList<>()); - - AbstractHandler logHandler = new AbstractHandler() { - @Override - public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { - requestedUris.add(request.getRequestURI()); - } - }; - - HandlerList handlerList = new HandlerList(); - handlerList.addHandler(logHandler); - handlerList.addHandler(new DefaultHandler()); - - Server server = new Server(0); - server.setHandler(handlerList); - server.start(); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - try { - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - int port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + port); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@port@", Integer.toString(port)); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.addCliArgument("-U"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("org.apache.maven.its.mng4772:maven-it-plugin:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Build should have failed to resolve version for unknown plugin"); - } catch (VerificationException e) { - // expected - } finally { - server.stop(); - server.join(); - } - - assertTrue(requestedUris.toString(), requestedUris.isEmpty()); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4776ForkedReactorPluginVersionResolutionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4776ForkedReactorPluginVersionResolutionTest.java deleted file mode 100644 index 956b66012..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4776ForkedReactorPluginVersionResolutionTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4776. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4776ForkedReactorPluginVersionResolutionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4776ForkedReactorPluginVersionResolutionTest() { - super("[2.0.3,3.0-alpha-1),[3.0-beta-3,)"); - } - - /** - * Verify that missing plugin versions in the POM are resolved for all projects on which a forking aggregator mojo - * will be run and not just the top-level project. This test checks the case of the mojo being invoked from a - * lifecycle phase. - * - * @throws Exception in case of failure - */ - @Test - public void testitLifecycle() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4776"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("sub/target"); - verifier.setLogFileName("log-lifecycle.txt"); - verifier.addCliArgument("test"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("sub/target/log.txt"); - } - - /** - * Verify that missing plugin versions in the POM are resolved for all projects on which a forking aggregator mojo - * will be run and not just the top-level project. This test checks the case of the mojo being invoked from the - * command line - * - * @throws Exception in case of failure - */ - @Test - public void testitCmdLine() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4776"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("sub/target"); - verifier.setLogFileName("log-cli.txt"); - verifier.addCliArgument( - "org.apache.maven.its.plugins:maven-it-plugin-fork:2.1-SNAPSHOT:fork-lifecycle-aggregator"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("sub/target/log.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4779MultipleDepsWithVersionRangeFromLocalRepoTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4779MultipleDepsWithVersionRangeFromLocalRepoTest.java deleted file mode 100644 index 4224a30fd..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4779MultipleDepsWithVersionRangeFromLocalRepoTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4779. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4779MultipleDepsWithVersionRangeFromLocalRepoTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4779MultipleDepsWithVersionRangeFromLocalRepoTest() { - super("[2.0.3,)"); - } - - /** - * Test that dependency resolution doesn't error out when a dependency with a range satisfied from the local repo - * is seen more than once during the collection. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4779"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("test/target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4779"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List classpath = verifier.loadLines("test/target/classpath.txt", "UTF-8"); - - assertEquals(classpath.toString(), 4, classpath.size()); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4781DeploymentToNexusStagingRepoTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4781DeploymentToNexusStagingRepoTest.java deleted file mode 100644 index 2c93aa7f7..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4781DeploymentToNexusStagingRepoTest.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import java.io.File; -import java.util.Deque; -import java.util.concurrent.ConcurrentLinkedDeque; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.server.Handler; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.AbstractHandler; -import org.eclipse.jetty.server.handler.HandlerList; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4781. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4781DeploymentToNexusStagingRepoTest extends AbstractMavenIntegrationTestCase { - private Server server; - - private int port; - - private final Deque requestedUris = new ConcurrentLinkedDeque<>(); - - private final Deque deployedUris = new ConcurrentLinkedDeque<>(); - - public MavenITmng4781DeploymentToNexusStagingRepoTest() { - super("[2.0.3,)"); - } - - @BeforeEach - public void setUp() throws Exception { - Handler repoHandler = new AbstractHandler() { - private volatile boolean putSeen; - - @Override - public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { - System.out.println("Handling " + request.getMethod() + " " + request.getRequestURL()); - - if ("PUT".equalsIgnoreCase(request.getMethod())) { - response.setStatus(HttpServletResponse.SC_CREATED); - deployedUris.add(request.getRequestURI()); - putSeen = true; - } else if (!putSeen) { - response.setStatus(HttpServletResponse.SC_BAD_REQUEST); - } else { - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - requestedUris.add(request.getRequestURI()); - } - - ((Request) request).setHandled(true); - } - }; - - HandlerList handlerList = new HandlerList(); - handlerList.addHandler(repoHandler); - - server = new Server(0); - server.setHandler(handlerList); - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + port); - } - - @AfterEach - protected void tearDown() throws Exception { - if (server != null) { - server.stop(); - server.join(); - } - - requestedUris.clear(); - deployedUris.clear(); - } - - /** - * Verify that deployment to a Nexus-like staging repository works. The subtle difference compared to an ordinary - * HTTP/WebDAV server is that those staging repos yield a HTTP 400 (and not 404) for every GET request until a - * PUT request is made (which initializes the staging repo). The bottom line is that remote metadata must not be - * requested before the first artifact is deployed. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4781"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("-DdeploymentPort=" + port); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - assertTrue(deployedUris.contains("/repo/org/apache/maven/its/mng4781/release/1.0/release-1.0.jar")); - assertTrue(deployedUris.contains("/repo/org/apache/maven/its/mng4781/release/1.0/release-1.0.pom")); - assertTrue(deployedUris.contains("/repo/org/apache/maven/its/mng4781/release/maven-metadata.xml")); - assertTrue(requestedUris.contains("/repo/org/apache/maven/its/mng4781/release/maven-metadata.xml")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4785TransitiveResolutionInForkedThreadTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4785TransitiveResolutionInForkedThreadTest.java deleted file mode 100644 index 144504a93..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4785TransitiveResolutionInForkedThreadTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4785. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4785TransitiveResolutionInForkedThreadTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4785TransitiveResolutionInForkedThreadTest() { - super("[2.0.3,3.0-alpha-1),[3.0-beta-4,)"); - } - - /** - * Verify that dependency resolution using the 2.x API in forked threads works (e.g. has access to any required - * session state). - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4785"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4785"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/artifacts.properties"); - String path = props.getProperty("org.apache.maven.its.mng4785:dep:jar:0.1-SNAPSHOT", ""); - assertTrue(path, path.endsWith("dep-0.1-SNAPSHOT.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4786AntBased21xMojoSupportTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4786AntBased21xMojoSupportTest.java deleted file mode 100644 index ae39710ca..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4786AntBased21xMojoSupportTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4786. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4786AntBased21xMojoSupportTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4786AntBased21xMojoSupportTest() { - super("[2.0.3,3.0-alpha-1),[3.0-beta-4,)"); - } - - /** - * Verify that plugins whose mojos are implemented as Ant scripts and use the Maven 2.1.x Ant support can be - * invoked. The essential bits here are that Ant-based mojos are instantiated via a custom component factory, yet - * must undergo the same IoC as for regular Java components. And the 2.1.x Ant support actually requires injection - * of a logger. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4786"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/ant.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4788InstallationToCustomLocalRepoTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4788InstallationToCustomLocalRepoTest.java deleted file mode 100644 index f69f1be2f..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4788InstallationToCustomLocalRepoTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4788. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4788InstallationToCustomLocalRepoTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4788InstallationToCustomLocalRepoTest() { - super("[2.0.3,3.0-alpha-1),[3.0-beta-4,)"); - } - - /** - * Verify that plugins can install artifacts to a custom local repo (i.e. custom base dir and custom layout). - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4788"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/local-repo/test-0.1-SNAPSHOT.jar"); - verifier.verifyFileNotPresent( - "target/local-repo/org/apache/maven/its/mng4788/test/0.1-SNAPSHOT/test-0.1-SNAPSHOT.jar"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4789ScopeInheritanceMeetsConflictTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4789ScopeInheritanceMeetsConflictTest.java deleted file mode 100644 index b1124331f..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4789ScopeInheritanceMeetsConflictTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4789. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4789ScopeInheritanceMeetsConflictTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4789ScopeInheritanceMeetsConflictTest() { - super("[2.0.3,3.0-alpha-1),[3.0-beta-4,)"); - } - - /** - * Test that scope inheritance considers the effective scope of parent nodes as enforced by direct dependency - * declarations. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4789"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteArtifacts("org.apache.maven.its.mng4789"); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List compile = verifier.loadLines("target/compile.txt", "UTF-8"); - assertFalse(compile.toString(), compile.contains("a-0.1.jar")); - assertTrue(compile.toString(), compile.contains("b-0.1.jar")); - assertFalse(compile.toString(), compile.contains("x-0.1.jar")); - - List runtime = verifier.loadLines("target/runtime.txt", "UTF-8"); - assertFalse(runtime.toString(), runtime.contains("a-0.1.jar")); - assertTrue(runtime.toString(), runtime.contains("b-0.1.jar")); - assertFalse(runtime.toString(), runtime.contains("x-0.1.jar")); - - List test = verifier.loadLines("target/test.txt", "UTF-8"); - assertTrue(test.toString(), test.contains("a-0.1.jar")); - assertTrue(test.toString(), test.contains("b-0.1.jar")); - assertTrue(test.toString(), test.contains("x-0.1.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4791ProjectBuilderResolvesRemotePomArtifactTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4791ProjectBuilderResolvesRemotePomArtifactTest.java deleted file mode 100644 index c27ec6971..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4791ProjectBuilderResolvesRemotePomArtifactTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4791. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4791ProjectBuilderResolvesRemotePomArtifactTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4791ProjectBuilderResolvesRemotePomArtifactTest() { - super("[2.0.3,3.0-alpha-1),[3.0-beta-4,)"); - } - - /** - * Test that the project builder resolves the input artifact when building remote POMs if the input artifact - * happens to be of type "pom". - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4791"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4791"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - - assertEquals( - "0.1-20100902.190819-1", props.getProperty("org.apache.maven.its.mng4791:a:pom:0.1-SNAPSHOT.version")); - String path = props.getProperty("org.apache.maven.its.mng4791:a:pom:0.1-SNAPSHOT.file"); - assertTrue(path, path.endsWith(".pom")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4795DepResolutionInReactorProjectForkedByLifecycleTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4795DepResolutionInReactorProjectForkedByLifecycleTest.java deleted file mode 100644 index 7c08213ca..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4795DepResolutionInReactorProjectForkedByLifecycleTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4795. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4795DepResolutionInReactorProjectForkedByLifecycleTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4795DepResolutionInReactorProjectForkedByLifecycleTest() { - super("[2.0.3,3.0-alpha-1),[3.0-beta-4,)"); - } - - /** - * Test that reactor projects forked by an aggregator mojo bound to a lifecycle phase are subject to dependency - * resolution as required by their respective build plugins. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4795"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("sub/target"); - verifier.addCliArgument("process-sources"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List compile0 = verifier.loadLines("sub/target/compile-0.txt", "UTF-8"); - assertTrue(compile0.toString(), compile0.contains("maven-core-it-support-1.0.jar")); - - List compile1 = verifier.loadLines("sub/target/compile-1.txt", "UTF-8"); - assertTrue(compile1.toString(), compile1.contains("maven-core-it-support-1.0.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4800NearestWinsVsScopeWideningTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4800NearestWinsVsScopeWideningTest.java deleted file mode 100644 index fae02a1af..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4800NearestWinsVsScopeWideningTest.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4800. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4800NearestWinsVsScopeWideningTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4800NearestWinsVsScopeWideningTest() { - super("[3.0-beta-4,)"); - } - - @Test - public void testitAB() throws Exception { - testit("test-ab"); - } - - @Test - public void testitBA() throws Exception { - testit("test-ba"); - } - - /** - * Verify that nearest-wins conflict resolution doesn't get confused when a farther conflicting dependency has - * a wider scope than the nearer dependency, i.e. one should still end up with the nearer dependency (s:1) and - * its subtree (x) but in the wider scope (compile). - */ - private void testit(String test) throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4800"); - - Verifier verifier = newVerifier(new File(testDir, test).getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4800"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("../settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List compile = verifier.loadLines("target/compile.txt", "UTF-8"); - - assertTrue(test + " > " + compile.toString(), compile.contains("b-0.1.jar")); - assertTrue(test + " > " + compile.toString(), compile.contains("c-0.1.jar")); - assertTrue(test + " > " + compile.toString(), compile.contains("s-0.1.jar")); - assertTrue(test + " > " + compile.toString(), compile.contains("x-0.1.jar")); - assertFalse(test + " > " + compile.toString(), compile.contains("a-0.1.jar")); - assertFalse(test + " > " + compile.toString(), compile.contains("s-0.2.jar")); - assertFalse(test + " > " + compile.toString(), compile.contains("y-0.1.jar")); - - List runtime = verifier.loadLines("target/runtime.txt", "UTF-8"); - - assertTrue(test + " > " + runtime.toString(), runtime.contains("b-0.1.jar")); - assertTrue(test + " > " + runtime.toString(), runtime.contains("c-0.1.jar")); - assertTrue(test + " > " + runtime.toString(), runtime.contains("s-0.1.jar")); - assertTrue(test + " > " + runtime.toString(), runtime.contains("x-0.1.jar")); - assertTrue(test + " > " + runtime.toString(), runtime.contains("a-0.1.jar")); - assertFalse(test + " > " + runtime.toString(), runtime.contains("s-0.2.jar")); - assertFalse(test + " > " + runtime.toString(), runtime.contains("y-0.1.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4811CustomComponentConfiguratorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4811CustomComponentConfiguratorTest.java deleted file mode 100644 index 8d238034d..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4811CustomComponentConfiguratorTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4811. - */ -public class MavenITmng4811CustomComponentConfiguratorTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4811CustomComponentConfiguratorTest() { - super("[2.0.3,3.0-alpha-1)[3.0,)"); - } - - /** - * Verify that plugins can use custom component configurators. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4811"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/config.properties"); - assertEquals("PASSED", props.getProperty("stringParam")); - assertEquals("configured", props.getProperty("customParam")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4814ReResolutionOfDependenciesDuringReactorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4814ReResolutionOfDependenciesDuringReactorTest.java deleted file mode 100644 index e70267c28..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4814ReResolutionOfDependenciesDuringReactorTest.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4814. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4814ReResolutionOfDependenciesDuringReactorTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4814ReResolutionOfDependenciesDuringReactorTest() { - super("[3.0,)"); - } - - /** - * Verify that dependency resolution by an aggregator before the build has actually produced any artifacts - * doesn't prevent later resolution of project artifacts from the reactor if the aggregator originally resolved - * them from the remote repo. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4814"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("consumer/target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4814"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArguments( - "validate", - "org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution:2.1-SNAPSHOT:aggregate-test"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List compile = verifier.loadLines("consumer/target/compile.txt", "UTF-8"); - - assertFalse(compile.toString(), compile.contains("0.1-SNAPSHOT/producer-0.1-SNAPSHOT.jar")); - assertTrue(compile.toString(), compile.contains("producer/pom.xml")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4829ChecksumFailureWarningTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4829ChecksumFailureWarningTest.java deleted file mode 100644 index 6954018de..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4829ChecksumFailureWarningTest.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4829. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4829ChecksumFailureWarningTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4829ChecksumFailureWarningTest() { - super("[2.0.3,3.0-alpha-1)[3.0,)"); - } - - /** - * Verify that artifacts with mismatching checksums cause a warning on the console. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4829"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4829"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.setEnvironmentVariable("CI", "false"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List lines = verifier.loadFile(new File(testDir, verifier.getLogFileName()), false); - - boolean foundWarningJar = false, foundWarningPom = false; - - for (String line : lines) { - if (line.matches("(?i)\\[WARNING\\].*Checksum.*failed.*fa23720355eead3906fdf4ffd2a1a5f5.*")) { - foundWarningPom = true; - } else if (line.matches( - "(?i)\\[WARNING\\].*Checksum.*failed.*d912aa49cba88e7e9c578e042953f7ce307daac5.*")) { - foundWarningJar = true; - } - } - - assertTrue("Checksum warning for corrupt.pom has not been logged.", foundWarningPom); - assertTrue("Checksum warning for corrupt.jar has not been logged.", foundWarningJar); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4834ParentProjectResolvedFromRemoteReposTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4834ParentProjectResolvedFromRemoteReposTest.java deleted file mode 100644 index 2bdefe27b..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4834ParentProjectResolvedFromRemoteReposTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4834. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4834ParentProjectResolvedFromRemoteReposTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4834ParentProjectResolvedFromRemoteReposTest() { - super("[2.0.3,3.0-alpha-1),[3.0,)"); - } - - /** - * Verify that MavenProject.getParent() can (lazily) resolve the parent from repositories contributed by the - * settings. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4834"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4834"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - assertEquals("PASSED", props.getProperty("project.parent.description")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4840MavenPrerequisiteTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4840MavenPrerequisiteTest.java deleted file mode 100644 index 802548298..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4840MavenPrerequisiteTest.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4840. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4840MavenPrerequisiteTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4840MavenPrerequisiteTest() { - super("[2.1.0,3.0-alpha-1),[3.0.2,)"); - } - - /** - * Verify that builds fail straight when the current Maven version doesn't match a plugin's prerequisite. - * - * @throws Exception in case of failure - */ - @Test - public void testitMojoExecution() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4840"); - - Verifier verifier = newVerifier(new File(testDir, "test-1").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4840"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("../settings-template.xml", "settings.xml", "UTF-8"); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Build did not fail despite unsatisfied prerequisite of plugin on Maven version."); - } catch (Exception e) { - // expected, unsolvable version conflict - } - } - - /** - * Verify that automatic plugin version resolution automatically skips plugin versions whose prerequisite on - * the current Maven version isn't satisfied. - * - * @throws Exception in case of failure - */ - @Test - public void testitPluginVersionResolution() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4840"); - - Verifier verifier = newVerifier(new File(testDir, "test-2").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4840"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("../settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("org.apache.maven.its.mng4840:maven-mng4840-plugin:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch-1.txt"); - verifier.verifyFileNotPresent("target/touch-2.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4842ParentResolutionOfDependencyPomTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4842ParentResolutionOfDependencyPomTest.java deleted file mode 100644 index f4bf7c337..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4842ParentResolutionOfDependencyPomTest.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4842. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4842ParentResolutionOfDependencyPomTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4842ParentResolutionOfDependencyPomTest() { - super("[2.0.3,3.0-alpha-1),[3.0,)"); - } - - /** - * Verify that resolution of parent POMs for dependency POMs treats the remote repositories of the current - * resolution request as dominant when merging with any repositories declared in the dependency POM. This - * variant of the test checks dependency resolution by the core. - * - * @throws Exception in case of failure - */ - @Test - public void testitCore() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4842"); - - Verifier verifier = newVerifier(new File(testDir, "core").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4842"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("../settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List compile = verifier.loadLines("target/compile.txt", "UTF-8"); - - assertTrue(compile.toString(), compile.contains("dep-0.1.jar")); - verifier.verifyArtifactPresent("org.apache.maven.its.mng4842", "parent", "0.1", "pom"); - } - - /** - * Verify that resolution of parent POMs for dependency POMs treats the remote repositories of the current - * resolution request as dominant when merging with any repositories declared in the dependency POM. This - * variant of the test checks manual dependency resolution by a plugin. - * - * @throws Exception in case of failure - */ - @Test - public void testitPlugin() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4842"); - - Verifier verifier = newVerifier(new File(testDir, "plugin").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4842"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("../settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng4842", "parent", "0.1", "pom"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4872ReactorResolutionAttachedWithExclusionsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4872ReactorResolutionAttachedWithExclusionsTest.java deleted file mode 100644 index dc56b6244..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4872ReactorResolutionAttachedWithExclusionsTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4872. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4872ReactorResolutionAttachedWithExclusionsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4872ReactorResolutionAttachedWithExclusionsTest() { - super("[3.0-beta-1,)"); - } - - /** - * Test that resolution of (attached) artifacts from the reactor doesn't cause exclusions to be lost. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4872"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("consumer/target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4872"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List artifacts = verifier.loadLines("consumer/target/artifacts.txt", "UTF-8"); - - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng4872:producer:jar:0.1")); - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng4872:producer:jar:shaded:0.1")); - assertFalse(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng4872:excluded:jar:0.1")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4874UpdateLatestPluginVersionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4874UpdateLatestPluginVersionTest.java deleted file mode 100644 index 7f5b3aa9c..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4874UpdateLatestPluginVersionTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.utils.io.FileUtils; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4874. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4874UpdateLatestPluginVersionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4874UpdateLatestPluginVersionTest() { - super("[2.0.3,3.0-alpha-1),[3.0.1,)"); - } - - /** - * Verify that deployment of a plugin updates the metadata's "latest" field. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4874"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4874"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - File metadataFile = new File(testDir, "target/repo/org/apache/maven/its/mng4874/test/maven-metadata.xml"); - String xml = FileUtils.fileRead(metadataFile, "UTF-8"); - assertTrue(xml, xml.matches("(?s).*0\\.1-SNAPSHOT.*")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4877DeployUsingPrivateKeyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4877DeployUsingPrivateKeyTest.java deleted file mode 100644 index bc993f957..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4877DeployUsingPrivateKeyTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4877. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4877DeployUsingPrivateKeyTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4877DeployUsingPrivateKeyTest() { - super("[2.0.3,3.0-alpha-1),[3.0.1,)"); - } - - /** - * Verify that configured private key and passphrase are used for (SSH) deployment. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4877"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/wagon.properties"); - assertEquals("testuser", props.get("username")); - assertEquals("testpass", props.get("password")); - assertEquals("testkey", props.get("privateKey")); - assertEquals("testphrase", props.get("passphrase")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4883FailUponOverconstrainedVersionRangesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4883FailUponOverconstrainedVersionRangesTest.java deleted file mode 100644 index 38a1055f1..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4883FailUponOverconstrainedVersionRangesTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4883. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4883FailUponOverconstrainedVersionRangesTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4883FailUponOverconstrainedVersionRangesTest() { - super("[2.0.3,3.0-alpha-1),[3.0.1,)"); - } - - /** - * Verify that dependency resolution fails if version ranges with an empty intersection are encountered. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4883"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4883"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Build did not fail despite over constrained version ranges"); - } catch (Exception e) { - // expected, unsolvable version conflict - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4890MakeLikeReactorConsidersVersionsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4890MakeLikeReactorConsidersVersionsTest.java deleted file mode 100644 index b97ed2d8e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4890MakeLikeReactorConsidersVersionsTest.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4890. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4890MakeLikeReactorConsidersVersionsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4890MakeLikeReactorConsidersVersionsTest() { - super("[3.0,)"); - } - - /** - * Verify that the make-like reactor mode considers actual project versions when calculating the inter-module - * dependencies and the modules which need to be build. This variant checks calculation of upstream modules. - * - * @throws Exception in case of failure - */ - @Test - public void testitAM() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4890"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("mod-a/target"); - verifier.deleteDirectory("mod-b/target"); - verifier.addCliArgument("--projects"); - verifier.addCliArgument("mod-b"); - verifier.addCliArgument("--also-make"); - verifier.setLogFileName("log-am.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("mod-b/target/touch.txt"); - verifier.verifyFileNotPresent("mod-a/target/touch.txt"); - verifier.verifyFileNotPresent("target/touch.txt"); - } - - /** - * Verify that the make-like reactor mode considers actual project versions when calculating the inter-module - * dependencies and the modules which need to be build. This variant checks calculation of downstream modules. - * - * @throws Exception in case of failure - */ - @Test - public void testitAMD() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4890"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("mod-a/target"); - verifier.deleteDirectory("mod-b/target"); - verifier.addCliArgument("--projects"); - verifier.addCliArgument("mod-a"); - verifier.addCliArgument("--also-make-dependents"); - verifier.setLogFileName("log-amd.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("mod-a/target/touch.txt"); - verifier.verifyFileNotPresent("mod-b/target/touch.txt"); - verifier.verifyFileNotPresent("target/touch.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4891RobustSnapshotResolutionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4891RobustSnapshotResolutionTest.java deleted file mode 100644 index 83fb0dba3..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4891RobustSnapshotResolutionTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4891. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4891RobustSnapshotResolutionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4891RobustSnapshotResolutionTest() { - super("[2.0.3,3.0-alpha-1),[3.0.1,)"); - } - - /** - * Verify that resolution of a local snapshot still succeeds even if the maven-metadata-local.xml has been - * corrupted by a remote repository that misuses the same repo id, i.e. "local". - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4891"); - - Verifier verifier = newVerifier(new File(testDir, "producer").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4891"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(new File(testDir, "consumer").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List artifacts = verifier.loadLines("target/artifacts.txt", "UTF-8"); - - assertTrue(artifacts.toString(), artifacts.contains("org.apache.maven.its.mng4891:producer:jar:0.1-SNAPSHOT")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4895PluginDepWithNonRelocatedMavenApiTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4895PluginDepWithNonRelocatedMavenApiTest.java deleted file mode 100644 index 10989807a..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4895PluginDepWithNonRelocatedMavenApiTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4895. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4895PluginDepWithNonRelocatedMavenApiTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4895PluginDepWithNonRelocatedMavenApiTest() { - super("[3.0.1,)"); - } - - /** - * Verify that the classes constituting the Maven API are always loaded from the Maven core realm even if the plugin - * realm contains a 3rd party dependency that contains (non-relocated) duplicates of API classes. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4895"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4895"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/classpath.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4913UserPropertyVsDependencyPomPropertyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4913UserPropertyVsDependencyPomPropertyTest.java deleted file mode 100644 index e16f90d15..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4913UserPropertyVsDependencyPomPropertyTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4913. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4913UserPropertyVsDependencyPomPropertyTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4913UserPropertyVsDependencyPomPropertyTest() { - super("[2.0.9,3.0-alpha-1),[3.0.2,)"); - } - - /** - * Verify that user properties from the CLI do not override POM properties of transitive dependencies. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4913"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4913"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("-Dmng4913.version=98.76"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List classpath = verifier.loadLines("target/classpath.txt", "UTF-8"); - - assertTrue(classpath.toString(), classpath.contains("a-0.1.jar")); - assertTrue(classpath.toString(), classpath.contains("b-0.1.jar")); - assertFalse(classpath.toString(), classpath.contains("a-98.76.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4919LifecycleMappingWithSameGoalTwiceTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4919LifecycleMappingWithSameGoalTwiceTest.java deleted file mode 100644 index ecf9df1f0..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4919LifecycleMappingWithSameGoalTwiceTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Arrays; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4919. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4919LifecycleMappingWithSameGoalTwiceTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4919LifecycleMappingWithSameGoalTwiceTest() { - super("[2.0.3,3.0-alpha-1),[3.0.2,)"); - } - - /** - * Verify that lifecycle mappings can bind a goal twice, say in different phases. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4919"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArguments("clean", "validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List lines = verifier.loadLines("target/log.txt", "UTF-8"); - assertEquals(Arrays.asList(new String[] {"check", "check"}), lines); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4925ContainerLookupRealmDuringMojoExecTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4925ContainerLookupRealmDuringMojoExecTest.java deleted file mode 100644 index 191e13544..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4925ContainerLookupRealmDuringMojoExecTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4925. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4925ContainerLookupRealmDuringMojoExecTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4925ContainerLookupRealmDuringMojoExecTest() { - super("[3.0.2,)"); - } - - /** - * Verify that the container's lookup realm is set to the plugin realm during a mojo execution as otherwise - * string-based lookups can fail to load the proper type. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4925"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4925"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4936EventSpyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4936EventSpyTest.java deleted file mode 100644 index b9b597de9..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4936EventSpyTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4936. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4936EventSpyTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4936EventSpyTest() { - super("[3.0.2,)"); - } - - /** - * Verify that loading of an event spy extension from CLI works. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4936"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setForkJvm(true); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-Dmaven.ext.class.path=spy-0.1.jar"); - verifier.addCliArgument("-X"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List lines = verifier.loadLines("target/spy.log", "UTF-8"); - assertTrue(lines.toString(), lines.get(0).toString().startsWith("init")); - assertTrue(lines.toString(), lines.get(lines.size() - 1).toString().startsWith("close")); - assertTrue( - lines.toString(), - lines.contains("event: org.apache.maven.settings.building.DefaultSettingsBuildingRequest")); - assertTrue( - lines.toString(), - lines.contains("event: org.apache.maven.settings.building.DefaultSettingsBuildingResult")); - assertTrue(lines.toString(), lines.contains("event: org.apache.maven.execution.DefaultMavenExecutionRequest")); - assertTrue(lines.toString(), lines.contains("event: org.apache.maven.execution.DefaultMavenExecutionResult")); - assertTrue( - lines.toString(), lines.contains("event: org.apache.maven.lifecycle.internal.DefaultExecutionEvent")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4952MetadataReleaseInfoUpdateTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4952MetadataReleaseInfoUpdateTest.java deleted file mode 100644 index 77b84dc1c..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4952MetadataReleaseInfoUpdateTest.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Map; - -import org.apache.maven.shared.utils.io.FileUtils; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4952. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4952MetadataReleaseInfoUpdateTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4952MetadataReleaseInfoUpdateTest() { - super("[2.0.3,3.0-alpha-1),[3.0.2,)"); - } - - /** - * Verify that the metadata's RELEASE field gets updated upon deployment of a new version. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4952"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4952"); - - Map props = verifier.newDefaultFilterMap(); - - props.put("@version@", "1.0"); - verifier.filterFile("pom-template.xml", "pom.xml", "UTF-8", props); - verifier.setLogFileName("log-1.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - props.put("@version@", "2.0"); - verifier.filterFile("pom-template.xml", "pom.xml", "UTF-8", props); - verifier.setLogFileName("log-2.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - File metadataFile = new File(testDir, "target/repo/org/apache/maven/its/mng4952/test/maven-metadata.xml"); - String xml = FileUtils.fileRead(metadataFile, "UTF-8"); - assertTrue(xml, xml.matches("(?s).*2\\.0.*")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4955LocalVsRemoteSnapshotResolutionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4955LocalVsRemoteSnapshotResolutionTest.java deleted file mode 100644 index a119b465c..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4955LocalVsRemoteSnapshotResolutionTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4955. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4955LocalVsRemoteSnapshotResolutionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4955LocalVsRemoteSnapshotResolutionTest() { - super("[2.0.10,2.0.99),[2.1.0,3.0-alpha-1),[3.0.2,)"); - } - - /** - * Verify that dependency resolution prefers newer local snapshots over outdated remote snapshots that use the new - * metadata format. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4955"); - - Verifier verifier = newVerifier(new File(testDir, "dep").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4955"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List classpath = verifier.loadLines("target/classpath.txt", "UTF-8"); - - File jarFile = new File(classpath.get(1).toString()); - assertEquals("eeff09b1b80e823eeb2a615b1d4b09e003e86fd3", ItUtils.calcHash(jarFile, "SHA-1")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4960MakeLikeReactorResumeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4960MakeLikeReactorResumeTest.java deleted file mode 100644 index 5b57225b8..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4960MakeLikeReactorResumeTest.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4960. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4960MakeLikeReactorResumeTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4960MakeLikeReactorResumeTest() { - super("[2.1.0,3.0-alpha-1),[3.0.2,)"); - } - - /** - * Verify that the make-like reactor mode doesn't omit the selected projects when building their prerequisites - * as well and resuming from one of them. - * - * @throws Exception in case of failure - */ - @Test - public void testitFromUpstream() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4960"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("mod-a/target"); - verifier.deleteDirectory("mod-b/target"); - verifier.addCliArgument("--projects"); - verifier.addCliArgument("mod-b"); - verifier.addCliArgument("--also-make"); - verifier.addCliArgument("--resume-from"); - verifier.addCliArgument("mod-a"); - verifier.setLogFileName("log-up.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("mod-a/target/touch.txt"); - verifier.verifyFilePresent("mod-b/target/touch.txt"); - verifier.verifyFileNotPresent("target/touch.txt"); - } - - /** - * Verify that the make-like reactor mode omits the selected project when building its dependents - * as well and resuming from one of them. - * - * @throws Exception in case of failure - */ - @Test - public void testitFromDownstream() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4960"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("mod-a/target"); - verifier.deleteDirectory("mod-b/target"); - verifier.addCliArgument("--projects"); - verifier.addCliArgument("mod-a"); - verifier.addCliArgument("--also-make-dependents"); - verifier.addCliArgument("--resume-from"); - verifier.addCliArgument("mod-b"); - verifier.setLogFileName("log-down.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFileNotPresent("mod-a/target/touch.txt"); - verifier.verifyFilePresent("mod-b/target/touch.txt"); - verifier.verifyFileNotPresent("target/touch.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4963ParentResolutionFromMirrorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4963ParentResolutionFromMirrorTest.java deleted file mode 100644 index b3a839de3..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4963ParentResolutionFromMirrorTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4963. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4963ParentResolutionFromMirrorTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4963ParentResolutionFromMirrorTest() { - super("[2.0.5,3.0-alpha-1),[3.0.3,)"); - } - - /** - * Verify that a released parent POM can be resolved when the settings define only a snapshot repository - * which is subject to mirroring. Technically, this means to properly aggregate the built-in central repo - * definition with the declared snapshot repo when both are mirrored. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4963"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4963"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4966AbnormalUrlPreservationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4966AbnormalUrlPreservationTest.java deleted file mode 100644 index e225bebd3..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4966AbnormalUrlPreservationTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4966. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4966AbnormalUrlPreservationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4966AbnormalUrlPreservationTest() { - super("[2.0.3,3.0-alpha-1),[3.0.2,)"); - } - - /** - * Verify that URLs in the effective model retain successive slashes which are significant in certain domains. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4966"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - assertEquals("file:////UNC/server/dir/", props.getProperty("project.url")); - assertEquals("ssh://localhost//home/user/", props.getProperty("project.scm.url")); - assertEquals("scm:hg:ssh://localhost//home/user/", props.getProperty("project.scm.connection")); - assertEquals( - "[fetch=]http://server.org/[push=]ssh://server.org/", - props.getProperty("project.scm.developerConnection")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4973ExtensionVisibleToPluginInReactorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4973ExtensionVisibleToPluginInReactorTest.java deleted file mode 100644 index 193187577..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4973ExtensionVisibleToPluginInReactorTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4973. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4973ExtensionVisibleToPluginInReactorTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4973ExtensionVisibleToPluginInReactorTest() { - super("[2.0.3,3.0-alpha-1),[3.0.3,)"); - } - - /** - * Verify that a given plugin within a reactor build gets run with the proper class loader that is wired to - * the extensions of the current module. More technically speaking, the plugin class realm cache must be keyed - * by the current project and its build extensions as well. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4973"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("sub-b/target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4973"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("sub-b/target/artifact.properties"); - assertNotNull(props.get("org.apache.maven.its.mng4973:dep:it-artifact:it:0.1")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4975ProfileInjectedPluginExecutionOrderTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4975ProfileInjectedPluginExecutionOrderTest.java deleted file mode 100644 index 415862763..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4975ProfileInjectedPluginExecutionOrderTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Arrays; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4975. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4975ProfileInjectedPluginExecutionOrderTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4975ProfileInjectedPluginExecutionOrderTest() { - super("[2.0.7,3.0-alpha-1),[3.0.3,)"); - } - - /** - * Test that plugin executions (in the same phase) are properly ordered after profile injection. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4975"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-Pprofile2,profile1"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List lines = verifier.loadLines("target/exec.log", "UTF-8"); - List expected = Arrays.asList(new String[] {"1", "2", "3", "4", "5"}); - assertEquals(expected, lines); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4987TimestampBasedSnapshotSelectionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4987TimestampBasedSnapshotSelectionTest.java deleted file mode 100644 index 0bd58022b..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4987TimestampBasedSnapshotSelectionTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4987. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4987TimestampBasedSnapshotSelectionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4987TimestampBasedSnapshotSelectionTest() { - super("[2.0.3,3.0-alpha-1),[3.0.3,)"); - } - - /** - * Verify that snapshot version resolution from multiple (3+) repositories properly selects the repo with the - * newest metadata according to its timestamps, regardless of the declaration order of the repos. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4987"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4987"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List compile = verifier.loadLines("target/compile.txt", "UTF-8"); - - assertTrue(compile.toString(), compile.get(1).toString().startsWith("dep-0.1-")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4991NonProxyHostsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4991NonProxyHostsTest.java deleted file mode 100644 index c5c1a33f7..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4991NonProxyHostsTest.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.net.InetAddress; -import java.util.List; -import java.util.Map; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.server.Handler; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.DefaultHandler; -import org.eclipse.jetty.server.handler.HandlerList; -import org.eclipse.jetty.server.handler.ResourceHandler; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4991. - * - * @author Benjamin Bentmann - */ -public class MavenITmng4991NonProxyHostsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4991NonProxyHostsTest() { - super("[2.0.3,3.0-alpha-1),[3.0.3,)"); - } - - /** - * Verify that the nonProxyHosts settings is respected. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4991"); - - ResourceHandler resourceHandler = new ResourceHandler(); - resourceHandler.setResourceBase(new File(testDir, "repo").getAbsolutePath()); - - HandlerList handlers = new HandlerList(); - handlers.setHandlers(new Handler[] {resourceHandler, new DefaultHandler()}); - - Server server = new Server(0); - server.setHandler(handlers); - - /* - * NOTE: To guard against automatic fallback to direct connection when the proxy is unreachable, we set up - * a dummy proxy as trap to catch the erroneous proxy usage in all cases. - */ - Server proxy = new Server(0); - proxy.setHandler(new DefaultHandler()); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - try { - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - - proxy.start(); - if (proxy.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng4991"); - Map filterProps = verifier.newDefaultFilterMap(); - int port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - filterProps.put("@port@", Integer.toString(port)); - int proxyPort = ((NetworkConnector) proxy.getConnectors()[0]).getLocalPort(); - filterProps.put("@proxyPort@", Integer.toString(proxyPort)); - filterProps.put("@localhost@", InetAddress.getLoopbackAddress().getCanonicalHostName()); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } finally { - server.stop(); - proxy.stop(); - server.join(); - proxy.join(); - } - - List compile = verifier.loadLines("target/compile.txt", "UTF-8"); - - assertTrue(compile.toString(), compile.contains("dep-0.1.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4992MapStylePropertiesParamConfigTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4992MapStylePropertiesParamConfigTest.java deleted file mode 100644 index 606feeaf8..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4992MapStylePropertiesParamConfigTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-4992. - */ -public class MavenITmng4992MapStylePropertiesParamConfigTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng4992MapStylePropertiesParamConfigTest() { - super("[3.0.3,)"); - } - - /** - * Verify that plugin parameters of type java.util.Properties can be configured like any other Map-style parameter. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-4992"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/config.properties"); - assertEquals("mapValue", props.getProperty("mapParam.mapKey")); - assertEquals("propValue", props.getProperty("propertiesParam.propKey")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5000ChildPathAwareUrlInheritanceTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5000ChildPathAwareUrlInheritanceTest.java deleted file mode 100644 index 36a2e4463..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5000ChildPathAwareUrlInheritanceTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5000. Note this is a subtle - * variation and not a duplicate of the test for MNG-2006. - * - * @author Benjamin Bentmann - * - */ -public class MavenITmng5000ChildPathAwareUrlInheritanceTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng5000ChildPathAwareUrlInheritanceTest() { - super("[2.0.11,2.0.99),[2.2.0,3.0-alpha-1),[3.0.3,)"); - } - - /** - * Verify that child path aware URL adjustment still works when the child's artifactId doesn't match the name - * of its base directory as given in the parent's module section. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5000"); - - Verifier verifier = newVerifier(new File(testDir, "different-from-artifactId").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - assertEquals("http://project.url/child", props.getProperty("project.url")); - assertEquals("http://viewvc.project.url/child", props.getProperty("project.scm.url")); - assertEquals("http://scm.project.url/child", props.getProperty("project.scm.connection")); - assertEquals("https://scm.project.url/child", props.getProperty("project.scm.developerConnection")); - assertEquals("http://site.project.url/child", props.getProperty("project.distributionManagement.site.url")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5006VersionRangeDependencyParentResolutionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5006VersionRangeDependencyParentResolutionTest.java deleted file mode 100644 index 117f7ebfb..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5006VersionRangeDependencyParentResolutionTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5006. - * - * @author Benjamin Bentmann - */ -public class MavenITmng5006VersionRangeDependencyParentResolutionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng5006VersionRangeDependencyParentResolutionTest() { - super("[2.0.3,3.0-alpha-1),[3.0.3,)"); - } - - /** - * Verify that resolution of parent POMs of dependencies that use a version range is not restricted to the - * repository from which the specific dependency version was picked. Or put differently, the fact that a:0.1 - * was found in repo-1 does not mean parents/dependencies of a:0.1 are also located in that same repo, they - * could be in any of the originally declared repos. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5006"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng5006"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List compile = verifier.loadLines("target/compile.txt", "UTF-8"); - - assertTrue(compile.toString(), compile.contains("a-0.1.jar")); - assertTrue(compile.toString(), compile.contains("b-0.1.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5009AggregationCycleTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5009AggregationCycleTest.java deleted file mode 100644 index 893ca3bb0..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5009AggregationCycleTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5009. - */ -public class MavenITmng5009AggregationCycleTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng5009AggregationCycleTest() { - super("[3.0.3,)"); - } - - /** - * Verify that aggregators POMs forming a cycle fail gracefully with a proper error message. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5009"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Build did not fail despite cycle in POM aggregation"); - } catch (Exception e) { - verifier.verifyTextInLog(" cycle "); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5011ConfigureCollectionArrayFromUserPropertiesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5011ConfigureCollectionArrayFromUserPropertiesTest.java deleted file mode 100644 index 353d1c5ad..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5011ConfigureCollectionArrayFromUserPropertiesTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5011. - */ -public class MavenITmng5011ConfigureCollectionArrayFromUserPropertiesTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng5011ConfigureCollectionArrayFromUserPropertiesTest() { - super("[3.0.3,)"); - } - - /** - * Verify that plugin parameters of type array/collection can be configured using user properties from the CLI. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5011"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-Dconfig.stringParams="); - verifier.addCliArgument("-Dconfig.fileParams=foo,bar"); - verifier.addCliArgument("-Dconfig.listParam=,two,,four,"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/config.properties"); - - assertEquals("0", props.getProperty("stringParams")); - - assertEquals("2", props.getProperty("fileParams")); - assertEquals( - new File(testDir, "foo").getCanonicalFile(), - new File(props.getProperty("fileParams.0")).getCanonicalFile()); - assertEquals( - new File(testDir, "bar").getCanonicalFile(), - new File(props.getProperty("fileParams.1")).getCanonicalFile()); - - assertEquals("5", props.getProperty("listParam")); - assertEquals("", props.getProperty("listParam.0", "")); - assertEquals("two", props.getProperty("listParam.1", "")); - assertEquals("", props.getProperty("listParam.2", "")); - assertEquals("four", props.getProperty("listParam.3", "")); - assertEquals("", props.getProperty("listParam.4", "")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5012CollectionVsArrayParamCoercionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5012CollectionVsArrayParamCoercionTest.java deleted file mode 100644 index 449bc96ca..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5012CollectionVsArrayParamCoercionTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5012. - */ -public class MavenITmng5012CollectionVsArrayParamCoercionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng5012CollectionVsArrayParamCoercionTest() { - super("[3.0.3,)"); - } - - /** - * Verify that plugin parameters of type array/collection can be configured from expressions/defaults that - * actually resolve to a collection/array. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5012"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/config.properties"); - assertEquals( - new File(testDir, "src/main/java").getCanonicalFile(), - new File(props.getProperty("stringParams.0")).getCanonicalFile()); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5013ConfigureParamBeanFromScalarValueTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5013ConfigureParamBeanFromScalarValueTest.java deleted file mode 100644 index 64366ec94..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5013ConfigureParamBeanFromScalarValueTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5013. - */ -public class MavenITmng5013ConfigureParamBeanFromScalarValueTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng5013ConfigureParamBeanFromScalarValueTest() { - super("[3.0.3,)"); - } - - /** - * Verify that plugin parameter beans can be configured from a single value. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5013"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/config.properties"); - assertEquals("PASSED", props.getProperty("beanParam.fieldParam")); - assertEquals("true", props.getProperty("beanParam.setterCalled")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5019StringBasedCompLookupFromChildPluginRealmTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5019StringBasedCompLookupFromChildPluginRealmTest.java deleted file mode 100644 index 41bf37198..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5019StringBasedCompLookupFromChildPluginRealmTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5019. - */ -public class MavenITmng5019StringBasedCompLookupFromChildPluginRealmTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng5019StringBasedCompLookupFromChildPluginRealmTest() { - super("[3.0.3,)"); - } - - /** - * Verify that plugins executed by other plugins (like reports executed by the maven-site-plugin) can successfully - * look up components via string-based roles from their plugin realm as denoted by the thread context class loader, - * even if those components are also contained in the parent plugin realm. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5019"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng5019"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5064SuppressSnapshotUpdatesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5064SuppressSnapshotUpdatesTest.java deleted file mode 100644 index 697cee2dd..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5064SuppressSnapshotUpdatesTest.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import java.io.File; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.AbstractHandler; -import org.eclipse.jetty.server.handler.DefaultHandler; -import org.eclipse.jetty.server.handler.HandlerList; -import org.eclipse.jetty.server.handler.ResourceHandler; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5064. - * - * @author Benjamin Bentmann - */ -public class MavenITmng5064SuppressSnapshotUpdatesTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng5064SuppressSnapshotUpdatesTest() { - super("[3.0.4,)"); - } - - /** - * Verify that snapshot updates can be completely suppressed via the CLI arg -nsu. The initial retrieval of a - * missing snapshot should not be suppressed though. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5064"); - - String metadataUri = "org/apache/maven/its/mng5064/dep/0.1-SNAPSHOT/maven-metadata.xml"; - - final List requestedUris = Collections.synchronizedList(new ArrayList<>()); - - AbstractHandler logHandler = new AbstractHandler() { - @Override - public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { - if (request.getRequestURI().startsWith("/repo/")) { - requestedUris.add(request.getRequestURI().substring(6)); - } - } - }; - - ResourceHandler repoHandler = new ResourceHandler(); - repoHandler.setResourceBase(testDir.getAbsolutePath()); - - HandlerList handlerList = new HandlerList(); - handlerList.addHandler(logHandler); - handlerList.addHandler(repoHandler); - handlerList.addHandler(new DefaultHandler()); - - Server server = new Server(0); - server.setHandler(handlerList); - server.start(); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - try { - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - int port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + port); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng5064"); - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@port@", Integer.toString(port)); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.addCliArgument("-nsu"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - - verifier.setLogFileName("log-1.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List classpath = verifier.loadLines("target/classpath.txt", "UTF-8"); - assertTrue(classpath.toString(), classpath.contains("dep-0.1-SNAPSHOT.jar")); - assertTrue(requestedUris.toString(), requestedUris.contains(metadataUri)); - - requestedUris.clear(); - - verifier.setLogFileName("log-2.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - classpath = verifier.loadLines("target/classpath.txt", "UTF-8"); - assertTrue(classpath.toString(), classpath.contains("dep-0.1-SNAPSHOT.jar")); - assertFalse(requestedUris.toString(), requestedUris.contains(metadataUri)); - } finally { - server.stop(); - server.join(); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5096ExclusionAtDependencyWithImpliedClassifierTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5096ExclusionAtDependencyWithImpliedClassifierTest.java deleted file mode 100644 index ee0a02818..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5096ExclusionAtDependencyWithImpliedClassifierTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5096. - * - * @author Benjamin Bentmann - */ -public class MavenITmng5096ExclusionAtDependencyWithImpliedClassifierTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng5096ExclusionAtDependencyWithImpliedClassifierTest() { - super("[2.0.9,3.0-alpha-1),[3.0.4,)"); - } - - /** - * Verify that exclusions on dependencies whose type implies a classifier are effective. For those dependencies, - * the versionless management key of the dependency is different from the versionless id of the resulting artifact - * which needs to be considered. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5096"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng5096"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List compile = verifier.loadLines("target/compile.txt", "UTF-8"); - - assertFalse(compile.toString(), compile.contains("a-0.1.jar")); - assertTrue(compile.toString(), compile.contains("b-0.1.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5135AggregatorDepResolutionModuleExtensionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5135AggregatorDepResolutionModuleExtensionTest.java deleted file mode 100644 index b08ccd3bc..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5135AggregatorDepResolutionModuleExtensionTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5135. - * - * @author Benjamin Bentmann - */ -public class MavenITmng5135AggregatorDepResolutionModuleExtensionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng5135AggregatorDepResolutionModuleExtensionTest() { - super("[2.0.9,3.0-alpha-1),[3.0.4,)"); - } - - /** - * Verify that dependency resolution for aggregator mojos considers the extensions that apply to a given module. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5135"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng5135"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution:aggregate-test"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List compile = verifier.loadLines("target/module.txt", "UTF-8"); - - assertTrue(compile.toString(), compile.contains("dep-0.1-it.jar")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5137ReactorResolutionInForkedBuildTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5137ReactorResolutionInForkedBuildTest.java deleted file mode 100644 index 57b3c2380..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5137ReactorResolutionInForkedBuildTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5137. - * - * @author Benjamin Bentmann - */ -public class MavenITmng5137ReactorResolutionInForkedBuildTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng5137ReactorResolutionInForkedBuildTest() { - super("[3.0.4,)"); - } - - /** - * Verify that reactor resolution also works within a forked multi-module lifecycle, i.e. a lifecycle fork caused - * by an aggregator mojo. Here, reactor resolution needs to search the forked project instances for build output, - * not the project instances from the main build. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5137"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("producer/target"); - verifier.deleteDirectory("consumer/target"); - verifier.deleteArtifacts("org.apache.maven.its.mng5137"); - verifier.addCliArgument( - "org.apache.maven.its.plugins:maven-it-plugin-fork:2.1-SNAPSHOT:fork-lifecycle-aggregator"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List compile = verifier.loadLines("consumer/target/compile.txt", "UTF-8"); - - assertTrue(compile.toString(), compile.contains("producer/pom.xml")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5175WagonHttpTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5175WagonHttpTest.java deleted file mode 100644 index 60a93dd8d..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5175WagonHttpTest.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import java.io.File; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.server.Handler; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.AbstractHandler; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5175. - * test correct integration of wagon http: read time out configuration from settings.xml - * - * - */ -public class MavenITmng5175WagonHttpTest extends AbstractMavenIntegrationTestCase { - private Server server; - - private int port; - - public MavenITmng5175WagonHttpTest() { - super("[3.0.4,)"); // 3.0.4+ - } - - @BeforeEach - protected void setUp() throws Exception { - Handler handler = new AbstractHandler() { - @Override - public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) - throws IOException, ServletException { - try { - // wait long enough for read timeout to happen in client - Thread.sleep(100); - } catch (InterruptedException e) { - throw new ServletException(e.getMessage()); - } - response.setContentType("text/plain"); - response.setStatus(HttpServletResponse.SC_OK); - response.getWriter().println("some content"); - response.getWriter().println(); - - ((Request) request).setHandled(true); - } - }; - - server = new Server(0); - server.setHandler(handler); - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + port); - } - - @AfterEach - protected void tearDown() throws Exception { - if (server != null) { - server.stop(); - server.join(); - } - } - - /** - * Test that the read time out from settings is used. - * basically use a 1ms time out and wait a bit in the handler - * - * @throws Exception in case of failure - */ - @Test - public void testmng5175_ReadTimeOutFromSettings() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5175"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - - Map filterProps = new HashMap<>(); - filterProps.put("@port@", Integer.toString(port)); - - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - - verifier.addCliArgument("-U"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("--fail-never"); - verifier.addCliArgument("--errors"); - verifier.addCliArgument("-X"); - verifier.addCliArgument("validate"); - verifier.execute(); - - verifier.verifyTextInLog( - "Could not transfer artifact org.apache.maven.its.mng5175:fake-dependency:pom:1.0-SNAPSHOT"); - verifier.verifyTextInLog("Read timed out"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5206PlexusLifecycleHonoured.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5206PlexusLifecycleHonoured.java deleted file mode 100644 index 52cacec1d..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5206PlexusLifecycleHonoured.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5206. - * - * @author Olivier Lamy - */ -@Tag("disabled") -public class MavenITmng5206PlexusLifecycleHonoured extends AbstractMavenIntegrationTestCase { - - public MavenITmng5206PlexusLifecycleHonoured() { - super("[2.0.7,)"); - } - - /** - * Verify that plexus lifecycle phases are honoured: contextualize, configure, dispose - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5206"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng5206"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyTextInLog("MojoWithPlexusLifecycle :: contextualize"); - verifier.verifyTextInLog("DefaultFakeComponent :: contextualize"); - verifier.verifyTextInLog("MojoWithPlexusLifecycle :: dispose"); - // olamy dispose on injected component is not called - // verifier.verifyTextInLog( "DefaultFakeComponent :: dispose" ); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5208EventSpyParallelTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5208EventSpyParallelTest.java deleted file mode 100644 index 5e2017a5e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5208EventSpyParallelTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -@Disabled -public class MavenITmng5208EventSpyParallelTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng5208EventSpyParallelTest() { - super("[3.0.5,)"); - } - - /** - * Verify spy signals correct module for failure - * - * @throws Exception in case of failure - */ - @Test - public void testCorrectModuleFails() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5208"); - - Verifier spy = newVerifier(testDir.getAbsolutePath() + "/spy"); - spy.addCliArgument("install"); - spy.execute(); - - Verifier verifier = newVerifier(testDir.getAbsolutePath() + "/project"); - verifier.setForkJvm(true); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-Dmaven.ext.class.path=../spy/target/event-spy-0.0.1-SNAPSHOT.jar"); - verifier.addCliArgument("-X"); - verifier.addCliArgument("-T"); - verifier.addCliArgument("2"); - verifier.addCliArgument("-fn"); - verifier.addCliArgument("compile"); - verifier.execute(); - verifier.verifyTextInLog("ProjectFailed/org.apache.maven.its.mng5208:sub-2"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5214DontMapWsdlToJar.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5214DontMapWsdlToJar.java deleted file mode 100644 index 0d7dc6cc6..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5214DontMapWsdlToJar.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng5214DontMapWsdlToJar extends AbstractMavenIntegrationTestCase { - public MavenITmng5214DontMapWsdlToJar() { - super("[3.1,)"); - } - - /** - * Test that the code that allows test-jar and ejb-client dependencies to resolve to the - * target/classes or target/test-class is *not* applies to other types, e.g. wsdl. - * - * @throws Exception in case of failure - */ - @Test - public void testitTestPhase() throws Exception { - File setupDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5214/dependency"); - - Verifier setupVerifier = newVerifier(setupDir.getAbsolutePath()); - setupVerifier.setAutoclean(false); - setupVerifier.addCliArgument("-X"); - setupVerifier.deleteDirectory("target"); - setupVerifier.deleteArtifacts("org.apache.maven.its.mng5214"); - setupVerifier.setLogFileName("log-setup.txt"); - setupVerifier.addCliArgument("-PcreateWsdl"); - setupVerifier.addCliArgument("generate-resources"); - setupVerifier.execute(); - - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5214"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("consumer/target"); - verifier.deleteDirectory("dependency/target"); - verifier.setLogFileName("log-test.txt"); - verifier.addCliArgument("test"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - List lines = verifier.loadFile(verifier.getBasedir(), verifier.getLogFileName(), false); - // RESOLVE-ONE-DEPENDENCY org.apache.maven.its.mng5214:dependency:wsdl:1.0-SNAPSHOT $ /tmp/it - // .repo/org/apache/maven/its/mng5214/dependency/1.0-SNAPSHOT/dependency-1.0-SNAPSHOT.wsdl - for (String line : lines) { - if (line.contains("RESOLVE-ONE-DEPENDENCY org.apache.maven.its.mng5214:dependency:wsdl:1.0-SNAPSHOT")) { - assertFalse(line.contains("classes-main")); - assertTrue(line.endsWith(".wsdl")); - } - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5222MojoDeprecatedTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5222MojoDeprecatedTest.java deleted file mode 100644 index 62fe81c32..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5222MojoDeprecatedTest.java +++ /dev/null @@ -1,264 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Properties; -import java.util.regex.Pattern; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * Test for - * MNG-5222 - * MNG-7457 - */ -public class MavenITmng5222MojoDeprecatedTest extends AbstractMavenIntegrationTestCase { - public MavenITmng5222MojoDeprecatedTest() { - super("[3.9.0,)"); - } - - /** - * Test that ensures that deprecation is not printed for empty and default value - * - * @throws Exception in case of failure - */ - @Test - public void testEmptyConfiguration() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5222-mojo-deprecated-params"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.setLogFileName("log-empty-configuration.txt"); - verifier.addCliArgument("-Dmaven.plugin.validation=verbose"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List logLines = verifier.loadFile(verifier.getBasedir(), verifier.getLogFileName(), false); - List warnLines = findDeprecationWarning(logLines); - - assertTrue(warnLines.stream() - .anyMatch(s -> s.contains("Goal 'deprecated-config' is deprecated: This goal is deprecated"))); - - Properties configProps = verifier.loadProperties("target/config.properties"); - - assertEquals("0", configProps.remove("deprecatedArray")); - - assertEquals("3", configProps.remove("deprecatedArrayWithDefaults")); - assertEquals("a1 ", configProps.remove("deprecatedArrayWithDefaults.0")); - assertEquals("a2", configProps.remove("deprecatedArrayWithDefaults.1")); - assertEquals(" a3", configProps.remove("deprecatedArrayWithDefaults.2")); - - assertEquals("0", configProps.remove("deprecatedList")); - - assertEquals("3", configProps.remove("deprecatedListWithDefaults")); - assertEquals("l1", configProps.remove("deprecatedListWithDefaults.0")); - assertEquals("l2", configProps.remove("deprecatedListWithDefaults.1")); - assertEquals("l3", configProps.remove("deprecatedListWithDefaults.2")); - - assertEquals("testValue", configProps.remove("deprecatedParamWithDefaultConstant")); - assertEquals("https://www.test.org", configProps.remove("deprecatedParamWithDefaultEvaluate")); - - assertTrue("not checked config properties: " + configProps, configProps.isEmpty()); - } - - /** - * Test that ensures that deprecation is printed for deprecated parameter set by property - * - * @throws Exception in case of failure - */ - @Test - public void testDeprecatedProperty() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5222-mojo-deprecated-params"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("-Dconfig.deprecatedParam2=deprecatedValueInProps"); - verifier.addCliArgument("-Dconfig.deprecatedArray=3,2,4,deprecated"); - verifier.addCliArgument("-Dconfig.deprecatedList=4,5,deprecated"); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.setLogFileName("log-deprecated-property.txt"); - verifier.addCliArgument("-Dmaven.plugin.validation=verbose"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List logLines = verifier.loadFile(verifier.getBasedir(), verifier.getLogFileName(), false); - List warnLines = findDeprecationWarning(logLines); - - assertTrue(warnLines.stream() - .anyMatch(s -> s.contains("Goal 'deprecated-config' is deprecated: This goal is deprecated"))); - assertTrue( - warnLines.stream() - .anyMatch( - s -> s.contains( - "Parameter 'deprecatedParam2' (user property 'config.deprecatedParam2') is deprecated: No reason given"))); - assertTrue( - warnLines.stream() - .anyMatch( - s -> s.contains( - "Parameter 'deprecatedArray' (user property 'config.deprecatedArray') is deprecated: deprecated array"))); - assertTrue( - warnLines.stream() - .anyMatch( - s -> s.contains( - "Parameter 'deprecatedList' (user property 'config.deprecatedList') is deprecated: deprecated list"))); - - Properties configProps = verifier.loadProperties("target/config.properties"); - - assertEquals("deprecatedValueInProps", configProps.remove("deprecatedParam2")); - - assertEquals("4", configProps.remove("deprecatedArray")); - assertEquals("3", configProps.remove("deprecatedArray.0")); - assertEquals("2", configProps.remove("deprecatedArray.1")); - assertEquals("4", configProps.remove("deprecatedArray.2")); - assertEquals("deprecated", configProps.remove("deprecatedArray.3")); - - assertEquals("3", configProps.remove("deprecatedArrayWithDefaults")); - assertEquals("a1 ", configProps.remove("deprecatedArrayWithDefaults.0")); - assertEquals("a2", configProps.remove("deprecatedArrayWithDefaults.1")); - assertEquals(" a3", configProps.remove("deprecatedArrayWithDefaults.2")); - - assertEquals("3", configProps.remove("deprecatedList")); - assertEquals("4", configProps.remove("deprecatedList.0")); - assertEquals("5", configProps.remove("deprecatedList.1")); - assertEquals("deprecated", configProps.remove("deprecatedList.2")); - - assertEquals("3", configProps.remove("deprecatedListWithDefaults")); - assertEquals("l1", configProps.remove("deprecatedListWithDefaults.0")); - assertEquals("l2", configProps.remove("deprecatedListWithDefaults.1")); - assertEquals("l3", configProps.remove("deprecatedListWithDefaults.2")); - - assertEquals("testValue", configProps.remove("deprecatedParamWithDefaultConstant")); - assertEquals("https://www.test.org", configProps.remove("deprecatedParamWithDefaultEvaluate")); - - assertTrue("not checked config properties: " + configProps, configProps.isEmpty()); - } - - /** - * Test that ensures that deprecation is printed for deprecated parameter set by plugin configuration. - * - * @throws Exception in case of failure - */ - @Test - public void testDeprecatedConfig() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5222-mojo-deprecated-params"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("-Pconfig-values"); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.setLogFileName("log-deprecated-config.txt"); - verifier.addCliArgument("-Dmaven.plugin.validation=verbose"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List logLines = verifier.loadFile(verifier.getBasedir(), verifier.getLogFileName(), false); - List warnLines = findDeprecationWarning(logLines); - - assertTrue(warnLines.stream() - .anyMatch(s -> s.contains("Goal 'deprecated-config' is deprecated: This goal is deprecated"))); - assertTrue(warnLines.stream() - .anyMatch(s -> s.contains("Parameter 'deprecatedParam' is deprecated: I'm deprecated param"))); - assertTrue( - warnLines.stream() - .anyMatch( - s -> s.contains( - "Parameter 'deprecatedParam2' (user property 'config.deprecatedParam2') is deprecated: No reason given"))); - assertTrue( - warnLines.stream() - .anyMatch( - s -> s.contains( - "Parameter 'deprecatedParamWithDefaultConstant' is deprecated: deprecated with constant value"))); - assertTrue( - warnLines.stream() - .anyMatch( - s -> s.contains( - "Parameter 'deprecatedParamWithDefaultEvaluate' is deprecated: deprecated with evaluate value"))); - assertTrue( - warnLines.stream() - .anyMatch( - s -> s.contains( - "Parameter 'deprecatedArray' (user property 'config.deprecatedArray') is deprecated: deprecated array"))); - assertTrue(warnLines.stream() - .anyMatch(s -> s.contains("Parameter 'deprecatedArrayWithDefaults' is deprecated: deprecated array"))); - assertTrue( - warnLines.stream() - .anyMatch( - s -> s.contains( - "Parameter 'deprecatedList' (user property 'config.deprecatedList') is deprecated: deprecated list"))); - assertTrue(warnLines.stream() - .anyMatch(s -> s.contains("Parameter 'deprecatedListWithDefaults' is deprecated: deprecated list"))); - assertTrue(warnLines.stream() - .anyMatch(s -> s.contains("Parameter 'deprecatedProperties' is deprecated: deprecated properties"))); - assertTrue(warnLines.stream() - .anyMatch(s -> s.contains("Parameter 'deprecatedMap' is deprecated: deprecated map"))); - - Properties configProps = verifier.loadProperties("target/config.properties"); - - assertEquals("value1", configProps.remove("deprecatedParam")); - assertEquals("value2", configProps.remove("deprecatedParam2")); - assertEquals("value3", configProps.remove("deprecatedParamWithDefaultConstant")); - assertEquals("value4", configProps.remove("deprecatedParamWithDefaultEvaluate")); - - assertEquals("2", configProps.remove("deprecatedArray")); - assertEquals("a1", configProps.remove("deprecatedArray.0")); - assertEquals("a2", configProps.remove("deprecatedArray.1")); - - assertEquals("2", configProps.remove("deprecatedArrayWithDefaults")); - assertEquals("b1", configProps.remove("deprecatedArrayWithDefaults.0")); - assertEquals("b2", configProps.remove("deprecatedArrayWithDefaults.1")); - - assertEquals("2", configProps.remove("deprecatedList")); - assertEquals("c1", configProps.remove("deprecatedList.0")); - assertEquals("c2", configProps.remove("deprecatedList.1")); - - assertEquals("2", configProps.remove("deprecatedListWithDefaults")); - assertEquals("d1", configProps.remove("deprecatedListWithDefaults.0")); - assertEquals("d2", configProps.remove("deprecatedListWithDefaults.1")); - - assertEquals("2", configProps.remove("deprecatedProperties")); - assertEquals("propertyValue1", configProps.remove("deprecatedProperties.propertyName1")); - assertEquals("propertyValue2", configProps.remove("deprecatedProperties.propertyName2")); - - assertEquals("2", configProps.remove("deprecatedMap")); - assertEquals("value1", configProps.remove("deprecatedMap.key1")); - assertEquals("value2", configProps.remove("deprecatedMap.key2")); - - assertTrue("not checked config properties: " + configProps, configProps.isEmpty()); - } - - private List findDeprecationWarning(List logLines) { - Pattern pattern = Pattern.compile(".* (Parameter|Goal) .* is deprecated:.*"); - List result = new ArrayList<>(); - for (String line : logLines) { - if (pattern.matcher(line).matches()) { - result.add(line); - } - } - return result; - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5224InjectedSettings.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5224InjectedSettings.java deleted file mode 100644 index 26c1b171f..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5224InjectedSettings.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.FileReader; -import java.util.ArrayList; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.codehaus.plexus.util.xml.Xpp3Dom; -import org.codehaus.plexus.util.xml.Xpp3DomBuilder; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5175. - * test correct injection of settings with profiles in ${settings} in mojo - * - * - */ -public class MavenITmng5224InjectedSettings extends AbstractMavenIntegrationTestCase { - public MavenITmng5224InjectedSettings() { - // olamy probably doesn't work with 3.x before 3.0.4 - super("[2.0.3,3.0-alpha-1),[3.0.4,)"); - } - - /** - * - * @throws Exception in case of failure - */ - @Test - public void testmng5224_ReadSettings() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5224"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - // verifier. - verifier.addCliArgument("validate"); - verifier.execute(); - - File settingsFile = new File(verifier.getBasedir(), "target/settings-dump.xml"); - - FileReader fr = new FileReader(settingsFile); - - Xpp3Dom dom = Xpp3DomBuilder.build(fr); - - Xpp3Dom profilesNode = dom.getChild("profiles"); - - Xpp3Dom[] profileNodes = profilesNode.getChildren("profile"); - - // 3 from the user settings + 1 for the global settings used for its - assertEquals(4, profileNodes.length); - - /** - * - * - * apache - * - * true - * - * - * true - * - * - * - * release - * - * verycomplicatedpassphrase - * - * - * - * fast - * - * true - * true - * - * - * - **/ - List profileIds = new ArrayList<>(4); - - for (Xpp3Dom node : profileNodes) { - Xpp3Dom idNode = node.getChild("id"); - profileIds.add(idNode.getValue()); - if ("apache".equals(idNode.getName())) { - Xpp3Dom propsNode = node.getChild("properties"); - assertEquals("true", propsNode.getChild("run-its").getValue()); - } - if ("release".equals(idNode.getName())) { - Xpp3Dom propsNode = node.getChild("properties"); - assertEquals( - "verycomplicatedpassphrase", - propsNode.getChild("gpg.passphrase").getValue()); - } - if ("fast".equals(idNode.getName())) { - Xpp3Dom propsNode = node.getChild("properties"); - assertEquals("true", propsNode.getChild("maven.test.skip").getValue()); - assertEquals("true", propsNode.getChild("skipTests").getValue()); - } - } - - assertTrue(profileIds.contains("apache")); - assertTrue(profileIds.contains("release")); - assertTrue(profileIds.contains("fast")); - assertTrue(profileIds.contains("it-defaults")); - - /** - * - * it-defaults - * apache - * - */ - Xpp3Dom activeProfilesNode = dom.getChild("activeProfiles"); - - // with maven3 profile activation (activeByDefault) is done later during project building phase - // so we have only a "dump" of the settings - - if (matchesVersionRange("[2.0.3,3.0-alpha-1)")) { - assertEquals(2, activeProfilesNode.getChildCount()); - } else { - assertEquals(1, activeProfilesNode.getChildCount()); - } - - List activeProfiles = new ArrayList<>(2); - - for (Xpp3Dom node : activeProfilesNode.getChildren()) { - activeProfiles.add(node.getValue()); - } - - if (matchesVersionRange("[2.0.3,3.0-alpha-1)")) { - assertTrue(activeProfiles.contains("apache")); - } - assertTrue(activeProfiles.contains("it-defaults")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5230MakeReactorWithExcludesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5230MakeReactorWithExcludesTest.java deleted file mode 100644 index 6f1d987e1..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5230MakeReactorWithExcludesTest.java +++ /dev/null @@ -1,287 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * Test case adapted from MNG-2576 - * @author Luuk van den Broek - */ -public class MavenITmng5230MakeReactorWithExcludesTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng5230MakeReactorWithExcludesTest() { - super("[3.2,)"); - } - - private void clean(Verifier verifier) throws Exception { - verifier.deleteDirectory("target"); - verifier.deleteDirectory("mod-a/target"); - verifier.deleteDirectory("mod-b/target"); - verifier.deleteDirectory("mod-c/target"); - verifier.deleteDirectory("mod-d/target"); - } - - /** - * Verify that project list exclusion by itself is not built - * - * @throws Exception in case of failure - */ - @Test - public void testitMakeWithExclude() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5230-make-reactor-with-excludes"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), true); - verifier.addCliArgument("-X"); - verifier.setAutoclean(false); - clean(verifier); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("!mod-b"); - verifier.setLogFileName("log-only.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch.txt"); - verifier.verifyFilePresent("mod-a/target/touch.txt"); - verifier.verifyFileNotPresent("mod-b/target/touch.txt"); - verifier.verifyFilePresent("mod-c/target/touch.txt"); - verifier.verifyFilePresent("mod-d/target/touch.txt"); - } - - /** - * Verify that that exclusion happens on upstream projects. - * - * @throws Exception in case of failure - */ - @Test - public void testitMakeUpstreamExclude() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5230-make-reactor-with-excludes"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - clean(verifier); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("mod-b,!mod-a"); - verifier.addCliArgument("-am"); - verifier.setLogFileName("log-upstream.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch.txt"); - verifier.verifyFileNotPresent("mod-a/target/touch.txt"); - verifier.verifyFilePresent("mod-b/target/touch.txt"); - verifier.verifyFileNotPresent("mod-c/target/touch.txt"); - verifier.verifyFileNotPresent("mod-d/target/touch.txt"); - } - - /** - * Verify that project list and all their downstream projects are built. - * - * @throws Exception in case of failure - */ - @Test - public void testitMakeDownstreamExclude() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5230-make-reactor-with-excludes"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - clean(verifier); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("mod-b,!mod-c"); - verifier.addCliArgument("-amd"); - verifier.setLogFileName("log-downstream.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFileNotPresent("target/touch.txt"); - verifier.verifyFileNotPresent("mod-a/target/touch.txt"); - verifier.verifyFilePresent("mod-b/target/touch.txt"); - verifier.verifyFileNotPresent("mod-c/target/touch.txt"); - verifier.verifyFileNotPresent("mod-d/target/touch.txt"); - } - - /** - * Verify project exclusion when also building upstream and downstream projects are built. - * - * @throws Exception in case of failure - */ - @Test - public void testitMakeBothExclude() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5230-make-reactor-with-excludes"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - clean(verifier); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("mod-b,!mod-a"); - verifier.addCliArgument("-am"); - verifier.addCliArgument("-amd"); - verifier.setLogFileName("log-both.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch.txt"); - verifier.verifyFileNotPresent("mod-a/target/touch.txt"); - verifier.verifyFilePresent("mod-b/target/touch.txt"); - verifier.verifyFilePresent("mod-c/target/touch.txt"); - verifier.verifyFileNotPresent("mod-d/target/touch.txt"); - } - - /** - * Verify that using the basedir for exclusion with an exclamation in the project list matches projects with non-default POM files. - * - * @throws Exception in case of failure - */ - @Test - public void testitMatchesByBasedirExclamationExclude() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5230-make-reactor-with-excludes"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - clean(verifier); - verifier.verifyFileNotPresent("mod-d/pom.xml"); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("!mod-d"); - verifier.setLogFileName("log-basedir-exclamation.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch.txt"); - verifier.verifyFilePresent("mod-a/target/touch.txt"); - verifier.verifyFilePresent("mod-b/target/touch.txt"); - verifier.verifyFilePresent("mod-c/target/touch.txt"); - verifier.verifyFileNotPresent("mod-d/target/touch.txt"); - } - - /** - * Verify that using the basedir for exclusion with a minus in the project list matches projects with non-default POM files. - * - * @throws Exception in case of failure - */ - @Test - public void testitMatchesByBasedirMinusExclude() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5230-make-reactor-with-excludes"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - clean(verifier); - verifier.verifyFileNotPresent("mod-d/pom.xml"); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("-mod-d"); - verifier.setLogFileName("log-basedir-minus.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch.txt"); - verifier.verifyFilePresent("mod-a/target/touch.txt"); - verifier.verifyFilePresent("mod-b/target/touch.txt"); - verifier.verifyFilePresent("mod-c/target/touch.txt"); - verifier.verifyFileNotPresent("mod-d/target/touch.txt"); - } - - /** - * Verify that the project list can also specify project ids for exclusion - * - * @throws Exception in case of failure - */ - @Test - public void testitMatchesByIdExclude() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5230-make-reactor-with-excludes"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - clean(verifier); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("!org.apache.maven.its.mng5230:mod-b"); - verifier.setLogFileName("log-id.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch.txt"); - verifier.verifyFilePresent("mod-a/target/touch.txt"); - verifier.verifyFileNotPresent("mod-b/target/touch.txt"); - verifier.verifyFilePresent("mod-c/target/touch.txt"); - verifier.verifyFilePresent("mod-d/target/touch.txt"); - } - - /** - * Verify that the project list exclude can also specify artifact ids. - * - * @throws Exception in case of failure - */ - @Test - public void testitMatchesByArtifactIdExclude() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5230-make-reactor-with-excludes"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - clean(verifier); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("!:mod-b"); - verifier.setLogFileName("log-artifact-id.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch.txt"); - verifier.verifyFilePresent("mod-a/target/touch.txt"); - verifier.verifyFileNotPresent("mod-b/target/touch.txt"); - verifier.verifyFilePresent("mod-c/target/touch.txt"); - verifier.verifyFilePresent("mod-d/target/touch.txt"); - } - - /** - * Verify that reactor is resumed from specified project with exclude - * - * @throws Exception in case of failure - */ - @Test - public void testitResumeFromExclude() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5230-make-reactor-with-excludes"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - clean(verifier); - verifier.addCliArgument("-rf"); - verifier.addCliArgument("mod-b"); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("!mod-c"); - verifier.setLogFileName("log-resume.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFileNotPresent("target/touch.txt"); - verifier.verifyFileNotPresent("mod-a/target/touch.txt"); - verifier.verifyFilePresent("mod-b/target/touch.txt"); - verifier.verifyFileNotPresent("mod-c/target/touch.txt"); - verifier.verifyFilePresent("mod-d/target/touch.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5280SettingsProfilesRepositoriesOrderTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5280SettingsProfilesRepositoriesOrderTest.java deleted file mode 100644 index bd4ab1cc3..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5280SettingsProfilesRepositoriesOrderTest.java +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.PrintWriter; -import java.util.Map; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.AbstractHandler; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5280. - * - * @author Anders Hammar - */ -public class MavenITmng5280SettingsProfilesRepositoriesOrderTest extends AbstractMavenIntegrationTestCase { - private File testDir; - - private Server server; - - public MavenITmng5280SettingsProfilesRepositoriesOrderTest() { - super("[3.1-A,)"); - } - - @BeforeEach - protected void setUp() throws Exception { - testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5280"); - server = new Server(0); - } - - @AfterEach - protected void tearDown() throws Exception { - if (server != null) { - server.stop(); - server.join(); - } - } - - /** - * Verify that the repositories are used in the reversed order of definition in settings.xml. - * - * @throws Exception in case of failure - */ - @Test - public void testRepositoriesOrder() throws Exception { - RepoHandler repoHandler = new RepoHandler(); - server.setHandler(repoHandler); - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - int httpPort = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + httpPort); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng5280"); - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@httpserver.port@", Integer.toString(httpPort)); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument( - "org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution:2.1-SNAPSHOT:compile"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - assertTrue(repoHandler.artifactRequestedFromRepo2); - assertTrue(repoHandler.artifactRequestedFromRepo1Last); - } - - /** - * Verify that the plugin repositories are used in the reversed order of definition in settings.xml. - * - * @throws Exception in case of failure - */ - @Test - public void testPluginRepositoriesOrder() throws Exception { - PluginRepoHandler pluginRepoHandler = new PluginRepoHandler(); - server.setHandler(pluginRepoHandler); - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - int httpPort = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + httpPort); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng5280"); - Map filterProps = verifier.newDefaultFilterMap(); - filterProps.put("@httpserver.port@", Integer.toString(httpPort)); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", filterProps); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("org.apache.maven.its.mng5280:fake-maven-plugin:1.0:fake"); - verifier.execute(); - - assertTrue(pluginRepoHandler.pluginRequestedFromRepo2); - assertTrue(pluginRepoHandler.pluginRequestedFromRepo1Last); - } - - private static final class RepoHandler extends AbstractHandler { - private volatile boolean artifactRequestedFromRepo1Last; - - private volatile boolean artifactRequestedFromRepo2; - - public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) - throws IOException { - String uri = request.getRequestURI(); - - if (uri.startsWith("/repo1/org/apache/maven/its/mng5280/fake-artifact/1.0/")) { - PrintWriter writer = response.getWriter(); - - if (uri.endsWith(".pom")) { - writer.println(""); - writer.println(" 4.0.0"); - writer.println(" org.apache.maven.its.mng5280"); - writer.println(" fake-artifact"); - writer.println(" 1.0"); - writer.println(""); - - response.setStatus(HttpServletResponse.SC_OK); - } else if (uri.endsWith(".jar")) { - writer.println("empty"); - - response.setStatus(HttpServletResponse.SC_OK); - artifactRequestedFromRepo1Last = true; - } else { - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - } - } else if (uri.startsWith("/repo2/org/apache/maven/its/mng5280/fake-artifact/1.0/")) { - if (uri.endsWith(".jar")) { - artifactRequestedFromRepo1Last = false; - artifactRequestedFromRepo2 = true; - } - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - } else { - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - } - - ((Request) request).setHandled(true); - } - } - - private class PluginRepoHandler extends AbstractHandler { - private volatile boolean pluginRequestedFromRepo1Last; - - private volatile boolean pluginRequestedFromRepo2; - - public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) - throws IOException { - String uri = request.getRequestURI(); - - if (uri.startsWith("/pluginRepo1/org/apache/maven/its/mng5280/fake-maven-plugin/1.0/")) { - OutputStream outStream = response.getOutputStream(); - - if (uri.endsWith(".pom")) { - File pluginPom = new File(testDir, "fake-maven-plugin/fake-maven-plugin-1.0.pom"); - InputStream inStream = new FileInputStream(pluginPom); - copy(inStream, outStream); - - response.setStatus(HttpServletResponse.SC_OK); - } else if (uri.endsWith(".jar")) { - File pluginJar = new File(testDir, "fake-maven-plugin/fake-maven-plugin-1.0.jar"); - InputStream inStream = new FileInputStream(pluginJar); - copy(inStream, outStream); - - response.setStatus(HttpServletResponse.SC_OK); - pluginRequestedFromRepo1Last = true; - } else { - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - } - } else if (uri.startsWith("/pluginRepo2/org/apache/maven/its/mng5280/fake-maven-plugin/1.0/")) { - if (uri.endsWith(".jar")) { - pluginRequestedFromRepo1Last = false; - pluginRequestedFromRepo2 = true; - } - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - } else { - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - } - - ((Request) request).setHandled(true); - } - - private long copy(InputStream input, OutputStream output) throws IOException { - byte[] buffer = new byte[4 * 1024]; - long count = 0; - int n = 0; - while (-1 != (n = input.read(buffer))) { - output.write(buffer, 0, n); - count += n; - } - return count; - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5338FileOptionToDirectory.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5338FileOptionToDirectory.java deleted file mode 100644 index e9ce69d16..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5338FileOptionToDirectory.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5338. - * - * @author Olivier Lamy - */ -public class MavenITmng5338FileOptionToDirectory extends AbstractMavenIntegrationTestCase { - - private File testDir; - - public MavenITmng5338FileOptionToDirectory() { - super("[3.1-A,)"); - } - - @BeforeEach - public void setUp() throws Exception { - testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5338"); - } - - @Test - public void testFileOptionToADirectory() throws Exception { - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng5338"); - - verifier.addCliArgument("-f"); - verifier.addCliArgument("project"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5382Jsr330Plugin.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5382Jsr330Plugin.java deleted file mode 100644 index 86d96cf4c..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5382Jsr330Plugin.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5382. - * - * @author Jason van Zyl - */ -public class MavenITmng5382Jsr330Plugin extends AbstractMavenIntegrationTestCase { - - private File testDir; - - public MavenITmng5382Jsr330Plugin() { - super("[3.1-alpha,)"); - } - - @BeforeEach - public void setUp() throws Exception { - testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5382"); - } - - @Test - public void testJsr330PluginExecution() throws Exception { - // - // Build a plugin that uses a JSR330 plugin - // - Verifier v0 = newVerifier(testDir.getAbsolutePath(), "remote"); - v0.setAutoclean(false); - v0.deleteDirectory("target"); - v0.deleteArtifacts("org.apache.maven.its.mng5382"); - v0.addCliArgument("install"); - v0.execute(); - v0.verifyErrorFreeLog(); - - // - // Execute the JSR330 plugin - // - Verifier v1 = newVerifier(testDir.getAbsolutePath(), "remote"); - v1.setAutoclean(false); - v1.addCliArgument("org.apache.maven.its.mng5382:jsr330-maven-plugin:0.0.1-SNAPSHOT:hello"); - v1.execute(); - v1.verifyErrorFreeLog(); - v1.verifyTextInLog( - "Hello! I am a component that is being used via constructor injection! That's right, I'm a JSR330 badass."); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5387ArtifactReplacementPlugin.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5387ArtifactReplacementPlugin.java deleted file mode 100644 index 91da281d6..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5387ArtifactReplacementPlugin.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.utils.io.FileUtils; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -public class MavenITmng5387ArtifactReplacementPlugin extends AbstractMavenIntegrationTestCase { - - private File testDir; - - public MavenITmng5387ArtifactReplacementPlugin() { - super("[3.1,)"); - } - - @BeforeEach - public void setUp() throws Exception { - testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5387"); - } - - @Test - public void testArtifactReplacementExecution() throws Exception { - Verifier v0 = newVerifier(testDir.getAbsolutePath(), "remote"); - v0.setAutoclean(false); - v0.deleteDirectory("target"); - v0.deleteArtifacts("org.apache.maven.its.mng5387"); - v0.addCliArgument("install"); - v0.execute(); - v0.verifyErrorFreeLog(); - - String path = v0.getArtifactPath("org.apache.maven.its.mng5387", "mng5387-it", "0.0.1-SNAPSHOT", "txt", "c"); - String contents = FileUtils.fileRead(new File(path), "utf-8"); - assertTrue(contents.contains("This is the second file")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5389LifecycleParticipantAfterSessionEnd.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5389LifecycleParticipantAfterSessionEnd.java deleted file mode 100644 index 627fab9d1..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5389LifecycleParticipantAfterSessionEnd.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng5389LifecycleParticipantAfterSessionEnd extends AbstractMavenIntegrationTestCase { - public MavenITmng5389LifecycleParticipantAfterSessionEnd() { - super("[3.2.1,)"); - } - - @Test - public void testit() throws Exception { - File testDir = - ResourceExtractor.simpleExtractResources(getClass(), "/mng-5389-lifecycleParticipant-afterSession"); - File extensionDir = new File(testDir, "extension"); - File projectDir = new File(testDir, "basic"); - - Verifier verifier; - - // install the test plugin - verifier = newVerifier(extensionDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // build the test project - verifier = newVerifier(projectDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("package"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/afterSessionEnd.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5418FileProjectPropertiesActivatorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5418FileProjectPropertiesActivatorTest.java deleted file mode 100644 index a3e0aeb4b..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5418FileProjectPropertiesActivatorTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5418. - * - * @author Olivier Lamy - */ -@Tag("disabled") -public class MavenITmng5418FileProjectPropertiesActivatorTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng5418FileProjectPropertiesActivatorTest() { - super("[3.1,)"); - } - - /** - * Test that the file-based profile activator resolves project properties. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5418"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/path1.txt"); - verifier.verifyFilePresent("target/file1.txt"); - verifier.verifyFilePresent("target/missing1.txt"); - verifier.verifyFileNotPresent("target/missing2.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5445LegacyStringSearchModelInterpolatorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5445LegacyStringSearchModelInterpolatorTest.java deleted file mode 100644 index e6fbc70ed..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5445LegacyStringSearchModelInterpolatorTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5445. - */ -public class MavenITmng5445LegacyStringSearchModelInterpolatorTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng5445LegacyStringSearchModelInterpolatorTest() { - super("[3.1,)"); - } - - /** - * Verify that the legacy StringSearchModelInterpolator has its PathTranslator injected. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5445"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5452MavenBuildTimestampUTCTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5452MavenBuildTimestampUTCTest.java deleted file mode 100644 index b9140a979..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5452MavenBuildTimestampUTCTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5452 - * Make sure that the maven.build.timestamp is in UTC. - */ -public class MavenITmng5452MavenBuildTimestampUTCTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng5452MavenBuildTimestampUTCTest() { - super("[3.2.2,)"); - } - - @Test - public void testMavenBuildTimestampIsUsingUTC() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5452-maven-build-timestamp-utc"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("process-resources"); - verifier.execute(); - // - // We have a timestamp format = yyyyMMdd:HHmm:z, where the final element is the timezone which should be UTC - // - Properties filteredProperties = verifier.loadProperties("target/classes/filtered.properties"); - String timestamp = filteredProperties.getProperty("timestamp"); - assertNotNull(timestamp); - assertTrue(timestamp.endsWith("UTC")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5482AetherNotFoundTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5482AetherNotFoundTest.java deleted file mode 100644 index 1daa1ada6..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5482AetherNotFoundTest.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.IOException; -import java.util.List; -import java.util.regex.Pattern; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5482. - * - * It checks that plugins and reports causing errors because of Aether change from Sonatype to Eclipse - * get a dedicated message to explain solution to end-users - * - * @author hboutemy - */ -public class MavenITmng5482AetherNotFoundTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng5482AetherNotFoundTest() { - super("[3.1-A,)"); - } - - @Test - public void testPluginDependency() throws IOException, VerificationException { - check("plugin-dependency"); - } - - @Test - public void testPluginSite() throws IOException, VerificationException { - check("plugin-site"); - } - - /*public void testReportMpir() - throws IOException, VerificationException - { - check( "report-mpir" ); - }*/ - - public void check(String dir) throws IOException, VerificationException { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5482/" + dir); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - verifier.setAutoclean(false); - - try { - verifier.addCliArgument("validate"); - verifier.execute(); - - fail("should throw an error during execution."); - } catch (VerificationException e) { - // expected...it'd be nice if we could get the specifics of the exception right here... - } - - List lines = verifier.loadFile(new File(testDir, "log.txt"), false); - - int msg = indexOf(lines, "Caused by: java.lang.ClassNotFoundException: org.sonatype.aether.+"); - assertTrue("ClassNotFoundException message was not found in output.", msg >= 0); - - int url = indexOf(lines, ".*http://cwiki.apache.org/confluence/display/MAVEN/AetherClassNotFound.*"); - assertTrue("Url to ClassNotFoundAether was not found in output.", url >= 0); - } - - private int indexOf(List logLines, String regex) { - Pattern pattern = Pattern.compile(regex); - - for (int i = 0; i < logLines.size(); i++) { - String logLine = logLines.get(i); - - if (pattern.matcher(logLine).matches()) { - return i; - } - } - - return -1; - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5503ZipInReactorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5503ZipInReactorTest.java deleted file mode 100644 index ade247ee6..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5503ZipInReactorTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5418. - * - * @author jvz - */ -@Tag("disabled") -@Disabled -public class MavenITmng5503ZipInReactorTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng5503ZipInReactorTest() { - super("[3.1,)"); - } - - /** - * Test that zip attached in the assembly plugin is found in the reactor. Simply running verify is sufficient to know that - * it is found with this project setup. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5503"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("verify"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5530MojoExecutionScopeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5530MojoExecutionScopeTest.java deleted file mode 100644 index a800fbea9..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5530MojoExecutionScopeTest.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng5530MojoExecutionScopeTest extends AbstractMavenIntegrationTestCase { - public MavenITmng5530MojoExecutionScopeTest() { - super("[3.2.1,)"); - } - - @Test - public void test_copyfiles() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5530-mojo-execution-scope"); - File pluginDir = new File(testDir, "plugin"); - File projectDir = new File(testDir, "basic"); - - Verifier verifier; - - // install the test plugin - verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // build the test project - verifier = newVerifier(projectDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("package"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // verifier.verifyFilePresent( "target/execution-failure.txt" ); - verifier.verifyFilePresent("target/execution-success.txt"); - verifier.verifyFilePresent("target/execution-before.txt"); - } - - @Test - public void test_copyfiles_multithreaded() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5530-mojo-execution-scope"); - File pluginDir = new File(testDir, "plugin"); - File projectDir = new File(testDir, "basic"); - - Verifier verifier; - - // install the test plugin - verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // build the test project - verifier = newVerifier(projectDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("--builder"); - verifier.addCliArgument("multithreaded"); - verifier.addCliArgument("-T"); - verifier.addCliArgument("1"); - verifier.addCliArgument("package"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // verifier.verifyFilePresent( "target/execution-failure.txt" ); - verifier.verifyFilePresent("target/execution-success.txt"); - verifier.verifyFilePresent("target/execution-before.txt"); - } - - @Test - public void testExtension() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5530-mojo-execution-scope"); - File extensionDir = new File(testDir, "extension"); - File pluginDir = new File(testDir, "extension-plugin"); - File projectDir = new File(testDir, "extension-project"); - - Verifier verifier; - - // install the test extension - verifier = newVerifier(extensionDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // install the test plugin - verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // build the test project - verifier = newVerifier(projectDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("-Dmaven.ext.class.path=" + new File(extensionDir, "target/classes").getAbsolutePath()); - verifier.setForkJvm(true); // verifier does not support custom realms in embedded mode - verifier.addCliArgument("package"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5557ProperlyRestrictedReactor.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5557ProperlyRestrictedReactor.java deleted file mode 100644 index b04bdf479..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5557ProperlyRestrictedReactor.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; - -/** - * Test to make sure that the reactor is properly constrained when --projects is used. Previous to 3.1.2 all of the - * projects found in the {@code } section of the POM were passed into the reactor. This test is a 5 project - * multi-module project where only project-0, and project-1 are specified to be used. The project-0 has a dependency on - * project-4 and in this constrained mode the dependency resolution should fail because project-4 is no longer placed in - * the reactor. - * - * @author jvanzyl - */ -@Tag("disabled") -public class MavenITmng5557ProperlyRestrictedReactor extends AbstractMavenIntegrationTestCase { - public MavenITmng5557ProperlyRestrictedReactor() { - super("[3.1.2,)"); - } - - @Test - public void testRunningRestrictedReactor() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5557-properly-restricted-reactor"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - // - // Remove everything related to this project from the local repository as we want this to be resolution purely - // from the reactor. - // - verifier.deleteArtifacts("org.apache.maven.its.mng5557"); - verifier.addCliArgument("--projects"); - verifier.addCliArgument("project-0,project-1"); - try { - verifier.addCliArgument("package"); - verifier.execute(); - } catch (VerificationException e) { - // the execution should fail due to a resolution error. - } - verifier.verifyTextInLog( - "Could not resolve dependencies for project org.apache.maven.its.mng5557:project-0:jar:1.0: Could not find artifact org.apache.maven.its.mng5557:project-4:jar:1.0"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5561PluginRelocationLosesConfigurationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5561PluginRelocationLosesConfigurationTest.java deleted file mode 100644 index 92df7b693..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5561PluginRelocationLosesConfigurationTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng5561PluginRelocationLosesConfigurationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng5561PluginRelocationLosesConfigurationTest() { - super("[3.8.5,)"); - } - - @Test - public void testit() throws Exception { - File testDir = - ResourceExtractor.simpleExtractResources(getClass(), "/mng-5561-plugin-relocation-loses-configuration"); - File oldPluginWithRelocationDir = new File(testDir, "old-plugin-with-relocation"); - File newPluginDir = new File(testDir, "new-plugin"); - File projectDir = new File(testDir, "project"); - - Verifier verifier; - - verifier = newVerifier(oldPluginWithRelocationDir.getAbsolutePath()); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(newPluginDir.getAbsolutePath()); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(projectDir.getAbsolutePath()); - verifier.addCliArgument("verify"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - verifier.verifyTextInLog("[WARNING] Hello from Maven!"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5572ReactorPluginExtensionsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5572ReactorPluginExtensionsTest.java deleted file mode 100644 index 30068d69b..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5572ReactorPluginExtensionsTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5572 - * as a response to MNG-1911 - * - * - * @author rfscholte - */ -public class MavenITmng5572ReactorPluginExtensionsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng5572ReactorPluginExtensionsTest() { - super("[3.2,)"); - } - - /** - * Test that Maven warns when one reactor project contains a plugin, and another tries to use it with extensions - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5572-reactor-plugin-extensions"); - - // plugin must be available in local repo, otherwise the project couldn't be built - Verifier setup = newVerifier(testDir.getAbsolutePath()); - setup.setAutoclean(true); - setup.addCliArgument("-f"); - setup.addCliArgument("plugin/pom.xml"); - setup.addCliArgument("install"); - setup.execute(); - setup.verifyErrorFreeLog(); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setLogFileName("log2.txt"); - verifier.setAutoclean(false); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - if (getMavenVersion().getMajorVersion() <= 3) { - verifier.verifyTextInLog( - "[WARNING] project uses org.apache.maven.its.mng5572:plugin as extensions, which is not possible within the same reactor build. This plugin was pulled from the local repository!"); - } else { - verifier.verifyTextInLog( - "[WARNING] 'project' uses 'org.apache.maven.its.mng5572:plugin' as extension which is not possible within the same reactor build. This plugin was pulled from the local repository!"); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5576CdFriendlyVersions.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5576CdFriendlyVersions.java deleted file mode 100644 index 61c1bf483..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5576CdFriendlyVersions.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5576. - * - * @author Jason van Zyl - */ -public class MavenITmng5576CdFriendlyVersions extends AbstractMavenIntegrationTestCase { - public MavenITmng5576CdFriendlyVersions() { - super("[3.2,)"); - } - - /** - * Verifies that property references with dotted notation work within - * POM interpolation. - * - * @throws Exception in case of failure - */ - @Test - public void testContinuousDeliveryFriendlyVersionsAreWarningFreeWithoutBuildConsumer() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5576-cd-friendly-versions"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-Dchangelist=changelist"); - verifier.addCliArgument("-Dmaven.experimental.buildconsumer=false"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - assertEquals("1.0.0.changelist", props.getProperty("project.version")); - - List lines = verifier.loadFile(new File(testDir, "log.txt"), false); - boolean seenScanning = false; - for (String line : lines) { - seenScanning |= line.contains("Scanning for projects"); - if (seenScanning) { - assertFalse(String.join("\n", lines), line.contains("WARNING")); - } - } - } - - /** - * Verifies that property references with dotted notation work within - * POM interpolation. - * - * @throws Exception in case of failure - */ - @Test - public void testContinuousDeliveryFriendlyVersionsAreWarningFreeWithBuildConsumer() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5576-cd-friendly-versions"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setLogFileName("log-bc.txt"); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-Dchangelist=changelist"); - verifier.addCliArgument("-Dmaven.experimental.buildconsumer=true"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/pom.properties"); - assertEquals("1.0.0.changelist", props.getProperty("project.version")); - - List lines = verifier.loadFile(new File(testDir, "log-bc.txt"), false); - boolean seenScanning = false; - for (String line : lines) { - seenScanning |= line.contains("Scanning for projects"); - if (seenScanning) { - assertFalse(String.join("\n", lines), line.contains("WARNING")); - } - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5578SessionScopeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5578SessionScopeTest.java deleted file mode 100644 index eaa2521c8..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5578SessionScopeTest.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng5578SessionScopeTest extends AbstractMavenIntegrationTestCase { - public MavenITmng5578SessionScopeTest() { - super("[3.2.4,)"); - } - - @Test - public void testBasic() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5578-session-scope"); - File pluginDir = new File(testDir, "plugin"); - File projectDir = new File(testDir, "basic"); - - Verifier verifier; - - // install the test plugin - verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // build the test project - verifier = newVerifier(projectDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("-Dit-build-extensions=false"); - verifier.addCliArgument("package"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } - - @Test - public void testBasic_multithreaded() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5578-session-scope"); - File pluginDir = new File(testDir, "plugin"); - File projectDir = new File(testDir, "basic"); - - Verifier verifier; - - // install the test plugin - verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // build the test project - verifier = newVerifier(projectDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("-Dit-build-extensions=false"); - verifier.addCliArgument("--builder"); - verifier.addCliArgument("multithreaded"); - verifier.addCliArgument("-T"); - verifier.addCliArgument("1"); - verifier.addCliArgument("package"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } - - @Test - public void testBasic_buildExtension() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5578-session-scope"); - File pluginDir = new File(testDir, "plugin"); - File projectDir = new File(testDir, "basic"); - - Verifier verifier; - - // install the test plugin - verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // build the test project - verifier = newVerifier(projectDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("-Dit-build-extensions=true"); - verifier.addCliArgument("package"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } - - @Test - public void testExtension() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5578-session-scope"); - File extensionDir = new File(testDir, "extension"); - File pluginDir = new File(testDir, "extension-plugin"); - File projectDir = new File(testDir, "extension-project"); - - Verifier verifier; - - // install the test extension - verifier = newVerifier(extensionDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // install the test plugin - verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // build the test project - verifier = newVerifier(projectDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("-Dmaven.ext.class.path=" + new File(extensionDir, "target/classes").getAbsolutePath()); - verifier.setForkJvm(true); // verifier does not support custom realms in embedded mode - verifier.addCliArgument("package"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5581LifecycleMappingDelegate.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5581LifecycleMappingDelegate.java deleted file mode 100644 index fab800017..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5581LifecycleMappingDelegate.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng5581LifecycleMappingDelegate extends AbstractMavenIntegrationTestCase { - public MavenITmng5581LifecycleMappingDelegate() { - super("[3.2.1,)"); - } - - @Test - public void testCustomLifecycle() throws Exception { - /* - * This test comes in two parts, a build extension project that defines custom lifecycle with corresponding - * lifecycle mapping delegate, and a test project used to validate the custom lifecycle. The custom lifecycle id - * is "test-only", it has single build phase "test-only" and lifecycle mapping delegate that picks default - * surefire-plugin execution out of all mojos configured in project pom.xml. The test asserts it is possible to - * run "test-only" build phase and that it does not run maven-compiler-plugin. - */ - - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5581-lifecycle-mapping-delegate"); - File extensionDir = new File(testDir, "extension"); - File projectDir = new File(testDir, "basic"); - - Verifier verifier; - - // install the test extension - verifier = newVerifier(extensionDir.getAbsolutePath()); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // compile the test project - verifier = newVerifier(projectDir.getAbsolutePath()); - verifier.setLogFileName("compile-log.txt"); - verifier.addCliArgument("compile"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // run custom "test-only" build phase - verifier = newVerifier(projectDir.getAbsolutePath(), "remote"); - verifier = newVerifier(projectDir.getAbsolutePath()); - verifier.setLogFileName("test-only-log.txt"); - verifier.setForkJvm(true); - verifier.addCliArgument("-X"); - verifier.addCliArgument("test-only"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - verifier.verifyTextInLog("maven-surefire-plugin"); - verifyTextNotInLog(verifier, "maven-compiler-plugin"); - } - - private void verifyTextNotInLog(Verifier verifier, String text) throws VerificationException { - List lines = verifier.loadFile(verifier.getBasedir(), verifier.getLogFileName(), false); - - boolean textFound = false; - for (String line : lines) { - if (line.contains(text)) { - textFound = true; - break; - } - } - if (textFound) { - throw new VerificationException("Text found in log: " + text); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5591WorkspaceReader.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5591WorkspaceReader.java deleted file mode 100644 index dc6331323..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5591WorkspaceReader.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng5591WorkspaceReader extends AbstractMavenIntegrationTestCase { - public MavenITmng5591WorkspaceReader() { - super("[3.1.0,)"); - } - - @Test - public void testWorkspaceReader() throws Exception { - /* - * The point of this test is to validate that ide WorkspaceReader, like one used by m2e, does not interfere with - * reactor dependency resolution. The test comes in two parts. mng-5591-workspace-reader/extension is noop - * WorkspaceReader implementation and mng-5591-workspace-reader/basic is a multi-module project with inter-module - * dependencies. The workspace reader extension is injected in maven runtime with -Dmaven.ext.class.path command - * line argument. The multi-module build fails unless reactor resolution works properly. - */ - - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5591-workspace-reader"); - File extensionDir = new File(testDir, "extension"); - File projectDir = new File(testDir, "basic"); - - Verifier verifier; - - // install the test extension - verifier = newVerifier(extensionDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // compile the test project - verifier = newVerifier(projectDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("-Dmaven.ext.class.path=" - + new File(extensionDir, "target/mng-5591-workspace-reader-extension-0.1.jar").getCanonicalPath()); - verifier.addCliArgument("compile"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5600DependencyManagementImportExclusionsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5600DependencyManagementImportExclusionsTest.java deleted file mode 100644 index d75fc7970..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5600DependencyManagementImportExclusionsTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * [MNG-5600] Dependency management import should support exclusions. - * - * @author Christian Schulte - */ -class MavenITmng5600DependencyManagementImportExclusionsTest extends AbstractMavenIntegrationTestCase { - - MavenITmng5600DependencyManagementImportExclusionsTest() { - super("[4.0.0-alpha-5,)"); - } - - @Test - public void testCanExcludeDependenciesFromImport() throws Exception { - final File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5600/exclusions"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.filterFile("../settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterMap()); - - verifier.addCliArguments("-s", "settings.xml"); - verifier.addCliArguments("clean", "verify"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - final Properties properties = verifier.loadProperties("target/project.properties"); - assertEquals("1", properties.getProperty("project.dependencyManagement.dependencies")); - assertEquals( - "commons-lang:commons-lang:jar", - properties.getProperty("project.dependencyManagement.dependencies.0.managementKey")); - - assertEquals("2", properties.getProperty("project.dependencyManagement.dependencies.0.exclusions")); - assertEquals( - "commons-io", - properties.getProperty("project.dependencyManagement.dependencies.0.exclusions.0.groupId")); - - assertEquals( - "commons-io", - properties.getProperty("project.dependencyManagement.dependencies.0.exclusions.0.artifactId")); - - assertEquals( - "commons-logging", - properties.getProperty("project.dependencyManagement.dependencies.0.exclusions.1.groupId")); - - assertEquals( - "commons-logging", - properties.getProperty("project.dependencyManagement.dependencies.0.exclusions.1.artifactId")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5608ProfileActivationWarningTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5608ProfileActivationWarningTest.java deleted file mode 100644 index 0681c6df4..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5608ProfileActivationWarningTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; -import java.util.regex.Pattern; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5608: - * Profile activation warning test when file specification contains ${project.basedir} - * instead of ${basedir} - */ -public class MavenITmng5608ProfileActivationWarningTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng5608ProfileActivationWarningTest() { - // changed in https://issues.apache.org/jira/browse/MNG-7895 - // TODO - consider a separate test - super("(3.2.1,3.9.4]"); - } - - @Test - public void testitMNG5608() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5608-profile-activation-warning"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // check expected profiles activated, just for sanity (or build should have failed, given other profiles) - assertFileExists(testDir, "target/exists-basedir"); - assertFileExists(testDir, "target/mng-5608-missing-project.basedir"); - - // check that the 2 profiles using ${project.basedir} caused warnings - List logFile = verifier.loadFile(verifier.getBasedir(), verifier.getLogFileName(), false); - assertNotNull(findWarning(logFile, "mng-5608-exists-project.basedir")); - assertNotNull(findWarning(logFile, "mng-5608-missing-project.basedir")); - } - - private void assertFileExists(File dir, String filename) { - File file = new File(dir, filename); - assertTrue("expected file: " + file, file.exists()); - } - - private String findWarning(List logLines, String profileId) { - Pattern pattern = - Pattern.compile("(?i).*Failed to interpolate file location ..project.basedir./pom.xml for profile " - + profileId + ": .*"); - - for (String logLine : logLines) { - if (pattern.matcher(logLine).matches()) { - return logLine; - } - } - - return null; - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5639ImportScopePomResolutionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5639ImportScopePomResolutionTest.java deleted file mode 100644 index 48c0713a1..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5639ImportScopePomResolutionTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5639: - * Check that import POM defined in DependencyManagement can be resolved from a parameterised repository - */ -public class MavenITmng5639ImportScopePomResolutionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng5639ImportScopePomResolutionTest() { - super("[3.2.2,)"); - } - - @Test - public void testitMNG5639() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5639-import-scope-pom-resolution"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.deleteArtifacts("org.apache.maven.its.mng5639"); - - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng5639", "b", "0.1", "jar"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5640LifecycleParticipantAfterSessionEnd.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5640LifecycleParticipantAfterSessionEnd.java deleted file mode 100644 index ee7d04497..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5640LifecycleParticipantAfterSessionEnd.java +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * IT that verifies that lifecycle participant - * methods are invoked even with various build failures/errors. - */ -public class MavenITmng5640LifecycleParticipantAfterSessionEnd extends AbstractMavenIntegrationTestCase { - public MavenITmng5640LifecycleParticipantAfterSessionEnd() { - super("[3.2.2,)"); - } - - /** - * IT executing a Maven build that has UT failure. - * - * @throws Exception in case of failure - */ - @Test - public void testBuildFailureUTFail() throws Exception { - File testDir = - ResourceExtractor.simpleExtractResources(getClass(), "/mng-5640-lifecycleParticipant-afterSession"); - File extensionDir = new File(testDir, "extension"); - File projectDir = new File(testDir, "buildfailure-utfail"); - - Verifier verifier; - - // install the test plugin - verifier = newVerifier(extensionDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // build the test project - verifier = newVerifier(projectDir.getAbsolutePath(), "remote"); - try { - verifier.addCliArgument("package"); - verifier.execute(); - fail("The build should fail"); - } catch (VerificationException e) { - // expected, as the build will fail due to always failing UT - } - verifier.verifyTextInLog("testApp(org.apache.maven.its.mng5640.FailingTest)"); - - verifier.verifyFilePresent("target/afterProjectsRead.txt"); - // See https://issues.apache.org/jira/browse/MNG-5641 - // verifier.verifyFilePresent( "target/afterSessionStart.txt" ); - verifier.verifyFilePresent("target/afterSessionEnd.txt"); - } - - /** - * IT executing a Maven build that has missing dependency. - * - * @throws Exception in case of failure - */ - @Test - public void testBuildFailureMissingDependency() throws Exception { - File testDir = - ResourceExtractor.simpleExtractResources(getClass(), "/mng-5640-lifecycleParticipant-afterSession"); - File extensionDir = new File(testDir, "extension"); - File projectDir = new File(testDir, "buildfailure-depmissing"); - - Verifier verifier; - - // install the test plugin - verifier = newVerifier(extensionDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // build the test project - verifier = newVerifier(projectDir.getAbsolutePath(), "remote"); - try { - verifier.addCliArgument("package"); - verifier.execute(); - fail("The build should fail"); - } catch (VerificationException e) { - // expected, as the build will fail due to always failing UT - } - - verifier.verifyFilePresent("target/afterProjectsRead.txt"); - // See https://issues.apache.org/jira/browse/MNG-5641 - // verifier.verifyFilePresent( "target/afterSessionStart.txt" ); - verifier.verifyFilePresent("target/afterSessionEnd.txt"); - } - - /** - * IT executing a Maven build that has failing Maven plugin. - * - * @throws Exception in case of failure - */ - @Test - public void testBuildError() throws Exception { - File testDir = - ResourceExtractor.simpleExtractResources(getClass(), "/mng-5640-lifecycleParticipant-afterSession"); - File extensionDir = new File(testDir, "extension"); - File pluginDir = new File(testDir, "badplugin"); - File projectDir = new File(testDir, "builderror-mojoex"); - - Verifier verifier; - - // install the test plugin - verifier = newVerifier(extensionDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // install the bad plugin - verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // build the test project - verifier = newVerifier(projectDir.getAbsolutePath(), "remote"); - try { - verifier.addCliArgument("package"); - verifier.execute(); - fail("The build should fail"); - } catch (VerificationException e) { - // expected, as the build will fail due to always failing UT - } - - verifier.verifyFilePresent("target/afterProjectsRead.txt"); - // See https://issues.apache.org/jira/browse/MNG-5641 - // verifier.verifyFilePresent( "target/afterSessionStart.txt" ); - verifier.verifyFilePresent("target/afterSessionEnd.txt"); - } - - /** - * IT executing a Maven build that has failing Maven plugin throwing RuntimeException. - * - * @throws Exception in case of failure - */ - @Test - public void testBuildErrorRt() throws Exception { - File testDir = - ResourceExtractor.simpleExtractResources(getClass(), "/mng-5640-lifecycleParticipant-afterSession"); - File extensionDir = new File(testDir, "extension"); - File pluginDir = new File(testDir, "badplugin"); - File projectDir = new File(testDir, "builderror-runtimeex"); - - Verifier verifier; - - // install the test plugin - verifier = newVerifier(extensionDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // install the bad plugin - verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // build the test project - verifier = newVerifier(projectDir.getAbsolutePath(), "remote"); - try { - verifier.addCliArgument("package"); - verifier.execute(); - fail("The build should fail"); - } catch (VerificationException e) { - // expected, as the build will fail due to always failing UT - } - - verifier.verifyFilePresent("target/afterProjectsRead.txt"); - // See https://issues.apache.org/jira/browse/MNG-5641 - // verifier.verifyFilePresent( "target/afterSessionStart.txt" ); - verifier.verifyFilePresent("target/afterSessionEnd.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5659ProjectSettingsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5659ProjectSettingsTest.java deleted file mode 100644 index 3bca7aab8..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5659ProjectSettingsTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import java.io.File; -import java.io.IOException; -import java.util.Properties; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng5659ProjectSettingsTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng5659ProjectSettingsTest() { - super("[4.0.0-alpha-6,)"); - } - - @Test - public void testProjectSettings() throws IOException, VerificationException { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5659-project-settings"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props; - - verifier.verifyFilePresent("target/pom.properties"); - props = verifier.loadProperties("target/pom.properties"); - assertEquals( - "project.properties.activated", - Boolean.TRUE.toString(), - props.getProperty("project.properties.activated")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5663NestedImportScopePomResolutionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5663NestedImportScopePomResolutionTest.java deleted file mode 100644 index 533813a5e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5663NestedImportScopePomResolutionTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5663: - * - * The test POM references an import scope POM, which also has a dependency on an import scope POM. - * - * The 2nd import scope POM is found in a repository that is only defined in the test POM. The test confirms - * that dependencies are successfully resolved for this setup. - * - */ -public class MavenITmng5663NestedImportScopePomResolutionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng5663NestedImportScopePomResolutionTest() { - super("[3.0.4,3.2.2),(3.2.2,)"); - } - - @Test - public void testitMNG5639() throws Exception { - File testDir = - ResourceExtractor.simpleExtractResources(getClass(), "/mng-5663-nested-import-scope-pom-resolution"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.deleteArtifacts("org.apache.maven.its.mng5663"); - - verifier.filterFile("pom-template.xml", "pom.xml", "UTF-8"); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyArtifactPresent("org.apache.maven.its.mng5663", "c", "0.1", "jar"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5669ReadPomsOnce.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5669ReadPomsOnce.java deleted file mode 100644 index 5169e06e9..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5669ReadPomsOnce.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * An integration test to ensure any pomfile is only read once. - * This is confirmed by adding a Java Agent to the DefaultModelReader and output the options, including the source location - * - * MNG-5669. - * - */ -public class MavenITmng5669ReadPomsOnce extends AbstractMavenIntegrationTestCase { - - public MavenITmng5669ReadPomsOnce() { - super("[4.0.0-alpha-1,)"); - } - - @Test - public void testWithoutBuildConsumer() throws Exception { - // prepare JavaAgent - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5669-read-poms-once"); - Verifier verifier = newVerifier(testDir.getAbsolutePath(), false); - Map filterProperties = Collections.singletonMap( - "${javaAgentJar}", - verifier.getArtifactPath("org.apache.maven.its", "core-it-javaagent", "2.1-SNAPSHOT", "jar")); - verifier.filterFile(".mvn/jvm.config", ".mvn/jvm.config", null, filterProperties); - - verifier.setForkJvm(true); // pick up agent - verifier.setAutoclean(false); - verifier.addCliArgument("-q"); - verifier.addCliArgument("-U"); - verifier.addCliArgument("-Dmaven.experimental.buildconsumer=false"); - verifier.addCliArgument("verify"); - verifier.execute(); - - List logTxt = verifier.loadLines("log.txt", "utf-8"); - - // count source items - Map sourceMap = logTxt.stream() - .map(this::getSourceFromLogLine) - .filter(Objects::nonNull) - .collect(Collectors.groupingBy(Function.identity(), Collectors.counting())); - - // find duplicates - List duplicates = sourceMap.entrySet().stream() - .filter(entry -> entry.getValue() > 1) - .map(Map.Entry::getKey) - .collect(Collectors.toList()); - - assertTrue("Duplicate items: " + String.join(System.lineSeparator(), duplicates), duplicates.isEmpty()); - } - - @Test - public void testWithBuildConsumer() throws Exception { - // prepare JavaAgent - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5669-read-poms-once"); - Verifier verifier = newVerifier(testDir.getAbsolutePath(), false); - Map filterProperties = Collections.singletonMap( - "${javaAgentJar}", - verifier.getArtifactPath("org.apache.maven.its", "core-it-javaagent", "2.1-SNAPSHOT", "jar")); - verifier.filterFile(".mvn/jvm.config", ".mvn/jvm.config", null, filterProperties); - - verifier.setLogFileName("log-bc.txt"); - verifier.setForkJvm(true); // pick up agent - verifier.setAutoclean(false); - verifier.addCliArgument("-q"); - verifier.addCliArgument("-U"); - verifier.addCliArgument("-Dmaven.experimental.buildconsumer=true"); - verifier.addCliArgument("verify"); - verifier.execute(); - - List logTxt = verifier.loadLines("log-bc.txt", "utf-8"); - - // count source items - Map sourceMap = logTxt.stream() - .map(this::getSourceFromLogLine) - .filter(Objects::nonNull) - .collect(Collectors.groupingBy(Function.identity(), Collectors.counting())); - - // find duplicates - List duplicates = sourceMap.entrySet().stream() - .filter(entry -> entry.getValue() > 1) - .map(Map.Entry::getKey) - .collect(Collectors.toList()); - - assertTrue("Duplicate items: " + String.join(System.lineSeparator(), duplicates), duplicates.isEmpty()); - } - - private String getSourceFromLogLine(String line) { - - final String buildSourceKey = "org.apache.maven.model.building.source="; - final int keyLength = buildSourceKey.length(); - int start = line.indexOf(buildSourceKey); - if (start < 0) { - return null; - } - - int end = line.indexOf(", ", start); - if (end < 0) { - end = line.length() - 1; // is the } - } - - return line.substring(start + keyLength, end); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5716ToolchainsTypeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5716ToolchainsTypeTest.java deleted file mode 100644 index 6a327582a..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5716ToolchainsTypeTest.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Map; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5716. - * - * @author Hervé Boutemy - */ -public class MavenITmng5716ToolchainsTypeTest extends AbstractMavenIntegrationTestCase { - public MavenITmng5716ToolchainsTypeTest() { - super("(3.2.3,)"); - } - - /** - * - * @throws Exception in case of failure - */ - @Test - public void testitMNG5716() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5716-toolchains-type"); - - File javaHome = new File(testDir, "javaHome"); - javaHome.mkdirs(); - new File(javaHome, "bin").mkdirs(); - new File(javaHome, "bin/javac").createNewFile(); - new File(javaHome, "bin/javac.exe").createNewFile(); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - Map properties = verifier.newDefaultFilterMap(); - properties.put("@javaHome@", javaHome.getAbsolutePath()); - - verifier.filterFile("toolchains.xml", "toolchains.xml", "UTF-8", properties); - - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("--toolchains"); - verifier.addCliArgument("toolchains.xml"); - verifier.addCliArgument("initialize"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/toolchains.properties"); - Properties results = verifier.loadProperties("target/toolchains.properties"); - assertNull("javac tool should not be found for requested 'fake' toolchain", results.getProperty("tool.1")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5742BuildExtensionClassloaderTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5742BuildExtensionClassloaderTest.java deleted file mode 100644 index 76926908b..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5742BuildExtensionClassloaderTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.utils.io.FileUtils; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng5742BuildExtensionClassloaderTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng5742BuildExtensionClassloaderTest() { - super("(3.2.5,)"); - } - - @Test - public void testBuildExtensionClassloader() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5742-build-extension-classloader"); - File pluginDir = new File(testDir, "plugin"); - File projectDir = new File(testDir, "project"); - - Verifier verifier; - - // install the test plugin - verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // build the test project - verifier = newVerifier(projectDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - verifier.verifyFilePresent("target/execution-success.txt"); - - String actual = FileUtils.fileRead(new File(projectDir, "target/execution-success.txt")); - assertEquals("executed", actual); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5753CustomMojoExecutionConfiguratorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5753CustomMojoExecutionConfiguratorTest.java deleted file mode 100644 index 7a1505a06..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5753CustomMojoExecutionConfiguratorTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.utils.io.FileUtils; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng5753CustomMojoExecutionConfiguratorTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng5753CustomMojoExecutionConfiguratorTest() { - super("[3.3.0-alpha,)"); - } - - @Test - public void testCustomMojoExecutionConfigurator() throws Exception { - File testDir = - ResourceExtractor.simpleExtractResources(getClass(), "/mng-5753-custom-mojo-execution-configurator"); - File pluginDir = new File(testDir, "plugin"); - File projectDir = new File(testDir, "project"); - - Verifier verifier; - - // install the test plugin - verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - File configurationFile = new File(projectDir, "configuration.txt"); - configurationFile.delete(); - - // build the test project - verifier = newVerifier(projectDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent(configurationFile.getCanonicalPath()); - // - // The element in the original configuration is "ORIGINAL". We want to assert that our - // custom MojoExecutionConfigurator made the transformation of the element from "ORIGINAL" to "TRANSFORMED" - // - String actual = FileUtils.fileRead(configurationFile); - assertEquals("TRANSFORMED", actual); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5760ResumeFeatureTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5760ResumeFeatureTest.java deleted file mode 100644 index 580582a70..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5760ResumeFeatureTest.java +++ /dev/null @@ -1,253 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.IOException; -import java.util.List; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a collection of test cases for MNG-5760, - * --resume / -r in case of build failures. - * - * The test uses a multi-module project with three modules: - *
    - *
  • module-a
  • - *
  • module-b
  • - *
  • module-c (depends on module-b)
  • - *
- * - * @author Maarten Mulders - * @author Martin Kanters - */ -public class MavenITmng5760ResumeFeatureTest extends AbstractMavenIntegrationTestCase { - private final File parentDependentTestDir; - private final File parentIndependentTestDir; - private final File noProjectTestDir; - private final File fourModulesTestDir; - - public MavenITmng5760ResumeFeatureTest() throws IOException { - super("[4.0.0-alpha-1,)"); - this.parentDependentTestDir = - ResourceExtractor.simpleExtractResources(getClass(), "/mng-5760-resume-feature/parent-dependent"); - this.parentIndependentTestDir = - ResourceExtractor.simpleExtractResources(getClass(), "/mng-5760-resume-feature/parent-independent"); - this.noProjectTestDir = - ResourceExtractor.simpleExtractResources(getClass(), "/mng-5760-resume-feature/no-project"); - this.fourModulesTestDir = - ResourceExtractor.simpleExtractResources(getClass(), "/mng-5760-resume-feature/four-modules"); - } - - /** - * Tests that the hint at the end of a failed build mentions --resume instead of --resume-from. - * - * @throws Exception in case of failure - */ - @Test - public void testShouldSuggestToResumeWithoutArgs() throws Exception { - Verifier verifier = newVerifier(parentDependentTestDir.getAbsolutePath()); - verifier.addCliArgument("-Dmodule-b.fail=true"); - - try { - verifier.addCliArgument("test"); - verifier.execute(); - fail("Expected this invocation to fail"); - } catch (final VerificationException ve) { - verifier.verifyTextInLog("mvn [args] -r"); - verifyTextNotInLog(verifier, "mvn [args] -rf :module-b"); - } - - // New build with -r should resume the build from module-b, skipping module-a since it has succeeded already. - verifier = newVerifier(parentDependentTestDir.getAbsolutePath()); - verifier.addCliArgument("-r"); - verifier.addCliArgument("test"); - verifier.execute(); - verifyTextNotInLog(verifier, "Building module-a 1.0"); - verifier.verifyTextInLog("Building module-b 1.0"); - verifier.verifyTextInLog("Building module-c 1.0"); - } - - @Test - public void testShouldSkipSuccessfulProjects() throws Exception { - Verifier verifier = newVerifier(parentDependentTestDir.getAbsolutePath()); - verifier.addCliArgument("-Dmodule-a.fail=true"); - verifier.addCliArgument("--fail-at-end"); - - try { - verifier.addCliArgument("test"); - verifier.execute(); - fail("Expected this invocation to fail"); - } catch (final VerificationException ve) { - // Expected to fail. - } - - // Let module-b and module-c fail, if they would have been built... - verifier = newVerifier(parentDependentTestDir.getAbsolutePath()); - verifier.addCliArgument("-Dmodule-b.fail=true"); - verifier.addCliArgument("-Dmodule-c.fail=true"); - // ... but adding -r should exclude those two from the build because the previous Maven invocation - // marked them as successfully built. - verifier.addCliArgument("-r"); - verifier.addCliArgument("test"); - verifier.execute(); - } - - @Test - public void testShouldSkipSuccessfulModulesWhenTheFirstModuleFailed() throws Exception { - // In this multi-module project, the submodules are not dependent on the parent. - // This results in the parent to be built last, and module-a to be built first. - // This enables us to let the first module in the reactor (module-a) fail. - Verifier verifier = newVerifier(parentIndependentTestDir.getAbsolutePath()); - verifier.addCliArgument("-Dmodule-a.fail=true"); - verifier.addCliArgument("--fail-at-end"); - - try { - verifier.addCliArgument("test"); - verifier.execute(); - fail("Expected this invocation to fail"); - } catch (final VerificationException ve) { - verifier.verifyTextInLog("mvn [args] -r"); - } - - verifier = newVerifier(parentIndependentTestDir.getAbsolutePath()); - verifier.addCliArgument("-r"); - verifier.addCliArgument("test"); - verifier.execute(); - verifier.verifyTextInLog("Building module-a 1.0"); - verifyTextNotInLog(verifier, "Building module-b 1.0"); - } - - @Test - public void testShouldNotCrashWithoutProject() throws Exception { - // There is no Maven project available in the test directory. - // As reported in JIRA this would previously break with a NullPointerException. - // (see - // https://issues.apache.org/jira/browse/MNG-5760?focusedCommentId=17143795&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17143795) - final Verifier verifier = newVerifier(noProjectTestDir.getAbsolutePath()); - try { - verifier.addCliArgument("org.apache.maven.plugins:maven-resources-plugin:resources"); - verifier.execute(); - } catch (final VerificationException ve) { - verifier.verifyTextInLog("Goal requires a project to execute but there is no POM in this directory"); - } - } - - @Test - public void testFailureWithParallelBuild() throws Exception { - // four modules: a, b, c, d - // c depends on b, d depends on a - - // Let's do a first pass with a and c failing. The build is parallel, - // so we have a first thread with a and d, and the second one with b and c - // The result should be: - // a : failure (slow, so b and c will be built in the meantime) - // b : success - // c : failure - // d : skipped - Verifier verifier = newVerifier(fourModulesTestDir.getAbsolutePath()); - verifier.addCliArgument("-T2"); - verifier.addCliArgument("-Dmodule-a.delay=1000"); - verifier.addCliArgument("-Dmodule-a.fail=true"); - verifier.addCliArgument("-Dmodule-c.fail=true"); - try { - verifier.addCliArgument("verify"); - verifier.execute(); - fail("Expected this invocation to fail"); - } catch (final VerificationException ve) { - // Expected to fail. - } - - // Let module-b fail, if it would have been built... - verifier = newVerifier(fourModulesTestDir.getAbsolutePath()); - verifier.addCliArgument("-T2"); - verifier.addCliArgument("-Dmodule-b.fail=true"); - // ... but adding -r should exclude it from the build because the previous Maven invocation - // marked it as successfully built. - verifier.addCliArgument("-r"); - // The result should be: - // a : success - // c : success - // d : success - - verifier.addCliArgument("verify"); - verifier.execute(); - } - - @Test - public void testFailureAfterSkipWithParallelBuild() throws Exception { - // four modules: a, b, c, d - // c depends on b, d depends on a - - // Let's do a first pass with a and c failing. The build is parallel, - // so we have a first thread with a and d, and the second one with b and c - // The result should be: - // a : success - // b : success, slow - // c : skipped - // d : failure - Verifier verifier = newVerifier(fourModulesTestDir.getAbsolutePath()); - verifier.addCliArgument("-T2"); - verifier.addCliArgument("-Dmodule-b.delay=2000"); - verifier.addCliArgument("-Dmodule-d.fail=true"); - try { - verifier.addCliArgument("verify"); - verifier.execute(); - fail("Expected this invocation to fail"); - } catch (final VerificationException ve) { - // Expected to fail. - } - - // Let module-a and module-b fail, if they would have been built... - verifier = newVerifier(fourModulesTestDir.getAbsolutePath()); - verifier.addCliArgument("-T2"); - verifier.addCliArgument("-Dmodule-a.fail=true"); - verifier.addCliArgument("-Dmodule-b.fail=true"); - // ... but adding -r should exclude those two from the build because the previous Maven invocation - // marked them as successfully built. - verifier.addCliArgument("-r"); - - // The result should be: - // c : success - // d : success - verifier.addCliArgument("verify"); - verifier.execute(); - } - - /** - * Throws an exception if the text is present in the log. - * - * @param verifier the verifier to use - * @param text the text to assert present - * @throws VerificationException if text is not found in log - */ - private void verifyTextNotInLog(Verifier verifier, String text) throws VerificationException { - List lines = verifier.loadFile(verifier.getBasedir(), verifier.getLogFileName(), false); - - for (String line : lines) { - if (Verifier.stripAnsi(line).contains(text)) { - throw new VerificationException("Text found in log: " + text); - } - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5768CliExecutionIdTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5768CliExecutionIdTest.java deleted file mode 100644 index 1110c5f41..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5768CliExecutionIdTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng5768CliExecutionIdTest extends AbstractMavenIntegrationTestCase { - public MavenITmng5768CliExecutionIdTest() { - super("(3.2.5,)"); - } - - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5768-cli-execution-id"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.deleteDirectory("target"); - verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-configuration:config@test-execution-id"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/config.properties"); - assertEquals("CONFIGURED", props.getProperty("beanParam.fieldParam")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5771CoreExtensionsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5771CoreExtensionsTest.java deleted file mode 100644 index c9f72eeb9..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5771CoreExtensionsTest.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Map; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5771: - * check that Maven loads core extensions and components contributed by .mvn/extensions.xml - * are available to regular plugins. - */ -public class MavenITmng5771CoreExtensionsTest extends AbstractMavenIntegrationTestCase { - public MavenITmng5771CoreExtensionsTest() { - super("(3.2.5,)"); - } - - @Test - public void testCoreExtension() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5771-core-extensions"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - - verifier = newVerifier(new File(testDir, "client").getAbsolutePath()); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.it-core-extensions"); - verifier.addCliArgument("-s"); - verifier.addCliArgument(new File(testDir, "settings.xml").getAbsolutePath()); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } - - @Test - public void testCoreExtensionNoDescriptor() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5771-core-extensions"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - - verifier = newVerifier(new File(testDir, "client-no-descriptor").getAbsolutePath()); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.it-core-extensions"); - verifier.addCliArgument("-s"); - verifier.addCliArgument(new File(testDir, "settings.xml").getAbsolutePath()); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } - - // - // https://issues.apache.org/jira/browse/MNG-5795: Maven extensions can not be retrieved from authenticated - // repositories - // - @Test - public void testCoreExtensionRetrievedFromAMirrorWithBasicAuthentication() throws Exception { - requiresMavenVersion("[3.3.2,)"); - - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5771-core-extensions"); - - HttpServer server = HttpServer.builder() // - .port(0) // - .username("maven") // - .password("secret") // - .source(new File(testDir, "repo")) // - .build(); - server.start(); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - Map properties = verifier.newDefaultFilterMap(); - properties.put("@port@", Integer.toString(server.port())); - String mirrorOf; - if (matchesVersionRange("[4.0.0-alpha-1,)")) { - mirrorOf = "*"; - } else { - mirrorOf = "external:*"; - } - properties.put("@mirrorOf@", mirrorOf); - verifier.filterFile("settings-template-mirror-auth.xml", "settings.xml", "UTF-8", properties); - - verifier = newVerifier(new File(testDir, "client").getAbsolutePath()); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.it-core-extensions"); - verifier.addCliArgument("-s"); - verifier.addCliArgument(new File(testDir, "settings.xml").getAbsolutePath()); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - server.stop(); - } - - // - // https://issues.apache.org/jira/browse/MNG-7395: Support properties in extensions.xml - // - @Test - public void testCoreExtensionWithProperties() throws Exception { - requiresMavenVersion("[3.8.5,)"); - - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5771-core-extensions"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - - verifier = newVerifier(new File(testDir, "client-properties").getAbsolutePath()); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.it-core-extensions"); - verifier.addCliArgument("-s"); - verifier.addCliArgument(new File(testDir, "settings.xml").getAbsolutePath()); - verifier.addCliArgument("-Dtest-extension-version=0.1"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } - - // - // https://issues.apache.org/jira/browse/MNG-7395: Support properties in extensions.xml - // - @Test - public void testCoreExtensionWithConfig() throws Exception { - requiresMavenVersion("[3.8.5,)"); - - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5771-core-extensions"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - - verifier = newVerifier(new File(testDir, "client-config").getAbsolutePath()); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.it-core-extensions"); - verifier.addCliArgument("-s"); - verifier.addCliArgument(new File(testDir, "settings.xml").getAbsolutePath()); - verifier.setForkJvm(true); // force forked JVM since we need the shell script to detect .mvn/ - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5774ConfigurationProcessorsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5774ConfigurationProcessorsTest.java deleted file mode 100644 index 61c683d71..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5774ConfigurationProcessorsTest.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng5774ConfigurationProcessorsTest extends AbstractMavenIntegrationTestCase { - public MavenITmng5774ConfigurationProcessorsTest() { - super("(3.2.5,)"); - } - - @Test - public void testBehaviourWhereThereIsOneUserSuppliedConfigurationProcessor() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5774-configuration-processors"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - - verifier = newVerifier(new File(testDir, "build-with-one-processor-valid").getAbsolutePath()); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.it-configuration-processors"); - verifier.addCliArgument("-s"); - verifier.addCliArgument(new File(testDir, "settings.xml").getAbsolutePath()); - verifier.addCliArgument("process-resources"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - // Making sure our configuration processor executes - verifier.verifyTextInLog("[INFO] ConfigurationProcessorOne.process()"); - // We have a property value injected by our configuration processor. Make sure it's correct - verifier.verifyFilePresent("target/classes/result.properties"); - Properties result = verifier.loadProperties("target/classes/result.properties"); - assertEquals("yes", result.getProperty("configurationProcessorContributedValue")); - } - - @Test - public void testBehaviourWhereThereAreTwoUserSuppliedConfigurationProcessor() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5774-configuration-processors"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - - verifier = newVerifier(new File(testDir, "build-with-two-processors-invalid").getAbsolutePath()); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.it-configuration-processors"); - verifier.addCliArgument("-s"); - verifier.addCliArgument(new File(testDir, "settings.xml").getAbsolutePath()); - try { - verifier.addCliArgument("process-resources"); - verifier.execute(); - fail( - "We expected this invocation to fail because of too many user supplied configuration processors being present"); - } catch (VerificationException e) { - verifier.verifyTextInLog("There can only be one user supplied ConfigurationProcessor"); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5783PluginDependencyFiltering.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5783PluginDependencyFiltering.java deleted file mode 100644 index 7180196d5..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5783PluginDependencyFiltering.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng5783PluginDependencyFiltering extends AbstractMavenIntegrationTestCase { - - public MavenITmng5783PluginDependencyFiltering() { - super("[3.0,)"); - } - - @Test - public void testSLF4j() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5783-plugin-dependency-filtering"); - Verifier verifier = newVerifier(new File(testDir, "plugin").getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(new File(testDir, "slf4j").getAbsolutePath(), "remote"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // Note that plugin dependencies always include plugin itself and plexus-utils - - List dependencies = verifier.loadLines("target/dependencies.txt", "UTF-8"); - if (matchesVersionRange("(,3.9.0)")) { - assertEquals(3, dependencies.size()); - } else { - assertEquals(2, dependencies.size()); - } - assertEquals( - "mng-5783-plugin-dependency-filtering:mng-5783-plugin-dependency-filtering-plugin:maven-plugin:0.1", - dependencies.get(0)); - assertEquals("org.slf4j:slf4j-api:jar:1.7.5", dependencies.get(1)); - if (matchesVersionRange("(,3.9.0)")) { - assertEquals("org.codehaus.plexus:plexus-utils:jar:1.1", dependencies.get(2)); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5805PkgTypeMojoConfiguration2.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5805PkgTypeMojoConfiguration2.java deleted file mode 100644 index 264349401..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5805PkgTypeMojoConfiguration2.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng5805PkgTypeMojoConfiguration2 extends AbstractMavenIntegrationTestCase { - - public MavenITmng5805PkgTypeMojoConfiguration2() { - super("(3.3.3,)"); - } - - @Test - public void testPkgTypeMojoConfiguration() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5805-pkg-type-mojo-configuration2"); - - Verifier verifier; - - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - verifier.verifyTextInLog("CLASS_NAME=org.apache.maven.its.mng5805.TestClass1"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5840ParentVersionRanges.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5840ParentVersionRanges.java deleted file mode 100644 index f95e44720..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5840ParentVersionRanges.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng5840ParentVersionRanges extends AbstractMavenIntegrationTestCase { - public MavenITmng5840ParentVersionRanges() { - super("[3.3,)"); - } - - @Test - public void testParentRangeRelativePathPointsToWrongVersion() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5840-relative-path-range-negative"); - - Verifier verifier = newVerifier(new File(testDir, "parent-1").getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(new File(testDir, "child").getAbsolutePath(), "remote"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } - - @Test - public void testParentRangeRelativePathPointsToCorrectVersion() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5840-relative-path-range-positive"); - - Verifier verifier = newVerifier(new File(testDir, "parent-1").getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(new File(testDir, "child").getAbsolutePath(), "remote"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5840RelativePathReactorMatching.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5840RelativePathReactorMatching.java deleted file mode 100644 index 444f872db..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5840RelativePathReactorMatching.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng5840RelativePathReactorMatching extends AbstractMavenIntegrationTestCase { - public MavenITmng5840RelativePathReactorMatching() { - super(ALL_MAVEN_VERSIONS); - } - - @Test - public void testRelativePathPointsToWrongVersion() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5840-relative-path-reactor-matching"); - - Verifier verifier = newVerifier(new File(testDir, "parent-1").getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(new File(testDir, "child").getAbsolutePath(), "remote"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5868NoDuplicateAttachedArtifacts.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5868NoDuplicateAttachedArtifacts.java deleted file mode 100644 index 46d1cd642..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5868NoDuplicateAttachedArtifacts.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import java.io.File; -import java.nio.file.Files; -import java.nio.file.Path; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.server.Handler; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.AbstractHandler; -import org.eclipse.jetty.server.handler.HandlerList; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5868. - * - * @author Olivier Lamy - */ -public class MavenITmng5868NoDuplicateAttachedArtifacts extends AbstractMavenIntegrationTestCase { - - private File testDir; - - private Server server; - - private int port; - - private int deployedJarArtifactNumber = 0; - - public MavenITmng5868NoDuplicateAttachedArtifacts() { - super("[3.8.2,)"); - } - - @BeforeEach - protected void setUp() throws Exception { - testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5868"); - - Handler repoHandler = new AbstractHandler() { - @Override - public void handle( - String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) { - System.out.println("Handling " + request.getMethod() + " " + request.getRequestURL()); - - if ("PUT".equalsIgnoreCase(request.getMethod())) { - String uri = request.getRequestURI(); - if (uri.startsWith("/repo/org/apache/maven/its/mng5868/mng5868/1.0-SNAPSHOT/mng5868-1.0") - && uri.endsWith("-run.jar")) { - deployedJarArtifactNumber++; - } - response.setStatus(HttpServletResponse.SC_OK); - } else { - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - } - - ((Request) request).setHandled(true); - } - }; - - server = new Server(0); - - HandlerList handlerList = new HandlerList(); - handlerList.addHandler(repoHandler); - - server.setHandler(handlerList); - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + port); - } - - @AfterEach - protected void tearDown() throws Exception { - if (server != null) { - server.stop(); - server.join(); - } - } - - @Test - public void testNoDeployNotDuplicate() throws Exception { - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - Path tmp = Files.createTempFile(testDir.toPath(), "FOO", "txt"); - - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng5868"); - verifier.addCliArgument("-Dartifact.attachedFile=" + tmp.toFile().getCanonicalPath()); - verifier.addCliArgument("-DdeploymentPort=" + port); - verifier.displayStreamBuffers(); - verifier.addCliArguments("org.apache.maven.its.plugins:maven-it-plugin-artifact:2.1-SNAPSHOT:attach", "deploy"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - assertEquals("deployedJarArtifactNumber: " + deployedJarArtifactNumber, 1, deployedJarArtifactNumber); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5889FindBasedir.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5889FindBasedir.java deleted file mode 100644 index 382ba5d08..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5889FindBasedir.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5889: - * check that extensions in .mvn/ are found when Maven is run with -f path/to/pom.xml. - */ -public class MavenITmng5889FindBasedir extends AbstractMavenIntegrationTestCase { - public MavenITmng5889FindBasedir() { - super("[3.5.0,3.5.1)"); - } - - /** - * check that path/to/.mvn/ is found when path to POM set by --file path/to/pom.xml - * - * @throws Exception in case of failure - */ - @Test - public void testMvnFileLongOption() throws Exception { - runCoreExtensionWithOption("--file", null); - } - - /** - * check that path/to/.mvn/ is found when path to POM set by -f path/to/pom.xml - * - * @throws Exception in case of failure - */ - @Test - public void testMvnFileShortOption() throws Exception { - runCoreExtensionWithOption("-f", null); - } - - /** - * check that path/to/.mvn/ is found when path to POM set by --file path/to/module/pom.xml - * - * @throws Exception in case of failure - */ - @Test - public void testMvnFileLongOptionModule() throws Exception { - runCoreExtensionWithOption("--file", "module"); - } - - /** - * check that path/to/.mvn/ is found when path to POM set by -f path/to/module/pom.xml - * - * @throws Exception in case of failure - */ - @Test - public void testMvnFileShortOptionModule() throws Exception { - runCoreExtensionWithOption("-f", "module"); - } - - private void runCoreExtensionWithOption(String option, String subdir) throws Exception { - runCoreExtensionWithOption(option, subdir, true); - } - - protected void runCoreExtensionWithOption(String option, String subdir, boolean pom) throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5889-find.mvn"); - - File basedir = - new File(testDir, "../mng-" + (pom ? "5889" : "6223") + "-find.mvn" + option + (pom ? "Pom" : "Dir")); - basedir.mkdir(); - - if (subdir != null) { - testDir = new File(testDir, subdir); - basedir = new File(basedir, subdir); - basedir.mkdirs(); - } - - Verifier verifier = newVerifier(basedir.getAbsolutePath()); - verifier.addCliArgument( - "-Dexpression.outputFile=" + new File(basedir, "expression.properties").getAbsolutePath()); - verifier.addCliArgument(option); // -f/--file client/pom.xml - verifier.addCliArgument((pom ? new File(testDir, "pom.xml") : testDir).getAbsolutePath()); - verifier.setForkJvm(true); // force forked JVM since we need the shell script to detect .mvn/ location - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("expression.properties"); - assertEquals("ok", props.getProperty("project.properties.jvm-config")); - assertEquals("ok", props.getProperty("project.properties.maven-config")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5895CIFriendlyUsageWithPropertyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5895CIFriendlyUsageWithPropertyTest.java deleted file mode 100644 index 4b30fcb11..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5895CIFriendlyUsageWithPropertyTest.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * The usage of a ${revision} for the version in the pom file and furthermore - * defining the property in the pom file and overwrite it via command line. - * MNG-5895. - * - * This will result in a failure without the fix for this issue. - * - * @author Karl Heinz Marbaise khmarbaise@apache.org - */ -public class MavenITmng5895CIFriendlyUsageWithPropertyTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng5895CIFriendlyUsageWithPropertyTest() { - // The first version which contains the fix for the MNG-issue. - // TODO: Think about it! - super("[3.5.0-alpha-2,)"); - } - - /** - * Check that the resulting run will not fail in case - * of defining the property via command line which is - * already defined inside the pom. - * - * @throws Exception in case of failure - */ - @Test - public void testitShouldResolveTheDependenciesWithoutBuildConsumer() throws Exception { - File testDir = - ResourceExtractor.simpleExtractResources(getClass(), "/mng-5895-ci-friendly-usage-with-property"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), false); - verifier.setAutoclean(false); - - // verifier.setLogFileName( "log-only.txt" ); - verifier.addCliArgument("-Drevision=1.2"); - verifier.addCliArgument("-Dmaven.experimental.buildconsumer=false"); - verifier.addCliArgument("clean"); - verifier.execute(); - verifier.addCliArgument("package"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } - - @Test - public void testitShouldResolveTheDependenciesWithBuildConsumer() throws Exception { - File testDir = - ResourceExtractor.simpleExtractResources(getClass(), "/mng-5895-ci-friendly-usage-with-property"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), false); - verifier.setAutoclean(false); - - verifier.setLogFileName("log-bc.txt"); - verifier.addCliArgument("-Drevision=1.2"); - verifier.addCliArgument("-Dmaven.experimental.buildconsumer=true"); - verifier.addCliArgument("clean"); - verifier.execute(); - verifier.addCliArgument("package"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5898BuildMultimoduleWithEARFailsToResolveWARTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5898BuildMultimoduleWithEARFailsToResolveWARTest.java deleted file mode 100644 index d77639c47..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5898BuildMultimoduleWithEARFailsToResolveWARTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5898. - * - * @author Karl Heinz Marbaise - */ -public class MavenITmng5898BuildMultimoduleWithEARFailsToResolveWARTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng5898BuildMultimoduleWithEARFailsToResolveWARTest() { - super("[3.1,)"); - } - - /** - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5898"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("test"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5935OptionalLostInTranstiveManagedDependenciesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5935OptionalLostInTranstiveManagedDependenciesTest.java deleted file mode 100644 index f8d4ed7bd..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5935OptionalLostInTranstiveManagedDependenciesTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-5935. - * - */ -public class MavenITmng5935OptionalLostInTranstiveManagedDependenciesTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng5935OptionalLostInTranstiveManagedDependenciesTest() { - super("[3.5.1,)"); - } - - @Test - public void testitMNG5935() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources( - getClass(), "/mng-5935-optional-lost-in-transtive-managed-dependencies"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), "remote"); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List dependencies = verifier.loadLines("target/dependencies.txt", "UTF-8"); - assertEquals(5, dependencies.size()); - assertEquals("com.mysema.querydsl:querydsl-core:jar:3.4.3 (optional)", dependencies.get(0)); - assertEquals("com.google.guava:guava:jar:17.0 (optional)", dependencies.get(1)); - assertEquals("com.google.code.findbugs:jsr305:jar:2.0.3 (optional)", dependencies.get(2)); - assertEquals("com.mysema.commons:mysema-commons-lang:jar:0.2.4 (optional)", dependencies.get(3)); - assertEquals("com.infradna.tool:bridge-method-annotation:jar:1.13 (optional)", dependencies.get(4)); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5958LifecyclePhaseBinaryCompat.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5958LifecyclePhaseBinaryCompat.java deleted file mode 100644 index 4fe4d5a38..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5958LifecyclePhaseBinaryCompat.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng5958LifecyclePhaseBinaryCompat extends AbstractMavenIntegrationTestCase { - - public MavenITmng5958LifecyclePhaseBinaryCompat() { - super("(3.3.9,)"); - } - - @Test - public void testGood() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5958-lifecycle-phases/good"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - verifier.verifyTextInLog("CLASS_NAME=java.lang.String"); - } - - @Test - public void testBad() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5958-lifecycle-phases/bad"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - } catch (VerificationException e) { - // There is no good way to test for Java 9+ in Verifier in order to add 'java.base/' to the string. - // Java 11: Internal error: java.lang.ClassCastException: class org.apache.maven.. - verifier.verifyTextInLog("[ERROR] Internal error: java.lang.ClassCastException: "); - verifier.verifyTextInLog("org.apache.maven.lifecycle.mapping.LifecyclePhase cannot be cast to "); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5965ParallelBuildMultipliesWorkTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5965ParallelBuildMultipliesWorkTest.java deleted file mode 100644 index 08334206c..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5965ParallelBuildMultipliesWorkTest.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.ArrayList; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * Test set for MNG-5965. - */ -public class MavenITmng5965ParallelBuildMultipliesWorkTest extends AbstractMavenIntegrationTestCase { - public MavenITmng5965ParallelBuildMultipliesWorkTest() { - super("[3.6.1,)"); - } - - @Test - public void testItShouldOnlyRunEachTaskOnce() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5965-parallel-build-multiplies-work"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), false); - verifier.setAutoclean(false); - - verifier.setLogFileName("log-only.txt"); - verifier.addCliArgument("-T1"); - // include an aggregator task so that the two goals end up in different task segments - verifier.addCliArguments("clean", "install:help"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List logLines = verifier.loadLines("log-only.txt", "UTF-8"); - - List cleanGoalsExecuted = findCleanExecutions(logLines); - - // clean only executed once per module - assertNoRepeatedLines(cleanGoalsExecuted); - - // clean executed in the 3 modules - assertEquals(cleanGoalsExecuted.size(), 3); - } - - private void assertNoRepeatedLines(List logLines) throws VerificationException { - Set uniqueLines = new LinkedHashSet<>(); - for (String line : logLines) { - if (uniqueLines.contains(line)) { - throw new VerificationException("Goal executed twice: " + line); - } - uniqueLines.add(line); - } - } - - private List findCleanExecutions(List fullLog) { - List cleanExecutions = new ArrayList<>(); - for (String line : fullLog) { - if (line.contains("(default-clean)")) { - cleanExecutions.add(line); - } - } - - return cleanExecutions; - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6057CheckReactorOrderTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6057CheckReactorOrderTest.java deleted file mode 100644 index 56e69d25e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6057CheckReactorOrderTest.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.LinkedList; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * Using a ${revision} in the version will change the reactor order before fixing - * MNG-6057. Without the fix for this issue the order of - * the reactor is changed in that way that the parent is ordered to the last position instead of the first position. - * - * @author Karl Heinz Marbaise khmarbaise@apache.org - */ -public class MavenITmng6057CheckReactorOrderTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng6057CheckReactorOrderTest() { - // The first version which contains the fix for the MNG-6057 issue. - // TODO: Think about it! - super("[3.5.0-alpha-2,)"); - } - - /** - * Verify that the result shows the reactor order as expected. - * - * @throws Exception in case of failure - */ - @Test - public void testitReactorShouldResultInExpectedOrder() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6057-check-reactor-order"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), false); - verifier.setAutoclean(false); - - verifier.setLogFileName("log-only.txt"); - verifier.addCliArgument("-Drevision=1.3.0-SNAPSHOT"); - verifier.addCliArgument("clean"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List loadedLines = verifier.loadLines("log-only.txt", "UTF-8"); - List resultingLines = extractReactorBuildOrder(loadedLines); - - // We're expecting exactly three lines as result. - assertEquals(3, resultingLines.size()); - - // We expect those lines in the following exact order. - assertTrue(resultingLines.get(0).startsWith("[INFO] base-project")); - assertTrue(resultingLines.get(1).startsWith("[INFO] module-1")); - assertTrue(resultingLines.get(2).startsWith("[INFO] module-2")); - } - - /** - * Extract the lines at the beginning of the Maven output: - * - *
-     * [INFO] Reactor Build Order:
-     * [INFO]
-     * [INFO] module-1
-     * [INFO] module-2
-     * [INFO] base-project
-     * [INFO]
-     * 
- */ - private List extractReactorBuildOrder(List loadedLines) { - List resultingLines = new LinkedList<>(); - boolean start = false; - for (String line : loadedLines) { - if (start) { - if (line.startsWith("[INFO] -------------")) { - start = false; - } else if (!line.endsWith("[INFO] ")) { - resultingLines.add(line); - } - } else { - if (line.startsWith("[INFO] Reactor Build Order:")) { - start = true; - } - } - } - return resultingLines; - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6065FailOnSeverityTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6065FailOnSeverityTest.java deleted file mode 100644 index 141d220e5..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6065FailOnSeverityTest.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * An integration test to verify that builds fail when logs occur - * above or equal to the --fail-on-severity cli property. - * - * MNG-6065. - * - */ -public class MavenITmng6065FailOnSeverityTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng6065FailOnSeverityTest() { - super("[4.0.0-alpha-1,)"); - } - - @Test - public void testItShouldFailOnWarnLogMessages() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6065-fail-on-severity"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), false); - verifier.setForkJvm(true); - verifier.addCliArgument("--fail-on-severity"); - verifier.addCliArgument("WARN"); - - boolean failed = false; - - try { - verifier.addCliArgument("compile"); - verifier.execute(); - } catch (VerificationException e) { - failed = true; - verifier.verifyTextInLog("Enabled to break the build on log level WARN."); - verifier.verifyTextInLog("Build failed due to log statements with a higher severity than allowed."); - } - - assertTrue("Build should have failed", failed); - } - - @Test - public void testItShouldSucceedOnWarnLogMessagesWhenFailLevelIsError() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6065-fail-on-severity"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), false); - verifier.setForkJvm(true); - verifier.addCliArgument("--fail-on-severity"); - verifier.addCliArgument("ERROR"); - - verifier.addCliArgument("compile"); - verifier.execute(); - - verifier.verifyTextInLog("Enabled to break the build on log level ERROR."); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6071GetResourceWithCustomPom.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6071GetResourceWithCustomPom.java deleted file mode 100644 index e930edfff..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6071GetResourceWithCustomPom.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-6071: - * check that getClass().getResource("/") returns consistent results when Maven is run with -f ./pom.xml. - */ -public class MavenITmng6071GetResourceWithCustomPom extends AbstractMavenIntegrationTestCase { - public MavenITmng6071GetResourceWithCustomPom() { - super("[3.8.2,)"); - } - - /** - * check when path to POM set by -f ./pom.xml - * - * @throws Exception in case of failure - */ - @Test - public void testRunCustomPomWithDot() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6071"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("-f"); - verifier.addCliArgument("./pom.xml"); - verifier.setForkJvm(true); - verifier.addCliArgument("verify"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6084Jsr250PluginTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6084Jsr250PluginTest.java deleted file mode 100644 index 07d788685..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6084Jsr250PluginTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-6084. - */ -public class MavenITmng6084Jsr250PluginTest extends AbstractMavenIntegrationTestCase { - - private File testDir; - - public MavenITmng6084Jsr250PluginTest() { - super("[3.5.1,)"); - } - - @BeforeEach - public void setUp() throws Exception { - testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6084-jsr250-support"); - } - - @Test - public void testJsr250PluginExecution() throws Exception { - // - // Build a plugin that uses JSR 250 annotations - // - Verifier v0 = newVerifier(testDir.getAbsolutePath(), "remote"); - v0.setAutoclean(false); - v0.deleteDirectory("target"); - v0.deleteArtifacts("org.apache.maven.its.mng6084"); - v0.addCliArgument("install"); - v0.execute(); - v0.verifyErrorFreeLog(); - - // - // Execute the JSR 250 plugin - // - Verifier v1 = newVerifier(testDir.getAbsolutePath(), "remote"); - v1.setAutoclean(false); - v1.addCliArgument("org.apache.maven.its.mng6084:jsr250-maven-plugin:0.0.1-SNAPSHOT:hello"); - v1.execute(); - v1.verifyErrorFreeLog(); - v1.verifyTextInLog("Hello! I am a component using JSR 250 with @PostConstruct support"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6090CIFriendlyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6090CIFriendlyTest.java deleted file mode 100644 index 72bd50eeb..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6090CIFriendlyTest.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * The usage of a ${revision} for the version in the pom file and furthermore - * defining the property in the pom file and overwrite it via command line and - * try to build a partial reactor via mvn -pl .. - * MNG-6090. - * - * @author Karl Heinz Marbaise khmarbaise@apache.org - */ -public class MavenITmng6090CIFriendlyTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng6090CIFriendlyTest() { - // The first version which contains the fix for the MNG-issue. - // TODO: Think about it! - super("[3.5.0-alpha-2,)"); - } - - /** - * Check that the resulting run will not fail in case - * of defining the property via command line and - * install the projects and afterwards just build - * a part of the whole reactor. - * - * @throws Exception in case of failure - */ - @Test - public void testitShouldResolveTheDependenciesWithoutBuildConsumer() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6090-ci-friendly"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), false); - verifier.setAutoclean(false); - - verifier.addCliArgument("-Drevision=1.2"); - verifier.addCliArgument("-Dmaven.experimental.buildconsumer=false"); - verifier.setLogFileName("install-log.txt"); - verifier.addCliArguments("clean", "install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(testDir.getAbsolutePath(), false); - verifier.setAutoclean(false); - - verifier.addCliArgument("-Drevision=1.2"); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("module-3"); - verifier.addCliArgument("package"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } - - @Test - public void testitShouldResolveTheDependenciesWithBuildConsumer() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6090-ci-friendly"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), false); - verifier.setAutoclean(false); - verifier.setForkJvm(true); - - verifier.addCliArgument("-Drevision=1.2"); - verifier.addCliArgument("-Dmaven.experimental.buildconsumer=true"); - verifier.setLogFileName("install-log.txt"); - verifier.addCliArguments("clean", "install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(testDir.getAbsolutePath(), false); - verifier.setAutoclean(false); - verifier.setForkJvm(true); - - verifier.addCliArgument("-Drevision=1.2"); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("module-3"); - verifier.addCliArgument("package"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6118SubmoduleInvocation.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6118SubmoduleInvocation.java deleted file mode 100644 index c1d7ce867..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6118SubmoduleInvocation.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.IOException; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a collection of test cases for MNG-6118, - * invoking Maven in a submodule of a multi-module project. - * - * The test uses a multi-module project with two modules: - *
    - *
  • app (depends on lib)
  • - *
  • lib
  • - *
- * - * @author Maarten Mulders - * @author Martin Kanters - */ -public class MavenITmng6118SubmoduleInvocation extends AbstractMavenIntegrationTestCase { - private static final String RESOURCE_PATH = "/mng-6118-submodule-invocation-full-reactor"; - private final File testDir; - - public MavenITmng6118SubmoduleInvocation() throws IOException { - super("[4.0.0-alpha-1,)"); - testDir = ResourceExtractor.simpleExtractResources(getClass(), RESOURCE_PATH); - } - - /** - * Performs a {@code cd app && mvn compile} invocation. Verifies that inter-module dependencies are resolved. - * - * @throws Exception in case of failure - */ - @Test - public void testInSubModule() throws Exception { - // Compile the whole project first. - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("package"); - verifier.execute(); - - final File submoduleDirectory = new File(testDir, "app"); - verifier = newVerifier(submoduleDirectory.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.setLogFileName("log-insubmodule.txt"); - verifier.addCliArgument("compile"); - verifier.execute(); - } - - /** - * Performs a {@code mvn -f app/pom.xml compile} invocation. Verifies that inter-module dependencies are resolved. - * - * @throws Exception in case of failure - */ - @Test - public void testWithFile() throws Exception { - // Compile the whole project first. - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("package"); - verifier.execute(); - - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.setLogFileName("log-withfile.txt"); - verifier.addCliArgument("-f"); - verifier.addCliArgument("app/pom.xml"); - verifier.addCliArgument("compile"); - verifier.execute(); - } - - /** - * Performs a {@code mvn -f app/pom.xml -am compile} invocation. Verifies that dependent modules are also built. - * - * @throws Exception in case of failure - */ - @Test - public void testWithFileAndAlsoMake() throws Exception { - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("-am"); - verifier.addCliArgument("-f"); - verifier.addCliArgument("app/pom.xml"); - verifier.setLogFileName("log-withfilealsomake.txt"); - verifier.addCliArgument("compile"); - verifier.execute(); - verifier.verifyTextInLog("Building Maven Integration Test :: MNG-6118 :: Library 1.0"); - } - - /** - * Performs a {@code cd app && mvn compile -am} invocation. Verifies that dependent modules are also built. - * - * @throws Exception in case of failure - */ - @Test - public void testInSubModuleWithAlsoMake() throws Exception { - File submoduleDirectory = new File(testDir, "app"); - Verifier verifier = newVerifier(submoduleDirectory.getAbsolutePath()); - verifier.addCliArgument("-am"); - verifier.setLogFileName("log-insubmodulealsomake.txt"); - verifier.addCliArgument("compile"); - verifier.execute(); - verifier.verifyTextInLog("Building Maven Integration Test :: MNG-6118 :: Library 1.0"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6127PluginExecutionConfigurationInterferenceTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6127PluginExecutionConfigurationInterferenceTest.java deleted file mode 100644 index 0b804e357..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6127PluginExecutionConfigurationInterferenceTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.utils.io.FileUtils; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng6127PluginExecutionConfigurationInterferenceTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng6127PluginExecutionConfigurationInterferenceTest() { - super("[3.5.1,)"); - } - - @Test - public void testCustomMojoExecutionConfigurator() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources( - getClass(), "/mng-6127-plugin-execution-configuration-interference"); - File pluginDir = new File(testDir, "plugin"); - File projectDir = new File(testDir, "project"); - File modAprojectDir = new File(projectDir, "mod-a"); - File modBprojectDir = new File(projectDir, "mod-b"); - File modCprojectDir = new File(projectDir, "mod-c"); - - Verifier verifier; - - // install the test plugin - verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - File modAconfigurationFile = new File(modAprojectDir, "configuration.txt"); - File modBconfigurationFile = new File(modBprojectDir, "configuration.txt"); - File modCconfigurationFile = new File(modCprojectDir, "configuration.txt"); - modAconfigurationFile.delete(); - modBconfigurationFile.delete(); - modCconfigurationFile.delete(); - - // build the test project - verifier = newVerifier(projectDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("verify"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent(modAconfigurationFile.getCanonicalPath()); - String modAactual = FileUtils.fileRead(modAconfigurationFile); - assertEquals("name=mod-a, secondName=second from components.xml", modAactual); - - verifier.verifyFilePresent(modBconfigurationFile.getCanonicalPath()); - String modBactual = FileUtils.fileRead(modBconfigurationFile); - assertEquals("name=mod-b, secondName=second from components.xml", modBactual); - - verifier.verifyFilePresent(modCconfigurationFile.getCanonicalPath()); - String modCactual = FileUtils.fileRead(modCconfigurationFile); - assertEquals("secondName=second from components.xml", modCactual); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6173GetAllProjectsInReactorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6173GetAllProjectsInReactorTest.java deleted file mode 100644 index 474129f09..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6173GetAllProjectsInReactorTest.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * Test case for MNG-6173. - */ -public class MavenITmng6173GetAllProjectsInReactorTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng6173GetAllProjectsInReactorTest() { - super("[3.2.1,3.3.1),[3.5.0-alpha-2,)"); - } - - /** - * Verifies that {@code MavenSession#getAllProjects()} returns all projects in the reactor - * not only the ones being built. - * - * @throws Exception in case of failure - */ - @Test - public void testitShouldReturnAllProjectsInReactor() throws Exception { - - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6173-get-all-projects-in-reactor"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("module-1/target"); - verifier.deleteDirectory("module-2/target"); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("module-1"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties properties = verifier.loadProperties("module-1/target/session.properties"); - assertEquals("3", properties.getProperty("session.allProjects.size")); - assertEquals(Arrays.asList(new String[] {"base-project", "module-1", "module-2"}), getProjects(properties)); - } - - private List getProjects(Properties properties) { - List projects = new ArrayList<>(); - - for (Object o : properties.keySet()) { - String key = o.toString(); - if (key.startsWith("session.allProjects.") && !key.endsWith(".size")) { - projects.add(properties.getProperty(key)); - } - } - - Collections.sort(projects); - - return projects; - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6173GetProjectsAndDependencyGraphTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6173GetProjectsAndDependencyGraphTest.java deleted file mode 100644 index c338b6d00..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6173GetProjectsAndDependencyGraphTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * Test case for MNG-6173. - */ -public class MavenITmng6173GetProjectsAndDependencyGraphTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng6173GetProjectsAndDependencyGraphTest() { - super("[3.0-alpha-3,)"); - } - - /** - * Verifies that {@code MavenSession#getProjects()} returns the projects being built and that - * {@code MavenSession#getDependencyGraph()} returns the dependency graph. - * - * @throws Exception in case of failure - */ - @Test - public void testitShouldReturnProjectsAndProjectDependencyGraph() throws Exception { - - File testDir = - ResourceExtractor.simpleExtractResources(getClass(), "/mng-6173-get-projects-and-dependency-graph"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteDirectory("module-1/target"); - verifier.deleteDirectory("module-2/target"); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("module-1"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties properties = verifier.loadProperties("module-1/target/session.properties"); - assertEquals("1", properties.getProperty("session.projects.size")); - assertEquals("module-1", properties.getProperty("session.projects.0.artifactId")); - assertEquals("1", properties.getProperty("session.projectDependencyGraph.sortedProjects.size")); - assertEquals("module-1", properties.getProperty("session.projectDependencyGraph.sortedProjects.0.artifactId")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6189SiteReportPluginsWarningTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6189SiteReportPluginsWarningTest.java deleted file mode 100644 index a25cc6c85..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6189SiteReportPluginsWarningTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-6189: - * using maven-site-plugin reportPlugins parameter must issue a warning. - * - * @author Hervé Boutemy - */ -public class MavenITmng6189SiteReportPluginsWarningTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng6189SiteReportPluginsWarningTest() { - super("(3.5-alpha-1,4.0.0-alpha-2]"); - } - - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6189-site-reportPlugins-warning"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyTextInLog("[WARNING] Reporting configuration should be done in section"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6210CoreExtensionsCustomScopesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6210CoreExtensionsCustomScopesTest.java deleted file mode 100644 index 075ba649e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6210CoreExtensionsCustomScopesTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-6210: - * check that Maven loads core extensions and {@code @SessionScoped} and - * {@code @MojoExecutionScoped} components contributed by .mvn/extensions.xml are - * available to regular plugins. - */ -public class MavenITmng6210CoreExtensionsCustomScopesTest extends AbstractMavenIntegrationTestCase { - public MavenITmng6210CoreExtensionsCustomScopesTest() { - super("(3.5.0,)"); - } - - @Test - public void testCoreExtensionCustomScopes() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6210-core-extensions-scopes"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - - verifier = newVerifier(new File(testDir, "client").getAbsolutePath()); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.it-core-extensions-custom-scopes"); - verifier.addCliArgument("-s"); - verifier.addCliArgument(new File(testDir, "settings.xml").getAbsolutePath()); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6223FindBasedir.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6223FindBasedir.java deleted file mode 100644 index 2a43a3b4b..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6223FindBasedir.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-6223: - * check that extensions in .mvn/ are found when Maven is run with -f path/to/dir. - * @see MavenITmng5889FindBasedir - */ -public class MavenITmng6223FindBasedir extends AbstractMavenIntegrationTestCase { - public MavenITmng6223FindBasedir() { - super("[3.5.1,)"); - } - - /** - * check that path/to/.mvn/ is found when path to POM set by --file path/to/dir - * - * @throws Exception in case of failure - */ - @Test - public void testMvnFileLongOptionToDir() throws Exception { - runCoreExtensionWithOptionToDir("--file", null); - } - - /** - * check that path/to/.mvn/ is found when path to POM set by -f path/to/dir - * - * @throws Exception in case of failure - */ - @Test - public void testMvnFileShortOptionToDir() throws Exception { - runCoreExtensionWithOptionToDir("-f", null); - } - - /** - * check that path/to/.mvn/ is found when path to POM set by --file path/to/module - * - * @throws Exception in case of failure - */ - @Test - public void testMvnFileLongOptionModuleToDir() throws Exception { - runCoreExtensionWithOptionToDir("--file", "module"); - } - - /** - * check that path/to/.mvn/ is found when path to POM set by -f path/to/module - * - * @throws Exception in case of failure - */ - @Test - public void testMvnFileShortOptionModuleToDir() throws Exception { - runCoreExtensionWithOptionToDir("-f", "module"); - } - - private void runCoreExtensionWithOptionToDir(String option, String subdir) throws Exception { - runCoreExtensionWithOption(option, subdir, false); - } - - protected void runCoreExtensionWithOption(String option, String subdir, boolean pom) throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5889-find.mvn"); - - File basedir = - new File(testDir, "../mng-" + (pom ? "5889" : "6223") + "-find.mvn" + option + (pom ? "Pom" : "Dir")); - basedir.mkdir(); - - if (subdir != null) { - testDir = new File(testDir, subdir); - basedir = new File(basedir, subdir); - basedir.mkdirs(); - } - - Verifier verifier = newVerifier(basedir.getAbsolutePath()); - verifier.addCliArgument( - "-Dexpression.outputFile=" + new File(basedir, "expression.properties").getAbsolutePath()); - verifier.addCliArgument(option); // -f/--file client/pom.xml - verifier.addCliArgument((pom ? new File(testDir, "pom.xml") : testDir).getAbsolutePath()); - verifier.setForkJvm(true); // force forked JVM since we need the shell script to detect .mvn/ location - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("expression.properties"); - assertEquals("ok", props.getProperty("project.properties.jvm-config")); - assertEquals("ok", props.getProperty("project.properties.maven-config")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6240PluginExtensionAetherProvider.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6240PluginExtensionAetherProvider.java deleted file mode 100644 index 39dcffa9e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6240PluginExtensionAetherProvider.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-6240. - * - * @author gboue - */ -public class MavenITmng6240PluginExtensionAetherProvider extends AbstractMavenIntegrationTestCase { - public MavenITmng6240PluginExtensionAetherProvider() { - super("[3.5.1,)"); - } - - /** - *

- * Checks that there are no duplicate classes from maven-aether-provider on the classpath, when the build has a - * plugin extension that depends on the former maven-aether-provider, renamed to maven-resolver-provider. - *

- * One way to do this is to look at MetadataGeneratorFactory, which is a class of this module: there should only be - * two instances (one of SnapshotMetadataGeneratorFactory and VersionsMetadataGeneratorFactory). When there are - * more, the Deploy Plugin will perform the download / upload of artifact metadata multiple times. This can be - * verified easily from the logs. - * - * @throws Exception in case of failure - */ - @Test - public void testPluginExtensionDependingOnMavenAetherProvider() throws Exception { - File testDir = - ResourceExtractor.simpleExtractResources(getClass(), "/mng-6240-plugin-extension-aether-provider"); - File pluginDir = new File(testDir, "plugin-extension"); - File projectDir = new File(testDir, "project"); - - Verifier verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - verifier.setEnvironmentVariable("CI", "false"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(projectDir.getAbsolutePath(), "remote"); - verifier.setEnvironmentVariable("CI", "false"); - verifier.addCliArgument("deploy"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List lines = verifier.loadFile(verifier.getBasedir(), verifier.getLogFileName(), false); - int count = 0; - for (String line : lines) { - if (line.endsWith("/repo/org/apache/maven/its/mng6240/project/1.0-SNAPSHOT/maven-metadata.xml")) { - count++; - } - } - assertEquals(2, count); // 1 from download, 1 from upload - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6255FixConcatLines.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6255FixConcatLines.java deleted file mode 100644 index 02f3f882c..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6255FixConcatLines.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import com.google.common.base.Charsets; -import com.google.common.base.Joiner; -import com.google.common.io.Files; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-6255: - * Check that the .mvn/jvm.config file contents are concatenated properly, no matter - * what line endings are used. - */ -public class MavenITmng6255FixConcatLines extends AbstractMavenIntegrationTestCase { - public MavenITmng6255FixConcatLines() { - super("[3.5.3,)"); - } - - /** - * Check that CR line endings work. - *

- * Currently disabled. - * - * @throws Exception in case of failure - */ - public void disabledJvmConfigFileCR() throws Exception { - runWithLineEndings("\r"); - } - - /** - * Check that LF line endings work. - * - * @throws Exception in case of failure - */ - @Test - public void testJvmConfigFileLF() throws Exception { - runWithLineEndings("\n"); - } - - /** - * Check that CRLF line endings work. - * - * @throws Exception in case of failure - */ - @Test - public void testJvmConfigFileCRLF() throws Exception { - runWithLineEndings("\r\n"); - } - - protected void runWithLineEndings(String lineEndings) throws Exception { - File baseDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6255"); - File mvnDir = new File(baseDir, ".mvn"); - - File jvmConfig = new File(mvnDir, "jvm.config"); - createJvmConfigFile(jvmConfig, lineEndings, "-Djvm.config=ok", "-Xms256m", "-Xmx512m"); - - Verifier verifier = newVerifier(baseDir.getAbsolutePath()); - verifier.addCliArgument( - "-Dexpression.outputFile=" + new File(baseDir, "expression.properties").getAbsolutePath()); - verifier.setForkJvm(true); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("expression.properties"); - assertEquals("ok", props.getProperty("project.properties.jvm-config")); - } - - protected void createJvmConfigFile(File jvmConfig, String lineEndings, String... lines) throws Exception { - String content = Joiner.on(lineEndings).join(lines); - Files.write(content, jvmConfig, Charsets.UTF_8); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6256SpecialCharsAlternatePOMLocation.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6256SpecialCharsAlternatePOMLocation.java deleted file mode 100644 index 94f037578..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6256SpecialCharsAlternatePOMLocation.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-6256: check that directories - * passed via -f/--file containing special characters do not break the script. E.g - * -f "directoryWithClosing)Bracket/pom.xml". - */ -public class MavenITmng6256SpecialCharsAlternatePOMLocation extends AbstractMavenIntegrationTestCase { - public MavenITmng6256SpecialCharsAlternatePOMLocation() { - super("(3.6.0,)"); - } - - /** - * check script is working when path to POM is set to directory-with- -space - * - * @throws Exception in case of failure - */ - @Test - public void testDirectoryWithSpace() throws Exception { - runWithMvnFileLongOption("directory-with- -space"); - runWithMvnFileShortOption("directory-with- -space"); - } - - /** - * check script is working when path to POM is set to directory-with-)-closing-bracket - * - * @throws Exception in case of failure - */ - @Test - public void testDirectoryWithClosingBracket() throws Exception { - runWithMvnFileLongOption("directory-with-)-closing-bracket"); - runWithMvnFileShortOption("directory-with-)-closing-bracket"); - } - - private void runWithMvnFileLongOption(String subDir) throws Exception { - runCoreExtensionWithOption("--file", subDir); - } - - private void runWithMvnFileShortOption(String subDir) throws Exception { - runCoreExtensionWithOption("-f", subDir); - } - - private void runCoreExtensionWithOption(String option, String subDir) throws Exception { - File resourceDir = - ResourceExtractor.simpleExtractResources(getClass(), "/mng-6256-special-chars-alternate-pom-location"); - - File testDir = new File(resourceDir, "../mng-6256-" + subDir); - testDir.mkdir(); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument(option); // -f/--file - verifier.addCliArgument("\"" + new File(resourceDir, subDir).getAbsolutePath() + "\""); // "" - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6326CoreExtensionsNotFoundTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6326CoreExtensionsNotFoundTest.java deleted file mode 100644 index de0596c61..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6326CoreExtensionsNotFoundTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-6326: - * check that Maven fails if it cannot load core extensions contributed by .mvn/extensions.xml. - */ -public class MavenITmng6326CoreExtensionsNotFoundTest extends AbstractMavenIntegrationTestCase { - public MavenITmng6326CoreExtensionsNotFoundTest() { - super("[3.8.5,)"); - } - - @Test - public void testCoreExtensionsNotFound() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6326-core-extensions-not-found"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - fail("should have failed "); - } catch (VerificationException e) { - try { - verifier.verifyTextInLog("[ERROR] Error executing Maven."); - verifier.verifyTextInLog( - "Extension org.apache.maven.its.it-core-extensions:maven-it-unknown-extensions:0.1 or one of its dependencies could not be resolved"); - } catch (VerificationException e2) { - throw new VerificationException(e2.getMessage() + "\nLog:" + ItUtils.getLogContent(verifier)); - } - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6330RelativePath.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6330RelativePath.java deleted file mode 100644 index bbbe2a0cc..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6330RelativePath.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * MNG-6030 reintroduced ReactorModelCache, but this ignores invalid relativePaths of parents - * - * @author Robert Scholte - */ -public class MavenITmng6330RelativePath extends AbstractMavenIntegrationTestCase { - public MavenITmng6330RelativePath() { - super("(,3.5.0),(3.5.2,)"); - } - - @Test - public void testRelativePath() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6330-relative-path"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setForkJvm(true); - - try { - verifier.addCliArgument("validate"); - verifier.execute(); - fail("Should fail due to non-resolvable parent"); - } catch (VerificationException e) { - assertTrue(e.getMessage().contains("Non-resolvable parent POM")); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6386BaseUriPropertyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6386BaseUriPropertyTest.java deleted file mode 100644 index 4c2eb1b01..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6386BaseUriPropertyTest.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.utils.Os; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-6386. - */ -public class MavenITmng6386BaseUriPropertyTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng6386BaseUriPropertyTest() { - super("[3.5.4,)"); - } - - @Test - public void testitMNG6386() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6386") - .getCanonicalFile(); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.setLogFileName("log-basic.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/profile.properties"); - String pomProperty = props.getProperty("project.properties.pomProperty"); - // set via project - assertEquals(testDir.toPath().toUri().toASCIIString(), pomProperty); - // check that baseUri begins with file:/// - assertTrue(pomProperty.startsWith("file:///")); - } - - @Test - public void testitMNG6386UnicodeChars() throws Exception { - String fileEncoding = System.getProperty("file.encoding"); - /* - * Unfortunately, AbstractMavenIntegrationTestCase still uses JUnit 3.8 which does not have - * Assume, so we cannot make assumptions and skip the test on non-compatible systems. - */ - if (Os.isFamily(Os.FAMILY_WINDOWS) - || "UTF-8".equalsIgnoreCase(fileEncoding) - || "UTF8".equalsIgnoreCase(fileEncoding)) { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6386-это по-русский") - .getCanonicalFile(); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.setLogFileName("log-basic.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/profile.properties"); - String pomProperty = props.getProperty("project.properties.pomProperty"); - // set via project - assertEquals(testDir.toPath().toUri().toASCIIString(), pomProperty); - // check that baseUri begins with file:/// - assertTrue(pomProperty.startsWith("file:///")); - // check that baseUri ends with "это по-русский/", but properly URI-encoded - // We need to make sure that either form NFC or NFD is accepted since HFS+ and APFS might use them - assertTrue(pomProperty.endsWith( - "%D1%8D%D1%82%D0%BE%20%D0%BF%D0%BE-%D1%80%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9/") - || pomProperty.endsWith( - "%D1%8D%D1%82%D0%BE%20%D0%BF%D0%BE-%D1%80%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B8%CC%86/")); - } else { - System.out.println(); - System.out.println( - "[WARNING] Skipping MNG-6386 Unicode Chars Test on incompatible encoding: " + fileEncoding); - System.out.println(); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6391PrintVersionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6391PrintVersionTest.java deleted file mode 100644 index cd56d7b7a..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6391PrintVersionTest.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.LinkedList; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * An integration test to check the enhancements to print out version - * information during the reactor summary output at the correct - * positions. - * - * MNG-6391. - * - * @author Karl Heinz Marbaise khmarbaise@apache.org - */ -public class MavenITmng6391PrintVersionTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng6391PrintVersionTest() { - super("[3.6.0,)"); - } - - /** - * Check that the resulting output is - * as expected for the root module and last - * module in build but not for the intermediate - * modules. - * - * @throws Exception in case of failure - */ - @Test - public void testitShouldPrintVersionAtTopAndAtBottom() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6391-print-version"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), false); - verifier.setAutoclean(false); - - verifier.setLogFileName("version-log.txt"); - verifier.addCliArgument("clean"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List loadedLines = verifier.loadLines("version-log.txt", "UTF-8"); - List resultingLines = extractReactorBuildOrder(loadedLines); - - // We're expecting exactly four lines as result. - assertEquals(5, resultingLines.size()); - - // We expect those lines in the following exact order. - // Maven 4.0.x has some code new code which takes care of the terminal width to adjust the output. - // The number of dots can thus vary when running the tests. - assertTrue(resultingLines.get(0).startsWith("[INFO] Reactor Summary for base-project 1.3.0-SNAPSHOT:")); - assertTrue(resultingLines.get(1).matches("\\Q[INFO] base-project ............\\E\\.+\\Q SUCCESS [\\E.*")); - assertTrue(resultingLines.get(2).matches("\\Q[INFO] module-1 ................\\E\\.+\\Q SUCCESS [\\E.*")); - assertTrue(resultingLines.get(3).matches("\\Q[INFO] module-2 ................\\E\\.+\\Q SUCCESS [\\E.*")); - assertTrue(resultingLines.get(4).matches("\\Q[INFO] module-3 ................\\E\\.+\\Q SUCCESS [\\E.*")); - - // We expect that line 1..4 have the same length - int line1Length = resultingLines.get(1).length(); - assertEquals(line1Length, resultingLines.get(2).length()); - assertEquals(line1Length, resultingLines.get(3).length()); - assertEquals(line1Length, resultingLines.get(4).length()); - } - - /** - * Check that the resulting output is - * as expected for all modules in case - * for an aggregator build. - * - * @throws Exception in case of failure - */ - @Test - public void testitShouldPrintVersionInAllLines() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6391-print-version-aggregator"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), false); - verifier.setAutoclean(false); - - verifier.setLogFileName("version-log.txt"); - verifier.addCliArguments("clean"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List loadedLines = verifier.loadLines("version-log.txt", "UTF-8"); - List resultingLines = extractReactorBuildOrder(loadedLines); - - // We're expecting exactly four lines as result. - assertEquals(5, resultingLines.size()); - - // We expect those lines in the following exact order. - // Maven 4.0.x has some code new code which takes care of the terminal width to adjust the output. - // The number of dots can thus vary when running the tests. - assertTrue(resultingLines.get(0).startsWith("[INFO] Reactor Summary:")); - assertTrue(resultingLines - .get(1) - .matches("\\Q[INFO] module-1 1.2.7.43.RELEASE ...............\\E\\.+\\Q SUCCESS [ \\E.*")); - assertTrue(resultingLines - .get(2) - .matches("\\Q[INFO] module-2 7.5-SNAPSHOT ...................\\E\\.+\\Q SUCCESS [ \\E.*")); - assertTrue(resultingLines - .get(3) - .matches("\\Q[INFO] module-3 1-RC1 ..........................\\E\\.+\\Q SUCCESS [ \\E.*")); - assertTrue(resultingLines - .get(4) - .matches("\\Q[INFO] base-project 1.0.0-SNAPSHOT .............\\E\\.+\\Q SUCCESS [ \\E.*")); - - // We expect that line 1..4 have the same length - int line1Length = resultingLines.get(1).length(); - assertEquals(line1Length, resultingLines.get(2).length()); - assertEquals(line1Length, resultingLines.get(3).length()); - assertEquals(line1Length, resultingLines.get(4).length()); - } - - /** - * Extract the lines at the end of the Maven output: - * - *

-     * [INFO] Reactor Summary..: XXX
-     * [INFO]
-     * [INFO] ...SUCCESS [  0.035 s]
-     * [INFO] ...SUCCESS [  0.035 s]
-     * [INFO] ...SUCCESS [  0.035 s]
-     * 
- */ - private List extractReactorBuildOrder(List loadedLines) { - List resultingLines = new LinkedList<>(); - boolean start = false; - for (String line : loadedLines) { - if (start) { - if (line.startsWith("[INFO] -------------")) { - start = false; - } else if (!line.endsWith("[INFO] ")) { - resultingLines.add(line); - } - } else { - if (line.startsWith("[INFO] Reactor Summary")) { - start = true; - resultingLines.add(line); - } - } - } - return resultingLines; - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6401ProxyPortInterpolationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6401ProxyPortInterpolationTest.java deleted file mode 100644 index 42c2cc639..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6401ProxyPortInterpolationTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.settings.Proxy; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -class MavenITmng6401ProxyPortInterpolationTest extends AbstractMavenIntegrationTestCase { - - private Proxy proxy; - - private int port; - - protected MavenITmng6401ProxyPortInterpolationTest() { - super("(4.0.0-alpha-7,)"); - } - - @Test - public void testitEnvVars() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6401-proxy-port-interpolation"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - verifier.setEnvironmentVariable("MAVEN_PROXY_ACTIVE_BOOLEAN", "true"); - verifier.setEnvironmentVariable("MAVEN_PROXY_HOST_STRING", "myproxy.host.net"); - verifier.setEnvironmentVariable("MAVEN_PROXY_PORT_INT", "18080"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props = verifier.loadProperties("target/settings.properties"); - assertEquals("true", props.getProperty("settings.proxies.0.active")); - assertEquals("myproxy.host.net", props.getProperty("settings.proxies.0.host")); - assertEquals("18080", props.getProperty("settings.proxies.0.port")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6506PackageAnnotationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6506PackageAnnotationTest.java deleted file mode 100644 index 0b8f883ec..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6506PackageAnnotationTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng6506PackageAnnotationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng6506PackageAnnotationTest() { - super("[3.6.1,)"); - } - - @Test - public void testGetPackageAnnotation() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6506-package-annotation"); - File pluginDir = new File(testDir, "plugin"); - File projectDir = new File(testDir, "project"); - - Verifier verifier; - - verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(projectDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("verify"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - verifier.verifyTextInLog("MNG-6506 check succeeded"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6511OptionalProjectSelectionTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6511OptionalProjectSelectionTest.java deleted file mode 100644 index e7b6b6ee7..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6511OptionalProjectSelectionTest.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.IOException; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a collection of test cases for MNG-6511, - * selecting and deselecting optional projects. - * - * @author Maarten Mulders - * @author Martin Kanters - */ -public class MavenITmng6511OptionalProjectSelectionTest extends AbstractMavenIntegrationTestCase { - private static final String RESOURCE_PATH = "/mng-6511-optional-project-selection"; - private final File testDir; - - public MavenITmng6511OptionalProjectSelectionTest() throws IOException { - super("[4.0.0-alpha-1,)"); - testDir = ResourceExtractor.simpleExtractResources(getClass(), RESOURCE_PATH); - } - - @Test - public void testSelectExistingOptionalProfile() throws VerificationException { - Verifier cleaner = newVerifier(testDir.getAbsolutePath()); - cleaner.addCliArgument("clean"); - cleaner.execute(); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setLogFileName("log-select-existing.txt"); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("?existing-module"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - verifier.verifyFilePresent("existing-module/target/touch.txt"); // existing-module should have been built. - } - - @Test - public void testSelectExistingOptionalProfileByArtifactId() throws VerificationException { - Verifier cleaner = newVerifier(testDir.getAbsolutePath()); - cleaner.addCliArgument("clean"); - cleaner.execute(); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setLogFileName("log-select-existing-artifact-id.txt"); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("?:existing-module"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - verifier.verifyFilePresent("existing-module/target/touch.txt"); // existing-module should have been built. - } - - @Test - public void testSelectNonExistingOptionalProfile() throws VerificationException { - Verifier cleaner = newVerifier(testDir.getAbsolutePath()); - cleaner.addCliArgument("clean"); - cleaner.execute(); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setLogFileName("log-select-non-existing.txt"); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("?non-existing-module"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - verifier.verifyFilePresent("existing-module/target/touch.txt"); // existing-module should have been built. - } - - @Test - public void testDeselectExistingOptionalProfile() throws VerificationException { - Verifier cleaner = newVerifier(testDir.getAbsolutePath()); - cleaner.addCliArgument("clean"); - cleaner.execute(); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setLogFileName("log-deselect-existing.txt"); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("!?existing-module"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - verifier.verifyFileNotPresent( - "existing-module/target/touch.txt"); // existing-module should not have been built. - } - - @Test - public void testDeselectNonExistingOptionalProfile() throws VerificationException { - Verifier cleaner = newVerifier(testDir.getAbsolutePath()); - cleaner.addCliArgument("clean"); - cleaner.execute(); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setLogFileName("log-deselect-non-existing.txt"); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("!?non-existing-module"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - verifier.verifyFilePresent("existing-module/target/touch.txt"); // existing-module should have been built. - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6558ToolchainsBuildingEventTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6558ToolchainsBuildingEventTest.java deleted file mode 100644 index 19dc466f3..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6558ToolchainsBuildingEventTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-6558. - */ -public class MavenITmng6558ToolchainsBuildingEventTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng6558ToolchainsBuildingEventTest() { - super("[3.6.1,)"); - } - - /** - * Verify that ToolchainsBuildingRequest and ToolchainsBuildingResult events are sent to event spy. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6558"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setForkJvm(true); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("-Dmaven.ext.class.path=spy-0.1.jar"); - verifier.addCliArgument("-X"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List lines = verifier.loadLines("target/spy.log", "UTF-8"); - assertTrue(lines.toString(), lines.get(0).startsWith("init")); - assertTrue(lines.toString(), lines.get(lines.size() - 1).startsWith("close")); - assertTrue( - lines.toString(), - lines.contains("event: org.apache.maven.toolchain.building.DefaultToolchainsBuildingRequest")); - assertTrue( - lines.toString(), - lines.contains("event: org.apache.maven.toolchain.building.DefaultToolchainsBuildingResult")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6562WarnDefaultBindings.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6562WarnDefaultBindings.java deleted file mode 100644 index 8ccea3326..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6562WarnDefaultBindings.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng6562WarnDefaultBindings extends AbstractMavenIntegrationTestCase { - - public MavenITmng6562WarnDefaultBindings() { - super("[4.0.0-alpha-1,)"); - } - - @Test - public void testItShouldNotWarn() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6562-default-bindings"); - - String phase = "validate"; - Verifier verifier = newVerifier(testDir.getAbsolutePath(), false); - verifier.setAutoclean(false); - verifier.setLogFileName(phase + ".txt"); - verifier.setForkJvm(true); // required due to --fail-on-severity - verifier.addCliArgument("-fos"); - verifier.addCliArgument("WARN"); // ALSO NO WARNINGS - verifier.addCliArgument(phase); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - } - - @Test - public void testItShouldNotWarn2() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6562-default-bindings"); - - String phase = "process-resources"; - Verifier verifier = newVerifier(testDir.getAbsolutePath(), false); - verifier.setAutoclean(false); - verifier.setLogFileName(phase + ".txt"); - verifier.setForkJvm(true); // required due to --fail-on-severity - verifier.addCliArgument("-fos"); - verifier.addCliArgument("WARN"); // ALSO NO WARNINGS - verifier.addCliArgument(phase); - verifier.execute(); - - verifier.verifyErrorFreeLog(); - } - - @Test - public void testItShouldWarnForCompilerPlugin() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6562-default-bindings"); - - String phase = "compile"; - Verifier verifier = newVerifier(testDir.getAbsolutePath(), false); - verifier.setAutoclean(false); - verifier.setLogFileName(phase + ".txt"); - verifier.addCliArgument(phase); - verifier.execute(); - - verifier.verifyTextInLog("Version not locked for default bindings plugins [maven-compiler-plugin]" - + ", you should define versions in pluginManagement section of your pom.xml or parent"); - } - - @Test - public void testItShouldWarnForCompilerPlugin2() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6562-default-bindings"); - - String phase = "process-test-resources"; - Verifier verifier = newVerifier(testDir.getAbsolutePath(), false); - verifier.setAutoclean(false); - verifier.setLogFileName(phase + ".txt"); - verifier.addCliArgument(phase); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyTextInLog("Version not locked for default bindings plugins [maven-compiler-plugin]" - + ", you should define versions in pluginManagement section of your pom.xml or parent"); - } - - @Test - public void testItShouldWarnForCompilerPlugin3() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6562-default-bindings"); - - String phase = "test-compile"; - Verifier verifier = newVerifier(testDir.getAbsolutePath(), false); - verifier.setAutoclean(false); - verifier.setLogFileName(phase + ".txt"); - verifier.addCliArgument(phase); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyTextInLog("Version not locked for default bindings plugins [maven-compiler-plugin]" - + ", you should define versions in pluginManagement section of your pom.xml or parent"); - } - - @Test - public void testItShouldWarnForCompilerPluginAndSurefirePlugin() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6562-default-bindings"); - - String phase = "test"; - Verifier verifier = newVerifier(testDir.getAbsolutePath(), false); - verifier.setAutoclean(false); - verifier.setLogFileName(phase + ".txt"); - verifier.addCliArgument(phase); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyTextInLog( - "Version not locked for default bindings plugins [maven-compiler-plugin, maven-surefire-plugin]" - + ", you should define versions in pluginManagement section of your pom.xml or parent"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6566ExecuteAnnotationShouldNotReExecuteGoalsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6566ExecuteAnnotationShouldNotReExecuteGoalsTest.java deleted file mode 100644 index 62b8fed14..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6566ExecuteAnnotationShouldNotReExecuteGoalsTest.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -public class MavenITmng6566ExecuteAnnotationShouldNotReExecuteGoalsTest extends AbstractMavenIntegrationTestCase { - private static final String RESOURCE_PATH = "/mng-6566-execute-annotation-should-not-re-execute-goals"; - private static final String PLUGIN_KEY = "org.apache.maven.its.mng6566:plugin:1.0-SNAPSHOT"; - - private File testDir; - - public MavenITmng6566ExecuteAnnotationShouldNotReExecuteGoalsTest() { - super("[4.0.0-alpha-1,)"); - } - - @BeforeEach - public void setUp() throws Exception { - testDir = ResourceExtractor.simpleExtractResources(getClass(), RESOURCE_PATH); - - File pluginDir = new File(testDir, "plugin"); - Verifier verifier = newVerifier(pluginDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } - - @Test - public void testRunsCompileGoalOnceWithDirectPluginInvocation() throws Exception { - File consumerDir = new File(testDir, "consumer"); - - Verifier verifier = newVerifier(consumerDir.getAbsolutePath()); - verifier.setLogFileName("log-direct-plugin-invocation.txt"); - verifier.addCliArgument(PLUGIN_KEY + ":require-compile-phase"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - assertCompiledOnce(verifier); - verifier.verifyTextInLog("MNG-6566 plugin require-compile-phase goal executed"); - } - - /** - * This test uses the
require-compile-phase
goal of the test plugin. - * - * @throws Exception in case of failure - */ - @Test - public void testRunsCompileGoalOnceWithPhaseExecution() throws Exception { - File consumerDir = new File(testDir, "consumer"); - - Verifier verifier = newVerifier(consumerDir.getAbsolutePath()); - verifier.setLogFileName("log-phase-execution.txt"); - verifier.addCliArgument("compile"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - assertCompiledOnce(verifier); - verifier.verifyTextInLog("MNG-6566 plugin require-compile-phase goal executed"); - } - - private void assertCompiledOnce(Verifier verifier) throws VerificationException { - List lines = verifier.loadFile(verifier.getBasedir(), verifier.getLogFileName(), false); - int counter = 0; - for (String line : lines) { - if (line.contains("compiler:0.1-stub-SNAPSHOT:compile")) { - counter++; - } - } - assertEquals("Compile goal was expected to run once", counter, 1); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6609ProfileActivationForPackagingTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6609ProfileActivationForPackagingTest.java deleted file mode 100644 index 111f4a011..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6609ProfileActivationForPackagingTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.Properties; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-6609. - * Similar to {@link MavenITmng2276ProfileActivationBySettingsPropertyTest}. - */ -class MavenITmng6609ProfileActivationForPackagingTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng6609ProfileActivationForPackagingTest() { - super("[3.9.0,4.0.0-alpha-1),[4.0.0-alpha-3,)"); - } - - /** - * Verify that builds uses packaging based activation. - * Each profile writes a Maven property named "packaging" with a different value (containing the actual packaging) - * - * @throws Exception in case of failure - */ - @Test - void testitMojoExecution() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6609"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - Properties props = verifier.loadProperties("target/profile.properties"); - assertEquals("pom", props.getProperty("project.properties.packaging")); - props = verifier.loadProperties("jar/target/profile.properties"); - assertEquals("jar", props.getProperty("project.properties.packaging")); - props = verifier.loadProperties("jar-no-packaging/target/profile.properties"); - assertEquals("jar", props.getProperty("project.properties.packaging")); - props = verifier.loadProperties("war/target/profile.properties"); - assertEquals("war", props.getProperty("project.properties.packaging")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6656BuildConsumer.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6656BuildConsumer.java deleted file mode 100644 index 2258fa737..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6656BuildConsumer.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.IOException; -import java.util.List; - -import org.apache.maven.shared.utils.io.FileUtils; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; -import org.opentest4j.AssertionFailedError; - -/** - * With the build-consumer the pom.xml will be adjusted during the process. - *
    - *
  • CLI-friendly versions will be resolved
  • - *
  • parents can omit the version if the relative path points to the correct parent
  • - *
  • dependencies can omit the version if it is part of the reactor
  • - *
- * - * During install the pom will be cleaned up - *
    - *
  • the modules will be removed
  • - *
  • the relativePath will be removed
  • - *
- * - * MNG-6656. - * - */ -public class MavenITmng6656BuildConsumer extends AbstractMavenIntegrationTestCase { - - public MavenITmng6656BuildConsumer() { - super("[4.0.0-alpha-1,)"); - } - - /** - * Verifies: - *
    - *
  • preserve license
  • - *
  • consistent line separators
  • - *
  • resolved project versions (at least 2 levels deep) in parent and dependencies
  • - *
  • removal of modules in aggregators
  • - *
- * - * @throws Exception in case of failure - */ - @Test - public void testPublishedPoms() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6656-buildconsumer"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), false); - verifier.setAutoclean(false); - verifier.addCliArgument("-Dchangelist=MNG6656"); - - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - assertTextEquals( - new File(testDir, "expected/parent.pom"), - new File(verifier.getArtifactPath( - "org.sonatype.mavenbook.multi", "parent", "0.9-MNG6656-SNAPSHOT", "pom"))); - - assertTextEquals( - new File(testDir, "expected/parent-build.pom"), - new File(verifier.getArtifactPath( - "org.sonatype.mavenbook.multi", "parent", "0.9-MNG6656-SNAPSHOT", "pom", "build"))); - - assertTextEquals( - new File(testDir, "expected/simple-parent.pom"), - new File(verifier.getArtifactPath( - "org.sonatype.mavenbook.multi", "simple-parent", "0.9-MNG6656-SNAPSHOT", "pom"))); - - assertTextEquals( - new File(testDir, "expected/simple-weather.pom"), - new File(verifier.getArtifactPath( - "org.sonatype.mavenbook.multi", "simple-weather", "0.9-MNG6656-SNAPSHOT", "pom"))); - - assertTextEquals( - new File(testDir, "expected/simple-weather-build.pom"), - new File(verifier.getArtifactPath( - "org.sonatype.mavenbook.multi", "simple-weather", "0.9-MNG6656-SNAPSHOT", "pom", "build"))); - - assertTextEquals( - new File(testDir, "expected/simple-webapp.pom"), - new File(verifier.getArtifactPath( - "org.sonatype.mavenbook.multi", "simple-webapp", "0.9-MNG6656-SNAPSHOT", "pom"))); - - assertTextEquals( - new File(testDir, "expected/simple-webapp-build.pom"), - new File(verifier.getArtifactPath( - "org.sonatype.mavenbook.multi", "simple-webapp", "0.9-MNG6656-SNAPSHOT", "pom", "build"))); - } - - static void assertTextEquals(File file1, File file2) throws IOException { - List s1 = FileUtils.loadFile(file1); - List s2 = FileUtils.loadFile(file2); - try { - assertEquals("Not same size", s1.size(), s2.size()); - for (int i = 0; i < s1.size(); i++) { - assertEquals("Mismatch line " + i, s1.get(i), s2.get(i)); - } - } catch (AssertionFailedError error) { - assertEquals(error.getMessage(), s1, s2); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6720FailFastTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6720FailFastTest.java deleted file mode 100644 index 78776e7e9..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6720FailFastTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * An integration test to check that concurrently running projects are finished - * in --fail-fast mode, while downstream projects are skipped. - * - * MNG-6720. - * - */ -class MavenITmng6720FailFastTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng6720FailFastTest() { - super("[3.6.2,)"); - } - - @Test - void testItShouldWaitForConcurrentModulesToFinish() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6720-fail-fast"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), false); - verifier.setAutoclean(false); - verifier.addCliArguments("-T", "2"); - verifier.addCliArgument("-Dmaven.test.redirectTestOutputToFile=true"); - verifier.addCliArguments("clean", "test"); - - try { - verifier.execute(); - } catch (VerificationException e) { - // expected - } - - List module1Lines = verifier.loadFile( - new File(testDir, "module-1/target/surefire-reports/mng6720.Module1Test-output.txt"), false); - assertTrue("module-1 should be executed", module1Lines.contains("Module1")); - List module2Lines = verifier.loadFile( - new File(testDir, "module-2/target/surefire-reports/mng6720.Module2Test-output.txt"), false); - assertTrue("module-2 should be executed", module2Lines.contains("Module2")); - List module3Lines = verifier.loadFile( - new File(testDir, "module-3/target/surefire-reports/mng6720.Module3Test-output.txt"), false); - assertTrue("module-3 should be skipped", module3Lines.isEmpty()); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6754TimestampInMultimoduleProject.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6754TimestampInMultimoduleProject.java deleted file mode 100644 index 4d0f4e804..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6754TimestampInMultimoduleProject.java +++ /dev/null @@ -1,391 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.Properties; - -import org.apache.maven.artifact.repository.metadata.Metadata; -import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.codehaus.plexus.util.xml.pull.XmlPullParserException; -import org.junit.jupiter.api.Test; - -public class MavenITmng6754TimestampInMultimoduleProject extends AbstractMavenIntegrationTestCase { - private static final String RESOURCE_PATH = "/mng-6754-version-timestamp-in-multimodule-build"; - private static final String VERSION = "1.0-SNAPSHOT"; - - public MavenITmng6754TimestampInMultimoduleProject() { - super("[3.8.2,)"); - } - - @Test - public void testArtifactsHaveSameTimestamp() throws Exception { - final File testDir = ResourceExtractor.simpleExtractResources(getClass(), RESOURCE_PATH); - final Verifier verifier = newVerifier(testDir.getAbsolutePath()); - final Path localRepoDir = Paths.get(verifier.getLocalRepository()); - final Path remoteRepoDir = Paths.get(verifier.getBasedir(), "repo"); - - verifier.deleteDirectory("repo"); - verifier.deleteArtifacts("org.apache.maven.its.mng6754"); - verifier.addCliArgument("-Drepodir=" + remoteRepoDir); - verifier.addCliArgument("deploy"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - final Properties props = verifier.loadProperties("target/timestamp.properties"); - // Reference timestamp - final String mavenBuildTimestamp = props.getProperty("project.properties.timestamp"); - - final Metadata parentMetadataLocal = getMetadata(getLocalMetadataPath(localRepoDir, "parent", null)); - final Metadata aMetadataLocal = getMetadata(getLocalMetadataPath(localRepoDir, "child-a", null)); - final Metadata bMetadataLocal = getMetadata(getLocalMetadataPath(localRepoDir, "child-b", null)); - - final String parentLastUpdatedLocal = - parentMetadataLocal.getVersioning().getLastUpdated(); - final String aLastUpdatedLocal = aMetadataLocal.getVersioning().getLastUpdated(); - final String bLastUpdatedLocal = bMetadataLocal.getVersioning().getLastUpdated(); - - assertEquals("parent", "local", "lastUpdated", mavenBuildTimestamp, parentLastUpdatedLocal); - assertEquals("child-a", "local", "lastUpdated", mavenBuildTimestamp, aLastUpdatedLocal); - assertEquals("child-b", "local", "lastUpdated", mavenBuildTimestamp, bLastUpdatedLocal); - - final Metadata parentVersionedMetadataLocal = - getMetadata(getLocalMetadataPath(localRepoDir, "parent", VERSION)); - final Metadata aVersionedMetadataLocal = getMetadata(getLocalMetadataPath(localRepoDir, "child-a", VERSION)); - final Metadata bVersionedMetadataLocal = getMetadata(getLocalMetadataPath(localRepoDir, "child-b", VERSION)); - - final String parentVersionedLastUpdatedLocal = - parentVersionedMetadataLocal.getVersioning().getLastUpdated(); - final String parentVersionedSnapshotVersionUpdatedLocal = parentVersionedMetadataLocal - .getVersioning() - .getSnapshotVersions() - .get(0) - .getUpdated(); - final String aLastVersionedUpdatedLocal = - aVersionedMetadataLocal.getVersioning().getLastUpdated(); - final String aVersionedSnapshotVersionUpdated1Local = aVersionedMetadataLocal - .getVersioning() - .getSnapshotVersions() - .get(0) - .getUpdated(); - final String aVersionedSnapshotVersionUpdated2Local = aVersionedMetadataLocal - .getVersioning() - .getSnapshotVersions() - .get(1) - .getUpdated(); - final String bLastVersionedUpdatedLocal = - bVersionedMetadataLocal.getVersioning().getLastUpdated(); - final String bVersionedSnapshotVersionUpdated1Local = bVersionedMetadataLocal - .getVersioning() - .getSnapshotVersions() - .get(0) - .getUpdated(); - final String bVersionedSnapshotVersionUpdated2Local = bVersionedMetadataLocal - .getVersioning() - .getSnapshotVersions() - .get(1) - .getUpdated(); - - assertEquals("parent", "local", "lastUpdated", mavenBuildTimestamp, parentVersionedLastUpdatedLocal); - assertEquals( - "parent", - "local", - "snapshotVersion[0]/updated", - mavenBuildTimestamp, - parentVersionedSnapshotVersionUpdatedLocal); - assertEquals("child-a", "local", "lastUpdated", mavenBuildTimestamp, aLastVersionedUpdatedLocal); - assertEquals( - "child-a", - "local", - "snapshotVersion[0]/updated", - mavenBuildTimestamp, - aVersionedSnapshotVersionUpdated1Local); - assertEquals( - "child-a", - "local", - "snapshotVersion[1]/updated", - mavenBuildTimestamp, - aVersionedSnapshotVersionUpdated2Local); - assertEquals("child-b", "local", "lastUpdated", mavenBuildTimestamp, bLastVersionedUpdatedLocal); - assertEquals( - "child-b", - "local", - "snapshotVersion[0]/updated", - mavenBuildTimestamp, - bVersionedSnapshotVersionUpdated1Local); - assertEquals( - "child-b", - "local", - "snapshotVersion[1]/updated", - mavenBuildTimestamp, - bVersionedSnapshotVersionUpdated2Local); - - final Metadata parentMetadataRemote = getMetadata(getRemoteMetadataPath(remoteRepoDir, "parent", null)); - final Metadata aMetadataRemote = getMetadata(getRemoteMetadataPath(remoteRepoDir, "child-a", null)); - final Metadata bMetadataRemote = getMetadata(getRemoteMetadataPath(remoteRepoDir, "child-b", null)); - - final String parentLastUpdatedRemote = - parentMetadataRemote.getVersioning().getLastUpdated(); - final String aLastUpdatedRemote = aMetadataRemote.getVersioning().getLastUpdated(); - final String bLastUpdatedRemote = bMetadataRemote.getVersioning().getLastUpdated(); - - assertEquals("parent", "remote", "lastUpdated", mavenBuildTimestamp, parentLastUpdatedRemote); - assertEquals("child-a", "remote", "lastUpdated", mavenBuildTimestamp, aLastUpdatedRemote); - assertEquals("child-b", "remote", "lastUpdated", mavenBuildTimestamp, bLastUpdatedRemote); - - final Metadata parentVersionedMetadataRemote = - getMetadata(getRemoteMetadataPath(remoteRepoDir, "parent", VERSION)); - final Metadata aVersionedMetadataRemote = getMetadata(getRemoteMetadataPath(remoteRepoDir, "child-a", VERSION)); - final Metadata bVersionedMetadataRemote = getMetadata(getRemoteMetadataPath(remoteRepoDir, "child-b", VERSION)); - - final String parentVersionedLastUpdatedRemote = - parentVersionedMetadataRemote.getVersioning().getLastUpdated(); - final String parentVersionedSnapshotTimestamp = parentVersionedMetadataRemote - .getVersioning() - .getSnapshot() - .getTimestamp() - .replace(".", ""); - final String parentVersionedSnapshotVersionUpdatedRemote = parentVersionedMetadataRemote - .getVersioning() - .getSnapshotVersions() - .get(0) - .getUpdated(); - final String parentVersionedSnapshotVersionValueRemote = parentVersionedMetadataRemote - .getVersioning() - .getSnapshotVersions() - .get(0) - .getVersion(); - final String aLastVersionedUpdatedRemote = - aVersionedMetadataRemote.getVersioning().getLastUpdated(); - final String aVersionedSnapshotTimestamp = aVersionedMetadataRemote - .getVersioning() - .getSnapshot() - .getTimestamp() - .replace(".", ""); - final String aVersionedSnapshotVersionUpdated1Remote = aVersionedMetadataRemote - .getVersioning() - .getSnapshotVersions() - .get(0) - .getUpdated(); - final String aVersionedSnapshotVersionValue1Remote = aVersionedMetadataRemote - .getVersioning() - .getSnapshotVersions() - .get(0) - .getVersion(); - final String aVersionedSnapshotVersionUpdated2Remote = aVersionedMetadataRemote - .getVersioning() - .getSnapshotVersions() - .get(1) - .getUpdated(); - final String aVersionedSnapshotVersionValue2Remote = aVersionedMetadataRemote - .getVersioning() - .getSnapshotVersions() - .get(1) - .getVersion(); - final String bLastVersionedUpdatedRemote = - bVersionedMetadataRemote.getVersioning().getLastUpdated(); - final String bVersionedSnapshotTimestamp = bVersionedMetadataRemote - .getVersioning() - .getSnapshot() - .getTimestamp() - .replace(".", ""); - final String bVersionedSnapshotVersionUpdated1Remote = bVersionedMetadataRemote - .getVersioning() - .getSnapshotVersions() - .get(0) - .getUpdated(); - final String bVersionedSnapshotVersionValue1Remote = bVersionedMetadataRemote - .getVersioning() - .getSnapshotVersions() - .get(0) - .getVersion(); - final String bVersionedSnapshotVersionUpdated2Remote = bVersionedMetadataRemote - .getVersioning() - .getSnapshotVersions() - .get(1) - .getUpdated(); - final String bVersionedSnapshotVersionValue2Remote = bVersionedMetadataRemote - .getVersioning() - .getSnapshotVersions() - .get(1) - .getVersion(); - - assertEquals("parent", "remote", "lastUpdated", mavenBuildTimestamp, parentVersionedLastUpdatedRemote); - assertEquals("parent", "remote", "snapshot/timestamp", mavenBuildTimestamp, parentVersionedSnapshotTimestamp); - assertEquals( - "parent", - "remote", - "snapshotVersion[0]/updated", - mavenBuildTimestamp, - parentVersionedSnapshotVersionUpdatedRemote); - assertEquals( - "parent", - "remote", - "snapshotVersion[0]/value", - mavenBuildTimestamp, - parentVersionedSnapshotVersionValueRemote.substring(4, 19).replace(".", "")); - assertEquals("child-a", "remote", "lastUpdated", mavenBuildTimestamp, aLastVersionedUpdatedRemote); - assertEquals("child-a", "remote", "snapshot/timestamp", mavenBuildTimestamp, aVersionedSnapshotTimestamp); - assertEquals( - "child-a", - "remote", - "snapshotVersion[0]/updated", - mavenBuildTimestamp, - aVersionedSnapshotVersionUpdated1Remote); - assertEquals( - "child-a", - "remote", - "snapshotVersion[0]/value", - mavenBuildTimestamp, - aVersionedSnapshotVersionValue1Remote.substring(4, 19).replace(".", "")); - assertEquals( - "child-a", - "remote", - "snapshotVersion[1]/updated", - mavenBuildTimestamp, - aVersionedSnapshotVersionUpdated2Remote); - assertEquals( - "child-a", - "remote", - "snapshotVersion[1]/value", - mavenBuildTimestamp, - aVersionedSnapshotVersionValue2Remote.substring(4, 19).replace(".", "")); - assertEquals("child-b", "remote", "lastUpdated", mavenBuildTimestamp, bLastVersionedUpdatedRemote); - assertEquals("child-b", "remote", "snapshot/timestamp", mavenBuildTimestamp, bVersionedSnapshotTimestamp); - assertEquals( - "child-b", - "remote", - "snapshotVersion[0]/updated", - mavenBuildTimestamp, - bVersionedSnapshotVersionUpdated1Remote); - assertEquals( - "child-b", - "remote", - "snapshotVersion[0]/value", - mavenBuildTimestamp, - bVersionedSnapshotVersionValue1Remote.substring(4, 19).replace(".", "")); - assertEquals( - "child-b", - "remote", - "snapshotVersion[1]/updated", - mavenBuildTimestamp, - bVersionedSnapshotVersionUpdated2Remote); - assertEquals( - "child-b", - "remote", - "snapshotVersion[1]/value", - mavenBuildTimestamp, - bVersionedSnapshotVersionValue2Remote.substring(4, 19).replace(".", "")); - assertPathExists( - remoteRepoDir, - "parent", - "remote", - VERSION, - "parent-" + parentVersionedSnapshotVersionValueRemote + ".pom"); - assertPathExists( - remoteRepoDir, - "child-a", - "remote", - VERSION, - "child-a-" + aVersionedSnapshotVersionValue1Remote + ".pom"); - assertPathExists( - remoteRepoDir, - "child-a", - "remote", - VERSION, - "child-a-" + aVersionedSnapshotVersionValue2Remote + ".jar"); - assertPathExists( - remoteRepoDir, - "child-b", - "remote", - VERSION, - "child-b-" + bVersionedSnapshotVersionValue1Remote + ".pom"); - assertPathExists( - remoteRepoDir, - "child-b", - "remote", - VERSION, - "child-b-" + bVersionedSnapshotVersionValue2Remote + ".jar"); - } - - private Path getLocalMetadataPath(final Path repoDir, final String moduleName, String version) { - return getRepoFile(repoDir, moduleName, version, "maven-metadata-local.xml"); - } - - private Path getRemoteMetadataPath(final Path repoDir, final String moduleName, String version) { - return getRepoFile(repoDir, moduleName, version, "maven-metadata.xml"); - } - - private Path getRepoFile(final Path repoDir, final String moduleName, String version, String fileName) { - final Path mng6754Path = Paths.get("org", "apache", "maven", "its", "mng6754"); - Path modulePath = repoDir.resolve(mng6754Path.resolve(moduleName)); - if (version != null) { - modulePath = modulePath.resolve(version); - } - return modulePath.resolve(fileName); - } - - private Metadata getMetadata(final Path metadataFile) throws IOException, XmlPullParserException { - MetadataXpp3Reader r = new MetadataXpp3Reader(); - try (InputStream is = Files.newInputStream(metadataFile)) { - return r.read(is); - } - } - - private void assertEquals(String moduleName, String location, String field, String expected, String actual) { - String phase = null; - switch (location) { - case "local": - phase = "Installed"; - break; - case "remote": - phase = "Deployed"; - break; - } - assertEquals( - String.format( - "%s %s module should have equal %s %s with the Maven build timestamp", - phase, moduleName, location, field), - expected, - actual); - } - - private void assertPathExists(Path repoDir, String moduleName, String location, String version, String fileName) { - String phase = null; - switch (location) { - case "local": - phase = "Installed"; - break; - case "remote": - phase = "Deployed"; - break; - } - Path file = getRepoFile(repoDir, moduleName, version, fileName); - assertTrue( - String.format("%s %s module %s file %s should exist", phase, moduleName, location, file), - Files.exists(file)); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6759TransitiveDependencyRepositoriesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6759TransitiveDependencyRepositoriesTest.java deleted file mode 100644 index 0369f6494..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6759TransitiveDependencyRepositoriesTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.net.URI; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test for MNG-6759. - */ -public class MavenITmng6759TransitiveDependencyRepositoriesTest extends AbstractMavenIntegrationTestCase { - - private final String projectBaseDir = "/mng-6759-transitive-dependency-repositories"; - - public MavenITmng6759TransitiveDependencyRepositoriesTest() { - super("(,3.6.2),(3.6.2,)"); - } - - /** - * Verifies that a project with a dependency graph like {@code A -> B -> C}, - * where C is in a non-Central repository should use B's {@literal } to resolve C. - * - * @throws Exception in case of failure - */ - @Test - public void testTransitiveDependenciesAccountForRepositoriesListedByDependencyTrailPredecessor() throws Exception { - installDependencyCInCustomRepo(); - File testDir = ResourceExtractor.simpleExtractResources(getClass(), projectBaseDir); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - - verifier.addCliArgument("package"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } - - private void installDependencyCInCustomRepo() throws Exception { - File dependencyCProjectDir = - ResourceExtractor.simpleExtractResources(getClass(), projectBaseDir + "/dependency-in-custom-repo"); - URI customRepoUri = new File(new File(dependencyCProjectDir, "target"), "repo").toURI(); - Verifier verifier = newVerifier(dependencyCProjectDir.getAbsolutePath()); - - verifier.deleteDirectory("target"); - if (getMavenVersion().getMajorVersion() <= 3) { - verifier.addCliArgument("-DaltDeploymentRepository=customRepo::default::" + customRepoUri); - } else { - verifier.addCliArgument("-DaltDeploymentRepository=customRepo::" + customRepoUri); - } - verifier.addCliArgument("deploy"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6772NestedImportScopeRepositoryOverride.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6772NestedImportScopeRepositoryOverride.java deleted file mode 100644 index eb61c048b..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6772NestedImportScopeRepositoryOverride.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-6772: - * - * The test POM references an import scope POM, which also has a dependency on an import scope POM. - * - * Both import POMs can only be found in the repository defined in the test POM. - * It has a parent POM that defines the same repository with a different location. - * The test confirms that the dominant repository definition (child) wins while resolving the import POMs. - * - */ -@Disabled // This IT has been disabled until it is decided how the solution shall look like -public class MavenITmng6772NestedImportScopeRepositoryOverride extends AbstractMavenIntegrationTestCase { - - public MavenITmng6772NestedImportScopeRepositoryOverride() { - super("(,4.0.0-alpha-1),[4.0.0-alpha-1,)"); - } - - // This will test the behavior using ProjectModelResolver - @Test - public void testitInProject() throws Exception { - final File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6772-override-in-project"); - - final Verifier verifier = newVerifier(testDir.getAbsolutePath(), null); - overrideGlobalSettings(testDir, verifier); - verifier.deleteArtifacts("org.apache.maven.its.mng6772"); - - verifier.filterFile("pom-template.xml", "pom.xml", "UTF-8"); - - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } - - // This will test the behavior using DefaultModelResolver - @Test - public void testitInDependency() throws Exception { - final File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6772-override-in-dependency"); - - final Verifier verifier = newVerifier(testDir.getAbsolutePath(), null); - overrideGlobalSettings(testDir, verifier); - verifier.deleteArtifacts("org.apache.maven.its.mng6772"); - - verifier.filterFile("pom-template.xml", "pom.xml", "UTF-8"); - - verifier.addCliArgument("compile"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } - - // central must not be defined in any settings.xml or super POM will never be in play. - private void overrideGlobalSettings(final File testDir, final Verifier verifier) { - final File settingsFile = new File(testDir, "settings-override.xml"); - final String path = settingsFile.getAbsolutePath(); - verifier.addCliArgument("--global-settings"); - if (path.indexOf(' ') < 0) { - verifier.addCliArgument(path); - } else { - verifier.addCliArgument('"' + path + '"'); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6957BuildConsumer.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6957BuildConsumer.java deleted file mode 100644 index 503b2fa36..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6957BuildConsumer.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.IOException; - -import org.apache.maven.shared.utils.io.FileUtils; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * With the build-consumer the POM will be adjusted during the process. - *
    - *
  • CI-friendly versions will be resolved
  • - *
  • parents can omit the version if the relative path points to the correct parent
  • - *
  • dependencies can omit the version if it is part of the reactor
  • - *
- * - * During install the POM will be cleaned up - *
    - *
  • the modules will be removed
  • - *
  • the relativePath will be removed
  • - *
- * - * MNG-6656. - * - */ -public class MavenITmng6957BuildConsumer extends AbstractMavenIntegrationTestCase { - - public MavenITmng6957BuildConsumer() { - super("[4.0.0-alpha-1,)"); - } - - /** - * Verifies: - *
    - *
  • preserve license
  • - *
  • consistent line separators
  • - *
  • resolved project versions (at least 2 levels deep) in parent and dependencies
  • - *
  • removal of modules in aggregators
  • - *
- * - * @throws Exception in case of failure - */ - @Test - public void testPublishedPoms() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-6957-buildconsumer"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath(), false); - verifier.setAutoclean(false); - verifier.addCliArgument("-Dchangelist=MNG6957"); - - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - assertTextEquals( - new File(testDir, "expected/parent.pom"), - new File(verifier.getArtifactPath( - "org.sonatype.mavenbook.multi", "parent", "0.9-MNG6957-SNAPSHOT", "pom"))); - - assertTextEquals( - new File(testDir, "expected/parent-build.pom"), - new File(verifier.getArtifactPath( - "org.sonatype.mavenbook.multi", "parent", "0.9-MNG6957-SNAPSHOT", "pom", "build"))); - - assertTextEquals( - new File(testDir, "expected/simple-parent.pom"), - new File(verifier.getArtifactPath( - "org.sonatype.mavenbook.multi", "simple-parent", "0.9-MNG6957-SNAPSHOT", "pom"))); - - assertTextEquals( - new File(testDir, "expected/simple-parent-build.pom"), - new File(verifier.getArtifactPath( - "org.sonatype.mavenbook.multi", "simple-parent", "0.9-MNG6957-SNAPSHOT", "pom", "build"))); - - assertTextEquals( - new File(testDir, "expected/simple-weather.pom"), - new File(verifier.getArtifactPath( - "org.sonatype.mavenbook.multi", "simple-weather", "0.9-MNG6957-SNAPSHOT", "pom"))); - - assertTextEquals( - new File(testDir, "expected/simple-weather-build.pom"), - new File(verifier.getArtifactPath( - "org.sonatype.mavenbook.multi", "simple-weather", "0.9-MNG6957-SNAPSHOT", "pom", "build"))); - - assertTextEquals( - new File(testDir, "expected/simple-webapp.pom"), - new File(verifier.getArtifactPath( - "org.sonatype.mavenbook.multi", "simple-webapp", "0.9-MNG6957-SNAPSHOT", "pom"))); - - assertTextEquals( - new File(testDir, "expected/simple-webapp-build.pom"), - new File(verifier.getArtifactPath( - "org.sonatype.mavenbook.multi", "simple-webapp", "0.9-MNG6957-SNAPSHOT", "pom", "build"))); - - assertTextEquals( - new File(testDir, "expected/simple-testutils.pom"), - new File(verifier.getArtifactPath( - "org.sonatype.mavenbook.multi", "simple-testutils", "0.9-MNG6957-SNAPSHOT", "pom"))); - - assertTextEquals( - new File(testDir, "expected/simple-testutils-build.pom"), - new File(verifier.getArtifactPath( - "org.sonatype.mavenbook.multi", "simple-testutils", "0.9-MNG6957-SNAPSHOT", "pom", "build"))); - - assertTextEquals( - new File(testDir, "expected/utils-parent.pom"), - new File(verifier.getArtifactPath( - "org.sonatype.mavenbook.multi", "utils-parent", "0.9-MNG6957-SNAPSHOT", "pom"))); - - assertTextEquals( - new File(testDir, "expected/utils-parent-build.pom"), - new File(verifier.getArtifactPath( - "org.sonatype.mavenbook.multi", "utils-parent", "0.9-MNG6957-SNAPSHOT", "pom", "build"))); - } - - static void assertTextEquals(File file1, File file2) throws IOException { - assertEquals(FileUtils.loadFile(file1), FileUtils.loadFile(file2)); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6972AllowAccessToGraphPackageTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6972AllowAccessToGraphPackageTest.java deleted file mode 100644 index e26d9da55..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6972AllowAccessToGraphPackageTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test for MNG-6972. - */ -public class MavenITmng6972AllowAccessToGraphPackageTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng6972AllowAccessToGraphPackageTest() { - super("[3.9.0,)"); - } - - @Test - public void testit() throws Exception { - - // The testdir is computed from the location of this file. - final File testDir = - ResourceExtractor.simpleExtractResources(getClass(), "/mng-6972-allow-access-to-graph-package"); - - Verifier verifier; - - /* - * We must first make sure that any artifact created - * by this test has been removed from the local - * repository. Failing to do this could cause - * unstable test results. Fortunately, the verifier - * makes it easy to do this. - */ - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.deleteArtifact("mng-6972-allow-access-to-graph-package", "build-plugin", "1.0", "jar"); - verifier.deleteArtifact("mng-6972-allow-access-to-graph-package", "using-module", "1.0", "jar"); - - verifier = newVerifier(new File(testDir.getAbsolutePath(), "build-plugin").getAbsolutePath()); - verifier.getSystemProperties().put("maven.multiModuleProjectDirectory", testDir.getAbsolutePath()); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(new File(testDir.getAbsolutePath(), "using-module").getAbsolutePath()); - verifier.getSystemProperties().put("maven.multiModuleProjectDirectory", testDir.getAbsolutePath()); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6981ProjectListShouldIncludeChildrenTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6981ProjectListShouldIncludeChildrenTest.java deleted file mode 100644 index 2fd8da0e5..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6981ProjectListShouldIncludeChildrenTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng6981ProjectListShouldIncludeChildrenTest extends AbstractMavenIntegrationTestCase { - - private static final String RESOURCE_PATH = "/mng-6981-pl-should-include-children"; - - public MavenITmng6981ProjectListShouldIncludeChildrenTest() { - super("[4.0.0-alpha-1,)"); - } - - @Test - public void testProjectListShouldIncludeChildrenByDefault() throws Exception { - final File testDir = ResourceExtractor.simpleExtractResources(getClass(), RESOURCE_PATH); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - - verifier.addCliArgument("-pl"); - verifier.addCliArgument(":module-a"); - verifier.addCliArgument("compile"); - verifier.execute(); - verifier.verifyTextInLog("Building module-a-1 1.0"); - } - - /** - * Since --pl's behavior is changed, make sure the alternative for building a pom without its children still works. - * - * @throws Exception in case of failure - */ - @Test - public void testFileSwitchAllowsExcludeOfChildren() throws Exception { - final File testDir = ResourceExtractor.simpleExtractResources(getClass(), RESOURCE_PATH); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - - verifier.addCliArgument("-f"); - verifier.addCliArgument("module-a"); - verifier.addCliArgument("--non-recursive"); - verifier.setLogFileName("log-non-recursive.txt"); - verifier.addCliArgument("compile"); - verifier.execute(); - verifyTextNotInLog(verifier, "Building module-a-1 1.0"); - } - - /** - * Throws an exception if the text is present in the log. - * - * @param verifier the verifier to use - * @param text the text to assert present - * @throws VerificationException if text is not found in log - */ - private void verifyTextNotInLog(Verifier verifier, String text) throws VerificationException { - List lines = verifier.loadFile(verifier.getBasedir(), verifier.getLogFileName(), false); - - for (String line : lines) { - if (Verifier.stripAnsi(line).contains(text)) { - throw new VerificationException("Text found in log: " + text); - } - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7038RootdirTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7038RootdirTest.java deleted file mode 100644 index 1808651d4..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7038RootdirTest.java +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.IOException; -import java.util.Properties; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng7038RootdirTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng7038RootdirTest() { - super("[4.0.0-alpha-6,)"); - } - - @Test - public void testRootdir() throws IOException, VerificationException { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7038-rootdir"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props; - - verifier.verifyFilePresent("target/pom.properties"); - props = verifier.loadProperties("target/pom.properties"); - assertEquals( - "project.properties.rootdir", - testDir.getAbsolutePath(), - props.getProperty("project.properties.rootdir")); - assertEquals("project.rootDirectory", testDir.getAbsolutePath(), props.getProperty("project.rootDirectory")); - assertEquals("session.topDirectory", testDir.getAbsolutePath(), props.getProperty("session.topDirectory")); - assertEquals("session.rootDirectory", testDir.getAbsolutePath(), props.getProperty("session.rootDirectory")); - assertEquals( - "project.properties.activated", - Boolean.TRUE.toString(), - props.getProperty("project.properties.activated")); - - verifier.verifyFilePresent("module-a/target/pom.properties"); - props = verifier.loadProperties("module-a/target/pom.properties"); - assertEquals( - "project.properties.rootdir", - new File(testDir, "module-a").getAbsolutePath(), - props.getProperty("project.properties.rootdir")); - assertEquals( - "project.rootDirectory", - new File(testDir, "module-a").getAbsolutePath(), - props.getProperty("project.rootDirectory")); - assertEquals("session.topDirectory", testDir.getAbsolutePath(), props.getProperty("session.topDirectory")); - assertEquals("session.rootDirectory", testDir.getAbsolutePath(), props.getProperty("session.rootDirectory")); - assertEquals( - "project.properties.activated", - Boolean.FALSE.toString(), - props.getProperty("project.properties.activated")); - - verifier.verifyFilePresent("module-a/module-a-1/target/pom.properties"); - props = verifier.loadProperties("module-a/module-a-1/target/pom.properties"); - assertEquals( - "project.properties.rootdir", - new File(testDir, "module-a").getAbsolutePath(), - props.getProperty("project.properties.rootdir")); - assertEquals( - "project.rootDirectory", - new File(testDir, "module-a").getAbsolutePath(), - props.getProperty("project.rootDirectory")); - assertEquals("session.topDirectory", testDir.getAbsolutePath(), props.getProperty("session.topDirectory")); - assertEquals("session.rootDirectory", testDir.getAbsolutePath(), props.getProperty("session.rootDirectory")); - assertEquals( - "project.properties.activated", - Boolean.FALSE.toString(), - props.getProperty("project.properties.activated")); - - verifier.verifyFilePresent("module-b/target/pom.properties"); - props = verifier.loadProperties("module-b/target/pom.properties"); - assertEquals( - "project.properties.rootdir", - testDir.getAbsolutePath(), - props.getProperty("project.properties.rootdir")); - assertEquals("project.rootDirectory", testDir.getAbsolutePath(), props.getProperty("project.rootDirectory")); - assertEquals("session.topDirectory", testDir.getAbsolutePath(), props.getProperty("session.topDirectory")); - assertEquals("session.rootDirectory", testDir.getAbsolutePath(), props.getProperty("session.rootDirectory")); - assertEquals( - "project.properties.activated", - Boolean.TRUE.toString(), - props.getProperty("project.properties.activated")); - - verifier.verifyFilePresent("module-b/module-b-1/target/pom.properties"); - props = verifier.loadProperties("module-b/module-b-1/target/pom.properties"); - assertEquals( - "project.properties.rootdir", - testDir.getAbsolutePath(), - props.getProperty("project.properties.rootdir")); - assertEquals("project.rootDirectory", testDir.getAbsolutePath(), props.getProperty("project.rootDirectory")); - assertEquals("session.topDirectory", testDir.getAbsolutePath(), props.getProperty("session.topDirectory")); - assertEquals("session.rootDirectory", testDir.getAbsolutePath(), props.getProperty("session.rootDirectory")); - assertEquals( - "project.properties.activated", - Boolean.TRUE.toString(), - props.getProperty("project.properties.activated")); - } - - @Test - public void testRootdirWithTopdirAndRoot() throws IOException, VerificationException { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7038-rootdir"); - Verifier verifier = newVerifier(new File(testDir, "module-a").getAbsolutePath()); - - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props; - - verifier.verifyFilePresent("target/pom.properties"); - props = verifier.loadProperties("target/pom.properties"); - assertEquals( - "project.properties.rootdir", - new File(testDir, "module-a").getAbsolutePath(), - props.getProperty("project.properties.rootdir")); - assertEquals( - "project.rootDirectory", - new File(testDir, "module-a").getAbsolutePath(), - props.getProperty("project.rootDirectory")); - assertEquals( - "session.topDirectory", - new File(testDir, "module-a").getAbsolutePath(), - props.getProperty("session.topDirectory")); - assertEquals( - "session.rootDirectory", - new File(testDir, "module-a").getAbsolutePath(), - props.getProperty("session.rootDirectory")); - assertEquals( - "project.properties.activated", - Boolean.FALSE.toString(), - props.getProperty("project.properties.activated")); - - verifier.verifyFilePresent("module-a-1/target/pom.properties"); - props = verifier.loadProperties("module-a-1/target/pom.properties"); - assertEquals( - "project.properties.rootdir", - new File(testDir, "module-a").getAbsolutePath(), - props.getProperty("project.properties.rootdir")); - assertEquals( - "project.rootDirectory", - new File(testDir, "module-a").getAbsolutePath(), - props.getProperty("project.rootDirectory")); - assertEquals( - "session.topDirectory", - new File(testDir, "module-a").getAbsolutePath(), - props.getProperty("session.topDirectory")); - assertEquals( - "session.rootDirectory", - new File(testDir, "module-a").getAbsolutePath(), - props.getProperty("session.rootDirectory")); - assertEquals( - "project.properties.activated", - Boolean.FALSE.toString(), - props.getProperty("project.properties.activated")); - } - - @Test - public void testRootdirWithTopdirAndNoRoot() throws IOException, VerificationException { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7038-rootdir"); - Verifier verifier = newVerifier(new File(testDir, "module-b").getAbsolutePath()); - - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - Properties props; - - verifier.verifyFilePresent("target/pom.properties"); - props = verifier.loadProperties("target/pom.properties"); - assertEquals( - "project.properties.rootdir", - testDir.getAbsolutePath(), - props.getProperty("project.properties.rootdir")); - assertEquals("project.rootDirectory", testDir.getAbsolutePath(), props.getProperty("project.rootDirectory")); - assertEquals( - "session.topDirectory", - new File(testDir, "module-b").getAbsolutePath(), - props.getProperty("session.topDirectory")); - assertEquals("session.rootDirectory", testDir.getAbsolutePath(), props.getProperty("session.rootDirectory")); - assertEquals( - "project.properties.activated", - Boolean.TRUE.toString(), - props.getProperty("project.properties.activated")); - - verifier.verifyFilePresent("module-b-1/target/pom.properties"); - props = verifier.loadProperties("module-b-1/target/pom.properties"); - assertEquals( - "project.properties.rootdir", - testDir.getAbsolutePath(), - props.getProperty("project.properties.rootdir")); - assertEquals("project.rootDirectory", testDir.getAbsolutePath(), props.getProperty("project.rootDirectory")); - assertEquals( - "session.topDirectory", - new File(testDir, "module-b").getAbsolutePath(), - props.getProperty("session.topDirectory")); - assertEquals("session.rootDirectory", testDir.getAbsolutePath(), props.getProperty("session.rootDirectory")); - assertEquals( - "project.properties.activated", - Boolean.TRUE.toString(), - props.getProperty("project.properties.activated")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7045DropUselessAndOutdatedCdiApiTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7045DropUselessAndOutdatedCdiApiTest.java deleted file mode 100644 index 6f64a2215..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7045DropUselessAndOutdatedCdiApiTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.IOException; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng7045DropUselessAndOutdatedCdiApiTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng7045DropUselessAndOutdatedCdiApiTest() { - super("[3.8.3,)"); - } - - @Test - public void testShouldNotLeakCdiApi() throws IOException, VerificationException { - // in test Groovy 4.x is used which requires JDK 1.8, so simply skip it for older JDKs - requiresJavaVersion("[1.8,)"); - - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7045"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - - verifier.addCliArgument("process-classes"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7051OptionalProfileActivationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7051OptionalProfileActivationTest.java deleted file mode 100644 index 7648d4e15..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7051OptionalProfileActivationTest.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng7051OptionalProfileActivationTest extends AbstractMavenIntegrationTestCase { - private static final String PROJECT_PATH = "/mng-7051-optional-profile-activation"; - - public MavenITmng7051OptionalProfileActivationTest() { - super("[4.0.0-alpha-1,)"); - } - - /** - * This test verifies that activating a non-existing profile breaks the build. - * - * @throws Exception in case of failure - */ - @Test - public void testActivatingNonExistingProfileBreaks() throws Exception { - final File projectDir = ResourceExtractor.simpleExtractResources(getClass(), PROJECT_PATH); - final Verifier verifier = newVerifier(projectDir.getAbsolutePath()); - - verifier.addCliArgument("-P"); - verifier.addCliArgument("non-existing-profile"); - verifier.setLogFileName("test-breaking.txt"); - - try { - verifier.addCliArgument("validate"); - verifier.execute(); - fail("Activated a non-existing profile without ? prefix should break the build, but it didn't."); - } catch (VerificationException ve) { - // Inspect the reason why the build broke. - verifier.verifyTextInLog( - "[ERROR] The requested profiles [non-existing-profile] could not be activated or deactivated because they do not exist."); - } - } - - /** - * This test verifies that activating a non-existing profile does not break the build when it is prefixed with ?. - * - * @throws Exception in case of failure - */ - @Test - public void testActivatingNonExistingProfileWithQuestionMarkDoesNotBreak() throws Exception { - final File projectDir = ResourceExtractor.simpleExtractResources(getClass(), PROJECT_PATH); - final Verifier verifier = newVerifier(projectDir.getAbsolutePath()); - - verifier.addCliArgument("-P"); - verifier.addCliArgument("?non-existing-profile"); - verifier.setLogFileName("test-non-breaking.txt"); - - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - verifier.verifyTextInLog( - "[INFO] The requested optional profiles [non-existing-profile] could not be activated or deactivated because they do not exist."); - } - - /** - * This test verifies that activating both an existing and a non-existing profile does not break the build when the latter is prefixed with ?. - * - * @throws Exception in case of failure - */ - @Test - public void testActivatingExistingAndNonExistingProfiles() throws Exception { - final File projectDir = ResourceExtractor.simpleExtractResources(getClass(), PROJECT_PATH); - final Verifier verifier = newVerifier(projectDir.getAbsolutePath()); - - verifier.addCliArgument("-P"); - verifier.addCliArgument("?non-existing-profile,existing"); - verifier.setLogFileName("test-non-breaking-mixed.txt"); - - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - verifier.verifyTextInLog( - "[INFO] The requested optional profiles [non-existing-profile] could not be activated or deactivated because they do not exist."); - } - - /** - * This test verifies that deactivating a non-existing profile does not break the build when it is prefixed with ?. - * - * @throws Exception in case of failure - */ - @Test - public void testDeactivatingNonExistingProfileWithQuestionMarkDoesNotBreak() throws Exception { - final File projectDir = ResourceExtractor.simpleExtractResources(getClass(), PROJECT_PATH); - final Verifier verifier = newVerifier(projectDir.getAbsolutePath()); - - verifier.addCliArgument("-P"); - verifier.addCliArgument("!?non-existing-profile"); - verifier.setLogFileName("test-deactivating-non-breaking.txt"); - - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - verifier.verifyTextInLog( - "[INFO] The requested optional profiles [non-existing-profile] could not be activated or deactivated because they do not exist."); - } - - /** - * This test verifies that deactivating both an existing and a non-existing profile does not break the build when the latter is prefixed with ?. - * - * @throws Exception in case of failure - */ - @Test - public void testDeactivatingExistingAndNonExistingProfiles() throws Exception { - final File projectDir = ResourceExtractor.simpleExtractResources(getClass(), PROJECT_PATH); - final Verifier verifier = newVerifier(projectDir.getAbsolutePath()); - - verifier.addCliArgument("-P"); - verifier.addCliArgument("!?non-existing-profile,!existing"); - verifier.setLogFileName("test-deactivating-non-breaking-mixed.txt"); - - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - verifier.verifyTextInLog( - "[INFO] The requested optional profiles [non-existing-profile] could not be activated or deactivated because they do not exist."); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7110ExtensionClassloader.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7110ExtensionClassloader.java deleted file mode 100644 index 974d33e94..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7110ExtensionClassloader.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.FileReader; -import java.io.IOException; -import java.io.Reader; -import java.util.Properties; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng7110ExtensionClassloader extends AbstractMavenIntegrationTestCase { - public MavenITmng7110ExtensionClassloader() { - super(ALL_MAVEN_VERSIONS); - } - - @Test - public void testVerifyResourceOfExtensionAndDependency() throws IOException, VerificationException { - final File projectDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7110-extensionclassloader"); - - final Verifier extensionVerifier = newVerifier(new File(projectDir, "extension").getAbsolutePath()); - extensionVerifier.addCliArgument("install"); - extensionVerifier.execute(); - extensionVerifier.verifyErrorFreeLog(); - - final Verifier libVerifier = newVerifier(new File(projectDir, "lib").getAbsolutePath()); - libVerifier.addCliArgument("install"); - libVerifier.execute(); - libVerifier.verifyErrorFreeLog(); - - final Verifier bomVerifier = newVerifier(new File(projectDir, "bom").getAbsolutePath()); - bomVerifier.addCliArgument("install"); - bomVerifier.execute(); - bomVerifier.verifyErrorFreeLog(); - - final Verifier projectVerifier = newVerifier(new File(projectDir, "module").getAbsolutePath()); - projectVerifier.addCliArgument("verify"); - projectVerifier.execute(); - projectVerifier.verifyErrorFreeLog(); - - Properties properties = new Properties(); - Reader fileReader = new FileReader(new File(projectDir, "module/out.txt")); - properties.load(fileReader); - - assertEquals("1", properties.getProperty("extension.txt.count", "-1")); - assertEquals("1", properties.getProperty("lib.txt.count", "-1")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7112ProjectsWithNonRecursiveTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7112ProjectsWithNonRecursiveTest.java deleted file mode 100644 index 077a77511..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7112ProjectsWithNonRecursiveTest.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.IOException; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng7112ProjectsWithNonRecursiveTest extends AbstractMavenIntegrationTestCase { - private static final String PROJECT_PATH = "/mng-7112-projects-with-non-recursive"; - - public MavenITmng7112ProjectsWithNonRecursiveTest() { - super("[4.0.0-alpha-1,)"); - } - - @Test - public void testAggregatesCanBeBuiltNonRecursively() throws IOException, VerificationException { - final File projectDir = ResourceExtractor.simpleExtractResources(getClass(), PROJECT_PATH); - Verifier cleaner = newVerifier(projectDir.getAbsolutePath()); - cleaner.addCliArgument("clean"); - cleaner.execute(); - - final Verifier verifier = newVerifier(projectDir.getAbsolutePath()); - - verifier.addCliArgument("-pl"); - verifier.addCliArgument(":aggregator-a,:aggregator-b"); - verifier.addCliArgument("-N"); - verifier.setLogFileName("selected-non-recursive.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - - verifier.verifyFileNotPresent("target/touch.txt"); - verifier.verifyFilePresent("aggregator-a/target/touch.txt"); - verifier.verifyFileNotPresent("aggregator-a/module-a/target/touch.txt"); - verifier.verifyFilePresent("aggregator-b/target/touch.txt"); - verifier.verifyFileNotPresent("aggregator-b/module-b/target/touch.txt"); - } - - @Test - public void testAggregatesCanBeDeselectedNonRecursively() throws IOException, VerificationException { - final File projectDir = ResourceExtractor.simpleExtractResources(getClass(), PROJECT_PATH); - Verifier cleaner = newVerifier(projectDir.getAbsolutePath()); - cleaner.addCliArgument("clean"); - cleaner.execute(); - - final Verifier verifier = newVerifier(projectDir.getAbsolutePath()); - - verifier.addCliArgument("-pl"); - verifier.addCliArgument("!:aggregator-a,!:aggregator-b"); - verifier.addCliArgument("-N"); - verifier.setLogFileName("excluded-non-recursive.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - - verifier.verifyFilePresent("target/touch.txt"); - verifier.verifyFileNotPresent("aggregator-a/target/touch.txt"); - verifier.verifyFilePresent("aggregator-a/module-a/target/touch.txt"); - verifier.verifyFileNotPresent("aggregator-b/target/touch.txt"); - verifier.verifyFilePresent("aggregator-b/module-b/target/touch.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7128BlockExternalHttpReactorTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7128BlockExternalHttpReactorTest.java deleted file mode 100644 index 449c30a68..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7128BlockExternalHttpReactorTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng7128BlockExternalHttpReactorTest extends AbstractMavenIntegrationTestCase { - private static final String PROJECT_PATH = "/mng-7128-block-external-http-reactor"; - - public MavenITmng7128BlockExternalHttpReactorTest() { - super("[3.8.1,)"); - } - - /** - * This test verifies that defining a repository in pom.xml that uses HTTP is blocked. - * - * @throws Exception in case of failure - */ - @Test - public void testBlockedHttpRepositoryInPom() throws Exception { - final File projectDir = ResourceExtractor.simpleExtractResources(getClass(), PROJECT_PATH); - final Verifier verifier = newVerifier(projectDir.getAbsolutePath()); - // ITs override global settings that provide blocked mirror: need to define the mirror in dedicated settings - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - - try { - verifier.addCliArgument("compiler:compile"); - verifier.execute(); - fail("HTTP repository defined in pom.xml should have failed the build but did not."); - } catch (VerificationException ve) { - // Inspect the reason why the build broke. - verifier.verifyTextInLog( - "[ERROR] Failed to execute goal on project http-repository-in-pom: "); // project failed - verifier.verifyTextInLog( - "Could not transfer artifact junit:junit:pom:1.3 from/to maven-default-http-blocker (http://0.0.0.0/): "); // mirror introduced in MNG-7118 - verifier.verifyTextInLog( - "Blocked mirror for repositories: [insecure-http-repo (http://repo.maven.apache.org/, default, releases+snapshots)]"); // blocked mirror text present - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7160ExtensionClassloader.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7160ExtensionClassloader.java deleted file mode 100644 index 5310228d1..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7160ExtensionClassloader.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.IOException; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng7160ExtensionClassloader extends AbstractMavenIntegrationTestCase { - public MavenITmng7160ExtensionClassloader() { - super("[3.9.0,)"); - } - - @Test - public void testVerify() throws IOException, VerificationException { - final File projectDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7160-extensionclassloader"); - - final Verifier extensionVerifier = newVerifier(new File(projectDir, "extension").getAbsolutePath()); - extensionVerifier.addCliArgument("install"); - extensionVerifier.execute(); - extensionVerifier.verifyErrorFreeLog(); - - final Verifier verifier1 = newVerifier(new File(projectDir, "project-build").getAbsolutePath()); - verifier1.addCliArgument("install"); - verifier1.execute(); - verifier1.verifyErrorFreeLog(); - verifier1.verifyTextInLog("xpp3 -> mvn"); - verifier1.verifyTextInLog("base64 -> ext"); - - final Verifier verifier2 = newVerifier(new File(projectDir, "project-core-parent-first").getAbsolutePath()); - verifier2.addCliArgument("install"); - verifier2.execute(); - verifier2.verifyErrorFreeLog(); - verifier2.verifyTextInLog("xpp3 -> mvn"); - verifier2.verifyTextInLog("base64 -> mvn"); - - final Verifier verifier3 = newVerifier(new File(projectDir, "project-core-plugin").getAbsolutePath()); - verifier3.addCliArgument("verify"); - verifier3.execute(); - verifier3.verifyErrorFreeLog(); - verifier3.verifyTextInLog("xpp3 -> mvn"); - verifier3.verifyTextInLog("base64 -> ext"); - - final Verifier verifier4 = newVerifier(new File(projectDir, "project-core-self-first").getAbsolutePath()); - verifier4.addCliArgument("verify"); - verifier4.execute(); - verifier4.verifyErrorFreeLog(); - verifier4.verifyTextInLog("xpp3 -> ext"); - verifier4.verifyTextInLog("base64 -> ext"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7228LeakyModelTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7228LeakyModelTest.java deleted file mode 100644 index 1868f57c1..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7228LeakyModelTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.commons.io.FileUtils; -import org.apache.maven.artifact.versioning.DefaultArtifactVersion; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.not; - -class MavenITmng7228LeakyModelTest extends AbstractMavenIntegrationTestCase { - - protected MavenITmng7228LeakyModelTest() { - // broken: 4.0.0-alpha-3 - 4.0.0-alpha-6 - super("[,4.0.0-alpha-3),(4.0.0-alpha-6,]"); - } - - @Test - void testLeakyModel() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7228-leaky-model"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setForkJvm(true); - - verifier.addCliArgument("-e"); - verifier.addCliArgument("-s"); - verifier.addCliArgument(new File(testDir, "settings.xml").getAbsolutePath()); - verifier.addCliArgument("-Pmanual-profile"); - - verifier.addCliArgument("install"); - - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - String classifier = null; - if (getMavenVersion().compareTo(new DefaultArtifactVersion("4.0.0-alpha-7")) > 0) { - classifier = "build"; - } - String pom = FileUtils.readFileToString(new File( - verifier.getArtifactPath("org.apache.maven.its.mng7228", "test", "1.0.0-SNAPSHOT", "pom", classifier))); - - assertThat(pom, containsString("projectProperty")); - assertThat(pom, not(containsString("activeProperty"))); - assertThat(pom, not(containsString("manualProperty"))); - - assertThat(pom, containsString("project-repo")); - assertThat(pom, not(containsString("active-repo"))); - assertThat(pom, not(containsString("manual-repo"))); - - assertThat(pom, containsString("project-plugin-repo")); - assertThat(pom, not(containsString("active-plugin-repo"))); - assertThat(pom, not(containsString("manual-plugin-repo"))); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7244IgnorePomPrefixInExpressions.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7244IgnorePomPrefixInExpressions.java deleted file mode 100644 index 9764edbd9..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7244IgnorePomPrefixInExpressions.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.IOException; -import java.util.List; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng7244IgnorePomPrefixInExpressions extends AbstractMavenIntegrationTestCase { - private static final String PROJECT_PATH = "/mng-7244-ignore-pom-prefix-in-expressions"; - - public MavenITmng7244IgnorePomPrefixInExpressions() { - super("[4.0.0-alpha-1,)"); - } - - @Test - public void testIgnorePomPrefixInExpressions() throws IOException, VerificationException { - final File projectDir = ResourceExtractor.simpleExtractResources(getClass(), PROJECT_PATH); - final Verifier verifier = newVerifier(projectDir.getAbsolutePath()); - - verifier.addCliArgument("validate"); - verifier.execute(); - - verifyLogDoesNotContainUnexpectedWarning(verifier); - } - - private void verifyLogDoesNotContainUnexpectedWarning(Verifier verifier) throws IOException { - List loadedLines = verifier.loadLines("log.txt", "UTF-8"); - for (String line : loadedLines) { - if (line.startsWith("[WARNING]") && line.contains("The expression ${pom.version} is deprecated.")) { - fail("Log contained unexpected deprecation warning"); - } - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7310LifecycleActivatedInSpecifiedModuleTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7310LifecycleActivatedInSpecifiedModuleTest.java deleted file mode 100644 index 1a689281e..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7310LifecycleActivatedInSpecifiedModuleTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; - -/** - * An integration test which proves that the bug of MNG-7310 is fixed. - * The bug is about loading an extension in a sibling submodule, which ends up failing the build. - * - * MNG-7310. - * - */ -public class MavenITmng7310LifecycleActivatedInSpecifiedModuleTest extends AbstractMavenIntegrationTestCase { - - public static final String BASE_TEST_DIR = "/mng-7310-lifecycle-activated-in-specified-module"; - - public MavenITmng7310LifecycleActivatedInSpecifiedModuleTest() { - super("[4.0.0-alpha-1,)"); - } - - public void testItShouldNotLoadAnExtensionInASiblingSubmodule() throws Exception { - File extensionTestDir = ResourceExtractor.simpleExtractResources(getClass(), BASE_TEST_DIR + "/extension"); - File projectTestDir = ResourceExtractor.simpleExtractResources(getClass(), BASE_TEST_DIR + "/project"); - - Verifier verifier = newVerifier(extensionTestDir.getAbsolutePath(), "remote"); - verifier.addCliArgument("install"); - verifier.execute(); - - Verifier verifier2 = newVerifier(projectTestDir.getAbsolutePath()); - verifier2.addCliArgument("compile"); - verifier2.execute(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7335MissingJarInParallelBuild.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7335MissingJarInParallelBuild.java deleted file mode 100644 index 3c275472d..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7335MissingJarInParallelBuild.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.IOException; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng7335MissingJarInParallelBuild extends AbstractMavenIntegrationTestCase { - private static final String PROJECT_PATH = "/mng-7335-missing-jar-in-parallel-build"; - - public MavenITmng7335MissingJarInParallelBuild() { - super("[3.8.1,)"); - } - - @Test - public void testMissingJarInParallelBuild() throws IOException, VerificationException { - final File projectDir = ResourceExtractor.simpleExtractResources(getClass(), PROJECT_PATH); - final Verifier verifier = newVerifier(projectDir.getAbsolutePath()); - verifier.addCliArgument("-T1C"); - verifier.addCliArguments("clean", "package"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7349RelocationWarningTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7349RelocationWarningTest.java deleted file mode 100644 index fb8bbc6eb..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7349RelocationWarningTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng7349RelocationWarningTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng7349RelocationWarningTest() { - super("[3.8.5,)"); - } - - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7349-relocation-warning"); - File artifactsDir = new File(testDir, "artifacts"); - File projectDir = new File(testDir, "project"); - - Verifier verifier; - - verifier = newVerifier(artifactsDir.getAbsolutePath()); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(projectDir.getAbsolutePath()); - verifier.addCliArgument("verify"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - List lines = verifier.loadLines(verifier.getLogFileName(), "UTF-8"); - List relocated = new ArrayList<>(); - for (String line : lines) { - if (line.contains("has been relocated")) { - relocated.add(line); - } - } - assertEquals("Expected 2 relocations, but found multiple", 2, relocated.size()); - assertTrue( - "Expected the relocation messages to be logged", - relocated.get(0).contains("Test relocation reason for old-plugin")); - assertTrue( - "Expected the relocation messages to be logged", - relocated.get(1).contains("Test relocation reason for old-dep")); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7353CliGoalInvocationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7353CliGoalInvocationTest.java deleted file mode 100644 index 8aec3e069..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7353CliGoalInvocationTest.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * Tests new mvn prefix:version:goal, - * MNG-7353. - */ -public class MavenITmng7353CliGoalInvocationTest extends AbstractMavenIntegrationTestCase { - public MavenITmng7353CliGoalInvocationTest() { - super("[3.9.0,)"); - } - - private void run(String id, String goal, String expectedInvocation) throws Exception { - File basedir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7353-cli-goal-invocation"); - Verifier verifier = newVerifier(basedir.getAbsolutePath()); - verifier.setLogFileName(id + ".txt"); - verifier.addCliArgument(goal); - verifier.execute(); - verifier.verifyTextInLog("[INFO] --- " + expectedInvocation); - } - - @Test - public void testPrefixGoal() throws Exception { - run("pluginPrefix-goal", "dependency:list", "dependency:3.3.0:list (default-cli)"); - } - - @Test - public void testPrefixGoalAtId() throws Exception { - run("pluginPrefix-goal@id", "dependency:list@id", "dependency:3.3.0:list (id)"); - } - - /** - * new pluginPrefix:version:goal in Maven 3.9.0 - */ - @Test - public void testPrefixVersionGoal() throws Exception { - run("pluginPrefix-version-goal", "dependency:3.1.1:list", "dependency:3.1.1:list (default-cli)"); - } - - /** - * new pluginPrefix:version:goal in Maven 3.9.0 - */ - @Test - public void testPrefixVersionGoalAtId() throws Exception { - run("pluginPrefix-goal@id", "dependency:3.1.1:list@id", "dependency:3.1.1:list (id)"); - } - - @Test - public void testGroupIdArtifactIdGoal() throws Exception { - run( - "groupId-artifactId-goal", - "org.apache.maven.plugins:maven-dependency-plugin:list", - "dependency:3.3.0:list (default-cli)"); - } - - @Test - public void testGroupIdArtifactIdGoalAtId() throws Exception { - run( - "groupId-artifactId-goal@id", - "org.apache.maven.plugins:maven-dependency-plugin:list@id", - "dependency:3.3.0:list (id)"); - } - - @Test - public void testGroupIdArtifactIdVersionGoal() throws Exception { - run( - "groupId-artifactId-version-goal", - "org.apache.maven.plugins:maven-dependency-plugin:3.1.1:list", - "dependency:3.1.1:list (default-cli)"); - } - - @Test - public void testGroupIdArtifactIdVersionGoalAtId() throws Exception { - run( - "groupId-artifactId-version-goal@id", - "org.apache.maven.plugins:maven-dependency-plugin:3.1.1:list@id", - "dependency:3.1.1:list (id)"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7360BuildConsumer.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7360BuildConsumer.java deleted file mode 100644 index 5b71e7d9f..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7360BuildConsumer.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This test suite tests whether the consumer pom feature can load a project with a {@code parent} tag - * inside the plugin configuration. - * Related JIRA issue: MNG-7360. - * - * @author Guillaume Nodet - */ -public class MavenITmng7360BuildConsumer extends AbstractMavenIntegrationTestCase { - - private static final String PROJECT_PATH = "/mng-7360-build-consumer"; - - public MavenITmng7360BuildConsumer() { - super("[4.0.0-alpha-1,)"); - } - - @Test - public void testSelectModuleByCoordinate() throws Exception { - final File projectDir = ResourceExtractor.simpleExtractResources(getClass(), PROJECT_PATH); - final Verifier verifier = newVerifier(projectDir.getAbsolutePath()); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7390SelectModuleOutsideCwdTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7390SelectModuleOutsideCwdTest.java deleted file mode 100644 index 66d5169ba..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7390SelectModuleOutsideCwdTest.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -/** - * This test suite tests whether other modules in the same multi-module project can be selected when invoking Maven from a submodule. - * Related JIRA issue: MNG-7390. - * - * @author Martin Kanters - */ -public class MavenITmng7390SelectModuleOutsideCwdTest extends AbstractMavenIntegrationTestCase { - - private File moduleADir; - - public MavenITmng7390SelectModuleOutsideCwdTest() { - super("[4.0.0-alpha-1,)"); - } - - @BeforeEach - protected void setUp() throws Exception { - moduleADir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7390-pl-outside-cwd/module-a"); - - // Clean up target files from earlier runs (verifier.setAutoClean does not work, as we are reducing the reactor) - final Verifier verifier = newVerifier(moduleADir.getAbsolutePath()); - verifier.addCliArgument("-f"); - verifier.addCliArgument(".."); - verifier.addCliArgument("clean"); - verifier.execute(); - } - - @Test - public void testSelectModuleByCoordinate() throws Exception { - final Verifier verifier = newVerifier(moduleADir.getAbsolutePath()); - - verifier.addCliArgument("-pl"); - verifier.addCliArgument(":module-b"); - verifier.setLogFileName("log-module-by-coordinate.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyFileNotPresent("target/touch.txt"); - verifier.verifyFileNotPresent("../target/touch.txt"); - verifier.verifyFilePresent("../module-b/target/touch.txt"); - } - - @Test - public void testSelectMultipleModulesByCoordinate() throws Exception { - final Verifier verifier = newVerifier(moduleADir.getAbsolutePath()); - - verifier.addCliArgument("-pl"); - verifier.addCliArgument(":module-b,:module-a"); - verifier.setLogFileName("log-modules-by-coordinate.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyFilePresent("target/touch.txt"); - verifier.verifyFileNotPresent("../target/touch.txt"); - verifier.verifyFilePresent("../module-b/target/touch.txt"); - } - - @Test - public void testSelectModuleByRelativePath() throws Exception { - final Verifier verifier = newVerifier(moduleADir.getAbsolutePath()); - - verifier.addCliArgument("-pl"); - verifier.addCliArgument("../module-b"); - verifier.setLogFileName("log-module-by-relative-path.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyFileNotPresent("target/touch.txt"); - verifier.verifyFileNotPresent("../target/touch.txt"); - verifier.verifyFilePresent("../module-b/target/touch.txt"); - } - - @Test - public void testSelectModulesByRelativePath() throws Exception { - final Verifier verifier = newVerifier(moduleADir.getAbsolutePath()); - - verifier.addCliArgument("-pl"); - verifier.addCliArgument("../module-b,."); - verifier.setLogFileName("log-modules-by-relative-path.txt"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyFilePresent("target/touch.txt"); - verifier.verifyFileNotPresent("../target/touch.txt"); - verifier.verifyFilePresent("../module-b/target/touch.txt"); - } - - /** - * Maven determines whether the target module is in a multi-module project based on the presence of a .mvn directory in root. - * This test verifies that when that directory is missing, the module cannot be found. - */ - @Test - public void testSelectModulesOutsideCwdDoesNotWorkWhenDotMvnIsNotPresent() throws Exception { - final String noDotMvnPath = "/mng-7390-pl-outside-cwd-no-dotmvn/module-a"; - final File noDotMvnDir = ResourceExtractor.simpleExtractResources(getClass(), noDotMvnPath); - final Verifier verifier = newVerifier(noDotMvnDir.getAbsolutePath()); - - verifier.addCliArgument("-pl"); - verifier.addCliArgument("../module-b"); - verifier.setLogFileName("log-modules-by-relative-path-no-dotmvn.txt"); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - fail("Expected goal to fail"); - } catch (VerificationException e) { - verifier.verifyFileNotPresent("target/touch.txt"); - verifier.verifyFileNotPresent("../target/touch.txt"); - verifier.verifyFileNotPresent("../module-b/target/touch.txt"); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7404IgnorePrefixlessExpressionsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7404IgnorePrefixlessExpressionsTest.java deleted file mode 100644 index 0ebd09398..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7404IgnorePrefixlessExpressionsTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.IOException; -import java.util.List; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng7404IgnorePrefixlessExpressionsTest extends AbstractMavenIntegrationTestCase { - private static final String PROJECT_PATH = "/mng-7404-ignore-prefixless-expressions"; - - public MavenITmng7404IgnorePrefixlessExpressionsTest() { - super("[4.0.0-alpha-1,)"); - } - - @Test - public void testIgnorePrefixlessExpressions() throws IOException, VerificationException { - final File projectDir = ResourceExtractor.simpleExtractResources(getClass(), PROJECT_PATH); - final Verifier verifier = newVerifier(projectDir.getAbsolutePath()); - - verifier.addCliArgument("validate"); - verifier.execute(); - - verifyLogDoesNotContainUnexpectedWarning(verifier); - } - - private void verifyLogDoesNotContainUnexpectedWarning(Verifier verifier) throws IOException { - List loadedLines = verifier.loadLines("log.txt", "UTF-8"); - for (String line : loadedLines) { - if (line.startsWith("[WARNING]") && line.contains("The expression ${version} is deprecated.")) { - fail("Log contained unexpected deprecation warning"); - } - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7443ConsistencyOfOptionalProjectsAndProfilesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7443ConsistencyOfOptionalProjectsAndProfilesTest.java deleted file mode 100644 index b762b7a82..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7443ConsistencyOfOptionalProjectsAndProfilesTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.IOException; -import java.util.List; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng7443ConsistencyOfOptionalProjectsAndProfilesTest extends AbstractMavenIntegrationTestCase { - public MavenITmng7443ConsistencyOfOptionalProjectsAndProfilesTest() { - super("[4.0.0-alpha-1,)"); - } - - @Test - public void testConsistentLoggingOfOptionalProfilesAndProjects() throws IOException, VerificationException { - File testDir = ResourceExtractor.simpleExtractResources( - getClass(), "/mng-7443-consistency-of-optional-profiles-and-projects"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("-pl"); - verifier.addCliArgument("?:does-not-exist"); - verifier.addCliArgument("-P"); - verifier.addCliArgument("?does-not-exist-either"); - - verifier.addCliArguments("clean", "verify"); - verifier.execute(); - - final List logLines = verifier.loadFile(verifier.getBasedir(), verifier.getLogFileName(), false); - - int projectSelectorMissingCounter = 0; - int profileSelectorMissingCounter = 0; - - for (String logLine : logLines) { - if (logLine.contains("The requested optional projects") - && logLine.contains(":does-not-exist") - && logLine.contains("do not exist")) { - projectSelectorMissingCounter++; - } - if (logLine.contains("The requested optional profiles") - && logLine.contains("does-not-exist-either") - && logLine.contains("do not exist")) { - profileSelectorMissingCounter++; - } - } - - assertEquals(2, profileSelectorMissingCounter); - assertEquals(2, projectSelectorMissingCounter); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7464ReadOnlyMojoParametersWarningTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7464ReadOnlyMojoParametersWarningTest.java deleted file mode 100644 index 94b0b4e8d..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7464ReadOnlyMojoParametersWarningTest.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Pattern; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * Test for - * MNG-7464 - * - * @author Slawomir Jaranowski - */ -public class MavenITmng7464ReadOnlyMojoParametersWarningTest extends AbstractMavenIntegrationTestCase { - public MavenITmng7464ReadOnlyMojoParametersWarningTest() { - super("[3.9.0,)"); - } - - /** - * Test that ensures that warning is not printed for empty and default value - */ - @Test - public void testEmptyConfiguration() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7464-mojo-read-only-params"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.setLogFileName("log-empty-configuration.txt"); - verifier.addCliArgument("-Dmaven.plugin.validation=verbose"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List logLines = verifier.loadFile(verifier.getBasedir(), verifier.getLogFileName(), false); - List warnLines = findReadOnlyWarning(logLines); - - assertTrue("Unwanted warnings: " + warnLines, warnLines.isEmpty()); - } - - /** - * Test that ensures that warning is printed for read-only parameter set by property - */ - @Test - public void testReadOnlyProperty() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7464-mojo-read-only-params"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("-Duser.property=value"); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.setLogFileName("log-read-only-property.txt"); - verifier.addCliArgument("-Dmaven.plugin.validation=verbose"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List logLines = verifier.loadFile(verifier.getBasedir(), verifier.getLogFileName(), false); - List warnLines = findReadOnlyWarning(logLines); - - assertTrue( - warnLines.stream() - .anyMatch( - s -> s.contains( - "Parameter 'readOnlyWithUserProperty' (user property 'user.property') is read-only, must not be used in configuration"))); - } - - /** - * Test that ensures that warning is printed for read-only parameter set by plugin configuration. - */ - @Test - public void testReadOnlyConfig() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7464-mojo-read-only-params"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.setLogFileName("log-read-only-configuration.txt"); - verifier.addCliArgument("-Pconfig-values"); - verifier.addCliArgument("-Dmaven.plugin.validation=verbose"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List logLines = verifier.loadFile(verifier.getBasedir(), verifier.getLogFileName(), false); - List warnLines = findReadOnlyWarning(logLines); - - assertTrue(warnLines.stream() - .anyMatch(s -> - s.contains("Parameter 'readOnlyWithDefault' is read-only, must not be used in configuration"))); - - assertTrue(warnLines.stream() - .anyMatch(s -> s.contains( - "Parameter 'readOnlyWithOutDefaults' is read-only, must not be used in configuration"))); - - assertTrue( - warnLines.stream() - .anyMatch( - s -> s.contains( - "Parameter 'readOnlyWithProperty' (user property 'project.version') is read-only, must not be used in configuration"))); - - assertTrue( - warnLines.stream() - .anyMatch( - s -> s.contains( - "Parameter 'readOnlyWithUserProperty' (user property 'user.property') is read-only, must not be used in configuration"))); - } - - private List findReadOnlyWarning(List logLines) { - Pattern pattern = Pattern.compile(".* Parameter .* is read-only.*"); - List result = new ArrayList<>(); - for (String line : logLines) { - if (pattern.matcher(line).matches()) { - result.add(line); - } - } - return result; - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7468UnsupportedPluginsParametersTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7468UnsupportedPluginsParametersTest.java deleted file mode 100644 index d1a320fc0..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7468UnsupportedPluginsParametersTest.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Pattern; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * Test for - * MNG-7468 - * - * @author Slawomir Jaranowski - */ -public class MavenITmng7468UnsupportedPluginsParametersTest extends AbstractMavenIntegrationTestCase { - public MavenITmng7468UnsupportedPluginsParametersTest() { - super("[3.9.0,)"); - } - - /** - * Test that ensures that warning is not printed for empty configuration - */ - @Test - public void testNoConfiguration() throws Exception { - List warnLines = performTest("no-config"); - assertTrue("Unwanted warnings: " + warnLines, warnLines.isEmpty()); - } - - /** - * Test that ensures that warning is not printed for valid parameters - */ - @Test - public void testValidParameter() throws Exception { - List warnLines = performTest("valid-parameter"); - assertTrue("Unwanted warnings: " + warnLines, warnLines.isEmpty()); - } - - /** - * Test that ensures that warning is not printed for valid parameters - */ - @Test - public void testValidParameterAlias() throws Exception { - List warnLines = performTest("valid-parameter-alias"); - assertTrue("Unwanted warnings: " + warnLines, warnLines.isEmpty()); - } - - /** - * Test that ensures that warning is not printed for valid parameters - */ - @Test - public void testValidParameterForOtherGoal() throws Exception { - List warnLines = performTest("valid-parameter-other-goal"); - assertTrue("Unwanted warnings: " + warnLines, warnLines.isEmpty()); - } - - /** - * Test that ensures that warning is printed for configuration - */ - @Test - public void testInBuildPlugin() throws Exception { - List warnLines = performTest("config-build-plugin"); - assertWarningContains(warnLines); - } - - /** - * Test that ensures that warning is printed for configuration - */ - @Test - public void testInBuildExecution() throws Exception { - List warnLines = performTest("config-build-execution"); - assertWarningContains(warnLines); - } - - /** - * Test that ensures that warning is printed for configuration - */ - @Test - public void testInBuildMixed() throws Exception { - List warnLines = performTest("config-build-mixed"); - assertWarningContains(warnLines); - } - - /** - * Test that ensures that warning is printed for configuration - */ - @Test - public void testInPluginManagement() throws Exception { - List warnLines = performTest("config-plugin-management"); - assertWarningContains(warnLines); - } - - /** - * Test that ensures that warning is printed for configuration - */ - @Test - public void testInPluginManagementParent() throws Exception { - List warnLines = performTest("config-plugin-management-parent"); - assertWarningContains(warnLines); - } - - /** - * Test that ensures that warning is printed for configuration - */ - @Test - public void testWithForkedGoalExecution() throws Exception { - List warnLines = performTest("config-with-fork-goal"); - - assertTrue( - warnLines.remove( - "[WARNING] Parameter 'invalidXml' is unknown for plugin 'maven-it-plugin-fork:2.1-SNAPSHOT:fork-goal (fork)'")); - - assertTrue( - warnLines.remove( - "[WARNING] Parameter 'invalidParam' is unknown for plugin 'maven-it-plugin-fork:2.1-SNAPSHOT:fork-goal (fork)'")); - - assertTrue( - warnLines.remove( - "[WARNING] Parameter 'invalidXml' is unknown for plugin 'maven-it-plugin-fork:2.1-SNAPSHOT:touch (touch)'")); - - assertTrue( - warnLines.remove( - "[WARNING] Parameter 'invalidParam' is unknown for plugin 'maven-it-plugin-fork:2.1-SNAPSHOT:touch (touch)'")); - - assertTrue("Not verified line: " + warnLines, warnLines.isEmpty()); - } - - private List performTest(String project) throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7468-unsupported-params"); - - Verifier verifier = newVerifier(new File(testDir, project).getAbsolutePath()); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List logLines = verifier.loadFile(verifier.getBasedir(), verifier.getLogFileName(), false); - return findUnknownWarning(logLines); - } - - private void assertWarningContains(List warnLines) { - assertTrue( - warnLines.remove( - "[WARNING] Parameter 'invalidParam' is unknown for plugin 'maven-it-plugin-configuration:2.1-SNAPSHOT:touch (default)'")); - - assertTrue( - warnLines.remove( - "[WARNING] Parameter 'invalidXml' is unknown for plugin 'maven-it-plugin-configuration:2.1-SNAPSHOT:touch (default)'")); - - assertTrue("Not verified line: " + warnLines, warnLines.isEmpty()); - } - - private List findUnknownWarning(List logLines) { - Pattern pattern = Pattern.compile("\\[WARNING] Parameter .* is unknown.*"); - List result = new ArrayList<>(); - for (String line : logLines) { - if (pattern.matcher(line).matches()) { - result.add(line); - } - } - - return result; - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7470ResolverTransportTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7470ResolverTransportTest.java deleted file mode 100644 index b6fa21bba..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7470ResolverTransportTest.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.HashMap; -import java.util.Map; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-7470: - * check that Maven bundled transports work as expected. - */ -public class MavenITmng7470ResolverTransportTest extends AbstractMavenIntegrationTestCase { - private File projectDir; - - private HttpServer server; - - private int port; - - public MavenITmng7470ResolverTransportTest() { - super("[3.9.0,)"); - } - - @BeforeEach - protected void setUp() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7470-resolver-transport"); - projectDir = new File(testDir, "project"); - - server = HttpServer.builder().port(0).source(new File(testDir, "repo")).build(); - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - port = server.port(); - System.out.println("Bound server socket to the port " + port); - } - - @AfterEach - protected void tearDown() throws Exception { - if (server != null) { - server.stop(); - server.join(); - } - } - - private void performTest(/* nullable */ final String transport, final String logSnippet) throws Exception { - Verifier verifier = newVerifier(projectDir.getAbsolutePath()); - verifier.setForkJvm(true); - - Map properties = new HashMap<>(); - properties.put("@port@", Integer.toString(port)); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", properties); - if (transport == null) { - verifier.setLogFileName("default-transport.log"); - } else { - verifier.setLogFileName(transport + "-transport.log"); - } - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.resolver.resolver-demo-maven-plugin"); - verifier.deleteArtifacts("org.apache.maven.its.resolver-transport"); - verifier.addCliArgument("-X"); - verifier.addCliArgument("-s"); - verifier.addCliArgument(new File(projectDir, "settings.xml").getAbsolutePath()); - verifier.addCliArgument("-Pmaven-core-it-repo"); - if (transport != null) { - verifier.addCliArgument("-Dmaven.resolver.transport=" + transport); - } - // Maven will fail if project dependencies cannot be resolved. - // As dependency exists ONLY in HTTP repo, it MUST be reached using selected transport and - // successfully resolved from it. - verifier.addCliArgument("verify"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - // verify maven console output contains "[DEBUG] Using transporter XXXTransporter" - verifier.verifyTextInLog(logSnippet); - } - - private static final String WAGON_LOG_SNIPPET = "[DEBUG] Using transporter WagonTransporter"; - - private static final String NATIVE_LOG_SNIPPET = "[DEBUG] Using transporter HttpTransporter"; - - @Test - public void testResolverTransportDefault() throws Exception { - performTest(null, NATIVE_LOG_SNIPPET); - } - - @Test - public void testResolverTransportWagon() throws Exception { - performTest("wagon", WAGON_LOG_SNIPPET); - } - - @Test - public void testResolverTransportNative() throws Exception { - performTest("native", NATIVE_LOG_SNIPPET); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7474SessionScopeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7474SessionScopeTest.java deleted file mode 100644 index 0e3179453..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7474SessionScopeTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-7474: - * check that Session scope beans are actually singletons for the session. - */ -public class MavenITmng7474SessionScopeTest extends AbstractMavenIntegrationTestCase { - public MavenITmng7474SessionScopeTest() { - super("[3.9.0,)"); - } - - @Test - public void testSessionScope() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7474-session-scope"); - - Verifier verifier = newVerifier(new File(testDir, "plugin").getAbsolutePath()); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(new File(testDir, "project").getAbsolutePath()); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7487DeadlockTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7487DeadlockTest.java deleted file mode 100644 index 4971f6ce4..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7487DeadlockTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.IOException; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -public class MavenITmng7487DeadlockTest extends AbstractMavenIntegrationTestCase { - private static final String PROJECT_PATH = "/mng-7487-deadlock"; - - public MavenITmng7487DeadlockTest() { - super("(,3.8.4],[3.8.6,)"); - } - - @Test - public void testDeadlock() throws IOException, VerificationException { - final File rootDir = ResourceExtractor.simpleExtractResources(getClass(), PROJECT_PATH); - - final File pluginDir = new File(rootDir, "plugin"); - final Verifier pluginVerifier = newVerifier(pluginDir.getAbsolutePath()); - pluginVerifier.addCliArgument("install"); - pluginVerifier.execute(); - - final File consumerDir = new File(rootDir, "consumer"); - final Verifier consumerVerifier = newVerifier(consumerDir.getAbsolutePath()); - consumerVerifier.setForkJvm(true); - ; - consumerVerifier.addCliArgument("-T2"); - consumerVerifier.addCliArgument("package"); - consumerVerifier.execute(); - consumerVerifier.verifyErrorFreeLog(); - consumerVerifier.verifyTextInLog("BUILD SUCCESS"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7504NotWarnUnsupportedReportPluginsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7504NotWarnUnsupportedReportPluginsTest.java deleted file mode 100644 index 8e4edc22c..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7504NotWarnUnsupportedReportPluginsTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.io.IOException; -import java.util.List; - -import org.apache.maven.shared.verifier.VerificationException; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * Test for - * MNG-7504 - * - * Warning about unsupported reportPlugins should not be printed for m-site-p. - * - * @author Slawomir Jaranowski - */ -public class MavenITmng7504NotWarnUnsupportedReportPluginsTest extends AbstractMavenIntegrationTestCase { - private static final String PROJECT_PATH = "/mng-7504-warn-unsupported-report-plugins"; - - public MavenITmng7504NotWarnUnsupportedReportPluginsTest() { - super("[3.9.0]"); - } - - @Test - public void testWarnNotPresent() throws IOException, VerificationException { - File rootDir = ResourceExtractor.simpleExtractResources(getClass(), PROJECT_PATH); - - Verifier verifier = newVerifier(rootDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.addCliArgument("site"); - verifier.execute(); - - List logLines = verifier.loadFile(verifier.getBasedir(), verifier.getLogFileName(), false); - - for (String line : logLines) { - assertFalse( - line.contains( - "[WARNING] Parameter 'reportPlugins' is unknown for plugin 'maven-site-plugin:0.1-stub-SNAPSHOT:site (default-site)'")); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7529VersionRangeRepositorySelection.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7529VersionRangeRepositorySelection.java deleted file mode 100644 index 2e6973f57..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7529VersionRangeRepositorySelection.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-7529. - */ -public class MavenITmng7529VersionRangeRepositorySelection extends AbstractMavenIntegrationTestCase { - - public MavenITmng7529VersionRangeRepositorySelection() { - super("(3.8.6,)"); - } - - /** - * Test dependency resolution from a version range using multiple remote repositories - * with snapshot or release enabled. - * - * @throws Exception in case of failure - */ - @Test - public void testit() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7529"); - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng7529"); - verifier.addCliArgument("--settings"); - verifier.addCliArgument("settings.xml"); - - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7566JavaPrerequisiteTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7566JavaPrerequisiteTest.java deleted file mode 100644 index f0f55c803..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7566JavaPrerequisiteTest.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-7566. - * Similar to {@link MavenITmng4840MavenPrerequisiteTest}. - * - */ -class MavenITmng7566JavaPrerequisiteTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng7566JavaPrerequisiteTest() { - super("[4.0.0-alpha-3,)"); - } - - /** - * Verify that builds fail straight when the current Java version doesn't match a plugin's prerequisite. - * - * @throws Exception in case of failure - */ - @Test - void testitMojoExecution() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7566"); - - Verifier verifier = newVerifier(new File(testDir, "test-1").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng7566"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("../settings-template.xml", "settings.xml", "UTF-8"); - try { - verifier.addCliArgument("validate"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - fail("Build did not fail despite unsatisfied prerequisite of plugin on Maven version."); - } catch (Exception e) { - // expected, unsolvable version conflict - } - } - - /** - * Verify that automatic plugin version resolution automatically skips plugin versions whose prerequisite on - * the current Java version isn't satisfied. - * - * @throws Exception in case of failure - */ - @Test - void testitPluginVersionResolution() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7566"); - - Verifier verifier = newVerifier(new File(testDir, "test-2").getAbsolutePath()); - verifier.setAutoclean(false); - verifier.deleteDirectory("target"); - verifier.deleteArtifacts("org.apache.maven.its.mng7566"); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.filterFile("../settings-template.xml", "settings.xml", "UTF-8"); - verifier.addCliArgument("org.apache.maven.its.mng7566:maven-mng7566-plugin:touch"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier.verifyFilePresent("target/touch-1.txt"); - verifier.verifyFileNotPresent("target/touch-2.txt"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7587Jsr330.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7587Jsr330.java deleted file mode 100644 index 120b516da..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7587Jsr330.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.EnabledOnJre; -import org.junit.jupiter.api.condition.JRE; - -/** - * This is a test set for MNG-7587. - * Simply verifies that plexus component using JSR330 and compiled with JDK 17 bytecode can - * work on maven. - */ -class MavenITmng7587Jsr330 extends AbstractMavenIntegrationTestCase { - - public MavenITmng7587Jsr330() { - // affected Maven versions: 4.0.0-alpha-5 - super("(4.0.0-alpha-5,)"); - } - - /** - * Verify components can be written using JSR330 on JDK 17. - * - * @throws Exception in case of failure - */ - @Test - @EnabledOnJre(JRE.JAVA_17) - void testJdk17() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7587-jsr330") - .getAbsoluteFile(); - - final Verifier pluginVerifier = newVerifier(new File(testDir, "plugin").getPath()); - pluginVerifier.addCliArgument("clean"); - pluginVerifier.addCliArgument("install"); - pluginVerifier.addCliArgument("-V"); - pluginVerifier.execute(); - pluginVerifier.verifyErrorFreeLog(); - - final Verifier consumerVerifier = newVerifier(new File(testDir, "consumer").getPath()); - consumerVerifier.addCliArgument("clean"); - consumerVerifier.addCliArgument("verify"); - consumerVerifier.addCliArgument("-V"); - consumerVerifier.execute(); - consumerVerifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7606DependencyImportScopeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7606DependencyImportScopeTest.java deleted file mode 100644 index 930697cb7..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7606DependencyImportScopeTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-7606. - * It checks that "import" scope for dependencies work - * - */ -class MavenITmng7606DependencyImportScopeTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng7606DependencyImportScopeTest() { - super(ALL_MAVEN_VERSIONS); - } - - /** - * Verify that dependencies which are managed through imported dependency management work - * - * @throws Exception in case of failure - */ - @Test - void testDependencyResolution() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7606"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(true); - verifier.deleteArtifacts("org.apache.maven.its.mng7606"); - verifier.addCliArgument("verify"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7629SubtreeBuildTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7629SubtreeBuildTest.java deleted file mode 100644 index e9375b581..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7629SubtreeBuildTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-7629. - * It checks that building a subtree that consumes an attached artifact works - * - */ -class MavenITmng7629SubtreeBuildTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng7629SubtreeBuildTest() { - super("[4.0.0-alpha-4,)"); - } - - /** - * Verify that dependencies which are managed through imported dependency management work - * - * @throws Exception in case of failure - */ - @Test - void testBuildSubtree() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7629"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(true); - verifier.addCliArgument("verify"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(true); - verifier.addCliArguments("-f", "child-2", "verify"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7679SingleMojoNoPomTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7679SingleMojoNoPomTest.java deleted file mode 100644 index 6f6d30c34..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7679SingleMojoNoPomTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-7679. - * Executing single mojo without POM should not NPE. - * - */ -class MavenITmng7679SingleMojoNoPomTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng7679SingleMojoNoPomTest() { - // affected Maven versions: 3.8.7, 3.9.0, 4.0.0-alpha-4 - super("(,3.8.7)(3.8.7,3.9.0),(3.9.0,4.0.0-alpha-4),(4.0.0-alpha-4,)"); - } - - /** - * Verify that maven invocation works (no NPE/error happens). - * - * @throws Exception in case of failure - */ - @Test - void testSingleMojoNoPom() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7679"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("install:install-file"); - verifier.addCliArgument("-Dfile=mng-7679.txt"); - verifier.addCliArgument("-DgroupId=org.apache.maven.it.mng7679"); - verifier.addCliArgument("-DartifactId=artifact"); - verifier.addCliArgument("-Dversion=1.0.0"); - verifier.addCliArgument("-Dpackaging=jar"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7697PomWithEmojiTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7697PomWithEmojiTest.java deleted file mode 100644 index 8d3c12667..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7697PomWithEmojiTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-7697. - * Verifies if pom with emoji in comments are parsed. - */ -class MavenITmng7697PomWithEmojiTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng7697PomWithEmojiTest() { - // affected Maven versions: 3.9.0, 4.0.0-alpha-4 - super("(,3.9.0),(3.9.0,4.0.0-alpha-4),(4.0.0-alpha-4,)"); - } - - /** - * Pom read successful. - * - * @throws Exception in case of failure - */ - @Test - void testPomRead() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7697-emoji"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setAutoclean(false); - verifier.addCliArgument("verify"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7716BuildDeadlock.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7716BuildDeadlock.java deleted file mode 100644 index 2483df65f..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7716BuildDeadlock.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.concurrent.TimeUnit; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; - -/** - * This is a test set for - * MNG-7716. - * Executing the project should not deadlock - * - */ -class MavenITmng7716BuildDeadlock extends AbstractMavenIntegrationTestCase { - - public MavenITmng7716BuildDeadlock() { - super("[3.8.8,3.9.0),[3.9.1,4.0.0-alpha-1),[4.0.0-alpha-5,)"); - } - - /** - * Verify that maven invocation works (no NPE/error happens). - * - * @throws Exception in case of failure - */ - @Test - @Timeout(value = 120, unit = TimeUnit.SECONDS) - void testNoDeadlockAtVersionUpdate() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7716"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("-f"); - verifier.addCliArgument("settings"); - verifier.addCliArgument("install"); - verifier.setLogFileName("log-settings.txt"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("-T1C"); - verifier.addCliArgument("org.codehaus.mojo:versions-maven-plugin:2.15.0:set"); - verifier.addCliArgument("-DnewVersion=1.2.3"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7737ProfileActivationTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7737ProfileActivationTest.java deleted file mode 100644 index ac4c0f3bb..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7737ProfileActivationTest.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.codehaus.plexus.util.Os; -import org.junit.jupiter.api.Test; - -/** - * This is a test set for MNG-7737. - * Simply verifies that various (expected) profiles are properly activated or not. - * - */ -class MavenITmng7737ProfileActivationTest extends AbstractMavenIntegrationTestCase { - - public MavenITmng7737ProfileActivationTest() { - // affected Maven versions: 3.9.0 - super("(,3.9.0),(3.9.0,)"); - } - - /** - * Verify that profiles are active as expected. - * - * @throws Exception in case of failure - */ - @Test - void testSingleMojoNoPom() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7737-profiles"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("-s"); - verifier.addCliArgument("settings.xml"); - verifier.addCliArgument("org.apache.maven.plugins:maven-help-plugin:3.3.0:active-profiles"); - verifier.addCliArgument("-Dsettings-property"); - verifier.addCliArgument("-Dpom-property"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - // Example output on my Linux Box w/ Java 17 - // The following profiles are active: - // - // - settings-active-default (source: external) - // - settings-active (source: external) - // - settings-jdk-8 (source: external) - // - settings-jdk-11 (source: external) - // - settings-jdk-17 (source: external) - // - settings-os-unix (source: external) - // - settings-property (source: external) - // - settings-file-exists-present (source: external) - // - settings-file-missing-absent (source: external) - // - it-defaults (source: external) - // - pom-jdk-8 (source: org.apache.maven.its.mng7737:test:0.1) - // - pom-jdk-11 (source: org.apache.maven.its.mng7737:test:0.1) - // - pom-jdk-17 (source: org.apache.maven.its.mng7737:test:0.1) - // - pom-os-unix (source: org.apache.maven.its.mng7737:test:0.1) - // - pom-property (source: org.apache.maven.its.mng7737:test:0.1) - // - pom-file-exists-present (source: org.apache.maven.its.mng7737:test:0.1) - // - pom-file-missing-absent (source: org.apache.maven.its.mng7737:test:0.1) - - verifier.verifyTextInLog("settings-active-default"); - verifier.verifyTextInLog("settings-active"); - verifier.verifyTextInLog("settings-jdk"); // enough, as we build on 8+ at least one is present - verifier.verifyTextInLog("settings-os-" + Os.OS_FAMILY); - verifier.verifyTextInLog("settings-property"); - verifier.verifyTextInLog("settings-file-exists-present"); - verifier.verifyTextInLog("settings-file-missing-absent"); - - // In case of POM, the pom-active-default documented constraint stands: - // "This profile will automatically be active for all builds unless - // **another profile in the same POM** is activated using one of the previously described methods." - verifier.verifyTextInLog("pom-jdk"); // enough, as we build on 8+ at least one is present - verifier.verifyTextInLog("pom-os-" + Os.OS_FAMILY); - verifier.verifyTextInLog("pom-property"); - verifier.verifyTextInLog("pom-file-exists-present"); - verifier.verifyTextInLog("pom-file-missing-absent"); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7740ConsumerBuildShouldCleanUpOldFilesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7740ConsumerBuildShouldCleanUpOldFilesTest.java deleted file mode 100644 index b84c5c04a..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7740ConsumerBuildShouldCleanUpOldFilesTest.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import java.io.File; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -class MavenITmng7740ConsumerBuildShouldCleanUpOldFilesTest extends AbstractMavenIntegrationTestCase { - - protected MavenITmng7740ConsumerBuildShouldCleanUpOldFilesTest() { - super("[4.0.0-alpha-6,)"); - } - - @Test - void testConsumerBuildShouldCleanUpOldConsumerFiles() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7740-consumer-files"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.addCliArgument("validate"); - - verifier.execute(); - - verifier.verifyErrorFreeLog(); - - try (Stream stream = Files.walk(testDir.toPath())) { - final List consumerFiles = stream.filter( - path -> path.getFileName().toString().contains("consumer") - && path.getFileName().toString().contains("pom")) - .collect(Collectors.toList()); - assertTrue("Expected no consumer pom file.", consumerFiles.size() == 0); - } - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7819FileLockingWithSnapshotsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7819FileLockingWithSnapshotsTest.java deleted file mode 100644 index e55201e31..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7819FileLockingWithSnapshotsTest.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.HashMap; -import java.util.Map; - -import org.apache.commons.io.FileUtils; -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.eclipse.jetty.server.Handler; -import org.eclipse.jetty.server.NetworkConnector; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.HandlerList; -import org.eclipse.jetty.server.handler.ResourceHandler; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -class MavenITmng7819FileLockingWithSnapshotsTest extends AbstractMavenIntegrationTestCase { - - private Server server; - - private int port; - - protected MavenITmng7819FileLockingWithSnapshotsTest() { - // broken: maven 3.9.2 and 4.0.0-alpha-5 - super("[3.9.0,3.9.2),(3.9.2,3.999.999],[4.0.0-alpha-6,)"); - } - - @BeforeEach - protected void setUp() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7819-file-locking-with-snapshots"); - server = new Server(0); - ResourceHandler resourceHandler = new ResourceHandler(); - resourceHandler.setWelcomeFiles(new String[] {"index.html"}); - resourceHandler.setDirectoriesListed(true); - resourceHandler.setResourceBase(new File(testDir, "repo").getAbsolutePath()); - HandlerList handlerList = new HandlerList(); - handlerList.setHandlers(new Handler[] {resourceHandler}); - server.setHandler(handlerList); - server.start(); - if (server.isFailed()) { - fail("Couldn't bind the server socket to a free port!"); - } - port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort(); - System.out.println("Bound server socket to the port " + port); - } - - @AfterEach - protected void tearDown() throws Exception { - if (server != null) { - server.stop(); - server.join(); - } - } - - @Test - void testFileLockingAndSnapshots() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7819-file-locking-with-snapshots"); - - Verifier verifier = newVerifier(testDir.getAbsolutePath()); - verifier.setForkJvm(true); - - // produce required precondition state: local repository must not have any of the org.apache.maven.its.mng7819 - // artifacts - String path = verifier.getArtifactPath("org.apache.maven.its.mng7819", "dependency", "1.0.0-SNAPSHOT", "pom"); - File groupDirectory = new File(path).getParentFile().getParentFile().getParentFile(); - FileUtils.deleteDirectory(groupDirectory); - - Map properties = new HashMap<>(); - properties.put("@port@", Integer.toString(port)); - verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", properties); - - verifier.addCliArgument("-e"); - verifier.addCliArgument("-s"); - verifier.addCliArgument(new File(testDir, "settings.xml").getAbsolutePath()); - verifier.addCliArgument("-Pmaven-core-it-repo"); - - verifier.addCliArgument("-Daether.syncContext.named.nameMapper=file-gav"); - verifier.addCliArgument("-Daether.syncContext.named.factory=file-lock"); - verifier.addCliArgument("package"); - - verifier.execute(); - - verifier.verifyErrorFreeLog(); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7836AlternativePomSyntaxTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7836AlternativePomSyntaxTest.java deleted file mode 100644 index 67d9f4902..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7836AlternativePomSyntaxTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -class MavenITmng7836AlternativePomSyntaxTest extends AbstractMavenIntegrationTestCase { - - protected MavenITmng7836AlternativePomSyntaxTest() { - // New feature in alpha-8-SNAPSHOT - super("(4.0.0-alpha-7,)"); - } - - @Test - void testAlternativeSyntax() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7836-alternative-pom-syntax"); - - final Verifier pluginVerifier = newVerifier(new File(testDir, "maven-hocon-extension").getPath()); - pluginVerifier.addCliArgument("clean"); - pluginVerifier.addCliArgument("install"); - pluginVerifier.addCliArgument("-V"); - pluginVerifier.execute(); - pluginVerifier.verifyErrorFreeLog(); - - final Verifier consumerVerifier = newVerifier(new File(testDir, "simple").getPath()); - consumerVerifier.addCliArgument("clean"); - consumerVerifier.addCliArgument("install"); - consumerVerifier.addCliArgument("-Drat.skip=true"); - consumerVerifier.addCliArgument("-V"); - - Path consumerPom = Paths.get(consumerVerifier.getArtifactPath( - "org.apache.maven.its.mng-7836", "hocon-simple", "1.0.0-SNAPSHOT", "pom", "")); - Path buildPom = Paths.get(consumerVerifier.getArtifactPath( - "org.apache.maven.its.mng-7836", "hocon-simple", "1.0.0-SNAPSHOT", "pom", "build")); - consumerVerifier.deleteArtifacts("org.apache.maven.its.mng-7836", "hocon-simple", "1.0.0-SNAPSHOT"); - - consumerVerifier.execute(); - consumerVerifier.verifyErrorFreeLog(); - - assertTrue(Files.isRegularFile(consumerPom)); - List consumerPomLines = Files.readAllLines(consumerPom, StandardCharsets.UTF_8); - assertTrue(consumerPomLines.stream().anyMatch(l -> l.contains("Apache-2.0"))); - assertFalse(consumerPomLines.stream().anyMatch(l -> l.contains(""))); - - // The build pom is the original POM, so the hocon file - assertTrue(Files.isRegularFile(buildPom)); - List buildPomLines = Files.readAllLines(buildPom, StandardCharsets.UTF_8); - assertTrue(buildPomLines.stream().anyMatch(l -> l.contains("groupId = org.apache.maven.extensions"))); - } -} diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7891ConfigurationForExtensionsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7891ConfigurationForExtensionsTest.java deleted file mode 100644 index a390cec45..000000000 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7891ConfigurationForExtensionsTest.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.it; - -import java.io.File; -import java.util.List; - -import org.apache.maven.shared.verifier.Verifier; -import org.apache.maven.shared.verifier.util.ResourceExtractor; -import org.junit.jupiter.api.Test; - -class MavenITmng7891ConfigurationForExtensionsTest extends AbstractMavenIntegrationTestCase { - - protected MavenITmng7891ConfigurationForExtensionsTest() { - super("(4.0.0-alpha-7,)"); - } - - @Test - void testConfigurationForCoreExtension() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7891-extension-configuration"); - - Verifier verifier = newVerifier(new File(testDir, "extension").getAbsolutePath()); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(new File(testDir, "core-extension").getAbsolutePath()); - verifier.addCliArgument("install"); - verifier.addCliArgument("-DuserValue=the-value"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List logFile = verifier.loadFile(verifier.getBasedir(), verifier.getLogFileName(), false); - String projects = logFile.stream() - .filter(s -> s.contains("All projects are read now")) - .findFirst() - .orElse(null); - assertNotNull(projects); - assertFalse(projects.contains("$")); - } - - @Test - void testConfigurationForBuildExtension() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7891-extension-configuration"); - - Verifier verifier = newVerifier(new File(testDir, "extension").getAbsolutePath()); - verifier.addCliArgument("install"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - verifier = newVerifier(new File(testDir, "build-extension").getAbsolutePath()); - verifier.addCliArgument("install"); - verifier.addCliArgument("-DuserValue=the-value"); - verifier.execute(); - verifier.verifyErrorFreeLog(); - - List logFile = verifier.loadFile(verifier.getBasedir(), verifier.getLogFileName(), false); - String projects = logFile.stream() - .filter(s -> s.contains("All projects are read now")) - .findFirst() - .orElse(null); - assertNotNull(projects); - assertFalse(projects.contains("$")); - } -}