From 7c0ec3e4540c1a10a03efcfbae06c4a7915977a6 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Tue, 1 Mar 2022 11:10:58 -0500 Subject: 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 Change-Id: Iea581c7f39b1038ce95cc0ca6728fe56dd023f3e --- core/sliapi/installer/pom.xml | 2 +- core/sliapi/model/pom.xml | 2 +- core/sliapi/model/swagger/pom.xml | 2 +- core/sliapi/model/yang/pom.xml | 2 +- core/sliapi/pom.xml | 2 +- core/sliapi/provider/pom.xml | 2 +- .../onap/ccsdk/sli/core/sliapi/SliapiProvider.java | 2 +- .../ccsdk/sli/core/sliapi/TestSliapiProvider.java | 33 ++++++++++++---------- 8 files changed, 25 insertions(+), 22 deletions(-) (limited to 'core/sliapi') diff --git a/core/sliapi/installer/pom.xml b/core/sliapi/installer/pom.xml index ca5c89a95..018f4eca8 100755 --- a/core/sliapi/installer/pom.xml +++ b/core/sliapi/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 2.3.2 + 2.3.3-SNAPSHOT diff --git a/core/sliapi/model/pom.xml b/core/sliapi/model/pom.xml index 77a090086..f09441ba4 100755 --- a/core/sliapi/model/pom.xml +++ b/core/sliapi/model/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 2.3.2 + 2.3.3-SNAPSHOT diff --git a/core/sliapi/model/swagger/pom.xml b/core/sliapi/model/swagger/pom.xml index c90a3361f..8e5e9537e 100644 --- a/core/sliapi/model/swagger/pom.xml +++ b/core/sliapi/model/swagger/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 2.3.2 + 2.3.3-SNAPSHOT org.onap.ccsdk.sli.core diff --git a/core/sliapi/model/yang/pom.xml b/core/sliapi/model/yang/pom.xml index 255d00ae2..b53b6aea2 100755 --- a/core/sliapi/model/yang/pom.xml +++ b/core/sliapi/model/yang/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 2.3.2 + 2.3.3-SNAPSHOT diff --git a/core/sliapi/pom.xml b/core/sliapi/pom.xml index c7cb55506..93cf051ff 100755 --- a/core/sliapi/pom.xml +++ b/core/sliapi/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 2.3.2 + 2.3.3-SNAPSHOT diff --git a/core/sliapi/provider/pom.xml b/core/sliapi/provider/pom.xml index 6e852ed0d..bda7226e0 100755 --- a/core/sliapi/provider/pom.xml +++ b/core/sliapi/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 2.3.2 + 2.3.3-SNAPSHOT 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 pList = new LinkedList<>(); + Map 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); -- cgit 1.2.3-korg