ch.elca.el4j.tests.services.monitoring.jmx
Class JmxTest

java.lang.Object
  extended by ch.elca.el4j.tests.services.monitoring.jmx.JmxTest

public class JmxTest
extends Object

JUnit Test Class for the JMX package.

If one wants to observe the SpringBeans of this test environment, then the commented part at the end of the second method should be uncommented. The SpringBeans of both ApplicationContexts of the first test can be accessed by entering http://localhost:9092/ at your web browser. The SpringBeans of the second test of the first ApplicationContext can be accessed by http://localhost:9093/ . The ones of the second ApplicationContext can be viewed by a management console which supports JSR 160 (JMX Remoting) connections. One such console is MC4J which can be found at http://mc4j.sourceforge.net/ .

Author:
Raphael Boog (RBO)
File-location:
JmxTest
Last check-in date:
2009-08-04 15:13:46 +0200 (Di, 04. Aug 2009) by swismer for revision 3879

Field Summary
(package private)  String m_fileName1
          Configuration file number 1.
(package private)  String m_fileName2
          Configuration file number 2.
(package private)  String m_fileName3
          Configuration file number 3.
(package private)  String m_fileName4
          Configuration file number 4.
(package private)  String m_mandatoryFiles
          All xml files in the 'mandatory' folder.
private static org.slf4j.Logger s_logger
          Private logger of this class.
 
Constructor Summary
JmxTest()
           
 
Method Summary
 void testRegisteredMBeanWithTwoAppCxtsAndOneJmxInstance()
          This test loads two ApplicationContexts where MBeans are registered at the same MBean Server and checks if the MBeans are really registered at the MBean Server.
 void testRegisteredMBeanWithTwoAppCxtsAndTwoMBeanServers()
          This test loads two ApplicationContexts where MBeans are registered at two different MBean Servers and checks if the MBeans are really registered at the corresponding MBean Server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

s_logger

private static org.slf4j.Logger s_logger
Private logger of this class.


m_mandatoryFiles

String m_mandatoryFiles
All xml files in the 'mandatory' folder.


m_fileName1

String m_fileName1
Configuration file number 1.


m_fileName2

String m_fileName2
Configuration file number 2.


m_fileName3

String m_fileName3
Configuration file number 3.


m_fileName4

String m_fileName4
Configuration file number 4.

Constructor Detail

JmxTest

public JmxTest()
Method Detail

testRegisteredMBeanWithTwoAppCxtsAndOneJmxInstance

public void testRegisteredMBeanWithTwoAppCxtsAndOneJmxInstance()
                                                        throws MalformedObjectNameException
This test loads two ApplicationContexts where MBeans are registered at the same MBean Server and checks if the MBeans are really registered at the MBean Server.

Throws:
MalformedObjectNameException - The format of the String does not correspond to a valid ObjectName

testRegisteredMBeanWithTwoAppCxtsAndTwoMBeanServers

public void testRegisteredMBeanWithTwoAppCxtsAndTwoMBeanServers()
                                                         throws MalformedObjectNameException
This test loads two ApplicationContexts where MBeans are registered at two different MBean Servers and checks if the MBeans are really registered at the corresponding MBean Server. The only difference in configuration to the test before is that the 'defaultDomain' property of the MBean Server is overridden in both ApplicationContexts and that the second ApplicationContext can be connected by a JSR 160 JMX connection instead of html.

Throws:
MalformedObjectNameException - The format of the string does not correspond to a valid ObjectName


Copyright © 2005-2011 ELCA. All Rights Reserved.