LAB4: generate test source from json

+2 votes
asked Nov 20, 2019 in SWSV by csutorasr (33 points)  

I have done the first 3 task from the HW. When I should generate the test sources with mvn graphwalker:generate-test-sources the test is not created.

Some of my friends have done it before, and with the yEd tool it worked as intended.
I think the difference is the json and the graphml file format.

2 Answers

+1 vote
answered Nov 24, 2019 by csutorasr (33 points)  
Best answer

The solution is to run the command from the 3rd lab. That will change the java version to 1.8 and then works. (That will work on the SWSV VM of BME.)

sdk install java 8.0.232-zulu
sdk use java 8.0.232-zulu
java -version
0 votes
answered Nov 20, 2019 by micskeiz (2,873 points)  

The test file will not be created, it has to be created by you.

If you place the json model in the appropriate folder (wiper-test/test/resources), then generate-test-sources will create the interface from it inside target/generated-test-sources/graphwalker.

commented Nov 20, 2019 by csutorasr (33 points)  
I tried to create. I modified the json. `Failed to create ScriptEngine` is what I get, when I try the original file. If I try with the modified I get build success both for the validation and the generation. `wiper-test/target/generated-test-sources/graphwalker/` contains only `cache.json`. No folders.

This happens to me and for everyone I know and started the HW today.
commented Nov 24, 2019 by onba (29 points)  
In my case I found the original WiperModel.json in this path: '\wiper-test\src\test\resources\hu\bme\mit\swsv\'. I modified it, and run the 'mvn graphwalker:generate-test-sources' command. I got 'could not read resource' error. So I copied the file in the 'wiper-test\test\resources' path, and i got no error. But the generated interface doesnt appear in the right folder.
commented Nov 24, 2019 by ha00 (21 points)  
In my case I get the same 'Failed to create ScriptEngine' error for the original model json file as well. I tried it on local (windows) machine and cloud (linux) machine none of them worked. On windows it says: 'Could not read resource' on linux: 'Failed to create ScriptEngine'. (It does not work with modified model as well of course.)