Search in sources :

Example 1 with ChildRuntimeInfoComponent

use of com.adaptris.core.runtime.ChildRuntimeInfoComponent in project interlok by adaptris.

the class StatisticsMBeanCase method testStandardGetters.

@Test
public void testStandardGetters() throws Exception {
    String adapterName = this.getClass().getSimpleName() + "." + getName();
    Adapter adapter = createAdapter(adapterName);
    AdapterManager am = new AdapterManager(adapter);
    try {
        start(adapter);
        am.registerMBean();
        Collection<BaseComponentMBean> children = am.getAllDescendants();
        for (BaseComponentMBean bean : children) {
            assertNotNull(bean.createObjectName());
            if (bean instanceof ChildRuntimeInfoComponent) {
                assertNotNull(((ChildRuntimeInfoComponent) bean).getParentId());
                assertNotNull(((ChildRuntimeInfoComponent) bean).getParentObjectName());
                assertNotNull(((ChildRuntimeInfoComponent) bean).getParentRuntimeInfoComponent());
            }
        }
    } finally {
        stop(adapter);
        am.unregisterMBean();
    }
}
Also used : BaseComponentMBean(com.adaptris.core.runtime.BaseComponentMBean) ChildRuntimeInfoComponent(com.adaptris.core.runtime.ChildRuntimeInfoComponent) AdapterManager(com.adaptris.core.runtime.AdapterManager) Adapter(com.adaptris.core.Adapter) Test(org.junit.Test)

Aggregations

Adapter (com.adaptris.core.Adapter)1 AdapterManager (com.adaptris.core.runtime.AdapterManager)1 BaseComponentMBean (com.adaptris.core.runtime.BaseComponentMBean)1 ChildRuntimeInfoComponent (com.adaptris.core.runtime.ChildRuntimeInfoComponent)1 Test (org.junit.Test)1