Sun Microsystems 1.2 Telephone Accessories User Manual


 
64 Java ME TCK Framework Developer’s Guide July 2007
Granting or Denying Security Permissions
A security test might require that certain permissions be granted (or denied) for the
test to pass. The test is run or not run according to the permissions that a test writer
grants or denies.
Granting Security Permissions
When writing security tests, a test writer can specify the permissions that the
security policy must grant in the protection domain for the test application to
execute and pass. A test writer can specify the required security permissions by
including a grant attribute in the test description. If the security policy doesn’t
grant the specified permissions, the test must be filtered out of the test run.
For example, a test application is written based on the assumption that following
permissions are granted:
javax.microedition.io.Connector.file.read
javax.microedition.io.Connector.file.write
<THEAD><TR><TH SCOPE="col">Item</TH><TH SCOPE=
"col">Value</TH></TR></THEAD>
<TR>
<TD SCOPE="row"> <B>title</B> </TD>
<TD> checking double duty test</TD>
</TR>
<TR>
<TD SCOPE="row"> <B>source</B> </TD>
<TD> <A HREF="Test.java">Test.java</A> </TD>
</TR>
<TR>
<TD SCOPE="row"> <B>executeClass</B> </TD>
<TD> sample.pkg.Test</TD>
</TR>
<TR>
<TD SCOPE="row"> <B>DoubleDutySecurity</B> </TD>
<TD> yes </TD>
</TR>
</TABLE>
</BODY>
</HTML
CODE EXAMPLE 4-17 Test Description for a Double Duty Test (Continued)