summaryrefslogtreecommitdiffstats
path: root/rulemgt/src/test
diff options
context:
space:
mode:
authorGuangrongFu <fu.guangrong@zte.com.cn>2017-02-23 17:04:23 +0800
committerGuangrongFu <fu.guangrong@zte.com.cn>2017-02-23 17:05:03 +0800
commit2a7cf2d3d4a5a3551346cf52a19c27ef21ae4946 (patch)
tree6d9b6de6c3a8495ff90a793f1455076cf8336302 /rulemgt/src/test
parent3bb5daf49ecab4da05a137e60b772c2ab91698a0 (diff)
Add a New Test Class
Change-Id: I4d9eb81d197499581f672c9f65de682314eef577 Issue-ID: HOLMES-47 Signed-off-by: GuangrongFu <fu.guangrong@zte.com.cn>
Diffstat (limited to 'rulemgt/src/test')
-rw-r--r--rulemgt/src/test/java/org/openo/holmes/rulemgt/db/CorrelationRuleQueryDaoTest.java7
1 files changed, 2 insertions, 5 deletions
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/db/CorrelationRuleQueryDaoTest.java b/rulemgt/src/test/java/org/openo/holmes/rulemgt/db/CorrelationRuleQueryDaoTest.java
index e0331de..0b1d151 100644
--- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/db/CorrelationRuleQueryDaoTest.java
+++ b/rulemgt/src/test/java/org/openo/holmes/rulemgt/db/CorrelationRuleQueryDaoTest.java
@@ -30,15 +30,12 @@ import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
-import org.junit.runner.RunWith;
import org.openo.holmes.common.api.entity.CorrelationRule;
import org.openo.holmes.common.exception.CorrelationException;
import org.openo.holmes.common.utils.DbDaoUtil;
import org.openo.holmes.common.utils.I18nProxy;
import org.openo.holmes.rulemgt.bean.request.RuleQueryCondition;
import org.powermock.api.easymock.PowerMock;
-import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor;
-import org.powermock.modules.junit4.PowerMockRunner;
import org.powermock.modules.junit4.rule.PowerMockRule;
import org.powermock.reflect.Whitebox;
import org.skife.jdbi.v2.Handle;
@@ -77,7 +74,7 @@ public class CorrelationRuleQueryDaoTest {
-
+ @Test
public void getCorrelationRulesByCondition_db_exception() throws Exception {
thrown.expect(CorrelationException.class);
@@ -96,7 +93,7 @@ public class CorrelationRuleQueryDaoTest {
PowerMock.verifyAll();
}
-
+ @Test
public void getCorrelationRulesByCondition_normal() throws Exception {
EasyMock.expect(dbDaoUtil.getHandle()).andReturn(handle);
EasyMock.expect(handle.createQuery(EasyMock.anyObject(String.class))).andReturn(query);