gnodet-bot commented on code in PR #1774: URL: https://github.com/apache/maven/pull/1774#discussion_r4293427546
########## impl/maven-impl/src/test/java/org/apache/maven/impl/model/DefaultProfileSelectorTest.java: ########## @@ -0,0 +1,439 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.maven.impl.model; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import org.apache.maven.api.model.Activation; +import org.apache.maven.api.model.ActivationProperty; +import org.apache.maven.api.model.Model; +import org.apache.maven.api.model.Profile; +import org.apache.maven.impl.DefaultModelVersionParser; +import org.apache.maven.impl.model.profile.PropertyProfileActivator; +import org.apache.maven.impl.model.profile.SimpleProblemCollector; +import org.apache.maven.impl.model.rootlocator.DefaultRootLocator; +import org.eclipse.aether.util.version.GenericVersionScheme; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Tests {@link DefaultProfileSelector} with focus on cascading activation behavior. + */ +public class DefaultProfileSelectorTest { Review Comment: ⚠️ **Missing test for file-existence cascade behavior.** The SPI Javadoc on `interpolatePath` now explicitly states: > *"file-existence conditions (`<exists>`, `<missing>`) can depend on properties set by earlier profiles in the activation cascade."* But this test class only registers `PropertyProfileActivator` and tests property-based cascading. There is no test that exercises file-existence activation (`FileProfileActivator`) triggered by a cascaded property. A test is needed to: 1. Set up a profile that sets `my.path` when activated 2. Set up a second profile with a `<exists>${my.path}</exists>` file activator 3. Verify that activating the first profile causes the second to activate via the cascaded `my.path` property Without this, the documented behavior (file-existence conditions depending on cascaded properties) has no regression coverage. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
