diff options
author | liamfallon <liam.fallon@ericsson.com> | 2018-09-13 23:48:50 +0100 |
---|---|---|
committer | liamfallon <liam.fallon@ericsson.com> | 2018-09-13 23:49:32 +0100 |
commit | cd68fc9bae7d6258f77ff59c1431e4f925f61a4c (patch) | |
tree | 53054a7c8e8738644785039c3a200c6b23d4b3ed /testsuites/performance/performance-context-metrics/src | |
parent | 4cfa2e2d98f6877d54da304ef17f096284430908 (diff) |
Address sonar/Checkstyle Issues
Sweep through Apex codebase to fix most ceheckstyle and
straightforward sonar issues.
Issue-ID: POLICY-1034
Change-Id: I149d9a94ad893affc93573e8de5e3304b6bdde2d
Signed-off-by: liamfallon <liam.fallon@ericsson.com>
Diffstat (limited to 'testsuites/performance/performance-context-metrics/src')
-rw-r--r-- | testsuites/performance/performance-context-metrics/src/main/java/org/onap/policy/apex/testsuites/performance/context/metrics/ConcurrentContextMetrics.java (renamed from testsuites/performance/performance-context-metrics/src/main/java/org/onap/policy/apex/plugins/context/metrics/ConcurrentContextMetrics.java) | 69 | ||||
-rw-r--r-- | testsuites/performance/performance-context-metrics/src/main/java/org/onap/policy/apex/testsuites/performance/context/metrics/package-info.java (renamed from testsuites/performance/performance-context-metrics/src/main/java/org/onap/policy/apex/plugins/context/metrics/package-info.java) | 2 | ||||
-rw-r--r-- | testsuites/performance/performance-context-metrics/src/test/java/org/onap/policy/apex/testsuites/performance/context/metrics/TestMetrics.java (renamed from testsuites/performance/performance-context-metrics/src/test/java/org/onap/policy/apex/plugins/context/metrics/TestMetrics.java) | 18 |
3 files changed, 52 insertions, 37 deletions
diff --git a/testsuites/performance/performance-context-metrics/src/main/java/org/onap/policy/apex/plugins/context/metrics/ConcurrentContextMetrics.java b/testsuites/performance/performance-context-metrics/src/main/java/org/onap/policy/apex/testsuites/performance/context/metrics/ConcurrentContextMetrics.java index 3d257f89a..c4e4de480 100644 --- a/testsuites/performance/performance-context-metrics/src/main/java/org/onap/policy/apex/plugins/context/metrics/ConcurrentContextMetrics.java +++ b/testsuites/performance/performance-context-metrics/src/main/java/org/onap/policy/apex/testsuites/performance/context/metrics/ConcurrentContextMetrics.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.policy.apex.plugins.context.metrics; +package org.onap.policy.apex.testsuites.performance.context.metrics; import static org.onap.policy.apex.context.parameters.DistributorParameters.DEFAULT_DISTRIBUTOR_PLUGIN_CLASS; import static org.onap.policy.apex.context.parameters.LockManagerParameters.DEFAULT_LOCK_MANAGER_PLUGIN_CLASS; @@ -80,39 +80,41 @@ public class ConcurrentContextMetrics { */ public static void main(final String[] args) throws Exception { if (args.length != NUM_ARGS) { - System.err.println("Args: " + Arrays.toString(args)); - System.err.println( - "usage: testLabel jvmCount threadCount threadLoops longArraySize lockType zookeeperAddress zookeeperPort zookeeperDirectory"); + String errorMessage = "Args: " + Arrays.toString(args) + + "\nusage: testLabel jvmCount threadCount threadLoops longArraySize lockType " + + "zookeeperAddress zookeeperPort zookeeperDirectory"; + LOGGER.info(errorMessage); return; } - final ConfigrationProvider configrationProvider = - new ConfigrationProviderImpl(args[ARG_LABEL], Integer.valueOf(args[ARG_JVM_COUNT]), - Integer.valueOf(args[ARG_THREAD_COUNT]), Integer.valueOf(args[ARG_ITERATIONS]), - Integer.valueOf(args[ARG_ARRAY_SIZE]), Integer.valueOf(args[ARG_LOCK_TYPE])); + final ConfigrationProvider configrationProvider = new ConfigrationProviderImpl(args[ARG_LABEL], + Integer.valueOf(args[ARG_JVM_COUNT]), Integer.valueOf(args[ARG_THREAD_COUNT]), + Integer.valueOf(args[ARG_ITERATIONS]), Integer.valueOf(args[ARG_ARRAY_SIZE]), + Integer.valueOf(args[ARG_LOCK_TYPE])); final ConcurrentContextMetrics concurrentContextMetrics = new ConcurrentContextMetrics(configrationProvider, - args[ARG_ZOOKEEPER_ADDRESS], Integer.valueOf(args[ARG_ZOOKEEPER_PORT]), args[ARG_ZOOKEEPER_DIRECTORY]); + args[ARG_ZOOKEEPER_ADDRESS], Integer.valueOf(args[ARG_ZOOKEEPER_PORT]), + args[ARG_ZOOKEEPER_DIRECTORY]); - concurrentContextMetrics.concurrentContextMetricsJVMLocal(); + concurrentContextMetrics.concurrentContextMetricsJvmLocal(); concurrentContextMetrics.concurrentContextMetricsCurator(); concurrentContextMetrics.concurrentContextMetricsHazelcast(); - concurrentContextMetrics.concurrentContextMetricsHazelcastMultiJVMHazelcastLock(); - concurrentContextMetrics.concurrentContextMetricsInfinispanMultiJVMHazelcastlock(); - concurrentContextMetrics.concurrentContextMetricsInfinispanMultiJVMCuratorLock(); - concurrentContextMetrics.concurrentContextMetricsHazelcastMultiJVMCuratorLock(); + concurrentContextMetrics.concurrentContextMetricsHazelcastMultiJvmHazelcastLock(); + concurrentContextMetrics.concurrentContextMetricsInfinispanMultiJvmHazelcastlock(); + concurrentContextMetrics.concurrentContextMetricsInfinispanMultiJvmCuratorLock(); + concurrentContextMetrics.concurrentContextMetricsHazelcastMultiJvmCuratorLock(); } /** - * The Constructor. + * Construct a concurrent context object. * - * @param configrationProvider - * @param zookeeperAddress - * @param zookeeperPort - * @param zookeeperDirectory + * @param configrationProvider Configuration for the context metrics + * @param zookeeperAddress Zookeeper address + * @param zookeeperPort Zookeeper port + * @param zookeeperDirectory Zookeeper directory */ public ConcurrentContextMetrics(final ConfigrationProvider configrationProvider, final String zookeeperAddress, - final int zookeeperPort, final String zookeeperDirectory) { + final int zookeeperPort, final String zookeeperDirectory) { this.configrationProvider = configrationProvider; this.zookeeperAddress = zookeeperAddress; this.zookeeperPort = zookeeperPort; @@ -126,7 +128,7 @@ public class ConcurrentContextMetrics { * @throws IOException the IO exception * @throws ApexException the apex exception */ - private void concurrentContextMetricsJVMLocal() throws ApexModelException, IOException, ApexException { + private void concurrentContextMetricsJvmLocal() throws IOException, ApexException { if (configrationProvider.getJvmCount() != 1) { return; } @@ -194,7 +196,7 @@ public class ConcurrentContextMetrics { * @throws IOException the IO exception * @throws ApexException the apex exception */ - private void concurrentContextMetricsHazelcastMultiJVMHazelcastLock() throws IOException, ApexException { + private void concurrentContextMetricsHazelcastMultiJvmHazelcastLock() throws IOException, ApexException { LOGGER.debug("Running concurrentContextMetricsHazelcastMultiJVMHazelcastLock metrics . . ."); final ContextParameters contextParameters = new ContextParameters(); @@ -212,7 +214,7 @@ public class ConcurrentContextMetrics { * @throws IOException the IO exception * @throws ApexException the apex exception */ - private void concurrentContextMetricsInfinispanMultiJVMHazelcastlock() throws IOException, ApexException { + private void concurrentContextMetricsInfinispanMultiJvmHazelcastlock() throws IOException, ApexException { LOGGER.debug("Running concurrentContextMetricsInfinispanMultiJVMHazelcastlock metrics . . ."); final ContextParameters contextParameters = new ContextParameters(); @@ -233,15 +235,15 @@ public class ConcurrentContextMetrics { * * @throws IOException the IO exception * @throws ApexException the apex exception - * @throws InterruptedException + * @throws InterruptedException on interrupts */ - private void concurrentContextMetricsInfinispanMultiJVMCuratorLock() - throws IOException, ApexException, InterruptedException { + private void concurrentContextMetricsInfinispanMultiJvmCuratorLock() + throws IOException, ApexException, InterruptedException { LOGGER.debug("Running concurrentContextMetricsInfinispanMultiJVMCuratorLock metrics . . ."); - final ZooKeeperServerServiceProvider zooKeeperServerServiceProvider = - new ZooKeeperServerServiceProvider(zookeeperDirectory, zookeeperAddress, zookeeperPort); + final ZooKeeperServerServiceProvider zooKeeperServerServiceProvider = new ZooKeeperServerServiceProvider( + zookeeperDirectory, zookeeperAddress, zookeeperPort); try { zooKeeperServerServiceProvider.startZookeeperServer(); final ContextParameters contextParameters = new ContextParameters(); @@ -268,14 +270,14 @@ public class ConcurrentContextMetrics { * * @throws IOException the IO exception * @throws ApexException the apex exception - * @throws InterruptedException + * @throws InterruptedException on interrupts */ - private void concurrentContextMetricsHazelcastMultiJVMCuratorLock() - throws IOException, ApexException, InterruptedException { + private void concurrentContextMetricsHazelcastMultiJvmCuratorLock() + throws IOException, ApexException, InterruptedException { LOGGER.debug("Running concurrentContextMetricsHazelcastMultiJVMCuratorLock metrics . . ."); - final ZooKeeperServerServiceProvider zooKeeperServerServiceProvider = - new ZooKeeperServerServiceProvider(zookeeperDirectory, zookeeperAddress, zookeeperPort); + final ZooKeeperServerServiceProvider zooKeeperServerServiceProvider = new ZooKeeperServerServiceProvider( + zookeeperDirectory, zookeeperAddress, zookeeperPort); try { zooKeeperServerServiceProvider.startZookeeperServer(); @@ -318,5 +320,4 @@ public class ConcurrentContextMetrics { LOGGER.info("Completed {} ...", testName); } - } diff --git a/testsuites/performance/performance-context-metrics/src/main/java/org/onap/policy/apex/plugins/context/metrics/package-info.java b/testsuites/performance/performance-context-metrics/src/main/java/org/onap/policy/apex/testsuites/performance/context/metrics/package-info.java index 5e916b6db..9bb84d76b 100644 --- a/testsuites/performance/performance-context-metrics/src/main/java/org/onap/policy/apex/plugins/context/metrics/package-info.java +++ b/testsuites/performance/performance-context-metrics/src/main/java/org/onap/policy/apex/testsuites/performance/context/metrics/package-info.java @@ -24,4 +24,4 @@ * * @author Liam Fallon (liam.fallon@ericsson.com) */ -package org.onap.policy.apex.plugins.context.metrics; +package org.onap.policy.apex.testsuites.performance.context.metrics; diff --git a/testsuites/performance/performance-context-metrics/src/test/java/org/onap/policy/apex/plugins/context/metrics/TestMetrics.java b/testsuites/performance/performance-context-metrics/src/test/java/org/onap/policy/apex/testsuites/performance/context/metrics/TestMetrics.java index 04b756417..6414fa81a 100644 --- a/testsuites/performance/performance-context-metrics/src/test/java/org/onap/policy/apex/plugins/context/metrics/TestMetrics.java +++ b/testsuites/performance/performance-context-metrics/src/test/java/org/onap/policy/apex/testsuites/performance/context/metrics/TestMetrics.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.policy.apex.plugins.context.metrics; +package org.onap.policy.apex.testsuites.performance.context.metrics; import static org.junit.Assert.fail; @@ -32,10 +32,14 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.onap.policy.apex.context.test.utils.NetworkUtils; +import org.onap.policy.apex.testsuites.performance.context.metrics.ConcurrentContextMetrics; import org.onap.policy.common.utils.resources.ResourceUtils; import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; +/** + * The Class TestMetrics. + */ public class TestMetrics { // Logger for this class private static final XLogger LOGGER = XLoggerFactory.getXLogger(TestMetrics.class); @@ -47,6 +51,11 @@ public class TestMetrics { @Rule public final TemporaryFolder folder = new TemporaryFolder(); + /** + * Configure. + * + * @throws Exception the exception + */ @BeforeClass public static void configure() throws Exception { System.setProperty(JAVA_NET_PREFER_IPV4_STACK, "true"); @@ -63,8 +72,13 @@ public class TestMetrics { } + /** + * Gets the single jvm metrics. + * + * @throws IOException Signals that an I/O exception has occurred. + */ @Test - public void getSingleJVMMetrics() throws IOException { + public void getSingleJvmMetrics() throws IOException { final File zookeeperDirectory = folder.newFolder("zookeeperDirectory"); final String[] args = {"singleJVMTestNL", "1", "32", "1000", "65536", "0", "localhost", "62181", zookeeperDirectory.getAbsolutePath()}; |