Skip to content
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

[tests] Rationalize GlobalStateMemento for Attribution.REGISTRY #2348

Open
eclipse-ocl-bot opened this issue Sep 26, 2024 · 2 comments
Open

Comments

@eclipse-ocl-bot
Copy link
Collaborator

| --- | --- |
| Bugzilla Link | 583509 |
| Status | NEW |
| Importance | P3 normal |
| Reported | Jul 30, 2024 03:32 EDT |
| Modified | Sep 06, 2024 11:02 EDT |
| Reporter | Ed Willink |

Description

The local copy of org.eclipse.xtext.testing.GlobalRegistries resolves EMF issues but is still inadequate. Perversely it is only used for testCompleteOCLRegistry_Access. Should be a full rteplacement of the PivotTestCase copy.

The standalone version of testUMLXCompiler_Forward2Reverse_CG identified a propblem whereby

registry.put(EssentialOCLCSPackage.Literals.SHADOW_PART_CS, ShadowPartCSAttribution.INSTANCE);

from EssentialOCLScoping has an initialization order dependency wrt

registry.put(EssentialOCLCSPackage.Literals.SHADOW_PART_CS, QVTimperativeShadowPartCSAttribution.INSTANCE);

from QVTimperativeScoping.

The immediate problem was worked around by an extra QVTimperativeScoping.init().

Attribution.REGISTRY should be part of the global state.

registry.put should perhaps be overloaded to detect a paut that is not a derived class of a prevailing init.

More generally makeCopyOfGlobalState() should perhaps diagnose unexpected global state that results from failure to observe the need to initialize pre-setup so that tearDown restores.

@eclipse-ocl-bot
Copy link
Collaborator Author

By Ed Willink on Jul 30, 2024 04:07

(In reply to Ed Willink from comment #0)

Attribution.REGISTRY should be part of the global state.

Yes, but clearing it in PicotStandaloneSetup.init forces a full re-init.

registry.put should perhaps be overloaded to detect a paut that is not a
derived class of a prevailing init.

Done.

@eclipse-ocl-bot
Copy link
Collaborator Author

By Ed Willink on Sep 06, 2024 11:02

a) Enforcing the doXXXStandaloneSetup before JUnit setUp() policy
b) abstracting AbstractPivotTestCAse with a TEstHelper to unifi OCL/QVTd
c) using a single GlobalStateMemento
improves general behaviour.

Since XXXScoping only happens when XXX is initialized, a thorough tearDown is needed to support GC testing.

There are no conflicting Attributions, e.g a refined QVTr Attribution extends and tests for the unrefined case. The AttributionRegistry can therefore just grow and grow with the no insyallation of anti-refined test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant