@@ -0,0 +1,1018 @@
+package com.dianping.cat.report.alert;%0A%0Aimport java.util.Date;%0Aimport java.util.concurrent.TimeUnit;%0A%0Aimport junit.framework.Assert;%0A%0Aimport org.junit.Test;%0Aimport org.unidal.lookup.ComponentTestCase;%0A%0Aimport com.dianping.cat.report.task.alert.AlertType;%0Aimport com.dianping.cat.report.task.alert.sender.AlertEntity;%0Aimport com.dianping.cat.report.task.alert.sender.AlertManager;%0A%0Apublic class SuspendTest extends ComponentTestCase %7B%0A%0A%09@Test%0A%09public void test() %7B%0A%09%09AlertManager manager = lookup(AlertManager.class);%0A%09%09AlertEntity entity = new AlertEntity();%0A%09%09entity.setDate(new Date()).setContent(%22test%22).setLevel(%22error%22);%0A%09%09entity.setMetric(%22testMetric%22).setType(AlertType.NETWORK).setGroup(%22testGroup%22);%0A%0A%09%09try %7B%0A%09%09%09manager.addAlert(entity);%0A%09%09%09TimeUnit.SECONDS.sleep(1);%0A%09%09%7D catch (Exception ex) %7B%0A%0A%09%09%7D%0A%0A%09%09Assert.assertTrue(manager.isSuspend(entity.getKey(), 1));%0A%09%09try %7B%0A%09%09%09TimeUnit.SECONDS.sleep(65);%0A%09%09%7D catch (InterruptedException e) %7B%0A%09%09%7D%0A%0A%09%09Assert.assertFalse(manager.isSuspend(entity.getKey(), 1));%0A%09%7D%0A%0A%7D%0A

add SuspendTest