test.compliance.server
Class MBeanServerTEST

java.lang.Object
  extended byTestCase
      extended bytest.compliance.server.MBeanServerTEST

public class MBeanServerTEST
extends TestCase

Tests the MBean server impl. through the MBeanServer interface.

See Also:
Serialized Form

Constructor Summary
MBeanServerTEST(java.lang.String s)
           
 
Method Summary
 void testAddListenerMultipleHandbacks()
          Tests one listener multiple handbacks
 void testAddListenerToTwoBroadcasters()
          Tests adding the listener to different broadcasters
 void testAddListenerToTwoBroadcastersRemoveOne()
          Tests adding the listener to different broadcasters but remove one
 void testAddMBeanListenerMultipleHandbacks()
          Tests one listener multiple handbacks
 void testAddMBeanListenerToTwoBroadcasters()
          Tests adding the listener to different broadcasters
 void testAddMBeanListenerToTwoBroadcastersRemoveOne()
          Tests adding the listener to different broadcasters but remove one
 void testAddMBeanMultipleListeners()
          Tests multiple listeners with different handbacks
 void testaddMBeanToDelegate()
          Tests basic listener registration to server delegate
 void testAddMultipleListeners()
          Tests multiple listeners with different handbacks
 void testAddNotificationListenerToDelegate()
          Tests basic listener registration to server delegate
 void testBasicUnregister()
          Tests basic register/unregister
 void testGetAttributeWithBusinessException()
           
 void testGetAttributeWithError()
           
 void testGetAttributeWithNonExistingAttribute()
           
 void testGetAttributeWithNonExistingMBean()
           
 void testGetAttributeWithUncheckedException()
           
 void testGetDomains()
           
 void testInstantiateWithDefaultConstructor()
          Tests instantiate(String className).
 void testInstantiateWithDefaultConstructorAndApplicationException()
          Tests instantiate(String className) with constructor that throws a checked application exception.
 void testInstantiateWithDefaultConstructorAndError()
          Tests instantiate(String className) with constructor that throws an error.
 void testInstantiateWithDefaultConstructorAndErrorInInit()
          Tests instatiante(String className) with constructor that fails with an error in static init block.
 void testInstantiateWithDefaultConstructorAndExceptionInInit()
          Tests instantiate(String className) with constructor that fails with an unchecked exception in static init block.
 void testInstantiateWithDefaultConstructorAndRuntimeException()
          Tests instantiate(String className) with constructor that throws an unchecked application exception.
 void testInstantiateWithDefaultConstructorAndUnknownClass()
          Tests instantiate(String className) with unfound class.
 void testInstantiateWithDefaultLoaderRepository()
          Tests instantiate(String className) classloading behaviour.
 void testInstantiateWithDefaultLoaderRepository2()
          Tests instantiate(String className, ObjectName loader) classloading behaviour.
 void testInstantiateWithEmptyClassName()
          Tests instantiate(String className) with empty class name string.
 void testInstantiateWithEmptyClassName2()
          Tests instantiate(String className, ObjectName loader) with empty class name string.
 void testInstantiateWithEmptyClassName3()
          Tests instantiate(String className, Object[] args, String[] sign) with empty class name string.
 void testInstantiateWithEmptyClassName4()
          Tests instantiate(String className, ObjectName loader, Object[] args, String[] sign) with empty class name string.
 void testInstantiateWithInaccessibleNoArgsConstructor()
          Tests instantiate(String className) with protected (no access) no args constructor.
 void testInstantiateWithMissingDefaultConstructor()
          Tests instantiate(String className) with class that doesn't have a default constructor.
 void testInstantiateWithNullClassName()
          Tests instantiate(String className) with null class name.
 void testInstantiateWithNullClassName2()
          Tests instantiate(String className, ObjectName loader) with null class name.
 void testInstantiateWithNullClassName3()
          Tests instantiate(String className, Object[] args, String[] sign) with null class name.
 void testInstantiateWithNullClassName4()
          Tests instantiate(String className, ObjectName loader, Object[] args, String[] sign) with null class name.
 void testInvokeWithBusinessException()
          Attempts to invoke a MBean operation that throws a business exception; MBeanException should be thrown.
 void testInvokeWithLongArrayReturn()
          Tests invoke with Long array return type.
 void testInvokeWithLongSignature()
          Tests invoke with long signature.
 void testInvokeWithMixedSignature()
          Tests invoke with mixed types in signature, especially types with double byte code length and arrays.
 void testInvokeWithNonExistantMBean()
          Attempts to invoke a method on an unregistered MBean; InstanceNotFoundException should occur.
 void testInvokeWithPrimitiveBooleanReturn()
          Tests invoke with primitive boolean return type.
 void testInvokeWithPrimitiveDoubleReturn()
          Tests invoke with primitive double return type.
 void testInvokeWithPrimitiveLongArrayReturn()
          Tests invoke with primitive long array return type.
 void testInvokeWithPrimitiveLongReturn()
          Tests invoke with primitive long return type.
 void testIsInstanceOf()
           
 void testIsInstanceOfErrors()
           
 void testMBeanRedeployNotification()
          Tests MBeanRedeploy notification
 void testMBeanRemoveBroadcaster()
          Tests removing a broadcaster
 void testMBeanRemoveListener()
          Tests removing a notification listener including multiple handbacks
 void testMBeanRemoveTriplet()
          Tests removing a notification listener triple
 void testRegisterJMImplementationDefaultDomainObjectName()
          Tests registering into JMImplementation using default domain
 void testRegisterJMImplementationObjectName()
          Tests registering into JMImplementation
 void testRegisterMBeanOnExceptionFromPreRegister()
          Tests register for an MBean that throws unchecked exception from preRegister()
 void testRegisterMBeanOnExceptionFromPreRegister2()
          Tests register for an MBean that throws checked exception from preRegister()
 void testRegisterMBeanOnExceptionFromPreRegister3()
          Tests register for an MBean that throws an MBeanRegistrationException from preRegister() method.
 void testRegisterNullObjectName()
          Tests registering with null object name.
 void testRegisterPatternObjectName()
          Tests registering with a pattern object name.
 void testRemoveBroadcaster()
          Tests removing a broadcaster
 void testRemoveListener()
          Tests removing a notification listener including multiple handbacks
 void testRemoveTriplet()
          Tests removing a notification listener triplet
 void testSetAttributeWithBusinessException()
           
 void testSetAttributeWithError()
           
 void testSetAttributeWithNonExistingAttribute()
           
 void testSetAttributeWithNonExistingMBean()
           
 void testSetAttributeWithUncheckedException()
           
 void testUnregisterDelegate()
          Tests unregister the delegate.
 void testUnregisterMBeanOnExceptionFromPreDeregister()
          Tests unregister for an MBean that prevents unregistration by throwing an unchecked exception from its preDeregister() method.
 void testUnregisterMBeanOnExceptionFromPreDeregister2()
          Tests unregister for an MBean that prevents unregistration by throwing a checked exception from its preDeregister() method.
 void testUnregisterMBeanOnExceptionFromPreDeregister3()
          Tests unregister for an MBean that prevents unregistration by throwing a MBeanRegistrationException from its preDeregister() method.
 void testUnregisterWithDefaultDomainName()
          Tests unregister with default domain name
 void testUnregisterWithObjectNameFromRegistration()
          Tests unregister with default domain name gotten from ObjectInstance at registration time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MBeanServerTEST

