Merge branch 'master' into dependabot/maven/org.eluder.coveralls-coveralls-maven-plugin-4.3.0
This commit is contained in:
commit
462361a3f8
8 changed files with 208 additions and 102 deletions
49
.gitignore
vendored
49
.gitignore
vendored
|
@ -1,48 +1,3 @@
|
||||||
# Package Files #
|
.idea/
|
||||||
*.jar
|
*.iml
|
||||||
*.war
|
|
||||||
*.ear
|
|
||||||
|
|
||||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
|
||||||
hs_err_pid*
|
|
||||||
|
|
||||||
# maven build outputs
|
|
||||||
target/
|
target/
|
||||||
|
|
||||||
# netbeans legacy
|
|
||||||
nbproject/
|
|
||||||
nbactions.xml
|
|
||||||
|
|
||||||
# eclipse legacy
|
|
||||||
.project
|
|
||||||
|
|
||||||
# intellij
|
|
||||||
.idea/libraries/
|
|
||||||
.idea/workspace.xml
|
|
||||||
.idea/uiDesigner.xml
|
|
||||||
.idea/compiler.xml
|
|
||||||
.idea/misc.xml
|
|
||||||
.idea/checkstyle.xml
|
|
||||||
.idea/artifacts/
|
|
||||||
.idea/dataSources*
|
|
||||||
.idea/tasks.xml
|
|
||||||
.idea/dictionaries/
|
|
||||||
.idea/shelf/
|
|
||||||
.idea/dynamic.xml
|
|
||||||
.idea/sqlDataSources.xml
|
|
||||||
.idea/gradle.xml
|
|
||||||
.idea/mongoSettings.xml
|
|
||||||
|
|
||||||
# Spring
|
|
||||||
spring.log
|
|
||||||
logs/
|
|
||||||
/application.properties
|
|
||||||
/bootstrap.properties
|
|
||||||
|
|
||||||
# Composer-style
|
|
||||||
vendor
|
|
||||||
|
|
||||||
# Git and temp files
|
|
||||||
*.orig
|
|
||||||
*.patch
|
|
||||||
*~
|
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
language: java
|
language: java
|
||||||
jdk:
|
jdk:
|
||||||
- oraclejdk8
|
- oraclejdk8
|
||||||
after_success:
|
cache:
|
||||||
- mvn clean test jacoco:report coveralls:report
|
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"?>
|
<?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">
|
<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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<groupId>net.kemitix</groupId>
|
<groupId>net.kemitix</groupId>
|
||||||
<artifactId>wiser-assertions</artifactId>
|
<artifactId>wiser-assertions</artifactId>
|
||||||
|
|
||||||
<version>0.4.0</version>
|
<version>0.4.0</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
@ -24,14 +34,12 @@
|
||||||
<url>git@github.com:kemitix/wiser-assertions.git</url>
|
<url>git@github.com:kemitix/wiser-assertions.git</url>
|
||||||
</scm>
|
</scm>
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>net.kemitix</groupId>
|
|
||||||
<artifactId>kemitix-parent</artifactId>
|
|
||||||
<version>1.2.0</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<properties>
|
<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>
|
<javax-mail.version>1.4.7</javax-mail.version>
|
||||||
<subethasmtp.version>3.1.7</subethasmtp.version>
|
<subethasmtp.version>3.1.7</subethasmtp.version>
|
||||||
<junit.version>4.12</junit.version>
|
<junit.version>4.12</junit.version>
|
||||||
|
@ -39,6 +47,10 @@
|
||||||
<simple-java-mail.version>3.1.1</simple-java-mail.version>
|
<simple-java-mail.version>3.1.1</simple-java-mail.version>
|
||||||
<spring-framework.version>4.2.6.RELEASE</spring-framework.version>
|
<spring-framework.version>4.2.6.RELEASE</spring-framework.version>
|
||||||
<coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version>
|
<coveralls-maven-plugin.version>4.3.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>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
@ -85,6 +97,19 @@
|
||||||
<artifactId>coveralls-maven-plugin</artifactId>
|
<artifactId>coveralls-maven-plugin</artifactId>
|
||||||
<version>${coveralls-maven-plugin.version}</version>
|
<version>${coveralls-maven-plugin.version}</version>
|
||||||
</plugin>
|
</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>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</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;
|
package net.kemitix.wiser.assertions;
|
||||||
|
|
||||||
import org.subethamail.wiser.Wiser;
|
import org.subethamail.wiser.Wiser;
|
||||||
|
@ -47,6 +68,7 @@ import javax.mail.internet.MimeMultipart;
|
||||||
* </code>
|
* </code>
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("methodcount")
|
||||||
public final class WiserAssertions {
|
public final class WiserAssertions {
|
||||||
|
|
||||||
private static final String ERROR_MESSAGE_SUBJECT
|
private static final String ERROR_MESSAGE_SUBJECT
|
||||||
|
@ -250,6 +272,7 @@ public final class WiserAssertions {
|
||||||
* @throws IOException if error extracting the mime message
|
* @throws IOException if error extracting the mime message
|
||||||
* @throws MessagingException if the message type is not known
|
* @throws MessagingException if the message type is not known
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("npathcomplexity")
|
||||||
private String getMimeMessageBody(final WiserMessage message)
|
private String getMimeMessageBody(final WiserMessage message)
|
||||||
throws IOException, MessagingException {
|
throws IOException, MessagingException {
|
||||||
Object content = getMimeMessage(message).getContent();
|
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
|
* Provides {@link WiserAssertions} to check for messages received by the Wiser
|
||||||
* SMTP test server from subethamail.
|
* 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;
|
package net.kemitix.wiser.assertions;
|
||||||
|
|
Loading…
Reference in a new issue