Skip to content

Commit

Permalink
[MSHARED-1016] IT tests for transitive provided scope dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
slawekjaranowski committed Jul 4, 2022
1 parent 98c5971 commit d0ebc5c
Show file tree
Hide file tree
Showing 10 changed files with 260 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/it/compile-provided-verbose/expected-default.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
org.apache.maven.its.dependency-tree:verbose:jar:1.0-SNAPSHOT
\- jakarta.transaction:jakarta.transaction-api:jar:2.0.1:compile
2 changes: 2 additions & 0 deletions src/it/compile-provided-verbose/expected-verbose.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
org.apache.maven.its.dependency-tree:verbose:jar:1.0-SNAPSHOT
\- jakarta.transaction:jakarta.transaction-api:jar:2.0.1:compile
20 changes: 20 additions & 0 deletions src/it/compile-provided-verbose/invoker.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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.

invoker.goals = clean validate
# Maven 2 makes wrong resolution
invoker.maven.version = 3.0+
80 changes: 80 additions & 0 deletions src/it/compile-provided-verbose/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?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.dependency-tree</groupId>
<artifactId>verbose</artifactId>
<version>1.0-SNAPSHOT</version>

<name>VerboseTest</name>
<description>
Test verbose dependency-tree - artifact with provided dependency in compile scope
</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>jakarta.transaction</groupId>
<artifactId>jakarta.transaction-api</artifactId>
<version>2.0.1</version>
<scope>compile</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.its.dependency-tree</groupId>
<artifactId>graph-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<executions>
<execution>
<id>verbose</id>
<phase>validate</phase>
<configuration>
<outputFile>target/tree-verbose.txt</outputFile>
<verbose>true</verbose>
</configuration>
<goals>
<goal>graph</goal>
</goals>
</execution>
<execution>
<id>default</id>
<phase>validate</phase>
<configuration>
<outputFile>target/tree-default.txt</outputFile>
</configuration>
<goals>
<goal>graph</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
26 changes: 26 additions & 0 deletions src/it/compile-provided-verbose/verify.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* 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.
*/

def actual = new File( basedir, "target/tree-verbose.txt" ).readLines()
def expected = new File( basedir, "expected-verbose.txt" ).readLines()
assert actual.equals( expected )

actual = new File( basedir, "target/tree-default.txt" ).readLines()
expected = new File( basedir, "expected-default.txt" ).readLines()
assert actual.equals( expected )
2 changes: 2 additions & 0 deletions src/it/runtime-provided-verbose/expected-default.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
org.apache.maven.its.dependency-tree:verbose:jar:1.0-SNAPSHOT
\- jakarta.transaction:jakarta.transaction-api:jar:2.0.1:runtime
2 changes: 2 additions & 0 deletions src/it/runtime-provided-verbose/expected-verbose.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
org.apache.maven.its.dependency-tree:verbose:jar:1.0-SNAPSHOT
\- jakarta.transaction:jakarta.transaction-api:jar:2.0.1:runtime
20 changes: 20 additions & 0 deletions src/it/runtime-provided-verbose/invoker.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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.

invoker.goals = clean validate
# Maven 2 makes wrong resolution
invoker.maven.version = 3.0+
80 changes: 80 additions & 0 deletions src/it/runtime-provided-verbose/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?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.dependency-tree</groupId>
<artifactId>verbose</artifactId>
<version>1.0-SNAPSHOT</version>

<name>VerboseTest</name>
<description>
Test verbose dependency-tree - artifact with provided dependency in runtime scope
</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>jakarta.transaction</groupId>
<artifactId>jakarta.transaction-api</artifactId>
<version>2.0.1</version>
<scope>runtime</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.its.dependency-tree</groupId>
<artifactId>graph-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<executions>
<execution>
<id>verbose</id>
<phase>validate</phase>
<configuration>
<outputFile>target/tree-verbose.txt</outputFile>
<verbose>true</verbose>
</configuration>
<goals>
<goal>graph</goal>
</goals>
</execution>
<execution>
<id>default</id>
<phase>validate</phase>
<configuration>
<outputFile>target/tree-default.txt</outputFile>
</configuration>
<goals>
<goal>graph</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
26 changes: 26 additions & 0 deletions src/it/runtime-provided-verbose/verify.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* 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.
*/

def actual = new File( basedir, "target/tree-verbose.txt" ).readLines()
def expected = new File( basedir, "expected-verbose.txt" ).readLines()
assert actual.equals( expected )

actual = new File( basedir, "target/tree-default.txt" ).readLines()
expected = new File( basedir, "expected-default.txt" ).readLines()
assert actual.equals( expected )

0 comments on commit d0ebc5c

Please sign in to comment.