Package org.springframework.jmx

Examples of org.springframework.jmx.IJmxTestBean


    return (IJmxTestBean) factory.getObject();
  }

  public void testProxyClassIsDifferent() throws Exception {
    if (!runTests) return;
    IJmxTestBean proxy = getProxy();
    assertTrue("The proxy class should be different than the base class",
        (proxy.getClass() != IJmxTestBean.class));
  }
View Full Code Here


        (proxy.getClass() != IJmxTestBean.class));
  }

  public void testDifferentProxiesSameClass() throws Exception {
    if (!runTests) return;
    IJmxTestBean proxy1 = getProxy();
    IJmxTestBean proxy2 = getProxy();

    assertNotSame("The proxies should NOT be the same", proxy1, proxy2);
    assertSame("The proxy classes should be the same", proxy1.getClass(), proxy2.getClass());
  }
View Full Code Here

    assertSame("The proxy classes should be the same", proxy1.getClass(), proxy2.getClass());
  }

  public void testGetAttributeValue() throws Exception {
    if (!runTests) return;
    IJmxTestBean proxy1 = getProxy();
    int age = proxy1.getAge();
    assertEquals("The age should be 100", 100, age);
  }
View Full Code Here

    assertEquals("The age should be 100", 100, age);
  }

  public void testSetAttributeValue() throws Exception {
    if (!runTests) return;
    IJmxTestBean proxy = getProxy();
    proxy.setName("Rob Harrop");
    assertEquals("The name of the bean should have been updated", "Rob Harrop", target.getName());
  }
View Full Code Here

    assertEquals("The name of the bean should have been updated", "Rob Harrop", target.getName());
  }

  public void testSetAttributeValueWithRuntimeException() throws Exception {
    if (!runTests) return;
    IJmxTestBean proxy = getProxy();
    try {
      proxy.setName("Juergen");
      fail("Should have thrown IllegalArgumentException");
    }
    catch (IllegalArgumentException ex) {
      // expected
    }
View Full Code Here

    }
  }

  public void testSetAttributeValueWithCheckedException() throws Exception {
    if (!runTests) return;
    IJmxTestBean proxy = getProxy();
    try {
      proxy.setName("Juergen Class");
      fail("Should have thrown ClassNotFoundException");
    }
    catch (ClassNotFoundException ex) {
      // expected
    }
View Full Code Here

    }
  }

  public void testSetAttributeValueWithIOException() throws Exception {
    if (!runTests) return;
    IJmxTestBean proxy = getProxy();
    try {
      proxy.setName("Juergen IO");
      fail("Should have thrown IOException");
    }
    catch (IOException ex) {
      // expected
    }
View Full Code Here

    }
  }

  public void testSetReadOnlyAttribute() throws Exception {
    if (!runTests) return;
    IJmxTestBean proxy = getProxy();
    try {
      proxy.setAge(900);
      fail("Should not be able to write to a read only attribute");
    }
    catch (InvalidInvocationException ex) {
      // success
    }
View Full Code Here

    }
  }

  public void testInvokeNoArgs() throws Exception {
    if (!runTests) return;
    IJmxTestBean proxy = getProxy();
    long result = proxy.myOperation();
    assertEquals("The operation should return 1", 1, result);
  }
View Full Code Here

    assertEquals("The operation should return 1", 1, result);
  }

  public void testInvokeArgs() throws Exception {
    if (!runTests) return;
    IJmxTestBean proxy = getProxy();
    int result = proxy.add(1, 2);
    assertEquals("The operation should return 3", 3, result);
  }
View Full Code Here

TOP

Related Classes of org.springframework.jmx.IJmxTestBean

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.