summaryrefslogtreecommitdiffstats
path: root/policy-management/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'policy-management/src/test')
-rw-r--r--policy-management/src/test/java/org/onap/policy/drools/stats/PolicyStatsManagerTest.java4
-rw-r--r--policy-management/src/test/java/org/onap/policy/drools/stats/PolicyStatsTest.java12
-rw-r--r--policy-management/src/test/java/org/onap/policy/drools/system/PolicyEngineManagerTest.java5
3 files changed, 10 insertions, 11 deletions
diff --git a/policy-management/src/test/java/org/onap/policy/drools/stats/PolicyStatsManagerTest.java b/policy-management/src/test/java/org/onap/policy/drools/stats/PolicyStatsManagerTest.java
index 9ab23979..a12fb50a 100644
--- a/policy-management/src/test/java/org/onap/policy/drools/stats/PolicyStatsManagerTest.java
+++ b/policy-management/src/test/java/org/onap/policy/drools/stats/PolicyStatsManagerTest.java
@@ -23,7 +23,7 @@ package org.onap.policy.drools.stats;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
-import org.onap.policy.drools.metrics.TransMetric;
+import org.onap.policy.drools.metrics.Metric;
public class PolicyStatsManagerTest {
@@ -32,7 +32,7 @@ public class PolicyStatsManagerTest {
PolicyStatsManager stats = new PolicyStatsManager();
assertEquals(0, stats.getGroupStat().getPolicyExecutedCount());
- TransMetric trans = new TransMetric();
+ Metric trans = new Metric();
stats.stat("foo", trans);
stats.stat("blah", trans);
stats.stat("blah", trans);
diff --git a/policy-management/src/test/java/org/onap/policy/drools/stats/PolicyStatsTest.java b/policy-management/src/test/java/org/onap/policy/drools/stats/PolicyStatsTest.java
index 29518e93..631e85b8 100644
--- a/policy-management/src/test/java/org/onap/policy/drools/stats/PolicyStatsTest.java
+++ b/policy-management/src/test/java/org/onap/policy/drools/stats/PolicyStatsTest.java
@@ -24,13 +24,13 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
-import org.onap.policy.drools.metrics.TransMetric;
+import org.onap.policy.drools.metrics.Metric;
public class PolicyStatsTest {
@Test
public void testStat() {
- TransMetric trans1 = createTrans();
+ Metric trans1 = createTrans();
trans1.setSuccess(true);
PolicyStats stats = new PolicyStats();
@@ -44,7 +44,7 @@ public class PolicyStatsTest {
assertEquals(1, stats.getPolicyExecutedSuccessCount());
assertThat(stats.getBirthTime()).isGreaterThanOrEqualTo(trans1.getStartTime().toEpochMilli());
- TransMetric trans2 = createTrans();
+ Metric trans2 = createTrans();
trans2.setSuccess(false);
trans2.setEndTime(trans2.getStartTime().plusMillis(5));
trans2.setElapsedTime(null);
@@ -58,7 +58,7 @@ public class PolicyStatsTest {
assertEquals(1, stats.getPolicyExecutedSuccessCount());
assertThat(stats.getBirthTime()).isLessThanOrEqualTo(trans2.getStartTime().toEpochMilli());
- TransMetric trans3 = createTrans();
+ Metric trans3 = createTrans();
trans3.setSuccess(false);
trans3.setEndTime(trans3.getStartTime().plusMillis(9));
trans3.setElapsedTime(null);
@@ -73,8 +73,8 @@ public class PolicyStatsTest {
assertThat(stats.getBirthTime()).isLessThanOrEqualTo(trans2.getStartTime().toEpochMilli());
}
- private TransMetric createTrans() {
- TransMetric trans = new TransMetric();
+ private Metric createTrans() {
+ Metric trans = new Metric();
trans.setStartTime(null);
trans.setEndTime(trans.getStartTime().plusMillis(1));
diff --git a/policy-management/src/test/java/org/onap/policy/drools/system/PolicyEngineManagerTest.java b/policy-management/src/test/java/org/onap/policy/drools/system/PolicyEngineManagerTest.java
index f9b101c3..1930dfb8 100644
--- a/policy-management/src/test/java/org/onap/policy/drools/system/PolicyEngineManagerTest.java
+++ b/policy-management/src/test/java/org/onap/policy/drools/system/PolicyEngineManagerTest.java
@@ -65,7 +65,6 @@ import org.onap.policy.drools.core.lock.PolicyResourceLockManager;
import org.onap.policy.drools.features.PolicyControllerFeatureApi;
import org.onap.policy.drools.features.PolicyEngineFeatureApi;
import org.onap.policy.drools.metrics.Metric;
-import org.onap.policy.drools.metrics.TransMetric;
import org.onap.policy.drools.persistence.SystemPersistence;
import org.onap.policy.drools.properties.DroolsPropertyConstants;
import org.onap.policy.drools.protocol.coders.EventProtocolCoder;
@@ -1365,10 +1364,10 @@ public class PolicyEngineManagerTest {
assertEquals(0, mgr.getStats().getGroupStat().getPolicyExecutedCount());
assertEquals(0, mgr.getStats().getSubgroupStats().size());
- mgr.transaction("foo", "bar", new TransMetric());
+ mgr.transaction("foo", "bar", new Metric());
assertEquals(1, mgr.getStats().getGroupStat().getPolicyExecutedCount());
assertEquals(1, mgr.getStats().getSubgroupStats().size());
- assertEquals(1, mgr.getStats().getSubgroupStats().get("foo[bar]").getPolicyExecutedFailCount());
+ assertEquals(1, mgr.getStats().getSubgroupStats().get("bar").getPolicyExecutedFailCount());
}
@Test