use of com.googlecode.jmxtrans.model.JmxResultProcessor in project jmxtrans by jmxtrans.
the class JmxResultProcessorTest method canReadSingleIntegerValue.
@Test
public void canReadSingleIntegerValue() throws MalformedObjectNameException, InstanceNotFoundException {
Attribute integerAttribute = new Attribute("CollectionCount", 51L);
ObjectInstance runtime = getRuntime();
List<Result> results = new JmxResultProcessor(dummyQueryWithResultAlias(), runtime, ImmutableList.of(integerAttribute), runtime.getClassName(), TEST_DOMAIN_NAME).getResults();
assertThat(results).hasSize(1);
Result integerResult = results.get(0);
assertThat(integerResult.getAttributeName()).isEqualTo("CollectionCount");
assertThat(integerResult.getValue()).isInstanceOf(Long.class);
assertThat(integerResult.getValue()).isEqualTo(51L);
}
Aggregations