JDK-7050329 : test/java/security/Policy/GetPermissions/JarURL.java fails on Windows
  • Type: Bug
  • Component: security-libs
  • Sub-Component: java.security
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2011-06-01
  • Updated: 2011-07-19
  • Resolved: 2011-07-19
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b145Fixed
Related Reports
Relates :  
Description
This test fails consistently on Windows. It looks like the split(":")[0] will result in the drive letter rather than the extension directory as expected.

The following is a sample failure:


TEST: java/security/Policy/GetPermissions/JarURL.java
JDK under test: (C:\temp\jprt\P1\T\035306~1.JCG\TESTPR~1\WINDOW~1.2-P)
java version "1.7.0-internal"
Java(TM) SE Runtime Environment (build 1.7.0-internal-201105310353.jcg-integrator.tl-pit-awt-s-b00)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b14, mixed mode)


ACTION: build -- Passed. Build successful
REASON: Named class compiled on demand
TIME:   0.016 seconds
messages:
command: build JarURL
reason: Named class compiled on demand
elapsed time (seconds): 0.016

ACTION: compile -- Passed. Compilation successful
REASON: .class file out of date or does not exist
TIME:   0.016 seconds
messages:
command: compile C:\temp\jprt\P1\T\035306.jcg-integrator\source\jdk\test\java\security\Policy\GetPermissions\JarURL.java
reason: .class file out of date or does not exist
elapsed time (seconds): 0.016

ACTION: main -- Failed. Execution failed: `main' threw exception: java.lang.Exception: FAILED: jar:file:C/foo.jar!/ not granted AllPermission
REASON: Assumed action based on file name: run main JarURL 
TIME:   0.0 seconds
messages:
command: main JarURL
reason: Assumed action based on file name: run main JarURL 
elapsed time (seconds): 0.0
STDOUT:
STDERR:
java.lang.Exception: FAILED: jar:file:C/foo.jar!/ not granted AllPermission
	at JarURL.main(JarURL.java:46)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at com.sun.javatest.regtest.MainAction$SameVMRunnable.run(MainAction.java:680)
	at java.lang.Thread.run(Thread.java:722)

JavaTest Message: Test threw exception: java.lang.Exception
JavaTest Message: shutting down test


TEST RESULT: Failed. Execution failed: `main' threw exception: java.lang.Exception: FAILED: jar:file:C/foo.jar!/ not granted AllPermission
Accepted for jdk7, but test should have been run before push.

Comments
EVALUATION This is a Windows-specific bug. The code to determine the standard extensions directory needs to be fixed.
01-06-2011