This is an automated email from the ASF dual-hosted git repository.

cstamas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git


The following commit(s) were added to refs/heads/master by this push:
     new d962e8153 [MNG-7606] add IT (#214)
d962e8153 is described below

commit d962e81534a2e852ac7157d193e33001ad7c0c13
Author: Konrad Windszus <k...@apache.org>
AuthorDate: Thu Dec 1 12:33:23 2022 +0100

    [MNG-7606] add IT (#214)
    
    Add IT, run with all Maven versions.
    
    Co-authored-by: Tamas Cservenak <ta...@cservenak.net>
---
 .../MavenITmng7606DependencyImportScopeTest.java   | 42 ++++++++++++++++
 .../org/apache/maven/it/TestSuiteOrdering.java     |  1 +
 .../src/test/resources-filtered/bootstrap.txt      |  2 +
 core-it-suite/src/test/resources/mng-7606/pom.xml  | 58 ++++++++++++++++++++++
 4 files changed, 103 insertions(+)

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
new file mode 100644
index 000000000..46211ca79
--- /dev/null
+++ 
b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7606DependencyImportScopeTest.java
@@ -0,0 +1,42 @@
+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 <a 
href="https://issues.apache.org/jira/browse/MNG-7606";>MNG-7606</a>.
+ * 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/TestSuiteOrdering.java 
b/core-it-suite/src/test/java/org/apache/maven/it/TestSuiteOrdering.java
index 897e09397..24e73640e 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/TestSuiteOrdering.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/TestSuiteOrdering.java
@@ -93,6 +93,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( MavenITmng7606DependencyImportScopeTest.class );
         suite.addTestSuite( 
MavenITmng6609ProfileActivationForPackagingTest.class );
         suite.addTestSuite( MavenITmng7566JavaPrerequisiteTest.class );
         suite.addTestSuite( MavenITmng5889FindBasedir.class );
diff --git a/core-it-suite/src/test/resources-filtered/bootstrap.txt 
b/core-it-suite/src/test/resources-filtered/bootstrap.txt
index 602fd27fa..90c38d935 100644
--- a/core-it-suite/src/test/resources-filtered/bootstrap.txt
+++ b/core-it-suite/src/test/resources-filtered/bootstrap.txt
@@ -166,6 +166,8 @@ org.eclipse.aether:aether-spi:0.9.0.M2
 org.eclipse.sisu:org.eclipse.sisu.inject:0.0.0.M5
 org.eclipse.sisu:org.eclipse.sisu.plexus:0.0.0.M5
 org.eclipse.sisu:sisu-maven-plugin:0.3.5
+org.junit:junit-bom:5.9.1:pom
+org.junit.jupiter:junit-jupiter-engine:5.9.1
 org.ow2.asm:asm:4.1
 org.ow2.asm:asm:6.2
 org.ow2.asm:asm:7.2
diff --git a/core-it-suite/src/test/resources/mng-7606/pom.xml 
b/core-it-suite/src/test/resources/mng-7606/pom.xml
new file mode 100644
index 000000000..9491e2344
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-7606/pom.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements. See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License. You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.apache.maven.its.mng7606</groupId>
+    <artifactId>test</artifactId>
+    <version>1.0-SNAPSHOT</version>
+
+    <dependencyManagement>
+        <dependencies>
+            <!-- The bug manifests if there are more than 1 import scoped POMs.
+                 Reason: first model is "stuck" with request.setRawModel( 
inputModel ) forever
+                 See commit: e921f1564ef9460ca58745eb52e3967dbbd0b9e7
+            -->
+            <dependency>
+                <groupId>org.apache.maven</groupId>
+                <artifactId>maven-core</artifactId>
+                <version>3.3.1</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+            <dependency>
+                <groupId>org.junit</groupId>
+                <artifactId>junit-bom</artifactId>
+                <version>5.9.1</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+    <dependencies>
+        <dependency>
+            <groupId>org.junit.jupiter</groupId>
+            <artifactId>junit-jupiter-engine</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+</project>

Reply via email to