* @tests java.lang.reflect.Field#setFloat(java.lang.Object, float)
* @tests java.lang.reflect.Field#setDouble(java.lang.Object, double)
* @tests java.lang.reflect.Field#setChar(java.lang.Object, char)
*/
public void testProtectedFieldAccess() {
Class fieldClass = new Support_Field().getClass();
String fieldName = null;
Field objectField = null;
Field booleanField = null;
Field byteField = null;
Field charField = null;
Field shortField = null;
Field intField = null;
Field longField = null;
Field floatField = null;
Field doubleField = null;
try {
fieldName = "objectField";
objectField = fieldClass.getDeclaredField(fieldName);
fieldName = "booleanField";
booleanField = fieldClass.getDeclaredField(fieldName);
fieldName = "byteField";
byteField = fieldClass.getDeclaredField(fieldName);
fieldName = "charField";
charField = fieldClass.getDeclaredField(fieldName);
fieldName = "shortField";
shortField = fieldClass.getDeclaredField(fieldName);
fieldName = "intField";
intField = fieldClass.getDeclaredField(fieldName);
fieldName = "longField";
longField = fieldClass.getDeclaredField(fieldName);
fieldName = "floatField";
floatField = fieldClass.getDeclaredField(fieldName);
fieldName = "doubleField";
doubleField = fieldClass.getDeclaredField(fieldName);
} catch (NoSuchFieldException e) {
fail("missing field " + fieldName + " in test support class "
+ fieldClass.getName());
}
// create the various objects that might or might not have an instance
// of the field
Support_Field parentClass = new Support_Field();
SupportSubClass subclass = new SupportSubClass();
SupportSubClass otherSubclass = new SupportSubClass();
Object plainObject = new Object();
Class illegalAccessExceptionClass = new IllegalAccessException()