public MBeanServerTEST(java.lang.String s)
Method Detail

testInvokeWithPrimitiveBooleanReturn

public void testInvokeWithPrimitiveBooleanReturn()
                                          throws java.lang.Exception
Tests invoke with primitive boolean return type.

Throws:
java.lang.Exception

testInvokeWithPrimitiveLongArrayReturn

public void testInvokeWithPrimitiveLongArrayReturn()
                                            throws java.lang.Exception
Tests invoke with primitive long array return type.

Throws:
java.lang.Exception

testInvokeWithLongArrayReturn

public void testInvokeWithLongArrayReturn()
                                   throws java.lang.Exception
Tests invoke with Long array return type.

Throws:
java.lang.Exception

testInvokeWithPrimitiveLongReturn

public void testInvokeWithPrimitiveLongReturn()
                                       throws java.lang.Exception
Tests invoke with primitive long return type.

Throws:
java.lang.Exception

testInvokeWithPrimitiveDoubleReturn

public void testInvokeWithPrimitiveDoubleReturn()
                                         throws java.lang.Exception
Tests invoke with primitive double return type.

Throws:
java.lang.Exception

testInvokeWithLongSignature

public void testInvokeWithLongSignature()
                                 throws java.lang.Exception
Tests invoke with long signature.

Throws:
java.lang.Exception

