FileDocCategorySizeDatePackage
TestUtil.javaAPI DocphoneME MR2 API (J2ME)4127Wed May 02 18:00:10 BST 2007com.sun.midp.suspend.test

TestUtil

public class TestUtil extends Object
Utilities for suspend/resume testing.

Fields Summary
private static com.sun.midp.security.SecurityToken
securityToken
Security token for provileged access to internal API's.
public static final int
DELAY
Default delay time.
Constructors Summary
Methods Summary
public static com.sun.midp.suspend.SuspendSystemgetSuspendSystem()
Retrieves SuspendSystem instance using privileged security token.

return
SuspendSystem singleton instance.

        return SuspendSystem.getInstance(securityToken);
    
public static native voidresumeMidp()
Sends MIDP resume request.

public static native voidsetNoVMSuspendMode()
Sets special testing suspend mode that does not suspend VM.

public static native voidsetVMSuspendMode()
Sets suspend mode that suspends both resources and VM.

public static voidsleep(long ms)
Provides execution delay.

param
ms delay time in milliseconds


                  
         
        try {
            Thread.sleep(ms);
        } catch (InterruptedException e) {
            // ignoring
        }
    
public static voidsleep()
Provides default execution delay.

        sleep(DELAY);
    
public static native voidsuspendAndResumeMidp(int timeout)
Requests MIDP to suspend and then resume by timeout.

param
timeout resume timeout.

public static native voidsuspendMidp()
Sends MIDP suspend request.