01: package com.tc.objectserver.managedobject.bytecode;
02:
03: import com.tc.object.LiteralValues;
04: import com.tc.test.TCTestCase;
05:
06: import java.lang.reflect.Field;
07: import java.lang.reflect.Modifier;
08:
09: public class PhysicalStateClassLoaderTest extends TCTestCase {
10:
11: public void testIfMappingForAllLiteralValuesExists()
12: throws Exception {
13: Field[] fields = LiteralValues.class.getDeclaredFields();
14:
15: for (int i = 0; i < fields.length; i++) {
16: Field field = fields[i];
17:
18: int fieldModifier = field.getModifiers();
19: if (Modifier.isPublic(fieldModifier)
20: && Modifier.isStatic(fieldModifier)
21: && Modifier.isFinal(fieldModifier)) {
22: Object type = field.get(null);
23: if (type instanceof Integer) {
24: Integer literalType = (Integer) type;
25: PhysicalStateClassLoader
26: .verifyTypePresent(literalType.intValue());
27: }
28: }
29: }
30: }
31: }
|