- Overview
- Event flow
- How can I be notified when a new PIT application is launched?
- How do I listen for new PIT results?
- How do I listen for new PIT mutations results?
This folder defines Pitclipse's source plug-ins. Here is an overview of their purposes.
Bundle | Purpose |
---|---|
org.pitest |
Wraps Pitest JARs as an Eclipse plug-in |
org.pitest.pitest-junit5-plugin |
Wraps JARs of the pitest-junit5-plugin as an Eclipse plug-in |
org.pitest.pitclipse.core |
Defines extension points and handlers forwarding Pitest results to registered extensions. |
org.pitest.pitclipse.launch |
Provides a PIT Mutation launch configuration. |
org.pitest.pitclipse.launch.ui |
Integrates Pitclipse's launch configurations within Eclipse IDE's UI. |
org.pitest.pitclipse.listeners |
Fragment for org.pitest allowing Pitest to discover Pitclipse's mutation listeners. |
org.pitest.pitclipse.preferences.ui |
Provides a Pitclipse Preferences page. |
org.pitest.pitclipse.runner |
Allows to execute Pitest within an Eclipse runtime. |
org.pitest.pitclipse.ui |
Provides views to display Pitest's results. |
Here is an introduction to how Pitclipse works.
TODO: Insert a sequence diagram to make the flow clearer
- A new Pitest application is launched through an Eclipse Launch Configuration. This Launch Configuration executes Pitest in a background VM.
- See AbstractPitLaunchDelegate for the definition of the Launch Configuration
- See PitRunner which
main
method is executed within the background VM and actually launches PIT
- The Launch Configuration uses an instance of ExtensionPointHandler to inform listeners that a PIT application has been launched
- A PitExecutionNotifier is thus notified and launches a server in background to listen for PIT results
- Once PIT results are available, they are broadcasted through an ExtensionPointResultHandler
- A MutationsModelNotifier is thus notified; it extracts the information about detected information and then broadcast them
- The PIT Mutations and PIT Summary views are thus notified and updated with PIT results.
A new listener can be registered by contributing to the org.pitest.pitclipse.core.executePit
extension point. It only requires a class that implements the ResultNotifier<PitRuntimeOptions>
interface:
public class MyPitStartListener implements ResultNotifier<PitRuntimeOptions> {
@Override
public void handleResults(PitRuntimeOptions options) {
// process options...
}
}
A new listener can be registered by contributing to the org.pitest.pitclipse.core.results
extension point. It only requires a class that implements the ResultNotifier<PitResults>
interface:
public class MyPitResultsListener implements ResultNotifier<PitResults> {
@Override
public void handleResults(PitResults results) {
// process results...
}
}
A new listener can be registered by contributing to the org.pitest.pitclipse.core.mutations.results
extension point. It only requires a class that implements the ResultNotifier<MutationsModel>
interface:
public class MyPitMutationsResultsListener implements ResultNotifier<MutationsModel> {
@Override
public void handleResults(MutationsModel mutations) {
// process detected mutations...
}
}