05d3e796469074ca95cc9705db3d7ead4cbc03c1
[dcaegen2/services/son-handler.git] / src / test / java / org / onap / dcaegen2 / services / sonhms / child / TestDetection.java
1 /*******************************************************************************
2  *  ============LICENSE_START=======================================================
3  *  son-handler
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
10  *  
11  *          http://www.apache.org/licenses/LICENSE-2.0
12  *  
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=========================================================
19  *  
20  *******************************************************************************/
21
22 package org.onap.dcaegen2.services.sonhms.child;
23
24
25 import java.util.ArrayList;
26 import java.util.HashMap;
27 import java.util.Map;
28
29 import org.junit.Test;
30 import org.onap.dcaegen2.services.sonhms.model.CellPciPair;
31
32
33 public class TestDetection {
34     @Test
35     public void testDetection() {
36
37         CellPciPair cpPair = new CellPciPair();
38         cpPair.setCellId("32");
39         cpPair.setPhysicalCellId(26);
40
41         CellPciPair cpPair1 = new CellPciPair();
42         cpPair1.setCellId("25");
43         cpPair1.setPhysicalCellId(23);
44
45         CellPciPair cpPair2 = new CellPciPair();
46         cpPair2.setCellId("42");
47         cpPair2.setPhysicalCellId(26);
48
49         CellPciPair cpPair3 = new CellPciPair();
50         cpPair3.setCellId("56");
51         cpPair3.setPhysicalCellId(200);
52
53         CellPciPair cpPair4 = new CellPciPair();
54         cpPair4.setCellId("21");
55         cpPair4.setPhysicalCellId(5);
56
57         CellPciPair cpPair5 = new CellPciPair();
58         cpPair5.setCellId("24");
59         cpPair5.setPhysicalCellId(5);
60
61         CellPciPair cpPair6 = new CellPciPair();
62         cpPair6.setCellId("38");
63         cpPair6.setPhysicalCellId(126);
64
65         CellPciPair cpPair7 = new CellPciPair();
66         cpPair7.setCellId("67");
67         cpPair7.setPhysicalCellId(300);
68
69         CellPciPair cpPair8 = new CellPciPair();
70         cpPair8.setCellId("69");
71         cpPair8.setPhysicalCellId(129);
72
73         CellPciPair cpPair9 = new CellPciPair();
74         cpPair9.setCellId("78");
75         cpPair9.setPhysicalCellId(147);
76
77         ArrayList<CellPciPair> al = new ArrayList<CellPciPair>();
78         al.add(cpPair1);
79         al.add(cpPair2);
80         al.add(cpPair3);
81
82         ArrayList<CellPciPair> al1 = new ArrayList<CellPciPair>();
83         al1.add(cpPair4);
84         al1.add(cpPair5);
85         al1.add(cpPair6);
86
87         ArrayList<CellPciPair> al2 = new ArrayList<CellPciPair>();
88         al2.add(cpPair7);
89         al2.add(cpPair8);
90         al2.add(cpPair9);
91
92         Map<CellPciPair, ArrayList<CellPciPair>> map = new HashMap<CellPciPair, ArrayList<CellPciPair>>();
93
94         map.put(cpPair, al);
95         map.put(cpPair1, al1);
96         map.put(cpPair2, al2);
97         map.put(cpPair3, new ArrayList<CellPciPair>());
98         map.put(cpPair4, new ArrayList<CellPciPair>());
99         map.put(cpPair5, new ArrayList<CellPciPair>());
100         map.put(cpPair6, new ArrayList<CellPciPair>());
101         map.put(cpPair7, new ArrayList<CellPciPair>());
102         map.put(cpPair8, new ArrayList<CellPciPair>());
103         map.put(cpPair9, new ArrayList<CellPciPair>());
104         Graph cluster = new Graph();
105
106         cluster.setCellPciNeighbourMap(map);
107
108         System.out.println("mapsssssss" + cluster.getCellPciNeighbourMap());
109         Detection detect = new Detection();
110         detect.detectCollisionConfusion(cluster);
111         System.out.println("result" + detect.detectCollisionConfusion(cluster));
112
113     }
114
115 }