How can I can run a particular test class

66 views
Skip to first unread message

paras santra

unread,
Aug 10, 2022, 4:31:25 PM8/10/22
to GraphWalker
Suppose I have
A.java
B.java

I want to run B.java

also how can I use inculde 
exclude 
groups
from mvn graphwalker:test

arzace20

unread,
Aug 18, 2022, 10:59:35 AM8/18/22
to GraphWalker

To be specific, if there are multiple test json files that we want to support which test different scenarios, is there way to do that in a single project?
ie. for the PetClinic project, if we want to have one .json that just traverses across Home and Find Owners, and another .json that just traverses across Home and Veterinarian, is there a way to execute those jsons separately?

Also, TestMojo.java has these parameters called include, exclude, and groups. But there's no documentation that I could find for usage of these parameters. Can you provide these? @kristian

Анатолий Цой

unread,
Aug 30, 2023, 5:40:23 AM8/30/23
to GraphWalker
hi there! Have you managed to solve the problem? 

четверг, 18 августа 2022 г. в 16:59:35 UTC+2, arzace20:

Byron Shank

unread,
Sep 25, 2023, 10:13:51 PM9/25/23
to GraphWalker
Hello,

I too am new to GraphWalker and I have found a couple of ways to do this.

For a very basic test with multiple potential paths, I used guard conditions combined with 'reached edge' or 'reached vertex' stop conditions in my path generator. Using the INIT: keyword on my starting vertex, I control which path gets walked in my tests by passing parameters through the test suite. (I use parameters and annotations provided by the TestNG library to control each path. Also, to be clear this was a proof of concept test with one graph and multiple paths like a tree graph, not one test with multiple models but I have succeeded in using multiple models as described next.)

The second way I have done this is to create separate model files for each of the components. Using the SHARED: attribute the INIT: attribute and more granular conditions for path guards, I can now write my test to include multiple execution contexts.
There is an example of that here: MultipleModelTest.java

BTW I use yEd to draw my models instead of GraphWalker Studio which means my model files are .graphml instead of .json. I think though it is still possible to do what I have described using GraphWalker Studio. A quick review of the newest UI tells me that the guards and other keyword attributes are accounted for and available to you. The absolute key for success in accomplishing what I had hoped with GraphWalker was understanding Global Attributes and Keywords as applied to @Edges and @Vertices. The linked document is an explanation using yEd, but it is clear and immediately applicable to creating and editing graphs in GraphWalker Studio.

I hope this helps you!

Best regards,

Byron
Reply all
Reply to author
Forward
0 new messages