
CODE EXAMPLE
javax.microedition.io.Connector.file.write </TD> </TR>
</TABLE>
</BODY>
</HTML>
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.
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>
The value of the deny attribute is a list of
The following is an example of a test description file that includes the deny attribute and permissions.
CODE EXAMPLE
<TITLE>Test Specifications and Descriptions for Test</TITLE> </HEAD>
<BODY>
<H1>Test Specifications and Descriptions for Test</H1>