Bug 210268

Summary: Problems with java.security while running LRGTestModel ...
Product: z_Archived Reporter: Mike Norman <michael.norman>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 Keywords: test
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: Fixed in 1.0M2
Attachments:
Description Flags
patch for ClearQueryOptionsOnStatementTest none

Description Mike Norman CLA 2007-11-19 11:34:48 EST
I was having difficulty getting clean runs for the LRGTestModel, with failures in the ValidationModel and in the
QueryOptionTestSuite in the FeatureTest Model.

It turns that there are 2 ways to solve the problem:

1) do not run with a security model - i.e. do not have -Djava.security.manager set when running the tests.
    However, in your 'endorsed JRE security library directory' - normally $JRE_HOME/lib/security,
    the original java.policy file needs to be replaced with one that grants AllPermission's:
  grant {
    permission java.security.AllPermission;
  };

  This is (sorta) how we run things in ADE (well not quite, but close enough - we get default settings
  from OC4J that are equivalent).

2) the above option is not very nice because it depends upon resources outside of the SVN tree, a variation
    of the 'works-for-me' problem. We should change the Wiki documentation for running the tests
    (http://wiki.eclipse.org/EclipseLink/Test/LRG#Running_the_Legacy_LRG) to:

    4. Add "-Xmx256m -Djava.security.manager -Djava.security.policy==${workspace_loc:eclipselink.core.test}/resource/java.policy.allpermissions"
        to the VM arguments section of the Arguments tab

and check the above java.policy file into to Subversion as:
${workspace_loc:eclipselink.core.test}/resource/java.policy.allpermissions

This does not solve 100% of the problems - in ClearQueryOptionsOnStatementTest, ~ line 104, the code
tries to grab a method from a class (instead of using a PrivilegedAccessHelper) - the code needs to be changed to:


-- 
Oracle Email Signature Logo
Mike Norman | Principal Software Designer | 613.288.4638
Oracle Server Technologies | TopLink Product
45 O'Connor Street, Suite 400 | Ottawa, ON K1P 1A4 | (fax) 613.238.2818
Comment 1 Mike Norman CLA 2007-11-19 11:35:51 EST
Created attachment 83249 [details]
patch for ClearQueryOptionsOnStatementTest
Comment 2 Mike Norman CLA 2007-11-19 15:17:55 EST
checked in fix into SVN repository:
 - check-in a java.policy file (under 'resources' directory) that gives
   AllPermission's
 - as per attach'd diff, change ClearQueryOptionsOnStatementTest
   to use PrivilegedAccessHelper to get declared method and do
   "method.setAccessible(true);" as well
 - modify documentation about running EclipseLink LRG
   (http://wiki.eclipse.org/EclipseLink/Test/LRG#Running_the_Legacy_LRG)
   to invoke TestBrowser with default Security Manager and custom
   java.policy file from above
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:31:00 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink