diff options
author | Dan Timoney <dtimoney@att.com> | 2022-03-01 11:10:58 -0500 |
---|---|---|
committer | Dan Timoney <dtimoney@att.com> | 2022-03-22 18:04:32 +0000 |
commit | 7c0ec3e4540c1a10a03efcfbae06c4a7915977a6 (patch) | |
tree | ca6c6fd9616f24efb786ee8620ad499cb258a4d9 /core/sliapi/provider/src | |
parent | b64e61b3631a022f6f166e6fc15026537ff46c63 (diff) |
Migrate SLI to OpenDaylight Phosphorus
Updated ccsdk/sli to use Phosphorus SR1 version of parent poms and
updated Java Reflection code to handle changes in Phosphorus:
- use Uint8/Uint16/Uint32/Uint64 classes in place of
char/Short/Long/BigInteger, respectively
- add code for toMap method to handle change in representation
of yang list from java List to java Map
- Add new YangUtils class to replace removed ODL yangtools SchemaUtils class
- Update restconf-client due to changes in yangtools
Issue-ID: CCSDK-3567
Signed-off-by: Dan Timoney <dtimoney@att.com>
Change-Id: Iea581c7f39b1038ce95cc0ca6728fe56dd023f3e
Diffstat (limited to 'core/sliapi/provider/src')
-rw-r--r-- | core/sliapi/provider/src/main/java/org/onap/ccsdk/sli/core/sliapi/SliapiProvider.java | 2 | ||||
-rw-r--r-- | core/sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java | 33 |
2 files changed, 19 insertions, 16 deletions
diff --git a/core/sliapi/provider/src/main/java/org/onap/ccsdk/sli/core/sliapi/SliapiProvider.java b/core/sliapi/provider/src/main/java/org/onap/ccsdk/sli/core/sliapi/SliapiProvider.java index a00131efb..015ef5e57 100644 --- a/core/sliapi/provider/src/main/java/org/onap/ccsdk/sli/core/sliapi/SliapiProvider.java +++ b/core/sliapi/provider/src/main/java/org/onap/ccsdk/sli/core/sliapi/SliapiProvider.java @@ -258,7 +258,7 @@ public class SliapiProvider implements AutoCloseable, SLIAPIService { String propValue = ""; - Boolean boolval = sliParm.isBooleanValue(); + Boolean boolval = sliParm.getBooleanValue(); if (boolval != null) { propValue = boolval.toString(); diff --git a/core/sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java b/core/sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java index cd7dd2058..73c613aa7 100644 --- a/core/sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java +++ b/core/sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java @@ -27,11 +27,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import java.io.InputStream; import java.net.URL; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Properties; +import java.util.*; import java.util.concurrent.Future; import org.junit.After; import org.junit.Before; @@ -72,6 +68,7 @@ import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.Hea import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.SLIAPIService; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.VlbcheckInput; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.execute.graph.input.SliParameter; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.execute.graph.input.SliParameterKey; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.execute.graph.input.SliParameterBuilder; import org.opendaylight.yangtools.concepts.ObjectRegistration; @@ -173,20 +170,23 @@ public class TestSliapiProvider { inputBuilder.setMode(ExecuteGraphInput.Mode.Sync); inputBuilder.setModuleName("sli"); inputBuilder.setRpcName("healthcheck"); - List<SliParameter> pList = new LinkedList<>(); + Map<SliParameterKey, SliParameter> pMap = new LinkedHashMap<>(); SliParameterBuilder pBuilder = new SliParameterBuilder(); pBuilder.setParameterName("int-parameter"); pBuilder.setIntValue(1); - pList.add(pBuilder.build()); + SliParameter sliParm = pBuilder.build(); + pMap.put(sliParm.key(), sliParm); pBuilder.setParameterName("bool-parameter"); pBuilder.setIntValue(null); pBuilder.setBooleanValue(true); - pList.add(pBuilder.build()); + sliParm = pBuilder.build(); + pMap.put(sliParm.key(), sliParm); pBuilder.setParameterName("str-parameter"); pBuilder.setBooleanValue(null); pBuilder.setStringValue("value"); - pList.add(pBuilder.build()); - inputBuilder.setSliParameter(pList); + sliParm = pBuilder.build(); + pMap.put(sliParm.key(), sliParm); + inputBuilder.setSliParameter(pMap); provider.executeGraph(inputBuilder.build()); @@ -194,20 +194,23 @@ public class TestSliapiProvider { inputBuilder.setMode(ExecuteGraphInput.Mode.Sync); inputBuilder.setModuleName("sli"); inputBuilder.setRpcName("no-such-graph"); - pList = new LinkedList<>(); + pMap = new LinkedHashMap<>(); pBuilder = new SliParameterBuilder(); pBuilder.setParameterName("int-parameter"); pBuilder.setIntValue(1); - pList.add(pBuilder.build()); + sliParm = pBuilder.build(); + pMap.put(sliParm.key(), sliParm); pBuilder.setParameterName("bool-parameter"); pBuilder.setIntValue(null); pBuilder.setBooleanValue(true); - pList.add(pBuilder.build()); + sliParm = pBuilder.build(); + pMap.put(sliParm.key(), sliParm); pBuilder.setParameterName("str-parameter"); pBuilder.setBooleanValue(null); pBuilder.setStringValue("value"); - pList.add(pBuilder.build()); - inputBuilder.setSliParameter(pList); + sliParm = pBuilder.build(); + pMap.put(sliParm.key(), sliParm); + inputBuilder.setSliParameter(pMap); provider.executeGraph(inputBuilder.build()); assertTrue(provider.vlbcheck(mock(VlbcheckInput.class)) instanceof Future<?>); |