Skip to content

Commit 284b30f

Browse files
gnodetcstamas
andauthored
[MNG-8293] [MNG-8288] Two new ITs and disable MNG-2196 IT (#382)
* Two new ITs for MNG-8288 and MNG-8293 Both problems happens during reactor load up, so ITs code is simple, just invoke "mvn validate" while the actual trick is in resources (projects). * Fix javadoc * Disable MNG-2196 IT as it can infer the parent --------- Co-authored-by: Tamas Cservenak <[email protected]>
1 parent ab36bd3 commit 284b30f

File tree

12 files changed

+313
-1
lines changed

12 files changed

+313
-1
lines changed

core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2196ParentResolutionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
public class MavenITmng2196ParentResolutionTest extends AbstractMavenIntegrationTestCase {
3232

3333
public MavenITmng2196ParentResolutionTest() {
34-
super(ALL_MAVEN_VERSIONS);
34+
super("[2.0,4.0.0-beta-5)");
3535
}
3636

3737
/**
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.apache.maven.it;
20+
21+
import java.io.File;
22+
23+
import org.apache.maven.shared.verifier.Verifier;
24+
import org.apache.maven.shared.verifier.util.ResourceExtractor;
25+
import org.junit.jupiter.api.Test;
26+
27+
/**
28+
* This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-8288">MNG-8288</a>.
29+
*/
30+
class MavenITmng8288NoRootPomTest extends AbstractMavenIntegrationTestCase {
31+
32+
MavenITmng8288NoRootPomTest() {
33+
super("[3.6.3,)");
34+
}
35+
36+
/**
37+
* Verify that project without root POM can be loaded up
38+
*/
39+
@Test
40+
void testitNoRootPomCanBeLoaded() throws Exception {
41+
File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-8288-no-root-pom");
42+
43+
Verifier verifier = newVerifier(testDir.getAbsolutePath());
44+
verifier.addCliArgument("-f");
45+
verifier.addCliArgument("project");
46+
verifier.addCliArgument("validate");
47+
verifier.execute();
48+
verifier.verifyErrorFreeLog();
49+
}
50+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.apache.maven.it;
20+
21+
import java.io.File;
22+
23+
import org.apache.maven.shared.verifier.Verifier;
24+
import org.apache.maven.shared.verifier.util.ResourceExtractor;
25+
import org.junit.jupiter.api.Test;
26+
27+
/**
28+
* This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-8293">MNG-8293</a>.
29+
*/
30+
class MavenITmng8293BomImportFromReactor extends AbstractMavenIntegrationTestCase {
31+
32+
MavenITmng8293BomImportFromReactor() {
33+
super("[3.6.3,)");
34+
}
35+
36+
/**
37+
* Verify that project doing BOM import of BOM from reactor can be loaded up
38+
*/
39+
@Test
40+
void testitNoRootPomCanBeLoaded() throws Exception {
41+
File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-8293-bom-import-from-reactor");
42+
43+
Verifier verifier = newVerifier(testDir.getAbsolutePath());
44+
verifier.addCliArgument("validate");
45+
verifier.execute();
46+
verifier.verifyErrorFreeLog();
47+
}
48+
}

core-it-suite/src/test/java/org/apache/maven/it/TestSuiteOrdering.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ public TestSuiteOrdering() {
120120
* the tests are to finishing. Newer tests are also more likely to fail, so this is
121121
* a fail fast technique as well.
122122
*/
123+
suite.addTestSuite(MavenITmng8293BomImportFromReactor.class);
124+
suite.addTestSuite(MavenITmng8288NoRootPomTest.class);
123125
suite.addTestSuite(MavenITmng8133RootDirectoryInParentTest.class);
124126
suite.addTestSuite(MavenITmng8230CIFriendlyTest.class);
125127
suite.addTestSuite(MavenITmng7255InferredGroupIdTest.class);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-e
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project>
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<parent>
6+
<groupId>myGroup</groupId>
7+
<artifactId>parent</artifactId>
8+
<version>1</version>
9+
</parent>
10+
11+
<artifactId>child</artifactId>
12+
</project>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project>
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<groupId>myGroup</groupId>
6+
<artifactId>parent</artifactId>
7+
<version>1</version>
8+
<packaging>pom</packaging>
9+
10+
<properties>
11+
<ci-version>1.0-SNAPSHOT</ci-version>
12+
</properties>
13+
</project>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-e
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Copyright 2019 the original author or authors.
5+
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
18+
-->
19+
<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/maven-v4_0_0.xsd">
20+
<modelVersion>4.0.0</modelVersion>
21+
<parent>
22+
<groupId>org.mvndaemon.mvnd.test.new-managed-module</groupId>
23+
<artifactId>new-managed-module-parent</artifactId>
24+
<version>0.0.1-SNAPSHOT</version>
25+
<relativePath>../pom.xml</relativePath>
26+
</parent>
27+
28+
<artifactId>new-managed-module-bom</artifactId>
29+
<packaging>pom</packaging>
30+
31+
<dependencyManagement>
32+
<dependencies>
33+
<dependency>
34+
<groupId>org.mvndaemon.mvnd.test.new-managed-module</groupId>
35+
<artifactId>new-managed-module-module</artifactId>
36+
<version>${project.version}</version>
37+
</dependency>
38+
</dependencies>
39+
</dependencyManagement>
40+
41+
</project>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Copyright 2019 the original author or authors.
5+
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
18+
-->
19+
<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/maven-v4_0_0.xsd">
20+
<modelVersion>4.0.0</modelVersion>
21+
<parent>
22+
<groupId>org.mvndaemon.mvnd.test.new-managed-module</groupId>
23+
<artifactId>new-managed-module-parent</artifactId>
24+
<version>0.0.1-SNAPSHOT</version>
25+
<relativePath>../pom.xml</relativePath>
26+
</parent>
27+
28+
<artifactId>new-managed-module-module</artifactId>
29+
30+
<dependencyManagement>
31+
<dependencies>
32+
<dependency>
33+
<groupId>org.mvndaemon.mvnd.test.new-managed-module</groupId>
34+
<artifactId>new-managed-module-bom</artifactId>
35+
<version>0.0.1-SNAPSHOT</version>
36+
<type>pom</type>
37+
<scope>import</scope>
38+
</dependency>
39+
</dependencies>
40+
</dependencyManagement>
41+
42+
</project>

0 commit comments

Comments
 (0)