Merge branch 'master' into update-gitignore
This commit is contained in:
commit
5cb697e51c
7 changed files with 206 additions and 55 deletions
|
@ -1,5 +1,8 @@
|
|||
language: java
|
||||
jdk:
|
||||
- oraclejdk8
|
||||
after_success:
|
||||
- mvn clean test jacoco:report coveralls:report
|
||||
cache:
|
||||
directories:
|
||||
- "$HOME/.m2"
|
||||
install: true
|
||||
script: "mvn -B -U clean install"
|
||||
|
|
104
Jenkinsfile.groovy
Normal file
104
Jenkinsfile.groovy
Normal file
|
@ -0,0 +1,104 @@
|
|||
final String publicRepo = 'https://github.com/kemitix/'
|
||||
final String mvn = "mvn --batch-mode --update-snapshots --errors"
|
||||
final dependenciesSupportJDK = 10
|
||||
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage('Build & Test') {
|
||||
steps {
|
||||
withMaven(maven: 'maven', jdk: 'JDK 1.8') {
|
||||
sh "${mvn} clean compile checkstyle:checkstyle pmd:pmd test"
|
||||
// PMD to Jenkins
|
||||
pmd canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '', unHealthy: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Report Coverage') {
|
||||
steps {
|
||||
withMaven(maven: 'maven', jdk: 'JDK 1.8') {
|
||||
// Code Coverage to Jenkins
|
||||
jacoco exclusionPattern: '**/*{Test|IT|Main|Application|Immutable}.class'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Report Checkstyle') {
|
||||
steps {
|
||||
withMaven(maven: 'maven', jdk: 'JDK 1.8') {
|
||||
// Checkstyle to Jenkins
|
||||
step([$class: 'hudson.plugins.checkstyle.CheckStylePublisher',
|
||||
pattern: '**/target/checkstyle-result.xml',
|
||||
healthy:'20',
|
||||
unHealthy:'100'])
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Verify & Install') {
|
||||
steps {
|
||||
withMaven(maven: 'maven', jdk: 'JDK 1.8') {
|
||||
sh "${mvn} -DskipTests install"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('SonarQube (published)') {
|
||||
when { expression { isPublished(publicRepo) } }
|
||||
steps {
|
||||
withSonarQubeEnv('sonarqube') {
|
||||
withMaven(maven: 'maven', jdk: 'JDK 1.8') {
|
||||
sh "${mvn} org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Deploy (published release branch)') {
|
||||
when {
|
||||
expression {
|
||||
(isReleaseBranch() &&
|
||||
isPublished(publicRepo) &&
|
||||
notSnapshot())
|
||||
}
|
||||
}
|
||||
steps {
|
||||
withMaven(maven: 'maven', jdk: 'JDK 1.8') {
|
||||
sh "${mvn} --activate-profiles release deploy"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Build Java 9') {
|
||||
when { expression { dependenciesSupportJDK >= 9 } }
|
||||
steps {
|
||||
withMaven(maven: 'maven', jdk: 'JDK 9') {
|
||||
sh "${mvn} clean verify -Djava.version=9"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Build Java 10') {
|
||||
when { expression { dependenciesSupportJDK >= 10 } }
|
||||
steps {
|
||||
withMaven(maven: 'maven', jdk: 'JDK 10') {
|
||||
sh "${mvn} clean verify -Djava.version=10"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isReleaseBranch() {
|
||||
return branchStartsWith('release/')
|
||||
}
|
||||
|
||||
private boolean branchStartsWith(final String branchName) {
|
||||
startsWith(env.GIT_BRANCH, branchName)
|
||||
}
|
||||
|
||||
private boolean isPublished(final String repo) {
|
||||
startsWith(env.GIT_URL, repo)
|
||||
}
|
||||
|
||||
private static boolean startsWith(final String value, final String match) {
|
||||
value != null && value.startsWith(match)
|
||||
}
|
||||
|
||||
private boolean notSnapshot() {
|
||||
return !(readMavenPom(file: 'pom.xml').version).contains("SNAPSHOT")
|
||||
}
|
22
LICENSE
22
LICENSE
|
@ -1,22 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Paul Campbell
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
20
LICENSE.txt
Normal file
20
LICENSE.txt
Normal file
|
@ -0,0 +1,20 @@
|
|||
/**
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2018 Paul Campbell
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
||||
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all copies
|
||||
* or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
|
||||
* AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
39
pom.xml
39
pom.xml
|
@ -1,8 +1,18 @@
|
|||
<?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/xsd/maven-4.0.0.xsd">
|
||||
|
||||
<parent>
|
||||
<groupId>net.kemitix</groupId>
|
||||
<artifactId>kemitix-parent</artifactId>
|
||||
<version>5.1.1</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>net.kemitix</groupId>
|
||||
<artifactId>wiser-assertions</artifactId>
|
||||
|
||||
<version>0.4.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
|
@ -24,14 +34,12 @@
|
|||
<url>git@github.com:kemitix/wiser-assertions.git</url>
|
||||
</scm>
|
||||
|
||||
<parent>
|
||||
<groupId>net.kemitix</groupId>
|
||||
<artifactId>kemitix-parent</artifactId>
|
||||
<version>1.2.0</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<tiles-maven-plugin.version>2.11</tiles-maven-plugin.version>
|
||||
<kemitix-tiles.version>0.9.0</kemitix-tiles.version>
|
||||
<kemitix-checkstyle.version>4.1.1</kemitix-checkstyle.version>
|
||||
<digraph-dependency.basePackage>net.kemitix.wiser.assertions</digraph-dependency.basePackage>
|
||||
|
||||
<javax-mail.version>1.4.7</javax-mail.version>
|
||||
<subethasmtp.version>3.1.7</subethasmtp.version>
|
||||
<junit.version>4.12</junit.version>
|
||||
|
@ -39,6 +47,10 @@
|
|||
<simple-java-mail.version>3.1.1</simple-java-mail.version>
|
||||
<spring-framework.version>4.2.6.RELEASE</spring-framework.version>
|
||||
<coveralls-maven-plugin.version>4.2.0</coveralls-maven-plugin.version>
|
||||
|
||||
<jacoco-class-line-covered-ratio>0</jacoco-class-line-covered-ratio>
|
||||
<jacoco-class-instruction-covered-ratio>0</jacoco-class-instruction-covered-ratio>
|
||||
<jacoco-class-missed-count-maximum>1</jacoco-class-missed-count-maximum>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
@ -85,6 +97,19 @@
|
|||
<artifactId>coveralls-maven-plugin</artifactId>
|
||||
<version>${coveralls-maven-plugin.version}</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>io.repaint.maven</groupId>
|
||||
<artifactId>tiles-maven-plugin</artifactId>
|
||||
<version>${tiles-maven-plugin.version}</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<tiles>
|
||||
<tile>net.kemitix.tiles:all:${kemitix-tiles.version}</tile>
|
||||
<tile>net.kemitix.checkstyle:tile:${kemitix-checkstyle.version}</tile>
|
||||
</tiles>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
|
@ -1,3 +1,24 @@
|
|||
/**
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2018 Paul Campbell
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
||||
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all copies
|
||||
* or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
|
||||
* AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.kemitix.wiser.assertions;
|
||||
|
||||
import org.subethamail.wiser.Wiser;
|
||||
|
@ -47,6 +68,7 @@ import javax.mail.internet.MimeMultipart;
|
|||
* </code>
|
||||
* </pre>
|
||||
*/
|
||||
@SuppressWarnings("methodcount")
|
||||
public final class WiserAssertions {
|
||||
|
||||
private static final String ERROR_MESSAGE_SUBJECT
|
||||
|
@ -250,6 +272,7 @@ public final class WiserAssertions {
|
|||
* @throws IOException if error extracting the mime message
|
||||
* @throws MessagingException if the message type is not known
|
||||
*/
|
||||
@SuppressWarnings("npathcomplexity")
|
||||
private String getMimeMessageBody(final WiserMessage message)
|
||||
throws IOException, MessagingException {
|
||||
Object content = getMimeMessage(message).getContent();
|
||||
|
|
|
@ -1,28 +1,26 @@
|
|||
/**
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2018 Paul Campbell
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
||||
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all copies
|
||||
* or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
|
||||
* AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Provides {@link WiserAssertions} to check for messages received by the Wiser
|
||||
* SMTP test server from subethamail.
|
||||
*
|
||||
* <p>
|
||||
* The MIT License.
|
||||
* <p>
|
||||
* Copyright 2015 pcampbell.
|
||||
* <p>
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
* <p>
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
* <p>
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package net.kemitix.wiser.assertions;
|
||||
|
|
Loading…
Reference in a new issue