Search⌘ K
AI Features

Discover and Execute Tests

Understand how JUnit Platform discovers tests using selectors and filters through the TestEngine's discover method, manages test descriptors in a tree structure, and executes tests with the execute method. Learn about configuring discovery requests, filtering by class or package names, and handling test execution events with listeners.

We'll cover the following...

Discover tests

The TestEngine method discover is responsible for discovering tests.

  • The first parameter of the EngineDiscoveryRequest type represents the requests to discover tests.
  • The second parameter of type UniqueId should be used as the unique ID of the returned root, TestDescriptor.

An EngineDiscoveryRequest consists of selectors and filters.Selectors select resources to discover tests, while filters filter resources. Selectors should implement the DiscoverySelector interface, and filters should implement ...