FileDocCategorySizeDatePackage
QualifierListTest.javaAPI DocAndroid 1.5 API2585Wed May 06 22:41:10 BST 2009com.android.ide.eclipse.editors.resources.manager

QualifierListTest

public class QualifierListTest extends TestCase

Fields Summary
private ResourceManager
mManager
Constructors Summary
Methods Summary
public voidsetUp()

        super.setUp();
        
        mManager = ResourceManager.getInstance();
    
protected voidtearDown()

        super.tearDown();
        mManager = null;
    
public voidtestQualifierList()

        try {
            // get the list of qualifier in the resource manager
            Field qualifierListField = ResourceManager.class.getDeclaredField("mQualifiers");
            assertNotNull(qualifierListField);
            qualifierListField.setAccessible(true);
            
            // get the actual list.
            ResourceQualifier[] qualifierList =
                (ResourceQualifier[])qualifierListField.get(mManager);
            
            // now get the number of qualifier in the FolderConfiguration
            Field qualCountField = FolderConfiguration.class.getDeclaredField("INDEX_COUNT");
            assertNotNull(qualCountField);
            qualCountField.setAccessible(true);
            
            // get the constant value
            Integer count = (Integer)qualCountField.get(null);
            
            // now compare
            assertEquals(count.intValue(), qualifierList.length);
        } catch (SecurityException e) {
            assertTrue(false);
        } catch (NoSuchFieldException e) {
            assertTrue(false);
        } catch (IllegalArgumentException e) {
            assertTrue(false);
        } catch (IllegalAccessException e) {
            assertTrue(false);
        }