[SPR-5859] @ManagedOperation can now be used on getters/setters
This commit is contained in:
@@ -42,6 +42,12 @@ public class AnnotationMetadataAssemblerTests extends AbstractMetadataAssemblerT
|
||||
assertNotNull(op);
|
||||
}
|
||||
|
||||
public void testOperationOnGetter() throws Exception {
|
||||
ModelMBeanInfo inf = getMBeanInfoFromAssembler();
|
||||
ModelMBeanOperationInfo op = inf.getOperation("getExpensiveToCalculate");
|
||||
assertNotNull(op);
|
||||
}
|
||||
|
||||
protected JmxAttributeSource getAttributeSource() {
|
||||
return new AnnotationJmxAttributeSource();
|
||||
}
|
||||
@@ -65,6 +71,6 @@ public class AnnotationMetadataAssemblerTests extends AbstractMetadataAssemblerT
|
||||
|
||||
@Override
|
||||
protected int getExpectedOperationCount() {
|
||||
return super.getExpectedOperationCount() + 3;
|
||||
return super.getExpectedOperationCount() + 4;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,4 +110,6 @@ public class AnnotationTestBean implements IJmxTestBean {
|
||||
return 3;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -48,4 +48,8 @@ public class AnnotationTestSubBean extends AnnotationTestBean implements IAnnota
|
||||
|
||||
public void fromInterface() {
|
||||
}
|
||||
|
||||
public int getExpensiveToCalculate() {
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,4 +29,7 @@ public interface IAnnotationTestBean {
|
||||
|
||||
@ManagedOperation
|
||||
void fromInterface();
|
||||
|
||||
@ManagedOperation
|
||||
int getExpensiveToCalculate();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user