Skip to content

I20231018-0110

@HeikoKlare HeikoKlare tagged this 13 Oct 13:25
The existing test TestBug297635 relies on reflection to test some
internal state change of the SavedState class that saves temporary
states until some save operation. The test was prone to fail because it
relied on internal state changes that depend an specific overall system
state (e.g., have an unsaved workspace state, so that no concurrent
automatic snapshot save is allowed to occur during test execution). It
used reflection to access an internal, highly volatile state.

The bug for which the test case serves as a regression test was due to
missing cleanup triggered by SavedState.forgetSavedTree(). Instead of
checking for internal state changes performed by the cleanup, the
rewritten test only checks for a call of the according method. To this
end, it temporarily inserts a spy on the SaveManager. Since a Workspace
and SaveManager are not easy to set up in an isolated way for testing
purposes, the test still relies on reflection, but only to inject a spy
on the SaveManager rather than to validate internal states.

Since the test is not required to be run as a session test anymore, it
is moved to the ordinary regression resource tests.

Fixes https://github.com/eclipse-platform/eclipse.platform/issues/460.
Assets 2
Loading