use of com.adaptris.core.runtime.WorkflowManagerMBean in project interlok by adaptris.
the class MetadataCountMBeanTest method testGetMetadataStatistics.
@Test
public void testGetMetadataStatistics() throws Exception {
String adapterName = this.getClass().getSimpleName() + "." + getName();
MetadataTotalsInterceptor interceptor = createInterceptor();
interceptor.setUniqueId(getName());
Adapter adapter = createSingleChannelAdapter(adapterName, interceptor);
List<BaseComponentMBean> mBeans = createJmxManagers(adapter);
try {
start(adapter);
register(mBeans);
ObjectName workflowObj = createWorkflowObjectName(adapterName);
ObjectName metricsObj = createMetricsObjectName(adapterName, getName());
MetadataStatisticsMBean stats = JMX.newMBeanProxy(mBeanServer, metricsObj, MetadataStatisticsMBean.class);
WorkflowManagerMBean workflow = JMX.newMBeanProxy(mBeanServer, workflowObj, WorkflowManagerMBean.class);
SerializableAdaptrisMessage msg = createMessageForInjection(null);
workflow.processAsync(msg);
assertEquals(1, stats.getStatistics().size());
assertEquals(interceptor.getStats().size(), stats.getStatistics().size());
MetadataStatistic interceptorStat = (MetadataStatistic) interceptor.getStats().get(0);
MetadataStatistic mbeanStat = stats.getStatistics().get(0);
// They're not objectively equals (not clones), and no equals method.
assertNotSame(interceptorStat, mbeanStat);
assertEquals(interceptorStat.getEndMillis(), mbeanStat.getEndMillis());
assertEquals(interceptorStat.getMetadataStatistics(), mbeanStat.getMetadataStatistics());
} finally {
stop(adapter);
}
}
use of com.adaptris.core.runtime.WorkflowManagerMBean in project interlok by adaptris.
the class StatisticsMBeanCase method testGetTimesliceDuration.
@Test
public void testGetTimesliceDuration() throws Exception {
String adapterName = this.getClass().getSimpleName() + "." + getName();
Adapter adapter = createAdapter(adapterName);
List<BaseComponentMBean> mBeans = createJmxManagers(adapter);
try {
start(adapter);
register(mBeans);
ObjectName workflowObj = createWorkflowObjectName(adapterName);
ObjectName metricsObj = createMetricsObjectName(adapterName);
MetricsMBean stats = JMX.newMBeanProxy(mBeanServer, metricsObj, MetricsMBean.class);
WorkflowManagerMBean workflow = JMX.newMBeanProxy(mBeanServer, workflowObj, WorkflowManagerMBean.class);
assertEquals(10, stats.getTimeSliceDurationSeconds());
} finally {
stop(adapter);
}
}
use of com.adaptris.core.runtime.WorkflowManagerMBean in project interlok by adaptris.
the class StatisticsMBeanCase method testGet_NoTimeslicesAvailable.
@Test
public void testGet_NoTimeslicesAvailable() throws Exception {
String adapterName = this.getClass().getSimpleName() + "." + getName();
Adapter adapter = createAdapter(adapterName);
List<BaseComponentMBean> mBeans = createJmxManagers(adapter);
try {
start(adapter);
register(mBeans);
ObjectName workflowObj = createWorkflowObjectName(adapterName);
ObjectName metricsObj = createMetricsObjectName(adapterName);
MetricsMBean stats = JMX.newMBeanProxy(mBeanServer, metricsObj, MetricsMBean.class);
WorkflowManagerMBean workflow = JMX.newMBeanProxy(mBeanServer, workflowObj, WorkflowManagerMBean.class);
assertEquals(0, stats.getNumberOfTimeSlices());
} finally {
stop(adapter);
}
}
use of com.adaptris.core.runtime.WorkflowManagerMBean in project interlok by adaptris.
the class MetadataTotalsMBeanTest method testGetMetadataStatistics.
@Test
public void testGetMetadataStatistics() throws Exception {
String adapterName = this.getClass().getSimpleName() + "." + getName();
MetadataCountInterceptor interceptor = createInterceptor();
interceptor.setUniqueId(getName());
Adapter adapter = createSingleChannelAdapter(adapterName, interceptor);
List<BaseComponentMBean> mBeans = createJmxManagers(adapter);
try {
start(adapter);
register(mBeans);
ObjectName workflowObj = createWorkflowObjectName(adapterName);
ObjectName metricsObj = createMetricsObjectName(adapterName, getName());
MetadataStatisticsMBean stats = JMX.newMBeanProxy(mBeanServer, metricsObj, MetadataStatisticsMBean.class);
WorkflowManagerMBean workflow = JMX.newMBeanProxy(mBeanServer, workflowObj, WorkflowManagerMBean.class);
SerializableAdaptrisMessage msg = createMessageForInjection(null);
workflow.processAsync(msg);
assertEquals(1, stats.getStatistics().size());
assertEquals(interceptor.getStats().size(), stats.getStatistics().size());
MetadataStatistic interceptorStat = (MetadataStatistic) interceptor.getStats().get(0);
MetadataStatistic mbeanStat = stats.getStatistics().get(0);
// They're not objectively equals (not clones), and no equals method.
assertNotSame(interceptorStat, mbeanStat);
assertEquals(interceptorStat.getEndMillis(), mbeanStat.getEndMillis());
assertEquals(interceptorStat.getMetadataStatistics(), mbeanStat.getMetadataStatistics());
} finally {
stop(adapter);
}
}
use of com.adaptris.core.runtime.WorkflowManagerMBean in project interlok by adaptris.
the class MessageMetricsStatisticsTest method testGetTotalStringStats.
@Test
public void testGetTotalStringStats() throws Exception {
String adapterName = this.getClass().getSimpleName() + "." + getName();
Adapter adapter = createAdapter(adapterName);
List<BaseComponentMBean> mBeans = createJmxManagers(adapter);
try {
start(adapter);
register(mBeans);
ObjectName workflowObj = createWorkflowObjectName(adapterName);
ObjectName metricsObj = createMetricsObjectName(adapterName);
MessageMetricsStatisticsMBean stats = JMX.newMBeanProxy(mBeanServer, metricsObj, MessageMetricsStatisticsMBean.class);
WorkflowManagerMBean workflow = JMX.newMBeanProxy(mBeanServer, workflowObj, WorkflowManagerMBean.class);
assertNotNull(stats.getTotalStringStats());
SerializableAdaptrisMessage msg = createMessageForInjection(null);
workflow.processAsync(msg);
assertNotNull(stats.getTotalStringStats());
} finally {
stop(adapter);
}
}
Aggregations