You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Stepan Mishura (JIRA)" <ji...@apache.org> on 2006/11/30 09:42:24 UTC

[jira] Updated: (HARMONY-1751) Classlib test org.apache.harmony.prefs.tests.java.util.prefs.PreferencesTest.testSystemNodeForPackage() fails

     [ http://issues.apache.org/jira/browse/HARMONY-1751?page=all ]

Stepan Mishura updated HARMONY-1751:
------------------------------------

    Attachment: fixFor_getNode.patch

Hi

Ilya, thanks for your comments on native code - you are right that getNode() algorithm is correct. However I still think that the bug in native code and the following line is incorrect:
err = openRegKey (env, jpath, jUserNode, &hKey, KEY_QUERY_VALUE);

I assume that Elena didn't have KEY_QUERY_VALUE permission on test machine. Please review and try a patch (fixFor_getNode.patch) to fix the issue with Preferences.systemNodeForPackage(Object.class);  

Steps to verify the fix (should work on Harmony and RI):
1) Apply the patch and do 'ant build-native'
2) create test that only invokes: Preferences.systemNodeForPackage(Object.class);  
3) deny all permission for HKEY_LOCAL_MACHINE / SOFTWARE / JavaSoft / Prefs
4) run the test - it MUST fail with SecurityException
5) allow 'Create Subkey' permission only for HKEY_LOCAL_MACHINE / SOFTWARE / JavaSoft / Prefs
6) run the test - it MUST pass
7) allow all permissions only for HKEY_LOCAL_MACHINE / SOFTWARE / JavaSoft / Prefs
8) press refresh (F5) on 'Prefs' entry - java/lang sub-entries MUST exist

Thanks,
Stepan.

> Classlib test org.apache.harmony.prefs.tests.java.util.prefs.PreferencesTest.testSystemNodeForPackage() fails
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1751
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1751
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Elena Semukhina
>         Assigned To: Stepan Mishura
>         Attachments: fixFor_getNode.patch, H-1751_PreferencesTest_updated.patch, Harmony-1751.patch, PreferencesTest.patch, TestPref.java
>
>
> The test fails for me on Windows on both j9 and drlvm with the following assertion:
> ant -Dbuild.module=prefs -Dtest.case=PreferencesTest test
> testSystemNodeForPackage Error N/A
> (J9)
> java.lang.SecurityException at java.util.prefs.RegistryPreferencesImpl.childSpi(RegistryPreferencesImpl.java:116) at java.util.prefs.AbstractPreferences.getNodeFromBackend(AbstractPreferences.java:645) at java.util.prefs.AbstractPreferences.nodeImpl(AbstractPreferences.java:626) at java.util.prefs.AbstractPreferences.node(AbstractPreferences.java:597) at java.util.prefs.Preferences.systemNodeForPackage(Preferences.java:767) at org.apache.harmony.prefs.tests.java.util.prefs.PreferencesTest.testSystemNodeForPackage(PreferencesTest.java:62) at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25) 
> (drlvm)
> java.lang.SecurityException at java.util.prefs.RegistryPreferencesImpl.childSpi(RegistryPreferencesImpl.java:116) at java.util.prefs.AbstractPreferences.getNodeFromBackend(AbstractPreferences.java:644) at java.util.prefs.AbstractPreferences.nodeImpl(AbstractPreferences.java:625) at java.util.prefs.AbstractPreferences.node(AbstractPreferences.java:595) at java.util.prefs.Preferences.systemNodeForPackage(Preferences.java:767) at org.apache.harmony.prefs.tests.java.util.prefs.PreferencesTest.testSystemNodeForPackage(PreferencesTest.java:62) at java.lang.reflect.VMReflection.invokeMethod(Native Method)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira