-
Notifications
You must be signed in to change notification settings - Fork 12
Ability to dump graph as a dot file #125
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
base: master
Are you sure you want to change the base?
Changes from all commits
21b28c2
bc76fe4
c2e2e1f
7248f3e
88f573e
37eab82
752e4cf
ae2c215
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -92,3 +92,4 @@ a|`smart.testing.report.name` | |
| |the file name of the generated report | ||
| a|`smart-testing-report.xml` | ||
|
|
||
| |=== | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| package org.arquillian.smart.testing.strategies.affected; | ||
|
|
||
| import org.jgrapht.DirectedGraph; | ||
| import org.jgrapht.ext.DOTExporter; | ||
| import org.jgrapht.ext.ExportException; | ||
| import org.jgrapht.graph.DefaultEdge; | ||
|
|
||
| import java.io.File; | ||
|
|
||
| class GraphExporter | ||
| { | ||
| public void dumpGraph(DirectedGraph<JavaElement, DefaultEdge> graph, String graphName) { | ||
| try { | ||
| new DOTExporter<JavaElement, DefaultEdge>(component -> "\"" + component.getClassName() + "\"", | ||
| null, null) | ||
| .exportGraph(graph, new File(System.getProperty("java.io.tmpdir") + "/graph-" + graphName + ".dot")); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Log also the information that it has been exported and the location of the file
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wouldn't make sense to store the file inside of
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah - updated description with the tasks. |
||
| } catch (ExportException e) { | ||
| throw new RuntimeException(e); | ||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default value is not necessary here - from the javadoc of
Boolean.valueofThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, but this will be gone as soon as we align with #91
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit more than that - see #113 (comment)