testInvokeWithMixedSignature

public void testInvokeWithMixedSignature()
                                  throws java.lang.Exception
Tests invoke with mixed types in signature, especially types with double byte code length and arrays.

Throws:
java.lang.Exception

testInvokeWithNonExistantMBean

public void testInvokeWithNonExistantMBean()
                                    throws java.lang.Exception
Attempts to invoke a method on an unregistered MBean; InstanceNotFoundException should occur.

Throws:
java.lang.Exception

testInvokeWithBusinessException

public void testInvokeWithBusinessException()
                                     throws java.lang.Exception
Attempts to invoke a MBean operation that throws a business exception; MBeanException should be thrown.

Throws:
java.lang.Exception

testGetAttributeWithNonExistingAttribute

public void testGetAttributeWithNonExistingAttribute()
                                              throws java.lang.Exception
Throws:
java.lang.Exception

testGetAttributeWithBusinessException

public void testGetAttributeWithBusinessException()
                                           throws java.lang.Exception
Throws:
java.lang.Exception

testGetAttributeWithNonExistingMBean

public void testGetAttributeWithNonExistingMBean()
                                          throws java.lang.Exception
Throws:
java.lang.Exception

testGetAttributeWithUncheckedException

public void testGetAttributeWithUncheckedException()
                                            throws java.lang.Exception
Throws:
java.lang.Exception

testGetAttributeWithError

public void testGetAttributeWithError()
                               throws java.lang.Exception
Throws:
java.lang.Exception

testSetAttributeWithNonExistingAttribute

public void testSetAttributeWithNonExistingAttribute()
                                              throws java.lang.Exception
Throws:
java.lang.Exception

testSetAttributeWithBusinessException

public void testSetAttributeWithBusinessException()
                                           throws java.lang.Exception
Throws:
java.lang.Exception

testSetAttributeWithNonExistingMBean

public void testSetAttributeWithNonExistingMBean()
                                          throws java.lang.Exception
Throws:
java.lang.Exception

testSetAttributeWithUncheckedException

public void testSetAttributeWithUncheckedException()
                                            throws java.lang.Exception
Throws:
java.lang.Exception

testSetAttributeWithError

public void testSetAttributeWithError()
                               throws java.lang.Exception
Throws:
java.lang.Exception

testInstantiateWithDefaultConstructor

public void testInstantiateWithDefaultConstructor()
                                           throws java.lang.Exception
Tests instantiate(String className). Class defined by system classloader.

Throws:
java.lang.Exception

testInstantiateWithDefaultConstructorAndApplicationException

public void testInstantiateWithDefaultConstructorAndApplicationException()
                                                                  throws java.lang.Exception
Tests instantiate(String className) with constructor that throws a checked application exception. Class defined by system classloader.

Throws:
java.lang.Exception

testInstantiateWithDefaultConstructorAndRuntimeException

public void testInstantiateWithDefaultConstructorAndRuntimeException()
                                                              throws java.lang.Exception
