Skip to content

Commit

Permalink
add test for packaging webresources (jenkinsci#213)
Browse files Browse the repository at this point in the history
#JENKINS-64408
  • Loading branch information
sephiroth-j authored Jul 17, 2021
1 parent 1c89ecc commit 95ebd58
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
invoker.goals=-Dstyle.color=always -ntp clean package
51 changes: 51 additions & 0 deletions src/it/JENKINS-64408-packaged-webresources/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?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>
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.15</version>
</parent>
<groupId>org.jenkins-ci.tools.hpi.its</groupId>
<artifactId>JENKINS-64408-packaged-webresources</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>hpi</packaging>
<properties>
<java.level>8</java.level>
<hpi-plugin.version>@project.version@</hpi-plugin.version>
</properties>

<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>

<build>
<plugins>
<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<configuration>
<webResources>
<resource>
<directory>src/main/webapp2</directory>
<targetPath>dir-within-hpi</targetPath>
<includes>
<include>non-standard-resource-in-subdir.txt</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?jelly escape-by-default='true'?>
<div/>
Empty file.
9 changes: 9 additions & 0 deletions src/it/JENKINS-64408-packaged-webresources/verify.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
assert new File(basedir, 'target/JENKINS-64408-packaged-webresources/WEB-INF/lib').listFiles().length == 1
assert new File(basedir, 'target/JENKINS-64408-packaged-webresources/WEB-INF/lib/JENKINS-64408-packaged-webresources.jar').exists()
assert new File(basedir, 'target/JENKINS-64408-packaged-webresources/standard-resource.txt').exists()
assert !new File(basedir, 'target/JENKINS-64408-packaged-webresources/non-standard-resource-in-subdir.txt').exists()
assert new File(basedir, 'target/JENKINS-64408-packaged-webresources/dir-within-hpi').exists()
assert new File(basedir, 'target/JENKINS-64408-packaged-webresources/dir-within-hpi').listFiles().length == 1
assert new File(basedir, 'target/JENKINS-64408-packaged-webresources/dir-within-hpi/non-standard-resource-in-subdir.txt').exists()

return true

0 comments on commit 95ebd58

Please sign in to comment.