summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-core
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-sdk/epsdk-core')
-rw-r--r--ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/ElementMapService.java21
-rw-r--r--ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/service/ElementMapServiceTest.java43
2 files changed, 53 insertions, 11 deletions
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/ElementMapService.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/ElementMapService.java
index 7fdc5609..b126d822 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/ElementMapService.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/ElementMapService.java
@@ -580,7 +580,11 @@ public class ElementMapService {
columns = computeColumns(containerElementsMap.keySet());
}
- Container thisContainer = new Container(id, name, rows, columns, 1, 4, 8, 12, 1, 2);
+ Container thisContainer = new Container.ContainerBuilder().setId(id).setName(name)
+ .setNumOfRows(rows).setNumOfCols(columns).setInterEleWd(1).setInterEleH(4)
+ .setInterEleToContainerWd(8).setInterEleToContainerH(12)
+ .setInterEleToInnerContainerWd(1).setInterEleToInnerContainerH(2)
+ .createContainer();
thisContainer.setElements(containerElementsMap);
return thisContainer;
@@ -603,7 +607,11 @@ public class ElementMapService {
columns = computeColumns(containerElementsMap.keySet());
}
- Container thisContainer = new Container(id, name, rows, columns, 2, 6, 2, 5, 0, 0);
+ Container thisContainer = new Container.ContainerBuilder().setId(id).setName(name)
+ .setNumOfRows(rows).setNumOfCols(columns).setInterEleWd(2).setInterEleH(6)
+ .setInterEleToContainerWd(2).setInterEleToContainerH(5)
+ .setInterEleToInnerContainerWd(0).setInterEleToInnerContainerH(0)
+ .createContainer();
thisContainer.setElements(containerElementsMap);
thisContainer.setInnerContainer(innerContainersMap);
@@ -864,8 +872,13 @@ public class ElementMapService {
if (domain.equalsIgnoreCase(domainName)) {
String rowColumnKey = "";
- Container eachContainer = new Container(domainName + ":" + elementName, elementName, 1, 1, 3, 6, 2,
- 5, 0, 0);
+ Container eachContainer =
+ new Container.ContainerBuilder().setId(domainName + ":" + elementName)
+ .setName(elementName).setNumOfRows(1).setNumOfCols(1)
+ .setInterEleWd(3).setInterEleH(6).setInterEleToContainerWd(2)
+ .setInterEleToContainerH(5).setInterEleToInnerContainerWd(0)
+ .setInterEleToInnerContainerH(0).createContainer();
+
int count = 0;
while (count <= 9) {
if (thisContainersMap.containsKey(String.valueOf(count).concat(String.valueOf(count)))) {
diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/service/ElementMapServiceTest.java b/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/service/ElementMapServiceTest.java
index e2655b59..c7f40c3c 100644
--- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/service/ElementMapServiceTest.java
+++ b/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/service/ElementMapServiceTest.java
@@ -153,13 +153,21 @@ public class ElementMapServiceTest {
elementRowcol.put("22", element2);
Map<String, Container> containerRowCol = new HashMap<>();
- Container container00 = new Container("test","test",1,1,10,10,10,10,10,10);
+ Container container00 = new Container.ContainerBuilder().setId("test").setName("test")
+ .setNumOfRows(1).setNumOfCols(1).setInterEleWd(10).setInterEleH(10)
+ .setInterEleToContainerWd(10).setInterEleToContainerH(10)
+ .setInterEleToInnerContainerWd(10).setInterEleToInnerContainerH(10)
+ .createContainer();
container00.setElements(elementRowcol);
container00.setP(position);
Map<String, Container> innerContainer = new HashMap<>();
- Container container01 = new Container("test","test",1,1,10,10,10,10,10,10);
+ Container container01 = new Container.ContainerBuilder().setId("test").setName("test")
+ .setNumOfRows(1).setNumOfCols(1).setInterEleWd(10).setInterEleH(10)
+ .setInterEleToContainerWd(10).setInterEleToContainerH(10)
+ .setInterEleToInnerContainerWd(10).setInterEleToInnerContainerH(10)
+ .createContainer();
Map<String, Element> elementRowcolInner = new HashMap<>();
Element elementInner = new Element("12", "dashed");
elementInner.setP(position);
@@ -304,7 +312,12 @@ public class ElementMapServiceTest {
toscalEleMap.set(elementMapService, toscaElementsMap);
HashMap<String, Container> innercontainerMap = new HashMap<>();
- Container container00 = new Container("test","test",1,1,10,10,10,10,10,10);
+ Container container00 = new Container.ContainerBuilder().setId("test").setName("test")
+ .setNumOfRows(1).setNumOfCols(1).setInterEleWd(10).setInterEleH(10)
+ .setInterEleToContainerWd(10).setInterEleToContainerH(10)
+ .setInterEleToInnerContainerWd(10).setInterEleToInnerContainerH(10)
+ .createContainer();
+
innercontainerMap.put(domain + ":" + name, container00);
Field innercontainers = elementMapService.getClass().getDeclaredField("innercontainers");
innercontainers.setAccessible(true);
@@ -346,7 +359,11 @@ public class ElementMapServiceTest {
toscalEleMap.set(elementMapService, toscaElementsMap);
HashMap<String, Container> innercontainerMap = new HashMap<>();
- Container container00 = new Container("test","test",1,1,10,10,10,10,10,10);
+ Container container00 = new Container.ContainerBuilder().setId("test").setName("test")
+ .setNumOfRows(1).setNumOfCols(1).setInterEleWd(10).setInterEleH(10)
+ .setInterEleToContainerWd(10).setInterEleToContainerH(10)
+ .setInterEleToInnerContainerWd(10).setInterEleToInnerContainerH(10)
+ .createContainer();
innercontainerMap.put(domain + ":" + name, container00);
Field innercontainers = elementMapService.getClass().getDeclaredField("innercontainers");
innercontainers.setAccessible(true);
@@ -378,15 +395,27 @@ public class ElementMapServiceTest {
elementRowCol.put("382", element2);
Map<String, Container> containerRowCol = new HashMap<>();
- Container container023 = new Container("test","test",1,1,10,10,10,10,10,10);
+ Container container023 = new Container.ContainerBuilder().setId("test").setName("test")
+ .setNumOfRows(1).setNumOfCols(1).setInterEleWd(10).setInterEleH(10)
+ .setInterEleToContainerWd(10).setInterEleToContainerH(10)
+ .setInterEleToInnerContainerWd(10).setInterEleToInnerContainerH(10)
+ .createContainer();
containerRowCol.put("00", container023);
HashMap<String, Container> outercontainerMap = new HashMap<>();
- Container container00 = new Container("test","test",1,1,10,10,10,10,10,10);
+ Container container00 = new Container.ContainerBuilder().setId("test").setName("test")
+ .setNumOfRows(1).setNumOfCols(1).setInterEleWd(10).setInterEleH(10)
+ .setInterEleToContainerWd(10).setInterEleToContainerH(10)
+ .setInterEleToInnerContainerWd(10).setInterEleToInnerContainerH(10)
+ .createContainer();
container00.setInnerContainer(containerRowCol);
container00.setElements(elementRowCol);
- Container container01 = new Container("test","test",1,1,10,10,10,10,10,10);
+ Container container01 = new Container.ContainerBuilder().setId("test").setName("test")
+ .setNumOfRows(1).setNumOfCols(1).setInterEleWd(10).setInterEleH(10)
+ .setInterEleToContainerWd(10).setInterEleToContainerH(10)
+ .setInterEleToInnerContainerWd(10).setInterEleToInnerContainerH(10)
+ .createContainer();
container01.setElements(elementRowCol);
outercontainerMap.put(name+":", container00);
outercontainerMap.put(name+":/Test", container01);