1 /*******************************************************************************
2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 Wipro Limited.
6 * ==============================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
20 *******************************************************************************/
22 package org.onap.dcaegen2.services.sonhms.child;
25 import java.util.ArrayList;
26 import java.util.HashMap;
29 import org.junit.Test;
30 import org.onap.dcaegen2.services.sonhms.child.Detection;
31 import org.onap.dcaegen2.services.sonhms.child.Graph;
32 import org.onap.dcaegen2.services.sonhms.model.CellPciPair;
35 public class TestDetection {
37 public void testDetection() {
39 CellPciPair cpPair = new CellPciPair();
40 cpPair.setCellId("32");
41 cpPair.setPhysicalCellId(26);
43 CellPciPair cpPair1 = new CellPciPair();
44 cpPair1.setCellId("25");
45 cpPair1.setPhysicalCellId(23);
47 CellPciPair cpPair2 = new CellPciPair();
48 cpPair2.setCellId("42");
49 cpPair2.setPhysicalCellId(26);
51 CellPciPair cpPair3 = new CellPciPair();
52 cpPair3.setCellId("56");
53 cpPair3.setPhysicalCellId(200);
55 CellPciPair cpPair4 = new CellPciPair();
56 cpPair4.setCellId("21");
57 cpPair4.setPhysicalCellId(5);
59 CellPciPair cpPair5 = new CellPciPair();
60 cpPair5.setCellId("24");
61 cpPair5.setPhysicalCellId(5);
63 CellPciPair cpPair6 = new CellPciPair();
64 cpPair6.setCellId("38");
65 cpPair6.setPhysicalCellId(126);
67 CellPciPair cpPair7 = new CellPciPair();
68 cpPair7.setCellId("67");
69 cpPair7.setPhysicalCellId(300);
71 CellPciPair cpPair8 = new CellPciPair();
72 cpPair8.setCellId("69");
73 cpPair8.setPhysicalCellId(129);
75 CellPciPair cpPair9 = new CellPciPair();
76 cpPair9.setCellId("78");
77 cpPair9.setPhysicalCellId(147);
79 ArrayList<CellPciPair> al = new ArrayList<CellPciPair>();
84 ArrayList<CellPciPair> al1 = new ArrayList<CellPciPair>();
89 ArrayList<CellPciPair> al2 = new ArrayList<CellPciPair>();
94 Map<CellPciPair, ArrayList<CellPciPair>> map = new HashMap<CellPciPair, ArrayList<CellPciPair>>();
97 map.put(cpPair1, al1);
98 map.put(cpPair2, al2);
99 map.put(cpPair3, new ArrayList<CellPciPair>());
100 map.put(cpPair4, new ArrayList<CellPciPair>());
101 map.put(cpPair5, new ArrayList<CellPciPair>());
102 map.put(cpPair6, new ArrayList<CellPciPair>());
103 map.put(cpPair7, new ArrayList<CellPciPair>());
104 map.put(cpPair8, new ArrayList<CellPciPair>());
105 map.put(cpPair9, new ArrayList<CellPciPair>());
106 Graph cluster = new Graph();
108 cluster.setCellPciNeighbourMap(map);
110 System.out.println("mapsssssss" + cluster.getCellPciNeighbourMap());
111 Detection detect = new Detection();
112 detect.detectCollisionConfusion(cluster);
113 System.out.println("result" + detect.detectCollisionConfusion(cluster));