discussion about an incomplete test#439
Conversation
|
| + " their work (Adding classes and dependencies as edges).") | ||
| void test_that_graph_is_collecting_edges_from_asm_correctly() throws IOException { | ||
|
|
||
| ResultCollector resultCollector = new ResultCollector(); |
There was a problem hiding this comment.
resultCollector object is isolated and useless, it's created in the test method but it's never used. visitor object has its own ResultCollector instance.
| // Checking for the expected results. | ||
| Assertions.assertTrue(directedGraph.containsVertex(className)); | ||
| for (String referencedClassMember : resultCollector.getDependencies()) { | ||
| for (String referencedClassMember : visitor.getDependencies()) { |
There was a problem hiding this comment.
@cesarsotovalero By the description of the test method, it feels like we should check the dependencies of the visitor. Since resultCollector is isolated and useless, the for loop body is never executed. But there's another problem, even if we use visitor's dependencies in this loop, the loop body won't be entered because there's a call resultCollector.clearClasses(); at the end of DependencyClassFileVisitor#visitClass(). I couldn't figure out why resultCollector of visitior is immediately cleared after being used for visiting class members. That's why visitor.getDependencies() will be empty. I don't know how to proceed to make this test complete.



@cesarsotovalero Can you check the comments on this PR, please? This PR shouldn't be merged, I've created it to start a discussion and figure out what's missing to make
DependencyClassFileVisitorTestcorrect. (Or fix something inDependencyClassFileVisitor)