FileDocCategorySizeDatePackage
AuthPermissionTest.javaAPI DocAndroid 1.5 API3450Wed May 06 22:41:06 BST 2009tests.api.javax.security.auth

AuthPermissionTest

public class AuthPermissionTest extends TestCase
Tests for AuthPermission class constructors and methods.

Fields Summary
Constructors Summary
Methods Summary
public voidtest_Constructor_01()

tests
javax.security.auth.AuthPermission#AuthPermission(String name)

        String[] strParam = {"", null};
        
        try {
            AuthPermission ap = new AuthPermission("AuthPermissionName");
            assertNotNull("Null object returned", ap);
            assertEquals("AuthPermissionName", ap.getName());
        } catch (Exception e) {
            fail("Unexpected exception: " + e);
        }
        
        for (int i = 0; i < strParam.length; i++) {
            try {
                AuthPermission ap = new AuthPermission(strParam[i]);
            } catch (Exception e) {
            }
        }
    
public voidtest_Constructor_02()

tests
javax.security.auth.AuthPermission#AuthPermission(String name, String actions)

        String[] strParam = {"", null};
        String[] actionParam = {"", null, "ActionName"};
        
        try {
            AuthPermission ap = new AuthPermission("AuthPermissionName", null);
            assertNotNull("Null object returned", ap);
            assertEquals("AuthPermissionName", ap.getName());
            assertEquals("", ap.getActions());
        } catch (Exception e) {
            fail("Unexpected exception: " + e);
        }

        for (int i = 0; i < strParam.length; i++) {
            try {
                AuthPermission ap = new AuthPermission(strParam[i], null);
            } catch (Exception e) {
            }
        }
        
        for (int i = 0; i < actionParam.length; i++) {
            try {
                AuthPermission ap = new AuthPermission("AuthPermissionName", actionParam[i]);
                assertNotNull("Null object returned", ap);
                assertEquals("", ap.getActions());
            } catch (Exception e) {
                fail("Unexpected exception: " + e);
            }
        }