| Summary: | Dot Attributes inconsistent handling | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Tamas Miklossy <miklossy> | ||||||||||||||||
| Component: | GEF DOT | Assignee: | Alexander Nyßen <nyssen> | ||||||||||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||||||||||
| Severity: | normal | ||||||||||||||||||
| Priority: | P3 | CC: | nyssen | ||||||||||||||||
| Version: | unspecified | ||||||||||||||||||
| Target Milestone: | 4.0.0 (Neon) RC1 | ||||||||||||||||||
| Hardware: | PC | ||||||||||||||||||
| OS: | Windows 7 | ||||||||||||||||||
| Whiteboard: | |||||||||||||||||||
| Attachments: |
|
||||||||||||||||||
|
Description
Tamas Miklossy
Created attachment 261510 [details] Invoke the Dot Attribute validation consistenly I uploaded a patch with the following improvements: [493136]: Invoke the Dot Attribute validation consistently for setters - Extend the setForceLabels method with validation method invocation. - Remove superfluous period at the end of the error message when parsing invalid "dir" attribute value. - Change the error message for setting invalid type attribute to be consistent with the other Dot attribute error messages. - Use the attributesProperty() consistently (instead of the getAttributes()) to get/set a given Dot attribute value. - Add missing "throws IllegalArgumentException" javadoc for the DotAttributes setter methods. - Implement additional DotAttribute Test cases for the "distortion", "forcelabels" dot attributes (getter/setter/getParsed/setParsed method with valid and invalid values). Hereby I confirm that my contribution complies with https://www.eclipse.org/legal/CoO.php. Created attachment 261511 [details] Invoke the Dot Attribute validation consistenly I uploaded a patch with the following improvements: [493136]: Invoke the Dot Attribute validation consistently for setters - Extend the setForceLabels method with validation method invocation - Remove superfluous period at the end of the error message when parsing invalid "dir" attribute value. - Use the attributesProperty() consistently (instead of the getAttributes()) to get/set a given Dot attribute value. - Add missing "throws IllegalArgumentException" javadoc for the DotAttributes setter methods. - Implement additional DotAttribute Test cases for the "distortion", "forcelabels" dot attributes (getter/setter/getParsed/setParsed method with valid and invalid values). Hereby I confirm that my contribution complies with https://www.eclipse.org/legal/CoO.php. Thanks Tamas, looks good. I released your patch to origin/master. I will leave this open, as the validation tests are not yet complete. I suppose you will contribute some additional tests? Created attachment 261535 [details] Implement additional DotAttributes test cases I uploaded a patch with the missing Dot Attributes test cases implementation: [493136] Implement additional DotAttributes test cases - Rename DotAttributes.LP__E to DotAttributes.LP__GE to indicate that the lp (label position) attribute is valid for both graphs and edges. - Implement missing getLp/getLpParsed/setLp/setLpParsed methods for graphs. - Add the missing validation method invocation within the setFixedSize, setHeadLp, setLp, setTailLp, setXlp methods (also extend the DotJavaValidator logic). - Improve javadoc of the getLayoutParsed(Graph graph) method. - Implement DotAttributes test cases for the "label", "layout", "lp", "shape", "skew", "sides", "style" dot attributes (getter/setter/getParsed/setParsed methods with valid and invalid values). Hereby I confirm that my contribution complies with https://www.eclipse.org/legal/CoO.php. Thanks Tamas! I released your patch to origin/master. I think we are almost done here. What should still be added, IMHO are interpreter/import tests for the individual attribute values, so we ensure they are all handled properly by the interpreter. Created attachment 261562 [details] Create DotSampleGraphs.xtend with sample graph definitions Yes, Alexander, you are right, some DotImporter/DotInterpreter test cases are still missing. I think first of all we should clean up these test cases before implementing the missing ones. I uploaded a patch with the following improvements: [493136]: Create DotSampleGraphs.xtend with sample graph definitions. - Extract the definitions of the sample dot graphs into a separate DotSampleGraphs.xtend file (utilize the xtend multi-line string functionality). - Reuse these sample graph definitions within the DotParser and DotInterpreter test cases. - Modify the org.eclipse.gef4.dot.tests plugin to be able to handle the xtend generated files (.classpath, .gitignore, .project, build.properties, pom.xml). - Implement additional DotParser test cases. Hereby I confirm that my contribution complies with https://www.eclipse.org/legal/CoO.php. Thanks Tamas. Nice idea to use Xtend here. I released your patch to origin/master. Created attachment 261603 [details] DotImportTests clean-ups and extensions I cleaned up the DotImport test cases and also defined some new ones: [493136] DotImportTests clean-ups and extensions - Divide the testFileImport() test case into smaller test cases (define one test case for each sample .dot file). - Extend the existing dot import test cases with org.eclipse.gef4.graph.Graph toString() equality assertions (for some sample files, the resulting graph was only checked whether it is null or not). - Implement additional dot import test cases based on the following sample files: arrowshapes_deprecated.dot,arrowshapes_direction_both.dot, arrowshapes_multiple.dot, arrowshapes_single.dot. Hereby I confirm that my contribution complies with https://www.eclipse.org/legal/CoO.php. (In reply to Tamas Miklossy from comment #8) > Created attachment 261603 [details] > DotImportTests clean-ups and extensions > > I cleaned up the DotImport test cases and also defined some new ones: > > [493136] DotImportTests clean-ups and extensions > > - Divide the testFileImport() test case into smaller test cases (define one > test case for each sample .dot file). > - Extend the existing dot import test cases with > org.eclipse.gef4.graph.Graph toString() equality assertions (for some sample > files, the resulting graph was only checked whether it is null or not). > - Implement additional dot import test cases based on the following sample > files: arrowshapes_deprecated.dot,arrowshapes_direction_both.dot, > arrowshapes_multiple.dot, arrowshapes_single.dot. > > Hereby I confirm that my contribution complies with > https://www.eclipse.org/legal/CoO.php. Thanks Tamas. However, I am unsure if this is the right strategy to improve the test basis. The test resource files are not very systematic, most of them were contributed as examples. I would propose to leave only few file-based tests, which should explicitly target the different file-based aspects (e.g. proper escaping of \\) and to transfer the other test resources into more consistent tests that are based on DotSampleGraphs (which we should probably rename to DotTestGraphs or similar), so we can design the (interpreter related) tests in a systematic manner (e.g. a test for each attribute). Created attachment 261698 [details] Add test dot graphs (DotSampleGraphs.xtend) with global/local/override dot attributes I agree with you, so I created a patch with additional DotSampleGraphs. [493136] Add test dot graphs with global/local/override dot attributes - define sample graphs with global/local/override dot attributes for all supported edge/node attributes except the following ones (since the global definition of these attributes does not make any sense): edge_headlp() edge_id() edge_lp() edge_pos() edge_taillp() edge_xlp() node_id() node_pos() node_xlp() Hereby I confirm that my contribution complies with https://www.eclipse.org/legal/CoO.php. (In reply to Tamas Miklossy from comment #10) > Created attachment 261698 [details] > Add test dot graphs (DotSampleGraphs.xtend) with global/local/override dot > attributes > > I agree with you, so I created a patch with additional DotSampleGraphs. > > [493136] Add test dot graphs with global/local/override dot attributes > > - define sample graphs with global/local/override dot attributes for all > supported edge/node attributes except the following ones (since the > global definition of these attributes does not make any sense): > > edge_headlp() > edge_id() > edge_lp() > edge_pos() > edge_taillp() > edge_xlp() > node_id() > node_pos() > node_xlp() > > Hereby I confirm that my contribution complies with > https://www.eclipse.org/legal/CoO.php. Which of the sample models can be replaced thereby? Shouldn't we adjust the tests to use these new samples as well? I think these sample graphs would be a good basis for further DotImportTest/DotInterpreterTest definitions. (In reply to Tamas Miklossy from comment #12) > I think these sample graphs would be a good basis for further > DotImportTest/DotInterpreterTest definitions. Ok. I have released your patch to origin/master. Created attachment 261715 [details] Add missing DotInterpreter logic for node attributes handling I uploaded a patch with the following improvements: [493136] Add missing DotInterpreter logic for node attributes handling - The following dot attributes were not handled properly by the dot interpreter: "distortion", "shape", "sides", "skew", "style". - Implement additional DotImport Test cases based on the test graphs defined within the DotSampleGraphs.xtend file. Hereby I confirm that my contribution complies with https://www.eclipse.org/legal/CoO.php. Thanks Tamas! I released your patch to origin/master. I have performed some additional cleanups and think we are done here then. Resolving as fixed in 4.0.0 RC1. |