diff options
author | Timoney, Dan (dt5972) <dt5972@att.com> | 2018-03-16 13:58:47 -0400 |
---|---|---|
committer | Timoney, Dan (dt5972) <dt5972@att.com> | 2018-03-16 13:58:47 -0400 |
commit | 67414f17e30d04ad278fe7ab73c0bed8c44c0523 (patch) | |
tree | 969700d95add133377f35e4907751be565632e97 /sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicNodeExecutor.java | |
parent | 6cea464120223c13d7d6e48f422d9964d14c8c8d (diff) |
Add test cases for sli
Added test cases for sli in sli/core
Change-Id: Ic8614f199ae843a46ec3441f0ae247f065b33322
Issue-ID: CCSDK-213
Signed-off-by: Timoney, Dan (dt5972) <dt5972@att.com>
Diffstat (limited to 'sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicNodeExecutor.java')
-rw-r--r-- | sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicNodeExecutor.java | 48 |
1 files changed, 9 insertions, 39 deletions
diff --git a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicNodeExecutor.java b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicNodeExecutor.java index 593c972a..f34c261d 100644 --- a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicNodeExecutor.java +++ b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicNodeExecutor.java @@ -29,6 +29,7 @@ import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; import org.onap.ccsdk.sli.core.sli.SvcLogicNode; import org.onap.ccsdk.sli.core.sli.SvcLogicRecorder; import org.onap.ccsdk.sli.core.sli.SvcLogicResource; +import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; import org.osgi.framework.FrameworkUtil; import org.osgi.framework.ServiceReference; @@ -53,56 +54,25 @@ public abstract class SvcLogicNodeExecutor { } + protected SvcLogicAdaptor getAdaptor(String adaptorName) { return SvcLogicAdaptorFactory.getInstance(adaptorName); } protected SvcLogicResource getSvcLogicResource(String plugin) { - BundleContext bctx = FrameworkUtil.getBundle(this.getClass()) - .getBundleContext(); - - ServiceReference sref = bctx.getServiceReference(plugin); - if (sref != null) { - SvcLogicResource resourcePlugin = (SvcLogicResource) bctx - .getService(sref); - return resourcePlugin; - } - else { - LOG.warn("Could not find service reference object for plugin " + plugin); - return null; - } + + return((SvcLogicResource) SvcLogicClassResolver.resolve(plugin)); } protected SvcLogicRecorder getSvcLogicRecorder(String plugin) { - BundleContext bctx = FrameworkUtil.getBundle(this.getClass()) - .getBundleContext(); - - ServiceReference sref = bctx.getServiceReference(plugin); - if (sref != null) { - SvcLogicRecorder resourcePlugin = (SvcLogicRecorder) bctx - .getService(sref); - return resourcePlugin; - } - else { - return null; - } + return((SvcLogicRecorder) SvcLogicClassResolver.resolve(plugin)); } protected SvcLogicJavaPlugin getSvcLogicJavaPlugin(String pluginName){ - BundleContext bctx = FrameworkUtil.getBundle(this.getClass()) - .getBundleContext(); - - ServiceReference sref = bctx.getServiceReference(pluginName); - - if (sref == null) { - LOG.warn("Could not find service reference object for plugin " + pluginName); - return null; - } else { - SvcLogicJavaPlugin plugin = (SvcLogicJavaPlugin) bctx - .getService(sref); - return plugin; - } - } + return((SvcLogicJavaPlugin) SvcLogicClassResolver.resolve(pluginName)); + + } + protected SvcLogicNode getNextNode(SvcLogicNode node, String outValue) { MetricLogger.resetContext(); SvcLogicNode nextNode = node.getOutcomeValue(outValue); |