AlertHandlerTestCase.java revision ea1068c292e9b341af6d6b563cd8988a96be20a9
/*
* 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 legal-notices/CDDLv1_0.txt
* 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 legal-notices/CDDLv1_0.txt.
* 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
*
*
* Copyright 2008 Sun Microsystems, Inc.
* Portions Copyright 2014-2015 ForgeRock AS
*/
/**
* A set of generic alert handler test cases.
*/
public class AlertHandlerTestCase
extends APITestCase
implements AlertGenerator
{
/**
* The alert type to use for these tests.
*/
/**
* The alert description to use for these tests.
*/
public static final String ALERT_DESCRIPTION =
"This is the alert description";
/**
* The alert message to use for these tests.
*/
public static final LocalizableMessage ALERT_MESSAGE = LocalizableMessage.raw("This is the alert message");
/**
* Ensures that the Directory Server is running and registers with it as an
* alert generator.
*
* @throws Exception If an unexpected problem occurs.
*/
public void startServer()
throws Exception
{
}
/**
* Tests the ability of the alert handler to send an administrative alert
* with no special configuration.
*/
@Test
public void testAlertHandler()
{
}
/**
* Tests alert handler functionality when a given alert is explicitly enabled.
*/
@Test
public void testEnabledAlert()
{
"set-alert-handler-prop",
"--handler-name", "Dummy Alert Handler",
try
{
}
finally
{
"set-alert-handler-prop",
"--handler-name", "Dummy Alert Handler",
}
}
/**
* Tests alert handler functionality when a given alert is not explicitly
* enabled but others are.
*/
@Test
public void testNotEnabledAlert()
{
"set-alert-handler-prop",
"--handler-name", "Dummy Alert Handler",
try
{
}
finally
{
"set-alert-handler-prop",
"--handler-name", "Dummy Alert Handler",
}
}
/**
* Tests alert handler functionality when a given alert is explicitly
* disabled.
*/
@Test
public void testDisabledAlert()
{
"set-alert-handler-prop",
"--handler-name", "Dummy Alert Handler",
try
{
}
finally
{
"set-alert-handler-prop",
"--handler-name", "Dummy Alert Handler",
}
}
/**
* Tests alert handler functionality when a given alert is not explicitly
* disabled but others are.
*/
@Test
public void testNotDisabledAlert()
{
"set-alert-handler-prop",
"--handler-name", "Dummy Alert Handler",
try
{
}
finally
{
"set-alert-handler-prop",
"--handler-name", "Dummy Alert Handler",
}
}
/**
* Tests alert handler functionality when a given alert is both enabled and
* disabled.
*/
@Test
public void testEnabledAndDisabledAlert()
{
"set-alert-handler-prop",
"--handler-name", "Dummy Alert Handler",
try
{
}
finally
{
"set-alert-handler-prop",
"--handler-name", "Dummy Alert Handler",
}
}
/**
* Retrieves the DN of the configuration entry with which this alert
* generator is associated.
*
* @return The DN of the configuration entry with which this alert
* generator is associated.
*/
@Test // TestNG treats this as a test, so we annotate it to eliminate warnings
public DN getComponentEntryDN()
{
try
{
}
catch (Exception e)
{
}
}
/**
* Retrieves the fully-qualified name of the Java class for this
* alert generator implementation.
*
* @return The fully-qualified name of the Java class for this
* alert generator implementation.
*/
@Test // TestNG treats this as a test, so we annotate it to eliminate warnings
public String getClassName()
{
}
/**
* Retrieves information about the set of alerts that this generator
* may produce. The map returned should be between the notification
* type for a particular notification and the human-readable
* description for that notification. This alert generator must not
* generate any alerts with types that are not contained in this
* list.
*
* @return Information about the set of alerts that this generator
* may produce.
*/
@Test // TestNG treats this as a test, so we annotate it to eliminate warnings
{
return alerts;
}
}