Skip to content

Instantly share code, notes, and snippets.

@michaelrice
Created February 8, 2015 16:39
Show Gist options
  • Select an option

  • Save michaelrice/ef04a3a331c7aa572058 to your computer and use it in GitHub Desktop.

Select an option

Save michaelrice/ef04a3a331c7aa572058 to your computer and use it in GitHub Desktop.
@Test
public void test_GetAllFields_Returns_All_Fields_With_AbstractClass() throws Exception {
abstract class MySuperClass {
public String baz;
public void myBaz() {}
}
class MyClass extends MySuperClass {
public String foo;
public int[] bar;
public void myFoo() {}
private int myBar;
}
Field[] fields = ReflectUtil.getAllFields(MyClass.class);
assertEquals(fields.length, 6);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment