2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2018 Ericsson. All rights reserved.
4 * ================================================================================
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 * SPDX-License-Identifier: Apache-2.0
18 * ============LICENSE_END=========================================================
20 package org.onap.policy.apex.plugins.context.distribution.infinispan;
22 import java.io.IOException;
24 import org.junit.Test;
25 import org.onap.policy.apex.context.parameters.ContextParameters;
26 import org.onap.policy.apex.context.test.distribution.ContextAlbumUpdate;
27 import org.onap.policy.apex.context.test.distribution.ContextInstantiation;
28 import org.onap.policy.apex.context.test.distribution.ContextUpdate;
29 import org.onap.policy.apex.context.test.distribution.SequentialContextInstantiation;
30 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
31 import org.onap.policy.apex.model.basicmodel.handling.ApexModelException;
32 import org.slf4j.ext.XLogger;
33 import org.slf4j.ext.XLoggerFactory;
35 public class InfinispanContextDistributorTest {
36 private static final XLogger logger = XLoggerFactory.getXLogger(InfinispanContextDistributorTest.class);
38 private static final String PLUGIN_CLASS = InfinispanContextDistributor.class.getCanonicalName();
41 public void testContextAlbumUpdateInfinispan() throws ApexModelException, IOException, ApexException {
42 logger.debug("Running testContextAlbumUpdateInfinispan test . . .");
44 final ContextParameters contextParameters = new ContextParameters();
45 contextParameters.getDistributorParameters().setPluginClass(PLUGIN_CLASS);
46 new InfinispanDistributorParameters();
48 new ContextAlbumUpdate().testContextAlbumUpdate();
50 logger.debug("Ran testContextAlbumUpdateInfinispan test");
54 public void testContextInstantiationInfinispan() throws ApexModelException, IOException, ApexException {
55 logger.debug("Running testContextInstantiationInfinispan test . . .");
57 final ContextParameters contextParameters = new ContextParameters();
58 contextParameters.getDistributorParameters().setPluginClass(PLUGIN_CLASS);
59 new InfinispanDistributorParameters();
61 new ContextInstantiation().testContextInstantiation();
63 logger.debug("Ran testContextInstantiationInfinispan test");
67 public void testContextUpdateInfinispan() throws ApexModelException, IOException, ApexException {
68 logger.debug("Running testContextUpdateInfinispan test . . .");
70 final ContextParameters contextParameters = new ContextParameters();
71 contextParameters.getDistributorParameters().setPluginClass(PLUGIN_CLASS);
72 new InfinispanDistributorParameters();
74 new ContextUpdate().testContextUpdate();
76 logger.debug("Ran testContextUpdateInfinispan test");
80 public void testSequentialContextInstantiationInfinispan() throws ApexModelException, IOException, ApexException {
81 logger.debug("Running testSequentialContextInstantiationInfinispan test . . .");
83 final ContextParameters contextParameters = new ContextParameters();
84 contextParameters.getDistributorParameters().setPluginClass(PLUGIN_CLASS);
85 new InfinispanDistributorParameters();
87 new SequentialContextInstantiation().testSequentialContextInstantiation();
89 logger.debug("Ran testSequentialContextInstantiationInfinispan test");