Sun Microsystems 1.2 Telephone Accessories User Manual


 
Chapter 4 Writing Tests 65
The following is an example of a grant attribute and permissions added to a test
description file.
The value of the grant attribute is a list of space-separated permissions (in the
example, javax.microedition.io.Connector.file.read and
javax.microedition.io.Connector.file.write) that must be granted by the
security policy for this test application to execute and pass. If these permissions are
not granted for the test application, the test application must be filtered out.
The following is an example of a test description file that includes the grant
attribute and permissions.
CODE EXAMPLE 4-18 grant Attribute Entry and Security Permissions
<TR>
<TD SCOPE="row"> <B>grant</B> </TD>
<TD> javax.microedition.io.Connector.file.read
javax.microedition.io.Connector.file.write </TD>
</TR>
CODE EXAMPLE 4-19 Test Description That Grants Permissions for a Security Test
<TITLE>Test Specifications and Descriptions for Test</TITLE>
</HEAD>
<BODY>
<H1>Test Specifications and Descriptions for Test</H1>
<HR>
<a name="Test"></a>
<TABLE BORDER=1 SUMMARY="Javatest Test Description" CLASS=
TestDescription>
<THEAD><TR><TH SCOPE="col">Item</TH><TH SCOPE=
"col">Value</TH></TR></THEAD>
<TR>
<TD SCOPE="row"> <B>title</B> </TD>
<TD> checking grant permission</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>grant</B> </TD>
<TD> javax.microedition.io.Connector.file.read