Skip to content

marschall/junit4-jfr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JUnit 4 JFR Maven Central Javadocs

A JUnit extension that generates JFR events.

<dependency>
  <groupId>com.github.marschall</groupId>
  <artifactId>junit4-jfr</artifactId>
  <version>0.1.0</version>
  <scope>test</scope>
</dependency>

Requires Java 11 based on OpenJDK.

Flight Recording of a JUnit Test

If you can migrate to JUnit 5 and marschall/junit-jfr as it offers much higher fidelity.

Usage

  • Add a JfrMethodRule to your unit test class, see JfrMethodRuleTest for and example.
  • Generate a flight recording from your unit tests, eg using
-XX:StartFlightRecording:filename=recording.jfr
-XX:FlightRecorderOptions:stackdepth=128
public class ProfiledTest {

  @Rule
  public JfrMethodRule jfr = new JfrMethodRule();

  @Test
  public void testMethod() {
    // implementation
  }

}

About

a JUnit 4 extension that generates JFR events

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages