Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AcceptanceTestFullReporter not available in release 3.1.1 #2915

Closed
xescuder opened this issue Sep 5, 2022 · 6 comments
Closed

AcceptanceTestFullReporter not available in release 3.1.1 #2915

xescuder opened this issue Sep 5, 2022 · 6 comments

Comments

@xescuder
Copy link

xescuder commented Sep 5, 2022

Hi.

We've used for several years a customized class that extends net.thucydides.core.reports.AcceptanceTestFullReporter to add some values in generated XUnit file from custom annotations in our tests. The generated files are synchronized with HP ALM (also for regulatory purposes).

The reporter class was easily defined in a META-INF/net.thucydides.core.reports.AcceptanceTestFullReporter file.

We've migrated to new versions of Serenity and it doesn't work anymore. It seems the class AcceptanceTestFullReporter is not available anymore, so we're stuck. We've seen the existence of class ExtendTestOutcomeAdaptorReporter that it seems very similar, but we don't find how to configure to use it with a custom class.

Thanks in advance.

@xescuder xescuder closed this as completed Sep 5, 2022
@xescuder xescuder reopened this Sep 5, 2022
@xescuder
Copy link
Author

xescuder commented Sep 5, 2022

Hi, @wakaleo. I closed the issue some minutes ago, but it's a mistake. It's an open issue.
Have you any advise, clue or example? Thanks a lot.

@wakaleo
Copy link
Member

wakaleo commented Sep 5, 2022

The AcceptanceTestFullReporter interface and the corresponding class loader code hasn't changed in over 4 years - maybe have a look at the ReportService class to see what is happening.

@xescuder
Copy link
Author

xescuder commented Sep 6, 2022

Thanks @wakaleo. Weird behaviour that also happened with another issue I opened related with step listeners. When I debug from IDE IntelliJ it works, but execution from Maven does not work, the code is not executed.

I've checked libraries and dependencies and everything seems correct. Do you know what is happening? (I've struggling several days with the other issue as well and I'm not able to see the problem).

Thanks a lot.

@wakaleo
Copy link
Member

wakaleo commented Sep 6, 2022

Hmmm, not sure. If it works in IntelliJ but not in Maven, it could be some kind of class loader issue perhaps?

@xescuder
Copy link
Author

xescuder commented Sep 6, 2022

Hi, @wakaleo. Thanks for the suggestion to look at ReportService. I've found where it fails:

public static List<AcceptanceTestFullReporter> getDefaultFullReporters() {
       ...
      ServiceLoader<AcceptanceTestFullReporter> reporterServiceLoader = ServiceLoader.load(AcceptanceTestFullReporter.class);
              Iterator<AcceptanceTestFullReporter> reporterImplementations = reporterServiceLoader.iterator();

        while (reporterImplementations.hasNext()) {
            AcceptanceTestFullReporter reporter = reporterImplementations.next();

At debugging with Maven I see next() is returning my class.

2022-09-06_12-21-49

But when it tries to get it and assign to reporter if throws an exception of java.util.NoSuchElementException, with this stack trace:

0 = {StackTraceElement@5661} "java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)"
1 = {StackTraceElement@5662} "java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)"
2 = {StackTraceElement@5663} "java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)"
3 = {StackTraceElement@5664} "java.base/java.lang.reflect.Method.invoke(Method.java:566)"
4 = {StackTraceElement@5665} "io.cucumber.java.Invoker.doInvoke(Invoker.java:66)"
5 = {StackTraceElement@5666} "io.cucumber.java.Invoker.invoke(Invoker.java:24)"
6 = {StackTraceElement@5667} "io.cucumber.java.AbstractGlueDefinition.invokeMethod(AbstractGlueDefinition.java:47)"
7 = {StackTraceElement@5668} "io.cucumber.java.JavaHookDefinition.execute(JavaHookDefinition.java:64)"
8 = {StackTraceElement@5669} "io.cucumber.core.runner.CoreHookDefinition.execute(CoreHookDefinition.java:46)"
9 = {StackTraceElement@5670} "io.cucumber.core.runner.HookDefinitionMatch.runStep(HookDefinitionMatch.java:21)"
10 = {StackTraceElement@5671} "io.cucumber.core.runner.ExecutionMode$1.execute(ExecutionMode.java:10)"
11 = {StackTraceElement@5672} "io.cucumber.core.runner.TestStep.executeStep(TestStep.java:85)"
12 = {StackTraceElement@5673} "io.cucumber.core.runner.TestStep.run(TestStep.java:57)"

I've checked that target test-classes has the class. So I don't know what's happening.

@xescuder
Copy link
Author

Solved with useModulePath set to false in failsafe plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants