From 4e1de4ef6e6d5ff716b3bd20dfd1408485355e13 Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Wed, 2 Oct 2024 23:27:02 +0200 Subject: [PATCH] [MNG-8133] IT for ${project.rootDirectory} in external parent (#368) --- ...venITmng8133RootDirectoryInParentTest.java | 46 +++++++++++++++++++ .../apache/maven/it/TestSuiteOrdering.java | 1 + .../child/.mvn/.gitkeep | 0 .../child/pom.xml | 11 +++++ .../parent/.mvn/.gitkeep | 0 .../parent/pom.xml | 20 ++++++++ 6 files changed, 78 insertions(+) create mode 100644 its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8133RootDirectoryInParentTest.java create mode 100644 its/core-it-suite/src/test/resources/mng-8133-root-directory-in-parent/child/.mvn/.gitkeep create mode 100644 its/core-it-suite/src/test/resources/mng-8133-root-directory-in-parent/child/pom.xml create mode 100644 its/core-it-suite/src/test/resources/mng-8133-root-directory-in-parent/parent/.mvn/.gitkeep create mode 100644 its/core-it-suite/src/test/resources/mng-8133-root-directory-in-parent/parent/pom.xml diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8133RootDirectoryInParentTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8133RootDirectoryInParentTest.java new file mode 100644 index 0000000000..ac6fca523e --- /dev/null +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8133RootDirectoryInParentTest.java @@ -0,0 +1,46 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the 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 MavenITmng8133RootDirectoryInParentTest extends AbstractMavenIntegrationTestCase { + public MavenITmng8133RootDirectoryInParentTest() { + super("[4.0.0-beta-5,)"); + } + + @Test + public void testRootDirectoryInParent() throws Exception { + File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-8133-root-directory-in-parent"); + + Verifier verifier = newVerifier(new File(testDir, "parent").getAbsolutePath()); + verifier.addCliArgument("install"); + verifier.execute(); + verifier.verifyErrorFreeLog(); + + verifier = newVerifier(new File(testDir, "child").getAbsolutePath()); + verifier.addCliArgument("install"); + verifier.execute(); + verifier.verifyErrorFreeLog(); + } +} diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/TestSuiteOrdering.java b/its/core-it-suite/src/test/java/org/apache/maven/it/TestSuiteOrdering.java index 1619516d83..13b4a3221b 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/TestSuiteOrdering.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/TestSuiteOrdering.java @@ -120,6 +120,7 @@ public class TestSuiteOrdering implements ClassOrderer { * the tests are to finishing. Newer tests are also more likely to fail, so this is * a fail fast technique as well. */ + suite.addTestSuite(MavenITmng8133RootDirectoryInParentTest.class); suite.addTestSuite(MavenITmng8230CIFriendlyTest.class); suite.addTestSuite(MavenITmng7255InferredGroupIdTest.class); suite.addTestSuite(MavenITmng8220ExtensionWithDITest.class); diff --git a/its/core-it-suite/src/test/resources/mng-8133-root-directory-in-parent/child/.mvn/.gitkeep b/its/core-it-suite/src/test/resources/mng-8133-root-directory-in-parent/child/.mvn/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/its/core-it-suite/src/test/resources/mng-8133-root-directory-in-parent/child/pom.xml b/its/core-it-suite/src/test/resources/mng-8133-root-directory-in-parent/child/pom.xml new file mode 100644 index 0000000000..cd44675d64 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-8133-root-directory-in-parent/child/pom.xml @@ -0,0 +1,11 @@ + + + + org.apache.maven.its.mng8133 + parent + 1.0-SNAPSHOT + + child + jar + + diff --git a/its/core-it-suite/src/test/resources/mng-8133-root-directory-in-parent/parent/.mvn/.gitkeep b/its/core-it-suite/src/test/resources/mng-8133-root-directory-in-parent/parent/.mvn/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/its/core-it-suite/src/test/resources/mng-8133-root-directory-in-parent/parent/pom.xml b/its/core-it-suite/src/test/resources/mng-8133-root-directory-in-parent/parent/pom.xml new file mode 100644 index 0000000000..a3fab582a1 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-8133-root-directory-in-parent/parent/pom.xml @@ -0,0 +1,20 @@ + + + org.apache.maven.its.mng8133 + parent + 1.0-SNAPSHOT + pom + + + + + org.apache.maven.its.plugins + maven-it-plugin-touch + 2.1-SNAPSHOT + + ${project.rootDirectory}/target/ + + + + +