Skip to content
This repository has been archived by the owner on Jan 15, 2023. It is now read-only.

Missing class com.aventstack.extentreports.gherkin.model.Angenommen #58

Closed
buekera opened this issue Jul 25, 2017 · 14 comments
Closed

Missing class com.aventstack.extentreports.gherkin.model.Angenommen #58

buekera opened this issue Jul 25, 2017 · 14 comments

Comments

@buekera
Copy link

buekera commented Jul 25, 2017

I just updated to version 3.0.1 and ExtentReport 3.0.6 and suddenly get an error.

I need to point out that I'm using the german classes for implementing the steps. That's why the missing class is "Angenommen", which means "Given".

I'm aware that the error may not have anything to do with your work @email2vimalraj but I'd like to post it anyway.

Here the full stacktrace:

java.lang.ClassNotFoundException: com.aventstack.extentreports.gherkin.model.Angenommen
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at com.aventstack.extentreports.GherkinKeyword.<init>(GherkinKeyword.java:46)
	at com.cucumber.listener.ExtentCucumberFormatter.match(ExtentCucumberFormatter.java:228)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at cucumber.runtime.Utils$1.call(Utils.java:37)
	at cucumber.runtime.Timeout.timeout(Timeout.java:13)
	at cucumber.runtime.Utils.invoke(Utils.java:31)
	at cucumber.runtime.RuntimeOptions$1.invoke(RuntimeOptions.java:290)
	at com.sun.proxy.$Proxy6.match(Unknown Source)
	at cucumber.runtime.Runtime.runStep(Runtime.java:278)
	at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
	at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
	at cucumber.runtime.model.CucumberScenario.runBackground(CucumberScenario.java:59)
	at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:42)
	at cucumber.runtime.model.CucumberScenarioOutline.run(CucumberScenarioOutline.java:46)
	at cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:165)
	at cucumber.runtime.Runtime.run(Runtime.java:121)
	at cucumber.api.cli.Main.run(Main.java:36)
	at cucumber.api.cli.Main.main(Main.java:18)
Exception in thread "main" java.lang.NullPointerException
	at com.cucumber.listener.ExtentCucumberFormatter.result(ExtentCucumberFormatter.java:191)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at cucumber.runtime.Utils$1.call(Utils.java:37)
	at cucumber.runtime.Timeout.timeout(Timeout.java:13)
	at cucumber.runtime.Utils.invoke(Utils.java:31)
	at cucumber.runtime.RuntimeOptions$1.invoke(RuntimeOptions.java:290)
	at com.sun.proxy.$Proxy6.result(Unknown Source)
	at cucumber.runtime.Runtime.runStep(Runtime.java:309)
	at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
	at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
	at cucumber.runtime.model.CucumberScenario.runBackground(CucumberScenario.java:59)
	at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:42)
	at cucumber.runtime.model.CucumberScenarioOutline.run(CucumberScenarioOutline.java:46)
	at cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:165)
	at cucumber.runtime.Runtime.run(Runtime.java:121)
	at cucumber.api.cli.Main.run(Main.java:36)
	at cucumber.api.cli.Main.main(Main.java:18)
@anshooarora
Copy link
Contributor

We can introduce a mapper in the API which would allow you to use different languages with the existing classes (And, Given) etc. I will share a sample soon.

@anshooarora
Copy link
Contributor

@anshooarora
Copy link
Contributor

anshooarora commented Aug 15, 2017

Hello. Can you please test with this branch: https://github.com/anshooarora/extentreports-java/tree/cucumber-spoken-languages? You will have to add the below statement to your setup:

extent.setGherkinDialect("de");

Once functional, this will merge with master for 3.0.7.

anshooarora added a commit to anshooarora/extentreports-java that referenced this issue Aug 15, 2017
adds ability to specific GherkinDialect
pom adds new dependency: gson
extent setGherkinDialect(..)
anshooarora added a commit to anshooarora/extentreports-java that referenced this issue Aug 15, 2017
adds tests
adds docs
+ a few minor fixes
@buekera
Copy link
Author

buekera commented Aug 21, 2017

I will test it within the next few days, thanks alot!

@buekera
Copy link
Author

buekera commented Sep 8, 2017

Hey @anshooarora , I finally have time to look into this issue.
How do I test this specific branch in my gradle setup?

@anshooarora
Copy link
Contributor

This issue is now fixed and will be part of 3.0.7. The release should be available in nexus/maven/gradle in the next hour or so. I will update the documentation and changelog tonight.

@buekera
Copy link
Author

buekera commented Sep 15, 2017

Cool, sounds very promising! Thanks for taking care about this kind of niche issue!

@buekera
Copy link
Author

buekera commented Nov 16, 2017

Thanks, everything is working as intended now! 👍

@buekera buekera closed this as completed Nov 16, 2017
@thomasdeurloo
Copy link

thomasdeurloo commented Nov 9, 2018

Hi, Gherkin also supports an asterisk "*" to use as a keyword instead of given,when,then. But when i use the asterisk i get te same error:

java.lang.ClassNotFoundException: com.aventstack.extentreports.gherkin.model.*
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)

I am running as a cucumber plugin so at this point i dont have a exentreportsobject to set the dialect on.

Using version 3.1.1 and extentreports 3.1.5. Or do I need to configure something?
Thanks in advance!

@foursyth
Copy link

foursyth commented Nov 9, 2018

Have you set the gherkin dialect to the correct language code?

@foursyth
Copy link

foursyth commented Nov 9, 2018

Oh, ignore my previous comment. I was looking at the subject. An asterisk I believe is not supported. What will an asterisk convert to?

@thomasdeurloo
Copy link

An asterisk can be used instead of Given, Then, When, And, But; to specify a step where the keyword is irrelevant. If i understand the above mentioned json file correctly that is also what is intended here with the asteriskses in every dialect, for example:
"en-pirate": {
"and": [
"* ",
"Aye "
],
"but": [
"* ",
"Avast! "
]

The asteriks does not necessarily have to convert into anything (if i understand your question right). It would be ok if it gets passed and parsed to the report as an asterisk. But indeed, it won't point to valid model in the report at the moment

@anshooarora
Copy link
Contributor

Support for asterisk is added in version 4.0.1-SNAPSHOT. The release version will be available in a few days.

@thomasdeurloo
Copy link

Great!, thanks! i'll check it out.

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

No branches or pull requests

4 participants