Skip to content

Commit

Permalink
up to serenity 4.0.50 we used the SerenityReporterPlugin to extend it…
Browse files Browse the repository at this point in the history
… and provide tight integration betwene Tiger and Serenity. Now with the plugin being deprecated and the parallel plugin taking over we need protected access to a few methods. (#3528)

Co-authored-by: t.eitzenberger <[email protected]>
  • Loading branch information
eitzenbe and t.eitzenberger authored Sep 8, 2024
1 parent 1e51683 commit 6c1b871
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public class SerenityReporterParallel implements Plugin, ConcurrentEventListener
*/
private final Map<URI, ScenarioContextParallel> localContexts = Collections.synchronizedMap(new HashMap<>());

private ScenarioContextParallel getContext(URI featureURI) {
protected ScenarioContextParallel getContext(URI featureURI) {
synchronized (localContexts) {
return localContexts.computeIfAbsent(featureURI, uri -> new ScenarioContextParallel(featureURI));
}
Expand Down Expand Up @@ -146,7 +146,7 @@ private void initialiseListenersFor(URI featurePath) {
private final EventHandler<TestRunFinished> runFinishedHandler = this::handleTestRunFinished;
private final EventHandler<WriteEvent> writeEventHandler = this::handleWrite;

private void handleTestRunStarted(TestRunStarted event) {
protected void handleTestRunStarted(TestRunStarted event) {
LOGGER.debug("SRP:handleTestRunStarted {} ", Thread.currentThread());
}

Expand All @@ -162,7 +162,7 @@ public void setEventPublisher(EventPublisher publisher) {
publisher.registerHandlerFor(WriteEvent.class, writeEventHandler);
}

private void handleTestSourceRead(TestSourceRead event) {
protected void handleTestSourceRead(TestSourceRead event) {
LOGGER.debug("SRP:handleTestSourceRead {}", Thread.currentThread());
featureLoader.addTestSourceReadEvent(event);
URI featurePath = event.getUri();
Expand Down Expand Up @@ -198,7 +198,7 @@ private String relativeUriFrom(URI fullPathUri) {
}
}

private Optional<Feature> featureFrom(URI featureFileUri) {
protected Optional<Feature> featureFrom(URI featureFileUri) {

LOGGER.debug("Running feature from " + featureFileUri.toString());
if (!featureFileUri.toString().contains(FEATURES_ROOT_PATH) && !featureFileUri.toString().contains(FEATURES_CLASSPATH_ROOT_PATH)) {
Expand Down Expand Up @@ -238,7 +238,7 @@ private Story userStoryFrom(Feature feature, String featureFileUri) {
return userStory;
}

private void handleTestCaseStarted(TestCaseStarted event) {
protected void handleTestCaseStarted(TestCaseStarted event) {
try {
TestCase testCase = event.getTestCase();
LOGGER.debug("SRP:handleTestCaseStarted {} {} {} at line {}", testCase.getUri(), Thread.currentThread(),
Expand Down Expand Up @@ -344,7 +344,7 @@ private Feature getFeatureForTestCase(TestSourcesModel.AstNode astNode) {
return (Feature) astNode.node;
}

private void handleTestCaseFinished(TestCaseFinished event) {
protected void handleTestCaseFinished(TestCaseFinished event) {
LOGGER.debug("SRP:handleTestCaseFinished " + " " + event.getTestCase().getUri()
+ " " + Thread.currentThread() + " " + event.getTestCase().getId() + " at line " + event.getTestCase().getLocation().getLine());
URI featurePath = event.getTestCase().getUri();
Expand Down Expand Up @@ -444,7 +444,7 @@ private TestOutcome latestOf(List<TestOutcome> testOutcomes) {
return testOutcomes.get(testOutcomes.size() - 1);
}

private void handleTestStepStarted(TestStepStarted event) {
protected void handleTestStepStarted(TestStepStarted event) {
ZonedDateTime startTime = ZonedDateTime.now();
URI featurePath = event.getTestCase().getUri();
TestSourcesModel.AstNode mainAstNode = featureLoader.getAstNode(featurePath, event.getTestCase().getLocation().getLine());
Expand Down Expand Up @@ -497,7 +497,7 @@ public void handleWrite(WriteEvent event) {
getContext(featurePath).stepEventBus().stepFinished();
}

private void handleTestStepFinished(TestStepFinished event) {
protected void handleTestStepFinished(TestStepFinished event) {
LOGGER.debug("SRP:handleTestStepFinished " + " " + event.getTestCase().getUri() +
" " + Thread.currentThread() + " " + event.getTestCase().getId() +
" at line " + event.getTestCase().getLocation().getLine());
Expand All @@ -516,7 +516,7 @@ private void handleTestStepFinished(TestStepFinished event) {

}

private void handleTestRunFinished(TestRunFinished event) {
protected void handleTestRunFinished(TestRunFinished event) {
LOGGER.debug("SRP:handleTestRunFinished " + Thread.currentThread() + " " + contextURISet);

for (URI featurePath : contextURISet) {
Expand Down

0 comments on commit 6c1b871

Please sign in to comment.