use of org.springframework.jmx.IJmxTestBean in project spring-framework by spring-projects.
the class AbstractJmxAssemblerTests method testRegisterOperations.
@Test
public void testRegisterOperations() throws Exception {
IJmxTestBean bean = getBean();
assertThat(bean).isNotNull();
MBeanInfo inf = getMBeanInfo();
assertThat(inf.getOperations()).as("Incorrect number of operations registered").hasSize(getExpectedOperationCount());
}
use of org.springframework.jmx.IJmxTestBean in project spring-framework by spring-projects.
the class AbstractJmxAssemblerTests method getMBeanInfoFromAssembler.
protected ModelMBeanInfo getMBeanInfoFromAssembler() throws Exception {
IJmxTestBean bean = getBean();
ModelMBeanInfo info = getAssembler().getMBeanInfo(bean, getObjectName());
return info;
}
use of org.springframework.jmx.IJmxTestBean in project spring-framework by spring-projects.
the class AbstractJmxAssemblerTests method testSetAttribute.
@Test
public void testSetAttribute() throws Exception {
ObjectName objectName = ObjectNameManager.getInstance(getObjectName());
getServer().setAttribute(objectName, new Attribute(NAME_ATTRIBUTE, "Rob Harrop"));
IJmxTestBean bean = (IJmxTestBean) getContext().getBean("testBean");
assertThat(bean.getName()).isEqualTo("Rob Harrop");
}
use of org.springframework.jmx.IJmxTestBean in project spring-framework by spring-projects.
the class AbstractJmxAssemblerTests method testRegisterAttributes.
@Test
public void testRegisterAttributes() throws Exception {
IJmxTestBean bean = getBean();
assertThat(bean).isNotNull();
MBeanInfo inf = getMBeanInfo();
assertThat(inf.getAttributes()).as("Incorrect number of attributes registered").hasSize(getExpectedAttributeCount());
}
use of org.springframework.jmx.IJmxTestBean in project spring-framework by spring-projects.
the class MBeanClientInterceptorTests method setAttributeValueWithIOException.
@Test
void setAttributeValueWithIOException() throws Exception {
assumeTrue(runTests);
IJmxTestBean proxy = getProxy();
assertThatIOException().isThrownBy(() -> proxy.setName("Juergen IO"));
}
Aggregations