Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
Add test for addDependencyBasedRequires option
Browse files Browse the repository at this point in the history
  • Loading branch information
EagleErwin committed Jul 25, 2020
1 parent 43a98dc commit 093b403
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/it/rpm-dependency-based-requires/invoker.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
invoker.goals = clean package
14 changes: 14 additions & 0 deletions src/it/rpm-dependency-based-requires/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>org.codehaus.mojo.rpm.its</groupId>
<artifactId>rpm-dependency-based-requires</artifactId>
<version>1.0</version>
<packaging>pom</packaging>

<modules>
<module>rpm-dep</module>
<module>rpm-rpm</module>
</modules>
</project>
45 changes: 45 additions & 0 deletions src/it/rpm-dependency-based-requires/rpm-dep/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>org.codehaus.mojo.rpm.its</groupId>
<artifactId>rpm-dependency-based-requires-rpm-dep</artifactId>
<version>8.1</version>
<packaging>rpm</packaging>

<inceptionYear>2009</inceptionYear>
<organization>
<name>my org</name>
<url>www.my.org</url>
</organization>

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

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rpm-maven-plugin</artifactId>
<version>@pom.version@</version>
<extensions>true</extensions>
<configuration>
<distribution>My App</distribution>
<group>Application/Collectors</group>
<release>rel</release>
<needarch>false</needarch>
<defaultUsername>myuser</defaultUsername>
<defaultGroupname>mygroup</defaultGroupname>
<mappings>
<mapping>
<directory>/usr/myusr/app</directory>
<dependency />
<directoryIncluded>false</directoryIncluded>
</mapping>
</mappings>
</configuration>
</plugin>
</plugins>
</build>
</project>
48 changes: 48 additions & 0 deletions src/it/rpm-dependency-based-requires/rpm-rpm/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>org.codehaus.mojo.rpm.its</groupId>
<artifactId>rpm-dependency-based-requires-rpm-rpm</artifactId>
<version>1.0</version>
<packaging>rpm</packaging>

<inceptionYear>2009</inceptionYear>
<organization>
<name>my org</name>
<url>www.my.org</url>
</organization>

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

<dependencies>
<dependency>
<groupId>org.codehaus.mojo.rpm.its</groupId>
<artifactId>rpm-dependency-based-requires-rpm-dep</artifactId>
<version>8.1</version>
<type>rpm</type>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rpm-maven-plugin</artifactId>
<version>@pom.version@</version>
<extensions>true</extensions>
<configuration>
<distribution>My App</distribution>
<group>Application/Collectors</group>
<release>rel</release>
<needarch>false</needarch>
<defaultUsername>myuser</defaultUsername>
<defaultGroupname>mygroup</defaultGroupname>
<addDependencyBasedRequires>true</addDependencyBasedRequires>
</configuration>
</plugin>
</plugins>
</build>
</project>
10 changes: 10 additions & 0 deletions src/it/rpm-dependency-based-requires/verify.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
File rpm = new File(basedir, "rpm-rpm/target/rpm/rpm-dependency-based-requires-rpm-rpm/RPMS/noarch/rpm-dependency-based-requires-rpm-rpm-1.0-rel.noarch.rpm")
if (!rpm.exists())
throw new AssertionError("rpm file does not exist: ${rpm.getAbsolutePath()}")

def proc = ["rpm", "-qpR", rpm.getAbsolutePath()].execute()
proc.waitFor()
if (!proc.in.text.contains("rpm-dependency-based-requires-rpm-dep >= 8.1-rel"))
throw new AssertionError("Dependency to rpm-dependency-based-requires-rpm-dep missing!")

return true

0 comments on commit 093b403

Please sign in to comment.