Skip to content

Commit c7a52b0

Browse files
committed
Implement IT for recursive resolution
1 parent 0dfad59 commit c7a52b0

4 files changed

Lines changed: 65 additions & 0 deletions

File tree

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*-
2+
* Copyright (c) 2016-2025 Red Hat, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.fedoraproject.xmvn.it.tool.resolver;
17+
18+
import static org.assertj.core.api.Assertions.assertThat;
19+
20+
import java.nio.file.Path;
21+
import java.util.List;
22+
import java.util.stream.Collectors;
23+
import org.fedoraproject.xmvn.it.tool.AbstractToolIntegrationTest;
24+
import org.junit.jupiter.api.Test;
25+
26+
/**
27+
* Integration tests for XMvn Resolver tool.
28+
*
29+
* @author Mikolaj Izdebski
30+
*/
31+
class ResolveRecursiveIntegrationTest extends AbstractToolIntegrationTest {
32+
@Test
33+
void testResolveRecursive() throws Exception {
34+
assertThat(invokeTool("xmvn-resolve", "-r", "junit:junit")).isEqualTo(0);
35+
assertThat(getStderr()).isEmpty();
36+
37+
List<String> out = getStdout().collect(Collectors.toList());
38+
assertThat(out).hasSize(2);
39+
Path first = Path.of(out.get(0));
40+
Path second = Path.of(out.get(1));
41+
42+
assertThat(first).endsWith(Path.of("src/test/resources/empty.jar")).isRegularFile();
43+
assertThat(second).endsWith(Path.of("src/test/resources/empty2.jar")).isRegularFile();
44+
}
45+
}
253 Bytes
Binary file not shown.

xmvn-it/src/test/resources/metadata.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,19 @@
88
<version>SYSTEM</version>
99
<path>@{xmvn.it.resourcesDir}/empty.jar</path>
1010
<uuid>3bdab429-d4fc-4471-b238-52855e5a39fe</uuid>
11+
<dependencies>
12+
<dependency>
13+
<groupId>org.hamcrest</groupId>
14+
<artifactId>hamcrest-core</artifactId>
15+
<requestedVersion>1.3</requestedVersion>
16+
</dependency>
17+
</dependencies>
18+
</artifact>
19+
<artifact>
20+
<groupId>org.hamcrest</groupId>
21+
<artifactId>hamcrest-core</artifactId>
22+
<version>3.0</version>
23+
<path>@{xmvn.it.resourcesDir}/empty2.jar</path>
1124
</artifact>
1225
<artifact>
1326
<groupId>xpp3</groupId>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<configuration>
2+
<resolverSettings>
3+
<metadataRepositories>
4+
<repository>metadata.xml</repository>
5+
</metadataRepositories>
6+
</resolverSettings>
7+
</configuration>

0 commit comments

Comments
 (0)