Sun Microsystems 1.2 Telephone Accessories User Manual


 
66 Java ME TCK Framework Developer’s Guide July 2007
Denying Security Permissions
When writing security tests, a test writer can specify the permissions that the
security policy must not grant in the protection domain for this test application to
execute and pass. Test writers can specify the denied security permissions by
including a deny attribute in the test description. If the security policy grants the
specified permissions, the test must be filtered out of the test run.
For example, suppose a test application is written to expect that a security exception
is thrown because the javax.microedition.io.Connector.file.read
permission is not granted. If the security policy grants the
javax.microedition.io.Connector.file.read permission to the test
application, the test must be filtered out and not run.
The following is an example of the deny attribute and permission added to a test
description file.
The value of the deny attribute is a list of space-separated permissions that must be
denied by the security policy for this test application to execute and pass. If the
permissions are granted in the protection domain for the test application, the test
application must be filtered out and not run.
The following is an example of a test description file that includes the deny attribute
and permissions.
javax.microedition.io.Connector.file.write </TD>
</TR>
</TABLE>
</BODY>
</HTML>
CODE EXAMPLE 4-20 deny Attribute in the Test Description
<TR>
<TD SCOPE="row"> <B>deny</B> </TD>
<TD> javax.microedition.io.Connector.file.read </TD>
</TR>
CODE EXAMPLE 4-21 Test Description That Denies Permissions for a Security Test
<TITLE>Test Specifications and Descriptions for Test</TITLE>
</HEAD>
<BODY>
<H1>Test Specifications and Descriptions for Test</H1>
CODE EXAMPLE 4-19 Test Description That Grants Permissions for a Security Test