Skip to content

Add a shared test-helper for the integration-tests module #54

Description

@dfa1

Background

The unit module shares fixtures via ZstdTestSupport / generators, but the integration-tests module is a separate Maven module and can't see those package-private test classes. So its three test files re-implement the same helpers:

  • random(Random, int) and compressible(Random, int) byte generators
  • the compression-levels array {min, 1, default, max}

Seen in:

  • integration-tests/.../it/ZstdJniInteropTest.java (e.g. payloadsAndLevels() ~L34-45)
  • integration-tests/.../it/ZstdInteropExtrasTest.java
  • integration-tests/.../it/GoldenCorpusTest.java

Task

Introduce one small package-private helper class in integration-tests/src/test/java/io/github/dfa1/zstd/it/ (e.g. ItTestSupport) holding the shared random/compressible/levels generators, and have the three test classes use it.

Note: keep it inside the integration-tests module — do not try to reuse the unit module's ZstdTestSupport (that would require publishing a test-jar, which is out of scope here).

Acceptance criteria

  • The duplicated generators live in one place; the three test files call it.
  • ./mvnw -pl integration-tests test stays green.

Pointers

  • integration-tests/src/test/java/io/github/dfa1/zstd/it/

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersjavaPull requests that update java code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions