[rfc][icedtea-web][policyeditor] Parsing enhancements and unit tests

Andrew Azores aazores at redhat.com
Wed Mar 5 17:01:22 UTC 2014


The previous thread was diverging into two quite different patches, so 
I'm splitting it.

This patch improves parsing, especially handling of comments, and adds a 
lot of new unit testing for this. A few small bugs were found and fixed 
along the way.

* NEWS: added entry for PolicyEditor
* netx/net/sourceforge/jnlp/security/policyeditor/CustomPermission.java:
(fromString) use regexes to parse
* netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java:
(file) keep reference to File rather than String filePath. (getPermissions)
returns empty map rather than null.  (setComponentMnemonic) new method.
(getCustomPermissions) new function. (openAndParsePolicyFile) check for
OpenFileResult FAILURE and NOT_FILE rather than null
(fromString) use regexes to parse
* netx/net/sourceforge/jnlp/util/FileUtils.java:
(testDirectoryPermissions) add check for getCanonicalFile and null
safeguarding. (testFilePermissions) add check for getCanonicalFile and
return FAILURE rather than null
(testMissingQuotationMarks) new test
testCodebaseTrailingSlashesDoNotMatch) new tests
new tests


Andrew A

-------------- next part --------------
A non-text attachment was scrubbed...
Name: policy-editor-parsing-tests.patch
Type: text/x-patch
Size: 50577 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20140305/242e212f/policy-editor-parsing-tests-0001.patch 

More information about the distro-pkg-dev mailing list