summaryrefslogtreecommitdiffstats
path: root/policy-management/src/test/java/org
diff options
context:
space:
mode:
authorjhh <jorge.hernandez-herrero@att.com>2021-02-18 13:32:16 -0600
committerjhh <jorge.hernandez-herrero@att.com>2021-02-19 08:24:29 -0600
commitd6083133bac5c1a54681a004468d416993d47d7f (patch)
treee99be71f5346b634150eebd2875f4f79b640a988 /policy-management/src/test/java/org
parentdd8c5ad785a19c3af7249808aa01fe4f04abc61e (diff)
remove TransMetric - not needed
Issue-ID: POLICY-3033 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I626de45b528bb891c79900085bfe783fe248b3fa Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Diffstat (limited to 'policy-management/src/test/java/org')
-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