FileDocCategorySizeDatePackage
ResourceNameTest.javaAPI DocAndroid 1.5 API2213Wed May 06 22:42:02 BST 2009com.android.unit_tests.content

ResourceNameTest

public class ResourceNameTest extends android.test.AndroidTestCase

Fields Summary
Constructors Summary
Methods Summary
public voidtestGetResourceIdentifier()

        Resources res = mContext.getResources();
        int resid = res.getIdentifier(
                "com.android.unit_tests:configVarying/simple",
                null, null);
        assertEquals(R.configVarying.simple, resid);
        
        resid = res.getIdentifier("configVarying/simple", null,
                "com.android.unit_tests");
        assertEquals(R.configVarying.simple, resid);
        
        resid = res.getIdentifier("simple", "configVarying",
                "com.android.unit_tests");
        assertEquals(R.configVarying.simple, resid);
    
public voidtestGetResourceName()

        Resources res = mContext.getResources();
        
        String fullName = res.getResourceName(R.configVarying.simple);
        assertEquals("com.android.unit_tests:configVarying/simple", fullName);
        
        String packageName = res.getResourcePackageName(R.configVarying.simple);
        assertEquals("com.android.unit_tests", packageName);
        
        String typeName = res.getResourceTypeName(R.configVarying.simple);
        assertEquals("configVarying", typeName);
        
        String entryName = res.getResourceEntryName(R.configVarying.simple);
        assertEquals("simple", entryName);