// fail("InvalidConfigurationException expected");
} catch (InvalidConfigurationException expected) {
}
{
final GAttributeInfo attributeInfo = new GAttributeInfo(attributeName, String.class.getName(), false, false, true, false, null, null);
GBeanAttribute attribute = new GBeanAttribute(gbeanInstance, attributeInfo);
assertTrue(attribute.isReadable());
assertFalse(attribute.isWritable());
}
{
final GAttributeInfo attributeInfo = new GAttributeInfo(persistentPrimitiveAttributeName, int.class.getName(), false, false, false, true, null, null);
GBeanAttribute attribute = new GBeanAttribute(gbeanInstance, attributeInfo);
assertFalse(attribute.isReadable());
assertTrue(attribute.isWritable());
}
{
// the attribute name and getter name are different, yet both
// exist.
// getYetAnotherFinalInt doesn't exist
final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, false, "getFinalInt", null);
GBeanAttribute attribute = new GBeanAttribute(gbeanInstance, attributeInfo);
assertNotNull(attribute);
}
{
final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, false, null, "setCharAsYetAnotherFinalInt");
try {
new GBeanAttribute(gbeanInstance, attributeInfo);
fail("Expected InvalidConfigurationException due to invalid setter parameter type");
} catch (InvalidConfigurationException expected) {
}
}
{
final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, false, null, "setBooleanAsYetAnotherFinalInt");
try {
new GBeanAttribute(gbeanInstance, attributeInfo);
fail("Expected InvalidConfigurationException due to invalid setter parameter type");
} catch (InvalidConfigurationException expected) {
}
}
{
final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, false, null, "setByteAsYetAnotherFinalInt");
try {
new GBeanAttribute(gbeanInstance, attributeInfo);
fail("Expected InvalidConfigurationException due to invalid setter parameter type");
} catch (InvalidConfigurationException expected) {
}
}
{
final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, false, null, "setShortAsYetAnotherFinalInt");
try {
new GBeanAttribute(gbeanInstance, attributeInfo);
fail("Expected InvalidConfigurationException due to invalid setter parameter type");
} catch (InvalidConfigurationException expected) {
}
}
{
final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, false, null, "setLongAsYetAnotherFinalInt");
try {
new GBeanAttribute(gbeanInstance, attributeInfo);
fail("Expected InvalidConfigurationException due to invalid setter parameter type");
} catch (InvalidConfigurationException expected) {
}
}
{
final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, false, null, "setFloatAsYetAnotherFinalInt");
try {
new GBeanAttribute(gbeanInstance, attributeInfo);
fail("Expected InvalidConfigurationException due to invalid setter parameter type");
} catch (InvalidConfigurationException expected) {
}
}
{
final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, false, null, "setDoubleAsYetAnotherFinalInt");
try {
new GBeanAttribute(gbeanInstance, attributeInfo);
fail("Expected InvalidConfigurationException due to invalid setter parameter type");
} catch (InvalidConfigurationException expected) {
}
}
{
final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, false, "getVoidGetterOfFinalInt", null);
try {
new GBeanAttribute(gbeanInstance, attributeInfo);
fail("Getter method not found on target; InvalidConfigurationException expected");
} catch (InvalidConfigurationException expected) {
}
}
{
final GAttributeInfo attributeInfo = new GAttributeInfo("YetAnotherFinalInt", int.class.getName(), true, false, null, "setThatDoesntExist");
try {
new GBeanAttribute(gbeanInstance, attributeInfo);
fail("Setter method not found on target; InvalidConfigurationException expected");
} catch (InvalidConfigurationException expected) {
}