Tests instantiate(String className) with constructor that throws an unchecked application exception. Class defined by the system classloader.

Throws:
java.lang.Exception

testInstantiateWithDefaultConstructorAndError

public void testInstantiateWithDefaultConstructorAndError()
                                                   throws java.lang.Exception
Tests instantiate(String className) with constructor that throws an error. Class defined by the system classloader.

Throws:
java.lang.Exception

testInstantiateWithDefaultConstructorAndExceptionInInit

public void testInstantiateWithDefaultConstructorAndExceptionInInit()
                                                             throws java.lang.Exception
Tests instantiate(String className) with constructor that fails with an unchecked exception in static init block. Class defined by the system classloader.

Throws:
java.lang.Exception

testInstantiateWithDefaultConstructorAndErrorInInit

public void testInstantiateWithDefaultConstructorAndErrorInInit()
                                                         throws java.lang.Exception
Tests instatiante(String className) with constructor that fails with an error in static init block. Class defined by the system classloader.

Throws:
java.lang.Exception

testInstantiateWithDefaultConstructorAndUnknownClass

public void testInstantiateWithDefaultConstructorAndUnknownClass()
                                                          throws java.lang.Exception
Tests instantiate(String className) with unfound class.

Throws:
java.lang.Exception

testInstantiateWithMissingDefaultConstructor

public void testInstantiateWithMissingDefaultConstructor()
                                                  throws java.lang.Exception
Tests instantiate(String className) with class that doesn't have a default constructor.

Throws:
java.lang.Exception

testInstantiateWithInaccessibleNoArgsConstructor

public void testInstantiateWithInaccessibleNoArgsConstructor()
                                                      throws java.lang.Exception
Tests instantiate(String className) with protected (no access) no args constructor.

Throws:
java.lang.Exception

testInstantiateWithNullClassName

public void testInstantiateWithNullClassName()
                                      throws java.lang.Exception
Tests instantiate(String className) with null class name. According to javadoc, should throw RuntimeOperationsException wrapping IllegalArgException.

Throws:
java.lang.Exception

testInstantiateWithEmptyClassName

public void testInstantiateWithEmptyClassName()
                                       throws java.lang.Exception
Tests instantiate(String className) with empty class name string. should throw ReflectionException wrapping CNFE.

Throws:
java.lang.Exception

testInstantiateWithNullClassName2

public void testInstantiateWithNullClassName2()
                                       throws java.lang.Exception
Tests instantiate(String className, ObjectName loader) with null class name. According to javadoc, should throw RuntimeOperationsException wrapping IllegalArgException.

Throws:
java.lang.Exception

testInstantiateWithEmptyClassName2

public void testInstantiateWithEmptyClassName2()
                                        throws java.lang.Exception
Tests instantiate(String className, ObjectName loader) with empty class name string. should throw ReflectionException wrapping CNFE.

Throws:
java.lang.Exception

testInstantiateWithNullClassName3

public void testInstantiateWithNullClassName3()
                                       throws java.lang.Exception
Tests instantiate(String className, Object[] args, String[] sign) with null class name. According to javadoc, should throw RuntimeOperationsException wrapping IllegalArgException.

Throws:
java.lang.Exception

testInstantiateWithEmptyClassName3

public void testInstantiateWithEmptyClassName3()
                                        throws java.lang.Exception
Tests instantiate(String className, Object[] args, String[] sign) with empty class name string. should throw ReflectionException wrapping CNFE.

Throws:
java.lang.Exception

testInstantiateWithNullClassName4

public void testInstantiateWithNullClassName4()
                                       throws java.lang.Exception
Tests instantiate(String className, ObjectName loader, Object[] args, String[] sign) with null class name. According to javadoc, should throw RuntimeOperationsException wrapping IllegalArgException.

Throws:
java.lang.Exception

testInstantiateWithEmptyClassName4

public void testInstantiateWithEmptyClassName4()
                                        throws java.lang.Exception
Tests instantiate(String className, ObjectName loader, Object[] args, String[] sign) with empty class name string. should throw ReflectionException wrapping CNFE.

Throws:
java.lang.Exception

testInstantiateWithDefaultLoaderRepository

public void testInstantiateWithDefaultLoaderRepository()
                                                throws java.lang.Exception
Tests instantiate(String className) classloading behaviour. According to javadoc, DLR should be used to instantiate the class

Throws:
java.lang.Exception

testInstantiateWithDefaultLoaderRepository2

public void testInstantiateWithDefaultLoaderRepository2()
                                                 throws java.lang.Exception
Tests instantiate(String className, ObjectName loader) classloading behaviour. According to javadoc, DLR should be used to instantiate the class. This should fail as the MLet MBean is never added to the agent and therefore not in the DLR.

Throws:
java.lang.Exception

testRegisterNullObjectName

public void testRegisterNullObjectName()
                                throws java.lang.Exception
Tests registering with null object name.

Throws:
java.lang.Exception

testRegisterPatternObjectName

public void testRegisterPatternObjectName()
                                   throws java.lang.Exception
Tests registering with a pattern object name.

Throws:
java.lang.Exception

testRegisterJMImplementationObjectName

public void testRegisterJMImplementationObjectName()
                                            throws java.lang.Exception
Tests registering into JMImplementation

Throws:
java.lang.Exception

testRegisterJMImplementationDefaultDomainObjectName

public void testRegisterJMImplementationDefaultDomainObjectName()
                                                         throws java.lang.Exception
Tests registering into JMImplementation using default domain

Throws:
java.lang.Exception

testRegisterMBeanOnExceptionFromPreRegister

public void testRegisterMBeanOnExceptionFromPreRegister()
                                                 throws java.lang.Exception
Tests register for an MBean that throws unchecked exception from preRegister()

Throws:
java.lang.Exception

testRegisterMBeanOnExceptionFromPreRegister2

public void testRegisterMBeanOnExceptionFromPreRegister2()
                                                  throws java.lang.Exception
Tests register for an MBean that throws checked exception from preRegister()

Throws:
java.lang.Exception

testRegisterMBeanOnExceptionFromPreRegister3

public void testRegisterMBeanOnExceptionFromPreRegister3()
                                                  throws java.lang.Exception
Tests register for an MBean that throws an MBeanRegistrationException from preRegister() method.

Throws:
java.lang.Exception

testUnregisterDelegate

public void testUnregisterDelegate()
                            throws java.lang.Exception
Tests unregister the delegate.

Throws:
java.lang.Exception

testBasicUnregister

public void testBasicUnregister()
                         throws java.lang.Exception
Tests basic register/unregister

Throws:
java.lang.Exception

testUnregisterWithDefaultDomainName

public void testUnregisterWithDefaultDomainName()
                                         throws java.lang.Exception
Tests unregister with default domain name

Throws:
java.lang.Exception

testUnregisterWithObjectNameFromRegistration

public void testUnregisterWithObjectNameFromRegistration()
                                                  throws java.lang.Exception
Tests unregister with default domain name gotten from ObjectInstance at registration time.

Throws:
java.lang.Exception

testUnregisterMBeanOnExceptionFromPreDeregister

public void testUnregisterMBeanOnExceptionFromPreDeregister()
                                                     throws java.lang.Exception
Tests unregister for an MBean that prevents unregistration by throwing an unchecked exception from its preDeregister() method.

Throws:
java.lang.Exception

testUnregisterMBeanOnExceptionFromPreDeregister2

public void testUnregisterMBeanOnExceptionFromPreDeregister2()
                                                      throws java.lang.Exception
Tests unregister for an MBean that prevents unregistration by throwing a checked exception from its preDeregister() method.

Throws:
java.lang.Exception

testUnregisterMBeanOnExceptionFromPreDeregister3

public void testUnregisterMBeanOnExceptionFromPreDeregister3()
                                                      throws java.lang.Exception
