summaryrefslogtreecommitdiffstats
path: root/sliapi/provider/src/main/java
diff options
context:
space:
mode:
authorTimoney, Dan (dt5972) <dt5972@att.com>2018-03-24 19:11:10 -0400
committerTimoney, Dan (dt5972) <dt5972@att.com>2018-03-27 14:58:43 -0400
commita0ab49e6c1ea41af18656d6e9efb3377051f2528 (patch)
treedc935417ffa4aac764aef2f1978c1ceecd68bd55 /sliapi/provider/src/main/java
parent5e0f12e215d579b2adff145a8527cc6a225d8db9 (diff)
Add unit tests for sli
Added unit tests for ccsdk/sli/core/sli Change-Id: I0d2408c43b9e56a78f3e01e87985aedb6cad5953 Issue-ID: CCSDK-213 Signed-off-by: Timoney, Dan (dt5972) <dt5972@att.com>
Diffstat (limited to 'sliapi/provider/src/main/java')
-rw-r--r--sliapi/provider/src/main/java/org/onap/ccsdk/sli/core/sliapi/sliapiProvider.java23
1 files changed, 20 insertions, 3 deletions
diff --git a/sliapi/provider/src/main/java/org/onap/ccsdk/sli/core/sliapi/sliapiProvider.java b/sliapi/provider/src/main/java/org/onap/ccsdk/sli/core/sliapi/sliapiProvider.java
index 3ff2f52d4..e9a2b8eb2 100644
--- a/sliapi/provider/src/main/java/org/onap/ccsdk/sli/core/sliapi/sliapiProvider.java
+++ b/sliapi/provider/src/main/java/org/onap/ccsdk/sli/core/sliapi/sliapiProvider.java
@@ -114,14 +114,16 @@ import com.google.common.util.concurrent.Futures;
*/
public class sliapiProvider implements AutoCloseable, SLIAPIService{
- private final Logger LOG = LoggerFactory.getLogger( sliapiProvider.class );
- private final String appName = "slitester";
+ private static final Logger LOG = LoggerFactory.getLogger( sliapiProvider.class );
+ private static final String appName = "slitester";
protected DataBroker dataBroker;
protected DOMDataBroker domDataBroker;
protected NotificationPublishService notificationService;
protected RpcProviderRegistry rpcRegistry;
+ private SvcLogicService svcLogic;
+
protected BindingAwareBroker.RpcRegistration<SLIAPIService> rpcRegistration;
private static String SLIAPI_NAMESPACE = "org:onap:ccsdk:sli:core:sliapi";
@@ -142,15 +144,23 @@ public class sliapiProvider implements AutoCloseable, SLIAPIService{
RESULTS_QNAME = QName.create(TEST_RESULT_QNAME, "results");
}
+ public sliapiProvider(
+ DataBroker dataBroker,
+ NotificationPublishService notificationPublishService,
+ RpcProviderRegistry rpcProviderRegistry) {
+ this(dataBroker, notificationPublishService, rpcProviderRegistry, findSvcLogicService());
+ }
public sliapiProvider(
DataBroker dataBroker,
NotificationPublishService notificationPublishService,
- RpcProviderRegistry rpcProviderRegistry) {
+ RpcProviderRegistry rpcProviderRegistry,
+ SvcLogicService svcLogic) {
this.LOG.info( "Creating provider for " + appName );
this.dataBroker = dataBroker;
this.notificationService = notificationPublishService;
this.rpcRegistry = rpcProviderRegistry;
+ this.svcLogic = svcLogic;
initialize();
}
@@ -357,6 +367,13 @@ public class sliapiProvider implements AutoCloseable, SLIAPIService{
private SvcLogicService getSvcLogicService() {
+ if (svcLogic == null) {
+ svcLogic = findSvcLogicService();
+ }
+
+ return(svcLogic);
+ }
+ private static SvcLogicService findSvcLogicService() {
BundleContext bctx = FrameworkUtil.getBundle(SvcLogicService.class).getBundleContext();
SvcLogicService svcLogic = null;