From 1ba6a3268b220cc99e9ed993553fa6f34f111a39 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Fri, 22 Feb 2019 17:30:59 +0000 Subject: Change versions of Zookeeper and C3P0 This review changes the versions of Zookeeper and C3P0 to resolve security issues. It also merges the context test utils module into the context test because that module was misplaced and put an incompatible Zookeeper dependency in the APEX context module. Issue-ID: POLICY-1540 Change-Id: I86048ae1fc8b818611f423d6fd1f4a9fcc3f76f9 Signed-off-by: liamfallon --- .../integration/integration-context-test/pom.xml | 7 +- .../integration/context/TestConcurrentContext.java | 104 +++- .../context/concepts/TestContextBooleanItem.java | 112 +++++ .../context/concepts/TestContextByteItem.java | 110 ++++ .../context/concepts/TestContextDateItem.java | 242 +++++++++ .../concepts/TestContextDateLocaleItem.java | 254 ++++++++++ .../context/concepts/TestContextDateTzItem.java | 193 +++++++ .../context/concepts/TestContextDoubleItem.java | 113 +++++ .../context/concepts/TestContextFloatItem.java | 110 ++++ .../context/concepts/TestContextIntItem.java | 119 +++++ .../context/concepts/TestContextLongItem.java | 111 +++++ .../concepts/TestContextLongObjectItem.java | 117 +++++ .../context/concepts/TestContextStringItem.java | 117 +++++ .../context/concepts/TestContextTreeMapItem.java | 123 +++++ .../context/concepts/TestContextTreeSetItem.java | 133 +++++ .../context/concepts/TestExternalContextItem.java | 435 ++++++++++++++++ .../context/concepts/TestGlobalContextItem.java | 435 ++++++++++++++++ .../context/concepts/TestPolicyContextItem.java | 242 +++++++++ .../integration/context/concepts/package-info.java | 28 ++ .../context/distribution/ContextAlbumUpdate.java | 121 +++++ .../context/distribution/ContextInstantiation.java | 555 +++++++++++++++++++++ .../context/distribution/ContextUpdate.java | 178 +++++++ .../SequentialContextInstantiation.java | 386 ++++++++++++++ .../context/distribution/package-info.java | 28 ++ .../context/entities/ArtifactKeyTestEntity.java | 258 ++++++++++ .../context/entities/ReferenceKeyTestEntity.java | 261 ++++++++++ .../integration/context/entities/package-info.java | 27 + .../context/factory/TestContextAlbumFactory.java | 217 ++++++++ .../integration/context/factory/package-info.java | 28 ++ .../context/lock/modifier/AlbumModifier.java | 43 ++ .../context/lock/modifier/LockType.java | 102 ++++ .../context/lock/modifier/NoLockAlbumModifier.java | 56 +++ .../lock/modifier/ReadLockAlbumModifier.java | 71 +++ .../SingleValueWriteLockAlbumModifier.java | 75 +++ .../lock/modifier/WriteLockAlbumModifier.java | 73 +++ .../context/lock/modifier/package-info.java | 26 + .../context/locking/ConcurrentContext.java | 166 ++++++ .../context/locking/ConcurrentContextJvm.java | 233 +++++++++ .../locking/ConcurrentContextJvmThread.java | 136 +++++ .../context/locking/ConcurrentContextThread.java | 95 ++++ .../integration/context/locking/package-info.java | 28 ++ .../context/utils/ConfigrationProvider.java | 146 ++++++ .../context/utils/ConfigrationProviderImpl.java | 265 ++++++++++ .../integration/context/utils/Constants.java | 81 +++ .../context/utils/IntegrationThreadFactory.java | 60 +++ .../integration/context/utils/NetworkUtils.java | 67 +++ .../utils/ZooKeeperServerServiceProvider.java | 106 ++++ .../integration/context/utils/package-info.java | 28 ++ .../src/test/resources/META-INF/persistence.xml | 51 ++ testsuites/integration/pom.xml | 14 +- .../performance-context-metrics/pom.xml | 93 ---- .../context/metrics/ConcurrentContextMetrics.java | 322 ------------ .../performance/context/metrics/package-info.java | 27 - .../src/site/css/site.css | 100 ---- .../src/site/images/logos.png | Bin 162383 -> 0 bytes .../performance-context-metrics/src/site/site.xml | 28 -- .../performance/context/metrics/MetricsTest.java | 94 ---- .../src/test/resources/hazelcast/hazelcast.xml | 63 --- .../resources/infinispan/default-jgroups-tcp.xml | 76 --- .../src/test/resources/infinispan/infinispan.xml | 41 -- testsuites/performance/pom.xml | 4 +- 61 files changed, 7051 insertions(+), 883 deletions(-) create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextBooleanItem.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextByteItem.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextDateItem.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextDateLocaleItem.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextDateTzItem.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextDoubleItem.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextFloatItem.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextIntItem.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextLongItem.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextLongObjectItem.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextStringItem.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextTreeMapItem.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextTreeSetItem.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestExternalContextItem.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestGlobalContextItem.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestPolicyContextItem.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/package-info.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/ContextAlbumUpdate.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/ContextInstantiation.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/ContextUpdate.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/SequentialContextInstantiation.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/package-info.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/entities/ArtifactKeyTestEntity.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/entities/ReferenceKeyTestEntity.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/entities/package-info.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/factory/TestContextAlbumFactory.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/factory/package-info.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/lock/modifier/AlbumModifier.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/lock/modifier/LockType.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/lock/modifier/NoLockAlbumModifier.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/lock/modifier/ReadLockAlbumModifier.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/lock/modifier/SingleValueWriteLockAlbumModifier.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/lock/modifier/WriteLockAlbumModifier.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/lock/modifier/package-info.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/locking/ConcurrentContext.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/locking/ConcurrentContextJvm.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/locking/ConcurrentContextJvmThread.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/locking/ConcurrentContextThread.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/locking/package-info.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/utils/ConfigrationProvider.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/utils/ConfigrationProviderImpl.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/utils/Constants.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/utils/IntegrationThreadFactory.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/utils/NetworkUtils.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/utils/ZooKeeperServerServiceProvider.java create mode 100755 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/utils/package-info.java create mode 100644 testsuites/integration/integration-context-test/src/test/resources/META-INF/persistence.xml delete mode 100644 testsuites/performance/performance-context-metrics/pom.xml delete mode 100644 testsuites/performance/performance-context-metrics/src/main/java/org/onap/policy/apex/testsuites/performance/context/metrics/ConcurrentContextMetrics.java delete mode 100644 testsuites/performance/performance-context-metrics/src/main/java/org/onap/policy/apex/testsuites/performance/context/metrics/package-info.java delete mode 100644 testsuites/performance/performance-context-metrics/src/site/css/site.css delete mode 100644 testsuites/performance/performance-context-metrics/src/site/images/logos.png delete mode 100644 testsuites/performance/performance-context-metrics/src/site/site.xml delete mode 100644 testsuites/performance/performance-context-metrics/src/test/java/org/onap/policy/apex/testsuites/performance/context/metrics/MetricsTest.java delete mode 100644 testsuites/performance/performance-context-metrics/src/test/resources/hazelcast/hazelcast.xml delete mode 100644 testsuites/performance/performance-context-metrics/src/test/resources/infinispan/default-jgroups-tcp.xml delete mode 100644 testsuites/performance/performance-context-metrics/src/test/resources/infinispan/infinispan.xml (limited to 'testsuites') diff --git a/testsuites/integration/integration-context-test/pom.xml b/testsuites/integration/integration-context-test/pom.xml index 239bc684d..f8a96fd12 100644 --- a/testsuites/integration/integration-context-test/pom.xml +++ b/testsuites/integration/integration-context-test/pom.xml @@ -1,6 +1,7 @@ + + + + org.eclipse.persistence.jpa.PersistenceProvider + + org.onap.policy.apex.model.basicmodel.dao.converters.CDataConditioner + org.onap.policy.apex.model.basicmodel.dao.converters.Uuid2String + org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey + org.onap.policy.apex.model.basicmodel.concepts.AxConcept + org.onap.policy.apex.model.basicmodel.concepts.AxKeyInfo + org.onap.policy.apex.model.basicmodel.concepts.AxKeyInformation + org.onap.policy.apex.model.basicmodel.concepts.AxModel + org.onap.policy.apex.model.basicmodel.concepts.TestEntity + org.onap.policy.apex.model.contextmodel.concepts.AxContextSchema + org.onap.policy.apex.model.contextmodel.concepts.AxContextSchemas + org.onap.policy.apex.model.contextmodel.concepts.AxContextAlbum + org.onap.policy.apex.model.contextmodel.concepts.AxContextAlbums + org.onap.policy.apex.model.contextmodel.concepts.AxContextModel + + + + + + + + + + + + diff --git a/testsuites/integration/pom.xml b/testsuites/integration/pom.xml index 4242e8231..c5b89a71c 100644 --- a/testsuites/integration/pom.xml +++ b/testsuites/integration/pom.xml @@ -1,6 +1,7 @@ - - - 4.0.0 - - org.onap.policy.apex-pdp.testsuites.performance - performance - 2.1.0-SNAPSHOT - - - performance-context-metrics - ${project.artifactId} - [${project.parent.artifactId}] module to calculate metrics using various plugins - - - - org.onap.policy.common - utils - - - org.onap.policy.apex-pdp.core - core-infrastructure - ${project.version} - - - org.onap.policy.apex-pdp.context - context-test-utils - ${project.version} - - - org.onap.policy.apex-pdp.plugins.plugins-context.plugins-context-distribution - plugins-context-distribution-hazelcast - ${project.version} - - - org.onap.policy.apex-pdp.plugins.plugins-context.plugins-context-distribution - plugins-context-distribution-infinispan - ${project.version} - - - org.onap.policy.apex-pdp.plugins.plugins-context.plugins-context-locking - plugins-context-locking-curator - ${project.version} - - - org.onap.policy.apex-pdp.plugins.plugins-context.plugins-context-locking - plugins-context-locking-hazelcast - ${project.version} - - - org.apache.curator - curator-test - 3.2.0 - test - - - - - - apexSite - - - apexSite - - - - - ${project.artifactId}-site - ${apex.adsite.prefix}/modules/testsuites/${project.parent.artifactId}/${project.artifactId}/ - - - - - \ No newline at end of file diff --git a/testsuites/performance/performance-context-metrics/src/main/java/org/onap/policy/apex/testsuites/performance/context/metrics/ConcurrentContextMetrics.java b/testsuites/performance/performance-context-metrics/src/main/java/org/onap/policy/apex/testsuites/performance/context/metrics/ConcurrentContextMetrics.java deleted file mode 100644 index b0bfb1ce7..000000000 --- a/testsuites/performance/performance-context-metrics/src/main/java/org/onap/policy/apex/testsuites/performance/context/metrics/ConcurrentContextMetrics.java +++ /dev/null @@ -1,322 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -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; - -import java.io.File; -import java.io.IOException; -import java.util.Arrays; -import java.util.Map; -import java.util.Map.Entry; - -import org.onap.policy.apex.context.parameters.ContextParameters; -import org.onap.policy.apex.context.parameters.DistributorParameters; -import org.onap.policy.apex.context.test.concepts.TestContextLongItem; -import org.onap.policy.apex.context.test.locking.ConcurrentContext; -import org.onap.policy.apex.context.test.utils.ConfigrationProvider; -import org.onap.policy.apex.context.test.utils.ConfigrationProviderImpl; -import org.onap.policy.apex.context.test.utils.ZooKeeperServerServiceProvider; -import org.onap.policy.apex.model.basicmodel.concepts.ApexException; -import org.onap.policy.apex.model.basicmodel.handling.ApexModelException; -import org.onap.policy.apex.plugins.context.distribution.hazelcast.HazelcastContextDistributor; -import org.onap.policy.apex.plugins.context.distribution.infinispan.InfinispanContextDistributor; -import org.onap.policy.apex.plugins.context.distribution.infinispan.InfinispanDistributorParameters; -import org.onap.policy.apex.plugins.context.locking.curator.CuratorLockManager; -import org.onap.policy.apex.plugins.context.locking.curator.CuratorLockManagerParameters; -import org.onap.policy.apex.plugins.context.locking.hazelcast.HazelcastLockManager; -import org.slf4j.ext.XLogger; -import org.slf4j.ext.XLoggerFactory; - -/** - * The Class concurrentContextMetrics tests concurrent use of context. - * - * @author Liam Fallon (liam.fallon@ericsson.com) - */ -public class ConcurrentContextMetrics { - private static final int NUM_ARGS = 9; - private static final int ARG_LABEL = 0; - private static final int ARG_JVM_COUNT = 1; - private static final int ARG_THREAD_COUNT = 2; - private static final int ARG_ITERATIONS = 3; - private static final int ARG_ARRAY_SIZE = 4; - private static final int ARG_LOCK_TYPE = 5; - private static final int ARG_ZOOKEEPER_ADDRESS = 6; - private static final int ARG_ZOOKEEPER_PORT = 7; - private static final int ARG_ZOOKEEPER_DIRECTORY = 8; - - // Logger for this class - private static final XLogger LOGGER = XLoggerFactory.getXLogger(ConcurrentContextMetrics.class); - - private String zookeeperAddress = null; - private final ConfigrationProvider configrationProvider; - private final File zookeeperDirectory; - private final int zookeeperPort; - - /** - * Construct a concurrent context object. - * - * @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) { - this.configrationProvider = configrationProvider; - this.zookeeperAddress = zookeeperAddress; - this.zookeeperPort = zookeeperPort; - this.zookeeperDirectory = new File(zookeeperDirectory); - } - - /** - * Concurrent context metrics JVM local. - * - * @throws ApexModelException the apex model exception - * @throws IOException the IO exception - * @throws ApexException the apex exception - */ - private void concurrentContextMetricsJvmLocal() throws ApexException { - if (configrationProvider.getJvmCount() != 1) { - return; - } - - LOGGER.debug("Running concurrentContextMetricsJVMLocalVarSet metrics . . ."); - - final ContextParameters contextParameters = new ContextParameters(); - contextParameters.getDistributorParameters().setPluginClass(DEFAULT_DISTRIBUTOR_PLUGIN_CLASS); - contextParameters.getLockManagerParameters().setPluginClass(DEFAULT_LOCK_MANAGER_PLUGIN_CLASS); - runConcurrentContextMetrics("JVMLocal"); - - LOGGER.debug("Ran concurrentContextMetricsJVMLocalVarSet metrics"); - } - - /** - * Concurrent context metrics hazelcast. - * - * @throws IOException the IO exception - * @throws ApexException the apex exception - */ - private void concurrentContextMetricsHazelcast() throws ApexException { - if (configrationProvider.getJvmCount() != 1) { - return; - } - - LOGGER.debug("Running concurrentContextMetricsHazelcast metrics . . ."); - - final ContextParameters contextParameters = new ContextParameters(); - contextParameters.getDistributorParameters().setPluginClass(DEFAULT_DISTRIBUTOR_PLUGIN_CLASS); - contextParameters.getLockManagerParameters().setPluginClass(HazelcastLockManager.class.getCanonicalName()); - runConcurrentContextMetrics("Hazelcast"); - - LOGGER.debug("Ran concurrentContextMetricsHazelcast metrics"); - } - - /** - * Concurrent context metrics curator. - * - * @throws IOException the IO exception - * @throws ApexException the apex exception - */ - private void concurrentContextMetricsCurator() throws ApexException { - if (configrationProvider.getJvmCount() != 1) { - return; - } - - LOGGER.debug("Running concurrentContextMetricsCurator metrics . . ."); - - final ContextParameters contextParameters = new ContextParameters(); - contextParameters.getDistributorParameters().setPluginClass(DEFAULT_DISTRIBUTOR_PLUGIN_CLASS); - - final CuratorLockManagerParameters curatorParameters = new CuratorLockManagerParameters(); - curatorParameters.setPluginClass(CuratorLockManager.class.getCanonicalName()); - contextParameters.setLockManagerParameters(curatorParameters); - curatorParameters.setZookeeperAddress(zookeeperAddress); - - runConcurrentContextMetrics("Curator"); - - LOGGER.debug("Ran concurrentContextMetricsCurator metrics"); - } - - /** - * Concurrent context metrics hazelcast multi JVM hazelcast lock. - * - * @throws IOException the IO exception - * @throws ApexException the apex exception - */ - private void concurrentContextMetricsHazelcastMultiJvmHazelcastLock() throws ApexException { - LOGGER.debug("Running concurrentContextMetricsHazelcastMultiJVMHazelcastLock metrics . . ."); - - final ContextParameters contextParameters = new ContextParameters(); - final DistributorParameters distributorParameters = contextParameters.getDistributorParameters(); - distributorParameters.setPluginClass(HazelcastContextDistributor.class.getCanonicalName()); - contextParameters.getLockManagerParameters().setPluginClass(HazelcastLockManager.class.getCanonicalName()); - runConcurrentContextMetrics("HazelcastMultiJVMHazelcastLock"); - - LOGGER.debug("Ran concurrentContextMetricsHazelcastMultiJVMHazelcastLock metrics"); - } - - /** - * Concurrent context metrics infinispan multi JVM hazelcastlock. - * - * @throws IOException the IO exception - * @throws ApexException the apex exception - */ - private void concurrentContextMetricsInfinispanMultiJvmHazelcastlock() throws ApexException { - LOGGER.debug("Running concurrentContextMetricsInfinispanMultiJVMHazelcastlock metrics . . ."); - - final ContextParameters contextParameters = new ContextParameters(); - final DistributorParameters distributorParameters = contextParameters.getDistributorParameters(); - distributorParameters.setPluginClass(InfinispanContextDistributor.class.getCanonicalName()); - contextParameters.getLockManagerParameters().setPluginClass(HazelcastLockManager.class.getCanonicalName()); - - final InfinispanDistributorParameters infinispanParameters = new InfinispanDistributorParameters(); - contextParameters.setDistributorParameters(infinispanParameters); - - runConcurrentContextMetrics("InfinispanMultiJVMHazelcastlock"); - - LOGGER.debug("Ran concurrentContextMetricsInfinispanMultiJVMHazelcastlock metrics"); - } - - /** - * Concurrent context metrics infinispan multi JVM curator lock. - * - * @throws IOException the IO exception - * @throws ApexException the apex exception - * @throws InterruptedException on interrupts - */ - private void concurrentContextMetricsInfinispanMultiJvmCuratorLock() - throws ApexException { - - LOGGER.debug("Running concurrentContextMetricsInfinispanMultiJVMCuratorLock metrics . . ."); - - final ZooKeeperServerServiceProvider zooKeeperServerServiceProvider = new ZooKeeperServerServiceProvider( - zookeeperDirectory, zookeeperAddress, zookeeperPort); - try { - zooKeeperServerServiceProvider.startZookeeperServer(); - final ContextParameters contextParameters = new ContextParameters(); - final DistributorParameters distributorParameters = contextParameters.getDistributorParameters(); - distributorParameters.setPluginClass(InfinispanContextDistributor.class.getCanonicalName()); - - final CuratorLockManagerParameters curatorParameters = new CuratorLockManagerParameters(); - curatorParameters.setPluginClass(CuratorLockManager.class.getCanonicalName()); - contextParameters.setLockManagerParameters(curatorParameters); - curatorParameters.setZookeeperAddress(zookeeperAddress); - - final InfinispanDistributorParameters infinispanParameters = new InfinispanDistributorParameters(); - contextParameters.setDistributorParameters(infinispanParameters); - - runConcurrentContextMetrics("InfinispanMultiJVMCuratorLock"); - } finally { - zooKeeperServerServiceProvider.stopZookeeperServer(); - } - LOGGER.debug("Ran concurrentContextMetricsInfinispanMultiJVMCuratorLock metrics"); - } - - /** - * Concurrent context metrics hazelcast multi JVM curator lock. - * - * @throws IOException the IO exception - * @throws ApexException the apex exception - * @throws InterruptedException on interrupts - */ - private void concurrentContextMetricsHazelcastMultiJvmCuratorLock() - throws ApexException { - LOGGER.debug("Running concurrentContextMetricsHazelcastMultiJVMCuratorLock metrics . . ."); - - final ZooKeeperServerServiceProvider zooKeeperServerServiceProvider = new ZooKeeperServerServiceProvider( - zookeeperDirectory, zookeeperAddress, zookeeperPort); - - try { - zooKeeperServerServiceProvider.startZookeeperServer(); - final ContextParameters contextParameters = new ContextParameters(); - final DistributorParameters distributorParameters = contextParameters.getDistributorParameters(); - distributorParameters.setPluginClass(HazelcastContextDistributor.class.getCanonicalName()); - - final CuratorLockManagerParameters curatorParameters = new CuratorLockManagerParameters(); - curatorParameters.setPluginClass(CuratorLockManager.class.getCanonicalName()); - contextParameters.setLockManagerParameters(curatorParameters); - curatorParameters.setZookeeperAddress(zookeeperAddress); - - runConcurrentContextMetrics("HazelcastMultiJVMCuratorLock"); - } finally { - zooKeeperServerServiceProvider.stopZookeeperServer(); - } - LOGGER.debug("Ran concurrentContextMetricsHazelcastMultiJVMCuratorLock metrics"); - } - - /** - * Run concurrent context metrics. - * - * @param testName the test name - * @throws IOException the IO exception - * @throws ApexException the apex exception - */ - private void runConcurrentContextMetrics(final String testName) throws ApexException { - final ConcurrentContext concurrentContext = new ConcurrentContext(configrationProvider); - - LOGGER.info("Running {} ...", testName); - final Map result = concurrentContext.testConcurrentContext(); - - long total = 0; - for (final Entry entry : result.entrySet()) { - LOGGER.trace("Album key: {}, value: {}", entry.getKey(), entry.getValue()); - total += entry.getValue().getLongValue(); - } - LOGGER.info("Album total value after execution: {}", total); - - LOGGER.info("Completed {} ...", testName); - } - - /** - * The main method. - * - * @param args the args - * @throws Exception the exception - */ - public static void main(final String[] args) throws Exception { - if (args.length != NUM_ARGS) { - 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 ConcurrentContextMetrics concurrentContextMetrics = new ConcurrentContextMetrics(configrationProvider, - args[ARG_ZOOKEEPER_ADDRESS], Integer.valueOf(args[ARG_ZOOKEEPER_PORT]), - args[ARG_ZOOKEEPER_DIRECTORY]); - - concurrentContextMetrics.concurrentContextMetricsJvmLocal(); - concurrentContextMetrics.concurrentContextMetricsCurator(); - concurrentContextMetrics.concurrentContextMetricsHazelcast(); - concurrentContextMetrics.concurrentContextMetricsHazelcastMultiJvmHazelcastLock(); - concurrentContextMetrics.concurrentContextMetricsInfinispanMultiJvmHazelcastlock(); - concurrentContextMetrics.concurrentContextMetricsInfinispanMultiJvmCuratorLock(); - concurrentContextMetrics.concurrentContextMetricsHazelcastMultiJvmCuratorLock(); - } -} diff --git a/testsuites/performance/performance-context-metrics/src/main/java/org/onap/policy/apex/testsuites/performance/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 deleted file mode 100644 index 9bb84d76b..000000000 --- a/testsuites/performance/performance-context-metrics/src/main/java/org/onap/policy/apex/testsuites/performance/context/metrics/package-info.java +++ /dev/null @@ -1,27 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -/** - * Used to get metrics on the performance of Context Album performance for various types of - * distribution and locking mechanisms in APEX. - * - * @author Liam Fallon (liam.fallon@ericsson.com) - */ -package org.onap.policy.apex.testsuites.performance.context.metrics; diff --git a/testsuites/performance/performance-context-metrics/src/site/css/site.css b/testsuites/performance/performance-context-metrics/src/site/css/site.css deleted file mode 100644 index ef8bd4d15..000000000 --- a/testsuites/performance/performance-context-metrics/src/site/css/site.css +++ /dev/null @@ -1,100 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -@import url(http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.2.0/css/font-awesome.css); - - -/*************** Table definitions *******************/ - -tableblock > .title, .tableblock > caption { line-height: 1.4; color: #7a2518; font-weight: 300; margin-top: 0.2em; margin-bottom: 0.5em; } - -.tableblock > caption { text-align: left; font-weight: bold; white-space: nowrap; overflow: visible; max-width: 0; } - -table.tableblock { background: white; margin-bottom: 1.25em; border: solid 1px #dddddd; } -table.tableblock thead, table.tableblock tfoot { background: whitesmoke; font-weight: bold; } -table.tableblock thead tr th, table.tableblock thead tr td, table tfoot tr th, table tfoot tr td { padding: 0.5em 0.625em 0.625em; font-size: inherit; color: #222222; text-align: left; } -table.tableblock tr th, table.tableblock tr td { padding: 0.5625em 0.625em; font-size: inherit; color: #222222; } -table.tableblock tr.even, table.tableblock tr.alt, table.tableblock tr:nth-of-type(even) { background: #f9f9f9; } -table.tableblock thead tr th, table.tableblock tfoot tr th, table.tableblock tbody tr td, table.tableblock tr td, table.tableblock tfoot tr td { display: table-cell; line-height: 1.6; } - -table.tableblock #preamble > .sectionbody > .paragraph:first-of-type p { font-size: inherit; } - -table.tableblock.grid-all { border-collapse: separate; border-spacing: 1px; -webkit-border-radius: 4px; border-radius: 4px; border-top: 1px solid #dddddd; border-bottom: 1px solid #dddddd; } - -table.tableblock.frame-topbot, table.tableblock.frame-none { border-left: 0; border-right: 0; } - -table.tableblock.frame-sides, table.tableblock.frame-none { border-top: 0; border-bottom: 0; } - -table.tableblock td .paragraph:last-child p, table.tableblock td > p:last-child { margin-bottom: 0; } - -th.tableblock.halign-left, td.tableblock.halign-left { text-align: left; } - -th.tableblock.halign-right, td.tableblock.halign-right { text-align: right; } - -th.tableblock.halign-center, td.tableblock.halign-center { text-align: center; } - -th.tableblock.valign-top, td.tableblock.valign-top { vertical-align: top; } - -th.tableblock.valign-bottom, td.tableblock.valign-bottom { vertical-align: bottom; } - -th.tableblock.valign-middle, td.tableblock.valign-middle { vertical-align: middle; } - -p.tableblock.header { color: #222222; font-weight: bold; } - - - -/*************** KBD Macro definitions *******************/ - -kbd.keyseq { color: #555555; } - -kbd:not(.keyseq) { display: inline-block; color: #222222; font-size: 0.75em; line-height: 1.4; background-color: #F7F7F7; border: 1px solid #ccc; -webkit-border-radius: 3px; border-radius: 3px; -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 0 0 2px white inset; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 0 0 2px white inset; margin: -0.15em 0.15em 0 0.15em; padding: 0.2em 0.6em 0.2em 0.5em; vertical-align: middle; white-space: nowrap; } - -kbd kbd:first-child { margin-left: 0; } - -kbd kbd:last-child { margin-right: 0; } - - -/*************** Admontion Blocks definitions *******************/ -.admonitionblock td.content > .title, .exampleblock > .title, .imageblock > .title, .videoblock > .title, .listingblock > .title, .literalblock > .title, .openblock > .title, .paragraph > .title, .quoteblock > .title, .sidebarblock > .title, .tableblock > .title, .verseblock > .title, .dlist > .title, .olist > .title, .ulist > .title, .qlist > .title, .hdlist > .title { text-align: left; font-weight: bold; } - -.admonitionblock > table { border: 0; background: none; width: 100%; margin-top: 1em; margin-bottom: 1em;} -.admonitionblock > table td.icon { text-align: center; width: 80px; } -.admonitionblock > table td.icon img { max-width: none; } -.admonitionblock > table td.icon .title { font-weight: bold; text-transform: uppercase; } -.admonitionblock > table td.content { padding-left: 1.125em; padding-right: 1.25em; border-left: 1px solid #dddddd; color: #6f6f6f; } -.admonitionblock > table td.content > :last-child > :last-child { margin-bottom: 0; } - -.admonitionblock td.icon [class^="fa icon-"]:before {font-size:2.5em;text-shadow:1px 1px 2px rgba(0,0,0,.5);cursor:default} -.admonitionblock td.icon .icon-note:before { content: "\f05a"; color: #005498; color: #003f72; } -.admonitionblock td.icon .icon-tip:before { content: "\f0eb"; text-shadow: 1px 1px 2px rgba(155, 155, 0, 0.8); color: #111; } -.admonitionblock td.icon .icon-warning:before { content: "\f071"; color: #bf6900; } -.admonitionblock td.icon .icon-caution:before { content: "\f06d"; color: #bf3400; } -.admonitionblock td.icon .icon-important:before { content: "\f06a"; color: #bf0000; } - - - -/*************** Misc definitions *******************/ - -*:not(pre) > code { font-size: 0.9375em; padding: 1px 3px 0; white-space: nowrap; background-color: #f2f2f2; border: 1px solid #cccccc; -webkit-border-radius: 4px; border-radius: 4px; text-shadow: none; } - -pre, pre > code { line-height: 1.4; color: inherit; font-family: Consolas, "Liberation Mono", Courier, monospace; font-weight: normal; } - -code { font-family: Consolas, "Liberation Mono", Courier, monospace; font-weight: normal; color: #6d180b; } - diff --git a/testsuites/performance/performance-context-metrics/src/site/images/logos.png b/testsuites/performance/performance-context-metrics/src/site/images/logos.png deleted file mode 100644 index 915d6e59d..000000000 Binary files a/testsuites/performance/performance-context-metrics/src/site/images/logos.png and /dev/null differ diff --git a/testsuites/performance/performance-context-metrics/src/site/site.xml b/testsuites/performance/performance-context-metrics/src/site/site.xml deleted file mode 100644 index 937759ed5..000000000 --- a/testsuites/performance/performance-context-metrics/src/site/site.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/testsuites/performance/performance-context-metrics/src/test/java/org/onap/policy/apex/testsuites/performance/context/metrics/MetricsTest.java b/testsuites/performance/performance-context-metrics/src/test/java/org/onap/policy/apex/testsuites/performance/context/metrics/MetricsTest.java deleted file mode 100644 index af6b46918..000000000 --- a/testsuites/performance/performance-context-metrics/src/test/java/org/onap/policy/apex/testsuites/performance/context/metrics/MetricsTest.java +++ /dev/null @@ -1,94 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -package org.onap.policy.apex.testsuites.performance.context.metrics; - -import static org.junit.Assert.fail; - -import java.io.File; -import java.io.IOException; -import java.util.Arrays; -import java.util.SortedSet; - -import org.junit.BeforeClass; -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 MetricsTest { - // Logger for this class - private static final XLogger LOGGER = XLoggerFactory.getXLogger(MetricsTest.class); - private static final String HAZELCAST_CONFIG = "hazelcast.config"; - - private static final String JAVA_NET_PREFER_IPV4_STACK = "java.net.preferIPv4Stack"; - private static final String HAZELCAST_XML_FILE = "src/test/resources/hazelcast/hazelcast.xml"; - - @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"); - final String hazelCastfileLocation = ResourceUtils.getFilePath4Resource(HAZELCAST_XML_FILE); - System.setProperty(HAZELCAST_CONFIG, hazelCastfileLocation); - - final SortedSet ipAddressSet = NetworkUtils.getIPv4NonLoopAddresses(); - - if (ipAddressSet.size() == 0) { - throw new Exception("cound not find real IP address for test"); - } - LOGGER.info("For Infinispan, setting jgroups.tcp.address to: {}", ipAddressSet.first()); - System.setProperty("jgroups.tcp.address", ipAddressSet.first()); - - } - - /** - * Gets the single jvm metrics. - * - * @throws IOException Signals that an I/O exception has occurred. - */ - @Test - public void getSingleJvmMetrics() throws IOException { - final File zookeeperDirectory = folder.newFolder("zookeeperDirectory"); - final String[] args = {"singleJVMTestNL", "1", "32", "1000", "65536", "0", "localhost", "62181", - zookeeperDirectory.getAbsolutePath()}; - - LOGGER.info("Starting with args: {}", Arrays.toString(args)); - try { - ConcurrentContextMetrics.main(args); - } catch (final Exception exception) { - LOGGER.error("Unexpected error", exception); - fail("Metrics test failed"); - } - } -} diff --git a/testsuites/performance/performance-context-metrics/src/test/resources/hazelcast/hazelcast.xml b/testsuites/performance/performance-context-metrics/src/test/resources/hazelcast/hazelcast.xml deleted file mode 100644 index 932b33cc9..000000000 --- a/testsuites/performance/performance-context-metrics/src/test/resources/hazelcast/hazelcast.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - HazelcastGroup3.0EVAL - password3.0EVAL - - - 5706 - - - 224.2.2.10 - 54327 - - - 127.0.0.1 - - - - - 127.0.0.* - - - - false - slf4j - - false - 60 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - - - 2 - - diff --git a/testsuites/performance/performance-context-metrics/src/test/resources/infinispan/default-jgroups-tcp.xml b/testsuites/performance/performance-context-metrics/src/test/resources/infinispan/default-jgroups-tcp.xml deleted file mode 100644 index 028cf1df6..000000000 --- a/testsuites/performance/performance-context-metrics/src/test/resources/infinispan/default-jgroups-tcp.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/testsuites/performance/performance-context-metrics/src/test/resources/infinispan/infinispan.xml b/testsuites/performance/performance-context-metrics/src/test/resources/infinispan/infinispan.xml deleted file mode 100644 index 5b416f50d..000000000 --- a/testsuites/performance/performance-context-metrics/src/test/resources/infinispan/infinispan.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/testsuites/performance/pom.xml b/testsuites/performance/pom.xml index 8682871cd..501cf658d 100644 --- a/testsuites/performance/pom.xml +++ b/testsuites/performance/pom.xml @@ -1,6 +1,7 @@