-
Bug
-
Resolution: Fixed
-
P3
-
jtreg3.2.2_02
-
None
-
fcs
-
generic
-
generic
-
Not verified
Currently the security manager in regtest, RegressionSecurityManager,
disallows modifications to system properties
(including getProperties, which is often just for reading).
This is so that tests do not interfere with each other.
It would be very nice to allow system property modifications,
by simply making a backup copy of the system properties,
and restoring them before the start of every test (with System.setProperties()).
This can be optimized in the obvious way by doing the backup/restore
only if the test actually does any system property manipulation,
which the security manager will know, since it will be asked for permission.
So for most tests, which have nothing to do with system properties,
the overhead of providing this convenience will be just the check of a volatile boolean.
The RegressionSecurityManager will need to cooperate with the harness to do the
restore and reset, since it cannot know when the next test is about to start.
Perhaps the RegressionSecurityManager could have a public method
prepareForNextTest()
disallows modifications to system properties
(including getProperties, which is often just for reading).
This is so that tests do not interfere with each other.
It would be very nice to allow system property modifications,
by simply making a backup copy of the system properties,
and restoring them before the start of every test (with System.setProperties()).
This can be optimized in the obvious way by doing the backup/restore
only if the test actually does any system property manipulation,
which the security manager will know, since it will be asked for permission.
So for most tests, which have nothing to do with system properties,
the overhead of providing this convenience will be just the check of a volatile boolean.
The RegressionSecurityManager will need to cooperate with the harness to do the
restore and reset, since it cannot know when the next test is about to start.
Perhaps the RegressionSecurityManager could have a public method
prepareForNextTest()