Tests unregister for an MBean that prevents unregistration by throwing a MBeanRegistrationException from its preDeregister() method. This should be rethrown by the agent as-is, and not wrapped into another MBeanRegistrationException.

Throws:
java.lang.Exception

testAddNotificationListenerToDelegate

public void testAddNotificationListenerToDelegate()
                                           throws java.lang.Exception
Tests basic listener registration to server delegate

Throws:
java.lang.Exception

testAddMultipleListeners

public void testAddMultipleListeners()
                              throws java.lang.Exception
Tests multiple listeners with different handbacks

Throws:
java.lang.Exception

testAddListenerMultipleHandbacks

public void testAddListenerMultipleHandbacks()
                                      throws java.lang.Exception
Tests one listener multiple handbacks

Throws:
java.lang.Exception

testRemoveListener

public void testRemoveListener()
                        throws java.lang.Exception
Tests removing a notification listener including multiple handbacks

Throws:
java.lang.Exception

testRemoveTriplet

public void testRemoveTriplet()
                       throws java.lang.Exception
Tests removing a notification listener triplet

Throws:
java.lang.Exception

testRemoveBroadcaster

public void testRemoveBroadcaster()
                           throws java.lang.Exception
Tests removing a broadcaster

Throws:
java.lang.Exception

testAddListenerToTwoBroadcasters

public void testAddListenerToTwoBroadcasters()
                                      throws java.lang.Exception
Tests adding the listener to different broadcasters

Throws:
java.lang.Exception

testAddListenerToTwoBroadcastersRemoveOne

public void testAddListenerToTwoBroadcastersRemoveOne()
                                               throws java.lang.Exception
Tests adding the listener to different broadcasters but remove one

Throws:
java.lang.Exception

testaddMBeanToDelegate

public void testaddMBeanToDelegate()
                            throws java.lang.Exception
Tests basic listener registration to server delegate

Throws:
java.lang.Exception

testAddMBeanMultipleListeners

public void testAddMBeanMultipleListeners()
                                   throws java.lang.Exception
Tests multiple listeners with different handbacks

Throws:
java.lang.Exception

testAddMBeanListenerMultipleHandbacks

public void testAddMBeanListenerMultipleHandbacks()
                                           throws java.lang.Exception
Tests one listener multiple handbacks

Throws:
java.lang.Exception

testMBeanRemoveListener

public void testMBeanRemoveListener()
                             throws java.lang.Exception
Tests removing a notification listener including multiple handbacks

Throws:
java.lang.Exception

testMBeanRemoveTriplet

public void testMBeanRemoveTriplet()
                            throws java.lang.Exception
Tests removing a notification listener triple

Throws:
java.lang.Exception

testMBeanRedeployNotification

public void testMBeanRedeployNotification()
                                   throws java.lang.Exception
Tests MBeanRedeploy notification

Throws:
java.lang.Exception

testMBeanRemoveBroadcaster

public void testMBeanRemoveBroadcaster()
                                throws java.lang.Exception
Tests removing a broadcaster

Throws:
java.lang.Exception

testAddMBeanListenerToTwoBroadcasters

public void testAddMBeanListenerToTwoBroadcasters()
                                           throws java.lang.Exception
Tests adding the listener to different broadcasters

Throws:
java.lang.Exception

testAddMBeanListenerToTwoBroadcastersRemoveOne

public void testAddMBeanListenerToTwoBroadcastersRemoveOne()
                                                    throws java.lang.Exception
Tests adding the listener to different broadcasters but remove one

Throws:
java.lang.Exception

testGetDomains

public void testGetDomains()
                    throws java.lang.Exception
Throws:
java.lang.Exception

testIsInstanceOf

public void testIsInstanceOf()
                      throws java.lang.Exception
Throws:
java.lang.Exception

testIsInstanceOfErrors

public void testIsInstanceOfErrors()
                            throws java.lang.Exception
Throws:
java.lang.Exception