JMXAlertHandlerTestCase.java revision 14b0770b613896800c1b5544730da9b736e1c9ba
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at
* trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
* add the following below this CDDL HEADER, with the fields enclosed
* by brackets "[]" replaced with your own identifying * information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Portions Copyright 2006 Sun Microsystems, Inc.
*/
/**
* A set of test cases for the JMX Alert Handler.
*/
public class JMXAlertHandlerTestCase
extends ExtensionsTestCase
{
/**
* Ensures that the Directory Server is running.
*
* @throws Exception If an unexpected problem occurs.
*/
@BeforeClass()
public void startServer()
throws Exception
{
}
/**
* Retrieves the set of JMX alert handlers registered with the Directory
* Server. There should just be one.
*
* @return The set of JMX alert handlers registered with the Directory
* Server.
*/
public Object[][] getJMXAlertHandlers()
{
{
if (handler instanceof JMXAlertHandler)
{
}
}
{
}
return handlerArray;
}
/**
* Tests the <CODE>getObjectName</CODE> method.
*
* @param handler The JMX alert handler to use for the test.
*/
{
}
/**
* Tests the <CODE>sendAlertNotification</CODE> method.
*
* @param handler The JMX alert handler to use for the test.
*
* @throws Exception If an unexpected problem occurs.
*/
throws Exception
{
"This is a test alert message.");
}
/**
* Tests the <CODE>getNotificationInfo</CODE> method.
*
* @param handler The JMX alert handler to use for the test.
*/
{
}
/**
* Tests the <CODE>getAttribute</CODE> method.
*
* @param handler The JMX alert handler to use for the test.
*
* @throws Exception If an unexpected problem occurs.
*/
expectedExceptions = { AttributeNotFoundException.class })
throws AttributeNotFoundException
{
}
/**
* Tests the <CODE>getAttributes</CODE> method.
*
* @param handler The JMX alert handler to use for the test.
*
* @throws Exception If an unexpected problem occurs.
*/
{
new AttributeList());
}
/**
* Tests the <CODE>setAttribute</CODE> method.
*
* @param handler The JMX alert handler to use for the test.
*
* @throws Exception If an unexpected problem occurs.
*/
expectedExceptions = { AttributeNotFoundException.class,
InvalidAttributeValueException.class })
{
}
/**
* Tests the <CODE>setAttributes</CODE> method.
*
* @param handler The JMX alert handler to use for the test.
*
* @throws Exception If an unexpected problem occurs.
*/
{
new AttributeList());
}
/**
* Tests the <CODE>invoke</CODE> method.
*
* @param handler The JMX alert handler to use for the test.
*
* @throws Exception If an unexpected problem occurs.
*/
expectedExceptions = { MBeanException.class })
throws MBeanException
{
}
/**
* Tests the <CODE>getMBeanInfo</CODE> method.
*
* @param handler The JMX alert handler to use for the test.
*
* @throws Exception If an unexpected problem occurs.
*/
{
}
}