add enumsource exclude reinclude functionality again#2940
Closed
carstenartur wants to merge 6 commits into
Closed
Conversation
… menu Agent-Logs-Url: https://github.com/carstenartur/eclipse.jdt.ui/sessions/c703c303-ece3-410e-85d9-be1e12f27382 Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com>
Agent-Logs-Url: https://github.com/carstenartur/eclipse.jdt.ui/sessions/c703c303-ece3-410e-85d9-be1e12f27382 Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com>
Agent-Logs-Url: https://github.com/carstenartur/eclipse.jdt.ui/sessions/c703c303-ece3-410e-85d9-be1e12f27382 Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What it does
Second work package from #2744 (first was #2907 — disable/enable test). Adds right-click context menu support in the JUnit test viewer to exclude specific enum values from
@EnumSourceparameterized tests and re-include them.New infrastructure
EnumSourceValidator— Reads/writes@EnumSourceannotation state via AST bindings: checks EXCLUDE mode, extracts excluded names, removes exclusions, strips[N]display-name prefix to recover enum constant namesParameterizedTestMetadataExtractor— Lazily populatesisParameterizedTest/parameterSourceType/parameterEnumTypeonTestCaseElementby parsing AST on demand; result is cached to avoid repeated parsesTestAnnotationModifier.excludeEnumValue(IMethod, String)— AST rewrite that converts@EnumSource(Foo.class)→@EnumSource(value=Foo.class, mode=Mode.EXCLUDE, names={"X"}), or appends to an existing exclusion listNew actions
ExcludeParameterValueActionTestCaseElementunder@EnumSourcenameswithmode=EXCLUDE; warns when ≤1 values remainReincludeAllEnumValuesActionTestSuiteElementmode+namesattributes entirely; cleans upModeimportReincludeEnumValueActionmode+nameswhen list becomes emptyModel / UI changes
TestCaseElement— Three new fields:fIsParameterizedTest,fParameterSourceType,fParameterEnumTypeTestSuiteElement— AddedgetSingleDynamicChild()TestViewer— WiresExcludeParameterValueActionfor case elements;addReincludeExcludedValuesSubmenu()builds the re-include submenu whenisExcludeMode()is trueTestSessionLabelProvider— Flat-layout label appends[@EnumSource(EnumType)]when metadata is populatedTests
ExcludeParameterValueDisplayNameTestcovers: initial exclude, append to existing exclusion list, remove-all, remove-single-value (including last-value-clears-mode), display-name stripping, andcomputeNamesAfterReincludeedge cases.How to test
Author checklist