From 6505fa1c845c34d59c44a40f87b66ef79f3e911c Mon Sep 17 00:00:00 2001 From: Pamela Dragosh Date: Tue, 14 Aug 2018 09:45:44 -0400 Subject: Fixes for checkstyle issues More fixes for spacing, adding comments, adding period at the end, and move code closer to usage. Issue-ID: POLICY-881 Change-Id: Ife99eaf627a221e87d65d24dfd145b0ee4e06d21 Signed-off-by: Pamela Dragosh --- .../org/onap/policy/common/ia/AuditPeriodTest.java | 2 +- .../org/onap/policy/common/ia/AuditorTimeTest.java | 3 ++- .../java/org/onap/policy/common/ia/DbAuditTest.java | 1 + .../onap/policy/common/ia/IntegrityAuditTestBase.java | 18 ++++++++++++------ 4 files changed, 16 insertions(+), 8 deletions(-) (limited to 'integrity-audit/src/test/java/org') diff --git a/integrity-audit/src/test/java/org/onap/policy/common/ia/AuditPeriodTest.java b/integrity-audit/src/test/java/org/onap/policy/common/ia/AuditPeriodTest.java index 5baf21ad..9aad6863 100644 --- a/integrity-audit/src/test/java/org/onap/policy/common/ia/AuditPeriodTest.java +++ b/integrity-audit/src/test/java/org/onap/policy/common/ia/AuditPeriodTest.java @@ -227,7 +227,7 @@ public class AuditPeriodTest extends IntegrityAuditTestBase { runAudit(p); long elapsed = p.getTimeInMillis() - tbegin; - synchronized(tmin) { + synchronized (tmin) { tmin.set(Math.min(tmin.get(), elapsed)); } diff --git a/integrity-audit/src/test/java/org/onap/policy/common/ia/AuditorTimeTest.java b/integrity-audit/src/test/java/org/onap/policy/common/ia/AuditorTimeTest.java index 6ee10102..7da157f2 100644 --- a/integrity-audit/src/test/java/org/onap/policy/common/ia/AuditorTimeTest.java +++ b/integrity-audit/src/test/java/org/onap/policy/common/ia/AuditorTimeTest.java @@ -21,11 +21,12 @@ package org.onap.policy.common.ia; import static org.junit.Assert.*; + import org.junit.Test; import org.onap.policy.common.utils.time.CurrentTime; /** - * + * Tests the AuditorTime class. */ public class AuditorTimeTest { diff --git a/integrity-audit/src/test/java/org/onap/policy/common/ia/DbAuditTest.java b/integrity-audit/src/test/java/org/onap/policy/common/ia/DbAuditTest.java index e7ea47e0..8e848787 100644 --- a/integrity-audit/src/test/java/org/onap/policy/common/ia/DbAuditTest.java +++ b/integrity-audit/src/test/java/org/onap/policy/common/ia/DbAuditTest.java @@ -23,6 +23,7 @@ package org.onap.policy.common.ia; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.fail; + import java.util.List; import java.util.Properties; import javax.persistence.EntityManager; diff --git a/integrity-audit/src/test/java/org/onap/policy/common/ia/IntegrityAuditTestBase.java b/integrity-audit/src/test/java/org/onap/policy/common/ia/IntegrityAuditTestBase.java index 94ee0297..9324dfb4 100644 --- a/integrity-audit/src/test/java/org/onap/policy/common/ia/IntegrityAuditTestBase.java +++ b/integrity-audit/src/test/java/org/onap/policy/common/ia/IntegrityAuditTestBase.java @@ -22,6 +22,9 @@ package org.onap.policy.common.ia; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.Logger; import java.io.FileOutputStream; import java.io.IOException; import java.util.ArrayList; @@ -45,8 +48,6 @@ import org.onap.policy.common.utils.time.CurrentTime; import org.onap.policy.common.utils.time.TestTime; import org.powermock.reflect.Whitebox; import org.slf4j.LoggerFactory; -import ch.qos.logback.classic.Level; -import ch.qos.logback.classic.Logger; /** * All JUnits are designed to run in the local development environment where they have write @@ -267,6 +268,8 @@ public class IntegrityAuditTestBase { } /** + * Get the test time. + * * @return the {@link TestTime} in use by this thread */ public static TestTime getTestTime() { @@ -521,10 +524,11 @@ public class IntegrityAuditTestBase { * @param resourceName the resource name * @param persistenceUnit the persistence unit * @param properties the properties - * @param time + * @param time the time * @throws Exception if an error occurs */ - public MyIntegrityAudit(String resourceName, String persistenceUnit, Properties properties, TestTime time) throws Exception { + public MyIntegrityAudit(String resourceName, String persistenceUnit, + Properties properties, TestTime time) throws Exception { super(resourceName, persistenceUnit, properties); myTime = time; @@ -536,6 +540,8 @@ public class IntegrityAuditTestBase { } /** + * Get time in milliseconds. + * * @return the "current" time for the auditor */ public long getTimeInMillis() { @@ -545,8 +551,8 @@ public class IntegrityAuditTestBase { /** * Sleeps for a period of time. * - * @param sleepMs - * @throws InterruptedException + * @param sleepMs time to sleep + * @throws InterruptedException can be interrupted */ public void sleep(long sleepMs) throws InterruptedException { myTime.sleep(sleepMs); -- cgit 1.2.3-korg