Adding Copyright Missing files
[oam/tr069-adapter.git] / mapper / src / main / java / org / commscope / tr069adapter / mapper / Test.java
1 /*
2  * ============LICENSE_START========================================================================
3  * ONAP : tr-069-adapter
4  * =================================================================================================
5  * Copyright (C) 2020 CommScope Inc Intellectual Property.
6  * =================================================================================================
7  * This tr-069-adapter software file is distributed by CommScope Inc under the Apache License,
8  * Version 2.0 (the "License"); you may not use this file except in compliance with the License. You
9  * may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
14  * either express or implied. See the License for the specific language governing permissions and
15  * limitations under the License.
16  * ===============LICENSE_END=======================================================================
17  */
18
19 package org.commscope.tr069adapter.mapper;\r
20 \r
21 import java.io.File;\r
22 import java.io.IOException;\r
23 \r
24 import org.apache.commons.io.FileUtils;\r
25 import org.commscope.tr069adapter.acs.common.DeviceRPCRequest;\r
26 import org.commscope.tr069adapter.acs.common.dto.TR069OperationCode;\r
27 import org.commscope.tr069adapter.mapper.util.MOMetaDataUtil;\r
28 import org.commscope.tr069adapter.mapper.util.NetconfToTr069MapperUtil;\r
29 import org.w3c.dom.Element;\r
30 \r
31 public class Test {\r
32 \r
33   public static final String INDEX_STR = "index";\r
34   public static final String INDEX_REGEX = "[0-9]{1,}";\r
35 \r
36   public static void main(String[] args) throws IOException {\r
37     File file = new File("rpc_set_input.xml");\r
38     String requestXML = FileUtils.readFileToString(file, "UTF-8");\r
39 \r
40 \r
41     StringBuilder buff = new StringBuilder();\r
42     for (int i = 6400; i <= 9600; i++) {\r
43       buff.append(i).append(",");\r
44     }\r
45     System.out.println(buff.toString());\r
46 \r
47     MOMetaDataUtil util = new MOMetaDataUtil();\r
48     util.loadMetaData();\r
49     Element el = NetconfToTr069MapperUtil.convertStringToDocument(requestXML);\r
50 \r
51     DeviceRPCRequest req = NetconfToTr069MapperUtil.prepareTR069Request("0005B9AAAAA3", el, "rpc",\r
52         TR069OperationCode.GET_PARAMETER_VALUES);\r
53     req.getOpDetails()\r
54         .setParmeters(util.getSupportedChildParameters(req.getOpDetails().getParmeters()));\r
55 \r
56     System.out.println(req);\r
57 \r
58   }\r
59 \r
60 }\r