34fa7d439c37df966fb6c67d96ab572090052521
[policy/apex-pdp.git] /
1 /*-
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
8  * 
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  * 
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.
16  * 
17  * SPDX-License-Identifier: Apache-2.0
18  * ============LICENSE_END=========================================================
19  */
20 package org.onap.policy.apex.plugins.context.distribution.infinispan;
21
22 import java.io.IOException;
23
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;
34
35 public class InfinispanContextDistributorTest {
36     private static final XLogger logger = XLoggerFactory.getXLogger(InfinispanContextDistributorTest.class);
37
38     private static final String PLUGIN_CLASS = InfinispanContextDistributor.class.getCanonicalName();
39
40     @Test
41     public void testContextAlbumUpdateInfinispan() throws ApexModelException, IOException, ApexException {
42         logger.debug("Running testContextAlbumUpdateInfinispan test . . .");
43
44         final ContextParameters contextParameters = new ContextParameters();
45         contextParameters.getDistributorParameters().setPluginClass(PLUGIN_CLASS);
46         new InfinispanDistributorParameters();
47
48         new ContextAlbumUpdate().testContextAlbumUpdate();
49
50         logger.debug("Ran testContextAlbumUpdateInfinispan test");
51     }
52
53     @Test
54     public void testContextInstantiationInfinispan() throws ApexModelException, IOException, ApexException {
55         logger.debug("Running testContextInstantiationInfinispan test . . .");
56
57         final ContextParameters contextParameters = new ContextParameters();
58         contextParameters.getDistributorParameters().setPluginClass(PLUGIN_CLASS);
59         new InfinispanDistributorParameters();
60
61         new ContextInstantiation().testContextInstantiation();
62
63         logger.debug("Ran testContextInstantiationInfinispan test");
64     }
65
66     @Test
67     public void testContextUpdateInfinispan() throws ApexModelException, IOException, ApexException {
68         logger.debug("Running testContextUpdateInfinispan test . . .");
69
70         final ContextParameters contextParameters = new ContextParameters();
71         contextParameters.getDistributorParameters().setPluginClass(PLUGIN_CLASS);
72         new InfinispanDistributorParameters();
73
74         new ContextUpdate().testContextUpdate();
75
76         logger.debug("Ran testContextUpdateInfinispan test");
77     }
78
79     @Test
80     public void testSequentialContextInstantiationInfinispan() throws ApexModelException, IOException, ApexException {
81         logger.debug("Running testSequentialContextInstantiationInfinispan test . . .");
82
83         final ContextParameters contextParameters = new ContextParameters();
84         contextParameters.getDistributorParameters().setPluginClass(PLUGIN_CLASS);
85         new InfinispanDistributorParameters();
86
87         new SequentialContextInstantiation().testSequentialContextInstantiation();
88
89         logger.debug("Ran testSequentialContextInstantiationInfinispan test");
90     }
91
92
93 }