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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=======================================================================
19 package org.commscope.tr069adapter.config;
21 import java.util.ArrayList;
22 import java.util.List;
24 import org.commscope.tr069adapter.config.model.ConfigFileContent;
26 public class ConfigDataTestsUtils {
28 private ConfigDataTestsUtils() {}
30 public static final String SERVER_URI = "http://localhost:9000/";
31 public static final String macId = "testMacId";
32 public static final String OUI = "0005B9";
33 public static final String PRODUCT_CLASS = "LTE_Enterprise_C-RANSC_Cntrl";
34 public static final String HAEDWARE_VERSION = "1.1.1.1";
35 public static final String SW_VERSION = "4.5.00.001";
37 public static final String CONFIG_FILE_NAME = macId + ".xml";
39 // public static ConfigurationData getConfigurationData() {
40 // ConfigurationData configData = new ConfigurationData();
42 // configData.setHardwareVersion(HAEDWARE_VERSION);
43 // configData.setSoftwareVersion(SW_VERSION);
44 // configData.setLocalDn(macId);
45 // configData.setOUI(OUI);
46 // configData.setProductClass(PRODUCT_CLASS);
48 //// Map<String, String> map = new HashMap<String, String>();
49 //// map.put(", value)
55 public static List<ConfigFileContent> getConfigFileContent() {
56 List<ConfigFileContent> data = new ArrayList<>();
58 for (int i = 0; i < 5; i++) {
59 ConfigFileContent configFileContent = new ConfigFileContent();
60 configFileContent.setFileContent(getFileContent());
61 configFileContent.setMacId(macId);
62 configFileContent.setSwVersion("4." + i);
69 public static String getFileContent() {
70 String fileContent = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" + "<configDataFile>\r\n"
71 + " <fileHeader fileFormatVersion=\"32.594 V14.0.0\" vendorName=\"Commscope\"/>\r\n"
73 + " <managedElement swVersion=\"4.3.00.038\" localDn=\"0005B95196D0\" hwVersion=\"750742.00.04\" ProductClass=\"LTE_Enterprise_C-RANSC_Cntrl\" OUI=\"0005B9\"/>\r\n"
74 + " <Device>\r\n" + " <FAP>\r\n" + " <GPS>\r\n"
75 + " <AGPSServerConfig>\r\n" + " <Enable>1</Enable>\r\n"
76 + " <Password>dmsuser</Password>\r\n"
77 + " <ServerPort>7001</ServerPort>\r\n"
78 + " <ServerURL>NONE</ServerURL>\r\n"
79 + " <Username>dmsuser</Username>\r\n" + " </AGPSServerConfig>\r\n"
80 + " <GPSReset>0</GPSReset>\r\n" + " </GPS>\r\n" + " </FAP>\r\n"
81 + " </Device>\r\n" + " </configData>\r\n"
82 + " <fileFooter dateTime=\"2019-07-16T17:32:35+05:30\"/>\r\n" + "</configDataFile>";