Add tests for simple reflection methods
This commit is contained in:
parent
44ed555bf3
commit
3a303ed20b
@ -0,0 +1,5 @@
|
||||
package eu.mikroskeem.utils.test.reflect;
|
||||
|
||||
public class SimpleReflectionTestClass {
|
||||
private String FOOBAR = "nope";
|
||||
}
|
@ -62,4 +62,17 @@ public class TestReflect {
|
||||
String value = (String)Reflect.readField(bazfed, null);
|
||||
Assert.assertEquals("no yeah man :(", value);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSimpleReadField(){
|
||||
SimpleReflectionTestClass testClass = new SimpleReflectionTestClass();
|
||||
Assert.assertEquals("nope", Reflect.simpleReadField(testClass, "FOOBAR"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSimpleWriteField(){
|
||||
SimpleReflectionTestClass testClass = new SimpleReflectionTestClass();
|
||||
Reflect.simpleWriteField(testClass, "FOOBAR", "yeah");
|
||||
Assert.assertEquals("yeah", Reflect.simpleReadField(testClass, "FOOBAR"));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user