-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
Add ability to parse test classes #16
Comments
@sunigos great improvement suggestion. Definitely worth looking into. |
@iluwatar : Can I work on this enhancement? |
Sure @sivasubramanim go ahead |
We can enable the ability to parse test classes with a simple change to the existing urm-maven project ->DomainMapperMojo class -> getClasspathUrls() method After this change, getClasspathUrls() method will return the target/classes url and target/test-classes url also. I tested the changes on a local project which has code in src/test/java and src/main/java and I am able to successfully generate the diagram. We should also modify the maven plugin parameter With these 2 changes, we can provide the ability to parse test classes for the urm-maven project. @iluwatar : Can you please let me know your thoughts on this? |
Thanks for looking into this. I think it would be good to have parameters for this. Whether the user wants to generate the diagrams from the |
Agreed @iluwatar . I will create two parameters namely |
Add ability to parse test classes
@iluwatar : I created a pull request with the changes for this enhancement. Please review it. |
@sivasubramanim looks good so far. Please add also the documentation to |
Thank you for reviewing my changes. I will make the necessary changes to the README.md file also. @iluwatar I feel the existing urm-core project can handle this scenario. Please let me know your thoughts. |
Good news if |
@iluwatar I will create a sample project and share the same with you on this regards in couple of days. |
Many thanks @sivasubramanim. I'm looking forward to it. |
@iluwatar I created two sample projects at https://github.com/sivasubramanim/UrmTester
Steps to Create Class Diagram using urm-core for Project which has only test classes:
Steps to Create Class Diagram using urm-core for Project which has both main and test classes as two seperate diagrams:
Steps to Create Class Diagram using urm-core for Project which has both main and test classes in one combined diagram:
As part of this sample i tried to cover all the possible use cases:
Please let me know your thoughts on this? |
Since we are using reflections for this class diagrams the expectation is that we need to have all the referenced/import classes in the JAR(JAR with dependencies). If we can build the JAR with dependencies urm-core will be able to generate the diagram. This applies to both src/main or src/test classes. |
Thanks for comprehensive testing @sivasubramanim I can confirm that everything with urm-core works as you wrote. If you can expand the |
@iluwatar The additional classes which you see are identified by the fieldscanner as edges of type static inner classes. Attaching a debug session screenshot on the same: As far as classes we got only the 4 classes but the remaining came up as part of the fieldscanner. |
I will update the README.md related to the changes we did to the urm-maven project. Can you please let me know if you are looking for any changes to the documentation related to urm-core project. |
Just updating the documentation related to the changes made in this pull request is enough. |
Add ability to parse test classes Updating README.md file
@iluwatar Updated the README.md document. |
Thank you @sivasubramanim for implementing this requested feature 😊 |
I work a lot with test automation and most of the code is located in
src/test/java
directory (maven structure).I want to create a class diagram for my testing project (it's pretty big and have more than 300 classes), but I can't use
uml-reverse-mapper
because it ignores classes insrc/test/java
and looks only insrc/main/java
It would be cool to add some attrubute to look for package not in the
/main
, but in the/test
.The text was updated successfully, but these errors were encountered: