hamcrest-mutliline-text-matcher
This project provides a Hamcrest matcher that gives you better diagnostics for multi-line text in case of mismatches.
In a Nutshell
import static org.itsallcode.matcher.MultilineTextMatcher.matchesAllLines;
public class TestSomeText {
@Test
public void testMatchesAllLines() {
assertThat("foo\nbar", MultilineTextMatcher.matchesAllLines("foo", "bar"));
}
}
Features
This matcher provides the following features:
- Reports mismatches in the number of lines
- Marks where in the text a mismatch is found
- Makes invisible characters visible (CR, LF, TAB)
Information for Developers
Dependencies
Runtime Dependencies
The Hamcrest Multiline Text Matcher requires Java 11 to run.
Test Dependencies
Test Dependencies
Dependency | Purpose | License |
---|---|---|
Apache Maven | Build tool | Apache License 2.0 |
Java Hamcrest | Checking for conditions in code via matchers | BSD License |
JUnit | Unit testing framework | Eclipse Public License 1.0 |
Maven Plug-ins
Plug-in | Purpose | License |
---|---|---|
License Maven Plugin | Adding license information to source files | LGPL3 |
Maven Compiler Plugin | Setting required Java version | Apache License 2.0 |
Maven Enforcer Plugin | Controlling environment constants | Apache License 2.0 |
Maven Failsafe Plugin | Integration testing | Apache License 2.0 |
Maven Jacoco Plugin | Code coverage metering | Eclipse Public License 2.0 |
Maven Javadoc Plugin | Create JAR archive with Javadoc | Apache License 2.0 |
Maven Source Plugin | Create JAR archive with source code | Apache License 2.0 |
Maven Surefire Plugin | Unit testing | Apache License 2.0 |
OSS Index Maven Plugin | Checking Dependencies Vulnerability | ASL2 |
Versions Maven Plugin | Checking if dependencies updates are available | Apache License 2.0 |
Development
Generate / update license file header
mvn license:update-file-header
Run local sonar analysis
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.organization=itsallcode \
-Dsonar.login=[token]
See analysis results at https://sonarcloud.io/dashboard?id=org.itsallcode%3Ahamcrest-mutliline-text-matcher
Check for updated dependencies / plugins
mvn versions:display-dependency-updates
mvn versions:display-plugin-updates
Publishing to JCenter
-
Add the following to your
~/.m2/settings.xml
:<settings> <servers> <server> <id>ossrh</id> <username>your-jira-id</username> <password>your-jira-pwd</password> </server> </servers> <profiles> <profile> <id>ossrh</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <gpg.executable>gpg</gpg.executable> <gpg.passphrase>the_pass_phrase</gpg.passphrase> </properties> </profile> </profiles> </settings>
-
Checkout the
master
branch. -
Update version in
pom.xml
, commit and push. -
Run command
mvn -DskipSigningArtifacts=false clean deploy
-
Create a release of the
master
branch on GitHub. -
After some time the release will be available at Maven Central.