Example usage for org.springframework.beans NotReadablePropertyException getBeanClass

List of usage examples for org.springframework.beans NotReadablePropertyException getBeanClass

Introduction

In this page you can find the example usage for org.springframework.beans NotReadablePropertyException getBeanClass.

Prototype

public Class<?> getBeanClass() 

Source Link

Document

Return the offending bean class.

Usage

From source file:org.springframework.beans.AbstractPropertyAccessorTests.java

@Test
public void getUnknownProperty() {
    Simple target = new Simple("John", 2);
    AbstractPropertyAccessor accessor = createAccessor(target);

    try {// w w  w .j  a  v  a  2s  .co m
        accessor.getPropertyValue("foo");
        fail("Should have failed to get an unknown property.");
    } catch (NotReadablePropertyException e) {
        assertEquals(Simple.class, e.getBeanClass());
        assertEquals("foo", e.getPropertyName());
    }
}