@Test public void setFieldValueRecursive() throws Exception { HashBlob blob = new ExtendedHashBlob(0); final int hash = hashCode(); ClassUtils.setFieldValue(blob, "hash", hash, true); assertThat(hash, equalTo(blob.getHash())); }
@Test public void getFieldValueRecursive() throws Exception { final int hash = hashCode(); HashBlob blob = new ExtendedHashBlob(hash); assertThat(hash, equalTo(ClassUtils.getFieldValue(blob, "hash", true))); }
@Test public void setFieldValueRecursive() throws Exception { HashBlob blob = new ExtendedHashBlob(0); final int hash = hashCode(); ClassUtils.setFieldValue(blob, "hash", hash, true); assertThat(hash, equalTo(blob.getHash())); }
@Test(expected = NoSuchFieldException.class) public void setUnexistentFieldValueRecursive() throws Exception { ClassUtils.setFieldValue(new ExtendedHashBlob(1), "fake", 0, true); }
@Test(expected = NoSuchFieldException.class) public void getInheritedFieldValueWithoutRecurse() throws Exception { ClassUtils.getFieldValue(new ExtendedHashBlob(1), "hash", false); }
@Test(expected = NoSuchFieldException.class) public void getUnexistentFieldValueRecursive() throws Exception { ClassUtils.getFieldValue(new ExtendedHashBlob(1), "fake", true); }
@Test(expected = NoSuchFieldException.class) public void setInheritedFieldValueWithoutRecurse() throws Exception { ClassUtils.setFieldValue(new ExtendedHashBlob(1), "hash", 0, false); }
@Test public void getFieldValueRecursive() throws Exception { final int hash = hashCode(); HashBlob blob = new ExtendedHashBlob(hash); assertThat(hash, equalTo(ClassUtils.getFieldValue(blob, "hash", true))); }
@Test(expected = NoSuchFieldException.class) public void setUnexistentFieldValueRecursive() throws Exception { ClassUtils.setFieldValue(new ExtendedHashBlob(1), "fake", 0, true); }
@Test(expected = NoSuchFieldException.class) public void getInheritedFieldValueWithoutRecurse() throws Exception { ClassUtils.getFieldValue(new ExtendedHashBlob(1), "hash", false); }
@Test(expected = NoSuchFieldException.class) public void getUnexistentFieldValueRecursive() throws Exception { ClassUtils.getFieldValue(new ExtendedHashBlob(1), "fake", true); }
@Test(expected = NoSuchFieldException.class) public void setInheritedFieldValueWithoutRecurse() throws Exception { ClassUtils.setFieldValue(new ExtendedHashBlob(1), "hash", 0, false); }