Skip to content

dgroup/xlsx-matchers

Repository files navigation

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

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();

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy