xlsx-matchers

Elegant object-oriented hamcrest matchers for Apache POI.

License

License

${project.licence}
GroupId

GroupId

io.github.dgroup
ArtifactId

ArtifactId

xlsx-matchers
Last Version

Last Version

0.2.1
Release Date

Release Date

Type

Type

jar
Description

Description

xlsx-matchers
Elegant object-oriented hamcrest matchers for Apache POI.
Project URL

Project URL

http://github.com/dgroup/xlsx-matchers
Source Code Management

Source Code Management

http://github.com/dgroup/xlsx-matchers/tree/master

Download xlsx-matchers

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.dgroup/xlsx-matchers/ -->
<dependency>
    <groupId>io.github.dgroup</groupId>
    <artifactId>xlsx-matchers</artifactId>
    <version>0.2.1</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.dgroup/xlsx-matchers/
implementation 'io.github.dgroup:xlsx-matchers:0.2.1'
// https://jarcasting.com/artifacts/io.github.dgroup/xlsx-matchers/
implementation ("io.github.dgroup:xlsx-matchers:0.2.1")
'io.github.dgroup:xlsx-matchers:jar:0.2.1'
<dependency org="io.github.dgroup" name="xlsx-matchers" rev="0.2.1">
  <artifact name="xlsx-matchers" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.dgroup', module='xlsx-matchers', version='0.2.1')
)
libraryDependencies += "io.github.dgroup" % "xlsx-matchers" % "0.2.1"
[io.github.dgroup/xlsx-matchers "0.2.1"]

Dependencies

provided (4)

Group / Artifact Type Version
org.cactoos : cactoos jar 0.42
org.llorllale : cactoos-matchers jar 0.17
org.apache.poi : poi jar 3.14
org.apache.poi : poi-ooxml jar 3.14

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
com.tngtech.java : junit-dataprovider jar 1.13.1

Project Modules

There are no modules declared in this project.

Maven Javadocs License: MIT Commit activity Hits-of-Code

Build Status 0pdd Dependencies Status Known Vulnerabilities

DevOps By Rultor.com EO badge We recommend IntelliJ IDEA

Qulice SQ maintainability Codebeat Codacy Badge Codecov

What it is

xlsx-matchers is an elegant object-oriented hamcrest matchers for Apache POI.

Principles

Design principles behind xlsx-matchers.

How to use

Get the latest version here:

<dependency>
    <groupId>io.github.dgroup</groupId>
    <artifactId>xlsx-matchers</artifactId>
    <version>${version}</version>
</dependency>

Java version required: 1.8+.

All examples below are using the following frameworks/libs:

  • Hamcrest - Library of matchers, which can be combined in to create flexible expressions of intent in tests.
  • cactoos - Object-Oriented Java primitives, as an alternative to Google Guava and Apache Commons.
  • cactoos-matchers - Object-Oriented Hamcrest matchers

HasCells

Ensure that particular Apache POI row has cells with the required data:

// Testing prerequisites
final XSSFRow row = new XSSFWorkbook().createSheet().createRow(1);
final XSSFCell name = row.createCell(0);
name.setCellValue("Name");
final XSSFCell birth = row.createCell(1);
birth.setCellValue("Birth");
final XSSFCell phone = row.createCell(2);
phone.setCellValue("Phone");
// Testing ...
MatcherAssert.assertThat(
    "The mather matches row with all required cells",
    row,
    new HasCells<>(
        new CellOf<>(0, "Name"),
        new CellOf<>(1, "Birth"),
        new CellOf<>(2, "Phone")
    )
);
// or in cactoos-matchers way
new Assertion<>(
    "The mather matches row with all required cells",
    row,
    new HasCells<>(
        new CellOf<>(0, "Name"),
        new CellOf<>(1, "Birth"),
        new CellOf<>(2, "Phone")
    )
).affirm();

Versions

Version
0.2.1
0.2.0
0.1.0