GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - MacleZhou/datatable-java: [READ ONLY] Data Table for Java - subtree of monorepo https://github.com/cucumber/cucumber

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

256 Commits
256 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
datatable
datatable
 
 
matchers
matchers
 
 
scripts
scripts
 
 
.gitignore
.gitignore
 
 
.rsync
.rsync
 
 
.subrepo
.subrepo
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
default.mk
default.mk
 
 
maven-versions-rules.xml
maven-versions-rules.xml
 
 
pom.xml
pom.xml
 
 

Repository files navigation

Maven Central

Data Table for Java

For general information about data tables please refer to the polyglot project for specific information the DataTable javadoc.

Comparing data tables

The matchers module contains Hamcrest matchers to compare data tables. These can be used in most common test frameworks and produces pretty error messages.

Add the datatable-matchers dependency to your pom.

<dependencies>
  [...]
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>datatable-matchers</artifactId>
        <version>${cucumber-datatable.version}</version>
        <scope>test</scope>
    </dependency>
  [...]
</dependencies>

Use the matcher in your step definition.

import static io.cucumber.datatable.matchers.DataTableHasTheSameRowsAs.hasTheSameRowsAs;

[...]

private final DataTable expected = DataTable.create(
    asList(
        asList("Annie M. G.", "Schmidt"),
        asList("Roald", "Dahl"),
));
    
@Then("these authors have registered:")
public void these_authors_have_registered(DataTable registeredAuthors){
    assertThat(registeredAuthors, hasTheSameRowsAs(expected).inOrder());
    
    // java.lang.AssertionError: 
    // Expected: a datable with the same rows
    // but: the tables were different
    // - | Annie M. G. | Schmidt  |
    //   | Roald       | Dahl     |
    // + | Astrid      | Lindgren |
} 

Build

Not building?

We're using shaded dependencies in a reactor build so make sure you run mvn clean install the first time.

IntelliJ IDEA also doesn't know how to handle the shaded pom

  1. mvn install
  2. Open the 'Maven Projects' tool window.
  3. Choose "Shaded DataTable Dependencies" -> "Ignore Projects".
  4. Open Project Structure, choose the "DataTable" module, add jars, select dependencies/datatable-dependencies-....jar
  5. Select the top level pom.xml and choose "Maven" -> "Reimport".

About

[READ ONLY] Data Table for Java - subtree of monorepo https://github.com/cucumber/cucumber

Resources

Readme
License
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.