xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016-present Open Networking Laboratory |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package org.onosproject.drivers.fujitsu; |
| 18 | |
| 19 | import org.junit.Before; |
| 20 | import org.junit.Test; |
| 21 | |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 22 | import static org.junit.Assert.assertTrue; |
| 23 | import static org.junit.Assert.assertNull; |
| 24 | import static org.junit.Assert.assertNotNull; |
| 25 | import static org.onosproject.drivers.fujitsu.FujitsuVoltXmlUtilityMock.*; |
| 26 | |
| 27 | |
| 28 | /** |
| 29 | * Unit tests for methods of FujitsuVoltOnuConfig. |
| 30 | */ |
| 31 | public class FujitsuVoltOnuConfigTest { |
| 32 | |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 33 | private final FujitsuNetconfSessionListenerTest listener = new InternalSessionListenerTest(); |
| 34 | |
| 35 | private static final String TEST_VOLT_ONUS = "volt-onus"; |
| 36 | private static final String TEST_ONUS_PERLINK = "onus-perlink"; |
| 37 | private static final String TEST_ONUS_LIST = "onus-list"; |
| 38 | private static final String TEST_ONU_INFO = "onu-info"; |
| 39 | private static final String TEST_ONU_SET_CONFIG = "onu-set-config"; |
| 40 | private static final String TEST_CONFIG_INFO = "config-info"; |
| 41 | private static final String TEST_VOLT_STATISTICS = "volt-statistics"; |
| 42 | private static final String TEST_ONU_STATISTICS = "onu-statistics"; |
| 43 | private static final String TEST_ONU_ETH_STATS = "onu-eth-stats"; |
| 44 | private static final String TEST_ETH_STATS = "eth-stats"; |
| 45 | private static final String TEST_ONU_GEM_STATS = "onu-gem-stats"; |
| 46 | private static final String TEST_GEM_STATS = "gem-stats"; |
| 47 | |
| 48 | private static final String TEST_ONU_SET_CONFIG_WITH_NAMESPACE = |
| 49 | TEST_ANGLE_LEFT + TEST_ONU_SET_CONFIG + TEST_SPACE + |
| 50 | TEST_VOLT_NE_NAMESPACE; |
| 51 | |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 52 | private static final String[] INVALID_GET_TCS = { |
| 53 | "a-b", |
| 54 | "--1-2", |
| 55 | "s-1", |
| 56 | "16-1-1", |
| 57 | "1 A-1", |
| 58 | "1*A-1", |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 59 | }; |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 60 | private static final String[] VALID_GET_TCS = { |
| 61 | "1", |
| 62 | "1-2", |
| 63 | null, |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 64 | }; |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 65 | private static final String[] INVALID_SET_TCS = { |
| 66 | "-11-3:admin-state:enable", |
| 67 | "1-2:admin-state:false", |
| 68 | "1-2:pm-enable:123", |
| 69 | "^1-2:pm-enable:false", |
| 70 | "1-2:fec-enable:xyz", |
| 71 | "1-2:security-enable:123abc", |
| 72 | "2-3:password:-1&", |
| 73 | "2:admin-state:disable", |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 74 | }; |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 75 | private static final String[] VALID_SET_TCS = { |
| 76 | "1-11:admin-state:disable", |
| 77 | "8-1:pm-enable:true", |
| 78 | "1-1:fec-enable:true", |
| 79 | "1-21:security-enable:false", |
| 80 | "3-2:password:abc123", |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 81 | }; |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 82 | private static final String[] INVALID_GET_STATS_TCS = { |
| 83 | "1-a", |
| 84 | "1:1", |
| 85 | "a-1", |
| 86 | "1-1-1", |
| 87 | "2 A-1", |
| 88 | "2/A-1", |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 89 | }; |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 90 | private static final String[] VALID_GET_STATS_TCS = { |
| 91 | "1", |
| 92 | "3-12", |
| 93 | null, |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 94 | }; |
| 95 | private Integer currentKey; |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 96 | private FujitsuNetconfControllerMock controller; |
| 97 | private FujitsuDriverHandlerAdapter driverHandler; |
| 98 | private FujitsuVoltOnuConfig voltConfig; |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 99 | |
| 100 | @Before |
| 101 | public void setUp() throws Exception { |
| 102 | controller = new FujitsuNetconfControllerMock(); |
| 103 | driverHandler = controller.setUp(listener); |
| 104 | voltConfig = new FujitsuVoltOnuConfig(); |
| 105 | voltConfig.setHandler(driverHandler); |
| 106 | } |
| 107 | |
| 108 | /** |
| 109 | * Run to verify handling of invalid input for get operation. |
| 110 | */ |
| 111 | @Test |
| 112 | public void testInvalidGetOnusInput() throws Exception { |
| 113 | String reply; |
| 114 | String target; |
| 115 | |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 116 | for (int i = ZERO; i < INVALID_GET_TCS.length; i++) { |
| 117 | target = INVALID_GET_TCS[i]; |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 118 | reply = voltConfig.getOnus(target); |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 119 | assertNull("Incorrect response for INVALID_GET_TCS", reply); |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 120 | } |
| 121 | } |
| 122 | |
| 123 | /** |
| 124 | * Run to verify handling of valid input for get operation. |
| 125 | */ |
| 126 | @Test |
| 127 | public void testValidGetOnus() throws Exception { |
| 128 | String reply; |
| 129 | String target; |
| 130 | |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 131 | for (int i = ZERO; i < VALID_GET_TCS.length; i++) { |
| 132 | target = VALID_GET_TCS[i]; |
| 133 | currentKey = i; |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 134 | reply = voltConfig.getOnus(target); |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 135 | assertNotNull("Incorrect response for VALID_GET_TCS", reply); |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 136 | } |
| 137 | } |
| 138 | |
| 139 | /** |
| 140 | * Run to verify handling of invalid input for set operation. |
| 141 | */ |
| 142 | @Test |
| 143 | public void testInvalidSetOnuInput() throws Exception { |
| 144 | String target; |
| 145 | String reply; |
| 146 | |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 147 | for (int i = ZERO; i < INVALID_SET_TCS.length; i++) { |
| 148 | target = INVALID_SET_TCS[i]; |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 149 | reply = voltConfig.setOnu(target); |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 150 | assertNull("Incorrect response for INVALID_SET_TCS", reply); |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 151 | } |
| 152 | } |
| 153 | |
| 154 | /** |
| 155 | * Run to verify handling of valid input for set operation. |
| 156 | */ |
| 157 | @Test |
| 158 | public void testValidSetOnu() throws Exception { |
| 159 | String target; |
| 160 | String reply; |
| 161 | |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 162 | for (int i = ZERO; i < VALID_SET_TCS.length; i++) { |
| 163 | target = VALID_SET_TCS[i]; |
| 164 | currentKey = i; |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 165 | reply = voltConfig.setOnu(target); |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 166 | assertNotNull("Incorrect response for VALID_SET_TCS", reply); |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 167 | } |
| 168 | } |
| 169 | |
| 170 | /** |
| 171 | * Run to verify handling of invalid input for get statistics operation. |
| 172 | */ |
| 173 | @Test |
| 174 | public void testInvalidGetOnuStatsInput() throws Exception { |
| 175 | String reply; |
| 176 | String target; |
| 177 | |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 178 | for (int i = ZERO; i < INVALID_GET_STATS_TCS.length; i++) { |
| 179 | target = INVALID_GET_STATS_TCS[i]; |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 180 | reply = voltConfig.getOnuStatistics(target); |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 181 | assertNull("Incorrect response for INVALID_GET_STATS_TCS", reply); |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 182 | } |
| 183 | } |
| 184 | |
| 185 | /** |
| 186 | * Run to verify handling of valid input for get statistics operation. |
| 187 | */ |
| 188 | @Test |
| 189 | public void testValidGetOnuStats() throws Exception { |
| 190 | String reply; |
| 191 | String target; |
| 192 | |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 193 | for (int i = ZERO; i < VALID_GET_STATS_TCS.length; i++) { |
| 194 | target = VALID_GET_STATS_TCS[i]; |
| 195 | currentKey = i; |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 196 | reply = voltConfig.getOnuStatistics(target); |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 197 | assertNotNull("Incorrect response for VALID_GET_STATS_TCS", reply); |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 198 | } |
| 199 | } |
| 200 | |
| 201 | /** |
| 202 | * Verifies XML request string by comparing with generated string. |
| 203 | * |
| 204 | * @param request XML string for get operation |
| 205 | * @return true if XML string matches with generated |
| 206 | */ |
| 207 | private boolean verifyGetRequest(String request) { |
| 208 | StringBuilder rpc = new StringBuilder(); |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 209 | String target = VALID_GET_TCS[currentKey]; |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 210 | String[] onuId = null; |
| 211 | |
| 212 | if (target != null) { |
| 213 | onuId = target.split(TEST_HYPHEN); |
| 214 | } |
| 215 | |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 216 | rpc.append(TEST_VOLT_NE_OPEN + TEST_VOLT_NE_NAMESPACE); |
| 217 | rpc.append(TEST_ANGLE_RIGHT + TEST_NEW_LINE); |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 218 | if (onuId != null) { |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 219 | rpc.append(startTag(TEST_VOLT_ONUS)) |
| 220 | .append(startTag(TEST_ONUS_PERLINK)) |
| 221 | .append(startTag(TEST_PONLINK_ID, false)) |
| 222 | .append(onuId[FIRST_PART]) |
| 223 | .append(endTag(TEST_PONLINK_ID)); |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 224 | if (onuId.length > ONE) { |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 225 | rpc.append(startTag(TEST_ONUS_LIST)) |
| 226 | .append(startTag(TEST_ONU_INFO)) |
| 227 | .append(startTag(TEST_ONU_ID, false)) |
| 228 | .append(onuId[SECOND_PART]) |
| 229 | .append(endTag(TEST_ONU_ID)) |
| 230 | .append(endTag(TEST_ONU_INFO)) |
| 231 | .append(endTag(TEST_ONUS_LIST)); |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 232 | } |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 233 | rpc.append(endTag(TEST_ONUS_PERLINK)) |
| 234 | .append(endTag(TEST_VOLT_ONUS)); |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 235 | } else { |
| 236 | rpc.append(emptyTag(TEST_VOLT_ONUS)); |
| 237 | } |
| 238 | rpc.append(TEST_VOLT_NE_CLOSE); |
| 239 | |
| 240 | String testRequest = rpc.toString(); |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 241 | boolean result = request.equals(testRequest); |
| 242 | assertTrue("Does not match with generated string", result); |
| 243 | return result; |
| 244 | } |
| 245 | |
| 246 | /** |
| 247 | * Verifies XML request string by comparing with generated string. |
| 248 | * |
| 249 | * @param request XML string for set operation |
| 250 | * @return true or false |
| 251 | */ |
| 252 | private boolean verifyWrappedRpcRequest(String request) { |
| 253 | StringBuilder rpc = new StringBuilder(); |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 254 | String target = VALID_SET_TCS[currentKey]; |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 255 | String[] data = target.split(TEST_COLON); |
| 256 | String[] onuId = data[FIRST_PART].split(TEST_HYPHEN); |
| 257 | |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 258 | rpc.append(TEST_ANGLE_LEFT + TEST_ONU_SET_CONFIG + TEST_SPACE); |
| 259 | rpc.append(TEST_VOLT_NE_NAMESPACE + TEST_ANGLE_RIGHT + TEST_NEW_LINE); |
| 260 | rpc.append(startTag(TEST_PONLINK_ID, false)) |
| 261 | .append(onuId[FIRST_PART]) |
| 262 | .append(endTag(TEST_PONLINK_ID)) |
| 263 | .append(startTag(TEST_ONU_ID, false)) |
| 264 | .append(onuId[SECOND_PART]) |
| 265 | .append(endTag(TEST_ONU_ID)) |
| 266 | .append(startTag(TEST_CONFIG_INFO)) |
| 267 | .append(startTag(data[SECOND_PART], false)) |
| 268 | .append(data[THIRD_PART]) |
| 269 | .append(endTag(data[SECOND_PART])) |
| 270 | .append(endTag(TEST_CONFIG_INFO)) |
| 271 | .append(endTag(TEST_ONU_SET_CONFIG)); |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 272 | |
| 273 | String testRequest = rpc.toString(); |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 274 | boolean result = request.equals(testRequest); |
| 275 | assertTrue("Does not match with generated string", result); |
| 276 | return result; |
| 277 | } |
| 278 | |
| 279 | /** |
| 280 | * Verifies XML request string by comparing with generated string (statistics). |
| 281 | * |
| 282 | * @param request XML string for get operation |
| 283 | * @return true if XML string matches with generated |
| 284 | */ |
| 285 | private boolean verifyGetRequestForStats(String request) { |
| 286 | StringBuilder rpc = new StringBuilder(); |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 287 | String target = VALID_GET_STATS_TCS[currentKey]; |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 288 | String[] onuId = null; |
| 289 | |
| 290 | if (target != null) { |
| 291 | onuId = target.split(TEST_HYPHEN); |
| 292 | } |
| 293 | |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 294 | rpc.append(TEST_VOLT_NE_OPEN + TEST_VOLT_NE_NAMESPACE); |
| 295 | rpc.append(TEST_ANGLE_RIGHT + TEST_NEW_LINE); |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 296 | rpc.append(startTag(TEST_VOLT_STATISTICS)); |
| 297 | if (onuId != null) { |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 298 | rpc.append(startTag(TEST_ONU_STATISTICS)) |
| 299 | .append(startTag(TEST_ONU_GEM_STATS)) |
| 300 | .append(startTag(TEST_GEM_STATS)) |
| 301 | .append(startTag(TEST_PONLINK_ID, false)) |
| 302 | .append(onuId[FIRST_PART]) |
| 303 | .append(endTag(TEST_PONLINK_ID)); |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 304 | if (onuId.length > ONE) { |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 305 | rpc.append(startTag(TEST_ONU_ID, false)) |
| 306 | .append(onuId[SECOND_PART]) |
| 307 | .append(endTag(TEST_ONU_ID)); |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 308 | } |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 309 | rpc.append(endTag(TEST_GEM_STATS)) |
| 310 | .append(endTag(TEST_ONU_GEM_STATS)); |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 311 | |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 312 | rpc.append(startTag(TEST_ONU_ETH_STATS)) |
| 313 | .append(startTag(TEST_ETH_STATS)) |
| 314 | .append(startTag(TEST_PONLINK_ID, false)) |
| 315 | .append(onuId[FIRST_PART]) |
| 316 | .append(endTag(TEST_PONLINK_ID)); |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 317 | if (onuId.length > ONE) { |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 318 | rpc.append(startTag(TEST_ONU_ID, false)) |
| 319 | .append(onuId[SECOND_PART]) |
| 320 | .append(endTag(TEST_ONU_ID)); |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 321 | } |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 322 | rpc.append(endTag(TEST_ETH_STATS)) |
| 323 | .append(endTag(TEST_ONU_ETH_STATS)) |
| 324 | .append(endTag(TEST_ONU_STATISTICS)); |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 325 | } else { |
| 326 | rpc.append(emptyTag(TEST_ONU_STATISTICS)); |
| 327 | } |
xueliang | c6e47e2 | 2016-10-20 16:37:24 +0900 | [diff] [blame^] | 328 | rpc.append(endTag(TEST_VOLT_STATISTICS)) |
| 329 | .append(TEST_VOLT_NE_CLOSE); |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 330 | |
| 331 | String testRequest = rpc.toString(); |
xueliang | 5b3d3444 | 2016-09-23 10:37:33 +0900 | [diff] [blame] | 332 | boolean result = request.equals(testRequest); |
| 333 | assertTrue("Does not match with generated string", result); |
| 334 | return result; |
| 335 | } |
| 336 | |
| 337 | /** |
| 338 | * Internal listener for device service events. |
| 339 | */ |
| 340 | private class InternalSessionListenerTest implements FujitsuNetconfSessionListenerTest { |
| 341 | @Override |
| 342 | public boolean verifyEditConfig(String request) { |
| 343 | return false; |
| 344 | } |
| 345 | |
| 346 | @Override |
| 347 | public boolean verifyEditConfig(String target, String mode, String request) { |
| 348 | return false; |
| 349 | } |
| 350 | |
| 351 | @Override |
| 352 | public boolean verifyGet(String filterSchema, String withDefaultsMode) { |
| 353 | boolean result; |
| 354 | boolean forStats; |
| 355 | |
| 356 | assertTrue("Incorrect withDefaultsMode", withDefaultsMode.equals(TEST_REPORT_ALL)); |
| 357 | filterSchema = filterSchema.replaceAll(TEST_DUPLICATE_SPACES_REGEX, TEST_SPACE); |
| 358 | assertTrue("Does not contain:" + TEST_VOLT_NAMESPACE, |
| 359 | filterSchema.contains(TEST_VOLT_NAMESPACE)); |
| 360 | |
| 361 | forStats = filterSchema.contains(TEST_VOLT_STATISTICS); |
| 362 | if (forStats) { |
| 363 | result = verifyGetRequestForStats(filterSchema); |
| 364 | } else { |
| 365 | result = verifyGetRequest(filterSchema); |
| 366 | } |
| 367 | assertTrue("XML verification failure", result); |
| 368 | return result; |
| 369 | } |
| 370 | |
| 371 | @Override |
| 372 | public String buildGetReply() { |
| 373 | return null; |
| 374 | } |
| 375 | |
| 376 | @Override |
| 377 | public boolean verifyWrappedRpc(String request) { |
| 378 | boolean result; |
| 379 | |
| 380 | request = request.replaceAll(TEST_DUPLICATE_SPACES_REGEX, TEST_SPACE); |
| 381 | assertTrue("Does not contain:" + TEST_ONU_SET_CONFIG_WITH_NAMESPACE, |
| 382 | request.contains(TEST_ONU_SET_CONFIG_WITH_NAMESPACE)); |
| 383 | |
| 384 | result = verifyWrappedRpcRequest(request); |
| 385 | assertTrue("XML verification failure", result); |
| 386 | return result; |
| 387 | } |
| 388 | |
| 389 | @Override |
| 390 | public void verifyStartSubscription(String filterSchema) { |
| 391 | } |
| 392 | } |
| 393 | |
| 394 | } |