Coder Social home page Coder Social logo

dgroup / xlsx-matchers Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 0.0 96 KB

Elegant object-oriented hamcrest matchers for Apache POI

License: MIT License

Shell 0.44% Java 99.56%
hamcrest hamcrest-matchers excel poi apache-poi java unit-testing testing elegantobjects tdd

xlsx-matchers's Introduction

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

xlsx-matchers's People

Contributors

dgroup avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

xlsx-matchers's Issues

java.lang.IllegalStateException: The maximum number of Cell Styles was exceeded. You can define up to 64000 style in a .xlsx Workbook

java.lang.IllegalStateException: The maximum number of Cell Styles was exceeded. You can define up to 64000 style in a .xlsx Workbook
        at org.apache.poi.xssf.model.StylesTable.createCellStyle(StylesTable.java:789)
        at org.apache.poi.xssf.usermodel.XSSFWorkbook.createCellStyle(XSSFWorkbook.java:682)
        at io.github.dgroup.xlsx.cell.CellOf.lambda$new$3(CellOf.java:110)
        at org.cactoos.func.UncheckedFunc.lambda$apply$0(UncheckedFunc.java:56)
        at org.cactoos.scalar.Checked.value(Checked.java:76)
        at org.cactoos.scalar.IoChecked.value(IoChecked.java:63)
        at org.cactoos.scalar.Unchecked.value(Unchecked.java:56)
        at org.cactoos.func.UncheckedFunc.apply(UncheckedFunc.java:57)
        at io.github.dgroup.xlsx.cell.Change.exec(Change.java:86)
        at io.github.dgroup.xlsx.cell.Change.exec(Change.java:47)
        at org.cactoos.func.CheckedProc.lambda$exec$0(CheckedProc.java:63)
        at org.cactoos.scalar.Checked.value(Checked.java:76)
        at org.cactoos.func.CheckedProc.exec(CheckedProc.java:67)
        at org.cactoos.func.IoCheckedProc.exec(IoCheckedProc.java:58)
        at org.cactoos.func.UncheckedProc.exec(UncheckedProc.java:56)
        at io.github.dgroup.xlsx.cell.CellOf.change(CellOf.java:180)
        at io.github.dgroup.xlsx.row.RowOf.change(RowOf.java:93)
    

pom.xml:33: 112 qulice violations to be fixed -->

The puzzle DEV-4ee84fa2 from #DEV has to be resolved:

<!-- @todo #/DEV 112 qulice violations to be fixed -->

The puzzle was created by @dgroup on 15-Dec-19.

role: DEV.

If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.

.rultor.yml:7: Enable Rultor for project.

The puzzle DEV-053de3aa from #DEV has to be resolved:

# @todo #/DEV Enable Rultor for project.

The puzzle was created by @dgroup on 15-Dec-19.

role: DEV.

If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.

.rultor.yml:9-16: Configure the deployment to staging...

The puzzle DEV-04774ad8 from #DEV has to be resolved:

# @todo #/DEV Configure the deployment to staging environment in order to work with RC
# https://help.sonatype.com/repomanager2/staging-releases/staging-overview
# https://help.sonatype.com/repomanager2/staging-releases/configuring-your-project-for-deployment
# https://nvie.com/posts/a-successful-git-branching-model
# https://github.com/nvie/gitflow
# https://gist.github.com/lemiorhan/97b4f827c08aed58a9d8
# https://github.com/jgitver/jgitver
# https://danielkummer.github.io/git-flow-cheatsheet/index.html

The puzzle was created by @dgroup on 15-Dec-19.

role: DEV.

If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.

pom.xml:112: Upgrade the hamcrest-all library to the...

The puzzle DEV-65a70c0d from #DEV has to be resolved:

<!-- @todo #/DEV Upgrade the hamcrest-all library to the latest release of hamcrest-java -->

The puzzle was created by @dgroup on 15-Dec-19.

role: DEV.

If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.

pom.xml:35: Cleanup readme.md -->

The puzzle DEV-8182bd15 from #DEV has to be resolved:

<!-- @todo #/DEV Cleanup readme.md -->

The puzzle was created by @dgroup on 15-Dec-19.

role: DEV.

If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.

pom.xml:146: Activate de.thetaphi:forbiddenapis in order...

The puzzle DEV-08faa53a from #DEV has to be resolved:

<!-- @todo #/DEV Activate de.thetaphi:forbiddenapis in order to forbid the usage of forbidden API like static matchers, etc -->

The puzzle was created by @dgroup on 15-Dec-19.

role: DEV.

If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.