@Test public void returnsAJmxAttribute() throws Exception { when(mBeanServer.getAttribute(objectName, "attr")).thenReturn(value); assertThat(gauge.getValue()) .isEqualTo(value); }
@Override public Object getValue() { try { Object result = mBeanServerConn.getAttribute(objectName, attributeName); lastUpdate = System.currentTimeMillis(); return result; } catch (IOException e) { return null; } catch (JMException e) { return null; } }
JmxAttributeGauge implements Gauge<Object> { @Override public Object getValue() { try { Object result = mBeanServerConn.getAttribute(objectName, attributeName); lastUpdate = System.currentTimeMillis(); return result; } catch (IOException e) { return null; } catch (JMException e) { return null; } } }
JmxAttributeGauge implements Gauge<Object> { @Override public Object getValue() { try { Object result = mBeanServerConn.getAttribute(objectName, attributeName); lastUpdate = System.currentTimeMillis(); return result; } catch (IOException e) { return null; } catch (JMException e) { return null; } } JmxAttributeGauge(ObjectName objectName, String attributeName);  JmxAttributeGauge(MBeanServerConnection mBeanServerConn, ObjectName objectName, String attributeName); }
JmxAttributeGauge implements Gauge<Object> { @Override public Object getValue() { try { Object result = mBeanServerConn.getAttribute(objectName, attributeName); lastUpdate = System.currentTimeMillis(); return result; } catch (IOException e) { return null; } catch (JMException e) { return null; } } JmxAttributeGauge(ObjectName objectName, String attributeName);  JmxAttributeGauge(MBeanServerConnection mBeanServerConn, ObjectName objectName, String attributeName); @Override Object getValue(); @Override long lastUpdateTime(); }
JmxAttributeGauge implements Gauge<Object> { @Override public Object getValue() { try { Object result = mBeanServerConn.getAttribute(objectName, attributeName); lastUpdate = System.currentTimeMillis(); return result; } catch (IOException e) { return null; } catch (JMException e) { return null; } } JmxAttributeGauge(ObjectName objectName, String attributeName);  JmxAttributeGauge(MBeanServerConnection mBeanServerConn, ObjectName objectName, String attributeName); @Override Object getValue(); @Override long lastUpdateTime();  }