use of cn.taketoday.jmx.IJmxTestBean in project today-infrastructure by TAKETODAY.
the class MBeanClientInterceptorTests method invokeUnexposedMethodWithException.
@Test
void invokeUnexposedMethodWithException() throws Exception {
assumeTrue(runTests);
IJmxTestBean bean = getProxy();
assertThatExceptionOfType(InvalidInvocationException.class).isThrownBy(() -> bean.dontExposeMe());
}
use of cn.taketoday.jmx.IJmxTestBean in project today-infrastructure by TAKETODAY.
the class MBeanClientInterceptorTests method proxyClassIsDifferent.
@Test
void proxyClassIsDifferent() throws Exception {
assumeTrue(runTests);
IJmxTestBean proxy = getProxy();
assertThat(proxy.getClass()).as("The proxy class should be different than the base class").isNotSameAs(IJmxTestBean.class);
}
use of cn.taketoday.jmx.IJmxTestBean in project today-infrastructure by TAKETODAY.
the class MBeanClientInterceptorTests method getAttributeValue.
@Test
void getAttributeValue() throws Exception {
assumeTrue(runTests);
IJmxTestBean proxy1 = getProxy();
int age = proxy1.getAge();
assertThat(age).as("The age should be 100").isEqualTo(100);
}
use of cn.taketoday.jmx.IJmxTestBean in project today-infrastructure by TAKETODAY.
the class MBeanClientInterceptorTests method setAttributeValueWithCheckedException.
@Test
void setAttributeValueWithCheckedException() throws Exception {
assumeTrue(runTests);
IJmxTestBean proxy = getProxy();
assertThatExceptionOfType(ClassNotFoundException.class).isThrownBy(() -> proxy.setName("Juergen Class"));
}
use of cn.taketoday.jmx.IJmxTestBean in project today-infrastructure by TAKETODAY.
the class MBeanClientInterceptorTests method setAttributeValue.
@Test
void setAttributeValue() throws Exception {
assumeTrue(runTests);
IJmxTestBean proxy = getProxy();
proxy.setName("Rob Harrop");
assertThat(target.getName()).as("The name of the bean should have been updated").isEqualTo("Rob Harrop");
}
Aggregations