Package uk.co.blackpepper.mock.jmx

Examples of uk.co.blackpepper.mock.jmx.MockMBeanServerConnection


  /**
   * Test method for {@link uk.co.blackpepper.test.stats.data.jmx.JMXAttributeStatisticTest#getValue()}.
   */
  @Test
  public void testGetValueNull() {
    statistic.setConnection(new MockMBeanServerConnection() {
      public Object getAttribute(
          final ObjectName name,
          final String attribute) {
        return null;
      }     
View Full Code Here


  /**
   * Test method for {@link uk.co.blackpepper.test.stats.data.jmx.JMXAttributeStatisticTest#getValue()}.
   */
  @Test
  public void testGetValueBadValue() {
    statistic.setConnection(new MockMBeanServerConnection() {
      public Object getAttribute(
          final ObjectName name,
          final String attribute) {
        return TEST;
      }     
View Full Code Here

  /**
   * Test method for {@link uk.co.blackpepper.test.stats.data.jmx.JMXAttributeStatisticTest#getValue()}.
   */
  @Test
  public void testGetValueMBeanException() {
    statistic.setConnection(new MockMBeanServerConnection() {
      public Object getAttribute(
          final ObjectName name,
          final String attribute) throws MBeanException {
        throw new MBeanException(new RuntimeException());
      }     
View Full Code Here

  /**
   * Test method for {@link uk.co.blackpepper.test.stats.data.jmx.JMXAttributeStatisticTest#getValue()}.
   */
  @Test
  public void testGetValueAttributeNotFoundException() {
    statistic.setConnection(new MockMBeanServerConnection() {
      public Object getAttribute(
          final ObjectName name,
          final String attribute) throws AttributeNotFoundException {
        throw new AttributeNotFoundException();
      }     
View Full Code Here

  /**
   * Test method for {@link uk.co.blackpepper.test.stats.data.jmx.JMXAttributeStatisticTest#getValue()}.
   */
  @Test
  public void testGetValueInstanceNotFoundException() {
    statistic.setConnection(new MockMBeanServerConnection() {
      public Object getAttribute(
          final ObjectName name,
          final String attribute) throws InstanceNotFoundException {
        throw new InstanceNotFoundException();
      }     
View Full Code Here

  /**
   * Test method for {@link uk.co.blackpepper.test.stats.data.jmx.JMXAttributeStatisticTest#getValue()}.
   */
  @Test
  public void testGetValueReflectionException() {
    statistic.setConnection(new MockMBeanServerConnection() {
      public Object getAttribute(
          final ObjectName name,
          final String attribute) throws ReflectionException {
        throw new ReflectionException(new RuntimeException());
      }     
View Full Code Here

  /**
   * Test method for {@link uk.co.blackpepper.test.stats.data.jmx.JMXAttributeStatisticTest#getValue()}.
   */
  @Test
  public void testGetValueIOException() {
    statistic.setConnection(new MockMBeanServerConnection() {
      public Object getAttribute(
          final ObjectName name,
          final String attribute) throws IOException {
        throw new IOException();
      }     
View Full Code Here

   * Test method for {@link uk.co.blackpepper.test.stats.data.jmx.JMXAttributeStatisticTest#init()}.
   */
  @Test
  public void testInitAll() {
    statistic.setAttributeName(TEST_ATTRIBUTE_NAME);
    statistic.setConnection(new MockMBeanServerConnection());
    statistic.setName(NAME);
    statistic.setObjectName(TEST_OBJECT_NAME);
    statistic.setFormatString(FORMAT);
    statistic.init();
  }
View Full Code Here

   *
   * Test method for {@link uk.co.blackpepper.test.stats.data.jmx.JMXAttributeStatisticTest#init()}.
   */
  @Test
  public void testInitAttribute() {
    statistic.setConnection(new MockMBeanServerConnection());
    statistic.setName(NAME);
    statistic.setObjectName(TEST_OBJECT_NAME);
    statistic.setFormatString(FORMAT);
    try {
      statistic.init();
View Full Code Here

   * Test method for {@link uk.co.blackpepper.test.stats.data.jmx.JMXAttributeStatisticTest#init()}.
   */
  @Test
  public void testInitName() {
    statistic.setAttributeName(TEST_ATTRIBUTE_NAME);
    statistic.setConnection(new MockMBeanServerConnection());
    statistic.setObjectName(TEST_OBJECT_NAME);
    statistic.setFormatString(FORMAT);
    try {
      statistic.init();
      fail("Expected IllegalStateException.");
View Full Code Here

TOP

Related Classes of uk.co.blackpepper.mock.jmx.MockMBeanServerConnection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.