Conversation
…UtilityAndCheckerTest Co-authored-by: rostam <1497363+rostam@users.noreply.github.com> Agent-Logs-Url: https://github.com/rostam/GraphTea/sessions/ce73976f-09e9-4ea9-a5cf-23401e825b2a
Review Summary by QodoExpand test coverage: register orphaned tests and add utility/checker tests
WalkthroughsDescription• Register 5 orphaned test files in build.xml (66 tests recovered) • Create UtilityAndCheckerTest.java with 33 new tests • Expand test coverage for AcyclicChecker, BipartiteChecker, ConnectivityChecker • Add tests for GOpUtils utility methods and Pair generic class Diagramflowchart LR
A["Orphaned Test Files<br/>5 classes"] -->|"Register in build.xml"| B["Build Configuration<br/>Updated"]
C["Uncovered Classes<br/>AcyclicChecker, BipartiteChecker<br/>ConnectivityChecker, GOpUtils, Pair"] -->|"Create UtilityAndCheckerTest.java"| D["33 New Tests<br/>Full Coverage"]
B -->|"Result"| E["403 Total Tests<br/>24 Registered Classes"]
D -->|"Result"| E
File Changes1. test/UtilityAndCheckerTest.java
|
Code Review by Qodo
1. Multiple statements per line
|
| Vertex v1 = new Vertex(); v1.setLocation(new GPoint(0.0, 0.0)); | ||
| Vertex v2 = new Vertex(); v2.setLocation(new GPoint(4.0, 6.0)); | ||
| g.insertVertex(v1); g.insertVertex(v2); | ||
|
|
||
| GPoint c = GOpUtils.center(g); | ||
| assertEquals(2.0, c.x, 1e-9); | ||
| assertEquals(3.0, c.y, 1e-9); | ||
| } | ||
|
|
||
| /** center() of a symmetric arrangement should lie at the origin. */ | ||
| @Test | ||
| public void testGOpUtilsCenterSymmetricArrangement() { | ||
| GraphModel g = new GraphModel(false); | ||
| Vertex v1 = new Vertex(); v1.setLocation(new GPoint(-1.0, 0.0)); | ||
| Vertex v2 = new Vertex(); v2.setLocation(new GPoint(1.0, 0.0)); | ||
| Vertex v3 = new Vertex(); v3.setLocation(new GPoint(0.0, 2.0)); | ||
| Vertex v4 = new Vertex(); v4.setLocation(new GPoint(0.0, -2.0)); | ||
| g.insertVertex(v1); g.insertVertex(v2); | ||
| g.insertVertex(v3); g.insertVertex(v4); |
There was a problem hiding this comment.
1. Multiple statements per line 📘 Rule violation ⚙ Maintainability
New test code places multiple statements on the same line (e.g., variable declaration and method call), violating the one-statement-per-line requirement and likely triggering Checkstyle formatting failures.
Agent Prompt
## Issue description
`UtilityAndCheckerTest.java` contains multiple statements on single lines (e.g., `Vertex v1 = new Vertex(); v1.setLocation(...)` and `g.insertVertex(v1); g.insertVertex(v2);`), violating the one-statement-per-line requirement.
## Issue Context
This is enforced by the compliance checklist and typically by Checkstyle.
## Fix Focus Areas
- test/UtilityAndCheckerTest.java[239-257]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| /** A cycle graph C_n (n ≥ 3) contains a cycle, so it is not acyclic. */ | ||
| @Test | ||
| public void testAcyclicCheckerCycleIsNotAcyclic() { | ||
| GraphModel g = CircleGenerator.generateCircle(4); | ||
| assertFalse(AcyclicChecker.isGraphAcyclic(g)); |
There was a problem hiding this comment.
2. Non-utf8 test compile 🐞 Bug ✓ Correctness
The new test source contains non-ASCII characters, but the Ant test <javac> task does not specify an encoding, so compilation can fail on non-UTF-8 platforms (e.g., Windows default cp1252). This will break the ant test target in those environments.
Agent Prompt
### Issue description
`ant test` compiles test sources with platform-default encoding. Newly added test sources contain non-ASCII characters (e.g., `≥`), which can cause javac to fail on non-UTF-8 systems.
### Issue Context
Ant `<javac>` defaults to the platform charset unless `encoding` is set.
### Fix Focus Areas
- build.xml[48-83]
- Add `encoding="UTF-8"` to the test `<javac>` task (and optionally also to the main compile `<javac>` for consistency).
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Several test files existed in
test/but were never compiled or run. Multiple core utility and graph-checker classes had zero test coverage.Orphaned test files registered in
build.xmlFive pre-existing test classes added to the Ant
testtarget (66 tests recovered):BiconnectedComponentsTest— 14 testsG6FormatTest— 16 testsGraphComplementTest— 11 testsGraphJoinTest— 11 testsRenderTableTest— 1 testNew:
UtilityAndCheckerTest.java(33 tests)Covers classes with no prior test coverage:
AcyclicCheckerBipartiteCheckerConnectivityCheckerGOpUtilscenter(),offsetPositionsToCenter(),midPoint()Pair<F,S>Net result: 337 → 403 tests; 18 → 24 registered test classes.