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);
}