Skip to content

Testing asynchronous code with JUnit 4 #16

@xapn

Description

@xapn

How can one test methods that fire asynchronous processes with Junit? One wants to make a test wait for the process to end. It is not exactly an unit test, it is more like an integration test as it involves several classes and not just one.

To test this asynchronous code, one will use a count-down latch. One will also see that a count-down latch is more efficient than a notification.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions