| | |
| | | import org.testng.annotations.Test; |
| | | |
| | | import org.opends.server.TestCaseUtils; |
| | | import org.opends.messages.Message; |
| | | import org.opends.server.api.AlertGenerator; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.extensions.DummyAlertHandler; |
| | |
| | | extends APITestCase |
| | | implements AlertGenerator |
| | | { |
| | | /** |
| | | * The alert ID to use for these tests. |
| | | */ |
| | | public static final int ALERT_ID = 12345; |
| | | |
| | | |
| | | |
| | | /** |
| | | * The alert type to use for these tests. |
| | |
| | | /** |
| | | * The alert message to use for these tests. |
| | | */ |
| | | public static final String ALERT_MESSAGE = "This is the alert message"; |
| | | public static final Message ALERT_MESSAGE = Message.raw("This is the alert message"); |
| | | |
| | | |
| | | |
| | |
| | | { |
| | | int count = DummyAlertHandler.getAlertCount(); |
| | | |
| | | DirectoryServer.sendAlertNotification(this, ALERT_TYPE, ALERT_ID, |
| | | DirectoryServer.sendAlertNotification(this, ALERT_TYPE, |
| | | ALERT_MESSAGE); |
| | | assertEquals(DummyAlertHandler.getAlertCount(), (count+1)); |
| | | } |
| | |
| | | { |
| | | int count = DummyAlertHandler.getAlertCount(); |
| | | |
| | | DirectoryServer.sendAlertNotification(this, ALERT_TYPE, ALERT_ID, |
| | | DirectoryServer.sendAlertNotification(this, ALERT_TYPE, |
| | | ALERT_MESSAGE); |
| | | assertEquals(DummyAlertHandler.getAlertCount(), (count+1)); |
| | | } |
| | |
| | | { |
| | | int count = DummyAlertHandler.getAlertCount(); |
| | | |
| | | DirectoryServer.sendAlertNotification(this, ALERT_TYPE, ALERT_ID, |
| | | DirectoryServer.sendAlertNotification(this, ALERT_TYPE, |
| | | ALERT_MESSAGE); |
| | | assertEquals(DummyAlertHandler.getAlertCount(), count); |
| | | } |
| | |
| | | { |
| | | int count = DummyAlertHandler.getAlertCount(); |
| | | |
| | | DirectoryServer.sendAlertNotification(this, ALERT_TYPE, ALERT_ID, |
| | | DirectoryServer.sendAlertNotification(this, ALERT_TYPE, |
| | | ALERT_MESSAGE); |
| | | assertEquals(DummyAlertHandler.getAlertCount(), count); |
| | | } |
| | |
| | | { |
| | | int count = DummyAlertHandler.getAlertCount(); |
| | | |
| | | DirectoryServer.sendAlertNotification(this, ALERT_TYPE, ALERT_ID, |
| | | DirectoryServer.sendAlertNotification(this, ALERT_TYPE, |
| | | ALERT_MESSAGE); |
| | | assertEquals(DummyAlertHandler.getAlertCount(), (count+1)); |
| | | } |
| | |
| | | { |
| | | int count = DummyAlertHandler.getAlertCount(); |
| | | |
| | | DirectoryServer.sendAlertNotification(this, ALERT_TYPE, ALERT_ID, |
| | | DirectoryServer.sendAlertNotification(this, ALERT_TYPE, |
| | | ALERT_MESSAGE); |
| | | assertEquals(DummyAlertHandler.getAlertCount(), count); |
| | | } |