Package com.dianping.cat.report.task.alert.sender

Examples of com.dianping.cat.report.task.alert.sender.AlertManager


public class SuspendTest extends ComponentTestCase {

  @Test
  public void test() {
    AlertManager manager = lookup(AlertManager.class);
    AlertEntity entity = new AlertEntity();
    entity.setDate(new Date()).setContent("test").setLevel("error");
    entity.setMetric("testMetric").setType(AlertType.Network.getName()).setGroup("testGroup");

    try {
      manager.addAlert(entity);
      TimeUnit.SECONDS.sleep(1);
    } catch (Exception ex) {

    }

    Assert.assertTrue(manager.isSuspend(entity.getKey(), 1));
    try {
      TimeUnit.SECONDS.sleep(65);
    } catch (InterruptedException e) {
    }

    Assert.assertFalse(manager.isSuspend(entity.getKey(), 1));
  }
View Full Code Here

TOP

Related Classes of com.dianping.cat.report.task.alert.sender.AlertManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.