2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
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=========================================================
21 package org.openecomp.sdc.be.config;
23 import org.junit.Test;
24 import org.openecomp.sdc.be.config.BeEcompErrorManager.ErrorSeverity;
25 import org.openecomp.sdc.common.config.IEcompConfigurationManager;
28 public class BeEcompErrorManagerTest {
30 private BeEcompErrorManager createTestSubject() {
31 return BeEcompErrorManager.getInstance();
36 public void testGetInstance() throws Exception {
37 BeEcompErrorManager result;
40 result = BeEcompErrorManager.getInstance();
47 public void testGetConfigurationManager() throws Exception {
48 BeEcompErrorManager testSubject;
49 IEcompConfigurationManager result;
52 testSubject = createTestSubject();
53 result = testSubject.getConfigurationManager();
58 public void testLogBeUebAuthenticationError() throws Exception {
59 BeEcompErrorManager testSubject;
64 testSubject = createTestSubject();
65 testSubject.logBeUebAuthenticationError(context, reason);
70 public void testLogBeHealthCheckRecovery() throws Exception {
71 BeEcompErrorManager testSubject;
75 testSubject = createTestSubject();
76 testSubject.logBeHealthCheckRecovery(context);
81 public void testLogBeHealthCheckJanusGraphRecovery() throws Exception {
82 BeEcompErrorManager testSubject;
86 testSubject = createTestSubject();
87 testSubject.logBeHealthCheckJanusGraphRecovery(context);
91 public void testLogBeHealthCheckUebClusterRecovery() throws Exception {
92 BeEcompErrorManager testSubject;
96 testSubject = createTestSubject();
97 testSubject.logBeHealthCheckUebClusterRecovery(context);
102 public void testLogFeHealthCheckRecovery() throws Exception {
103 BeEcompErrorManager testSubject;
107 testSubject = createTestSubject();
108 testSubject.logFeHealthCheckRecovery(context);
113 public void testLogBeHealthCheckError() throws Exception {
114 BeEcompErrorManager testSubject;
118 testSubject = createTestSubject();
119 testSubject.logBeHealthCheckError(context);
124 public void testLogBeHealthCheckJanusGraphError() throws Exception {
125 BeEcompErrorManager testSubject;
129 testSubject = createTestSubject();
130 testSubject.logBeHealthCheckJanusGraphError(context);
134 public void testLogBeHealthCheckUebClusterError() throws Exception {
135 BeEcompErrorManager testSubject;
139 testSubject = createTestSubject();
140 testSubject.logBeHealthCheckUebClusterError(context);
145 public void testLogFeHealthCheckError() throws Exception {
146 BeEcompErrorManager testSubject;
150 testSubject = createTestSubject();
151 testSubject.logFeHealthCheckError(context);
156 public void testLogBeUebConnectionError() throws Exception {
157 BeEcompErrorManager testSubject;
162 testSubject = createTestSubject();
163 testSubject.logBeUebConnectionError(context, reason);
168 public void testLogBeUebUnkownHostError() throws Exception {
169 BeEcompErrorManager testSubject;
174 testSubject = createTestSubject();
175 testSubject.logBeUebUnkownHostError(context, host);
180 public void testLogBeComponentMissingError() throws Exception {
181 BeEcompErrorManager testSubject;
183 String componentType = "";
187 testSubject = createTestSubject();
188 testSubject.logBeComponentMissingError(context, componentType, name);
193 public void testLogBeIncorrectComponentError() throws Exception {
194 BeEcompErrorManager testSubject;
196 String componentType = "";
200 testSubject = createTestSubject();
201 testSubject.logBeIncorrectComponentError(context, componentType, name);
206 public void testLogBeInvalidConfigurationError() throws Exception {
207 BeEcompErrorManager testSubject;
209 String parameterName = "";
210 String parameterValue = "";
213 testSubject = createTestSubject();
214 testSubject.logBeInvalidConfigurationError(context, parameterName, parameterValue);
219 public void testLogBeUebObjectNotFoundError() throws Exception {
220 BeEcompErrorManager testSubject;
222 String notFoundObjectName = "";
225 testSubject = createTestSubject();
226 testSubject.logBeUebObjectNotFoundError(context, notFoundObjectName);
231 public void testLogBeDistributionEngineInvalidArtifactType() throws Exception {
232 BeEcompErrorManager testSubject;
234 String artifactType = "";
235 String validArtifactTypes = "";
238 testSubject = createTestSubject();
239 testSubject.logBeDistributionEngineInvalidArtifactType(context, artifactType, validArtifactTypes);
244 public void testLogBeMissingConfigurationError() throws Exception {
245 BeEcompErrorManager testSubject;
247 String parameterName = "";
250 testSubject = createTestSubject();
251 testSubject.logBeMissingConfigurationError(context, parameterName);
256 public void testLogBeConfigurationInvalidListSizeError() throws Exception {
257 BeEcompErrorManager testSubject;
259 String parameterName = "";
260 int listMinimumSize = 0;
263 testSubject = createTestSubject();
264 testSubject.logBeConfigurationInvalidListSizeError(context, parameterName, listMinimumSize);
269 public void testLogErrorConfigFileFormat() throws Exception {
270 BeEcompErrorManager testSubject;
272 String description = "";
275 testSubject = createTestSubject();
276 testSubject.logErrorConfigFileFormat(context, description);
281 public void testLogBeMissingArtifactInformationError() throws Exception {
282 BeEcompErrorManager testSubject;
284 String missingInfo = "";
287 testSubject = createTestSubject();
288 testSubject.logBeMissingArtifactInformationError(context, missingInfo);
293 public void testLogBeArtifactMissingError() throws Exception {
294 BeEcompErrorManager testSubject;
296 String artifactName = "";
299 testSubject = createTestSubject();
300 testSubject.logBeArtifactMissingError(context, artifactName);
305 public void testLogBeUserMissingError() throws Exception {
306 BeEcompErrorManager testSubject;
311 testSubject = createTestSubject();
312 testSubject.logBeUserMissingError(context, userId);
317 public void testLogBeInvalidTypeError() throws Exception {
318 BeEcompErrorManager testSubject;
324 testSubject = createTestSubject();
325 testSubject.logBeInvalidTypeError(context, type, name);
330 public void testLogBeInvalidValueError() throws Exception {
331 BeEcompErrorManager testSubject;
338 testSubject = createTestSubject();
339 testSubject.logBeInvalidValueError(context, value, name, type);
344 public void testLogBeArtifactPayloadInvalid() throws Exception {
345 BeEcompErrorManager testSubject;
349 testSubject = createTestSubject();
350 testSubject.logBeArtifactPayloadInvalid(context);
355 public void testLogBeArtifactInformationInvalidError() throws Exception {
356 BeEcompErrorManager testSubject;
360 testSubject = createTestSubject();
361 testSubject.logBeArtifactInformationInvalidError(context);
366 public void testLogBeDistributionMissingError() throws Exception {
367 BeEcompErrorManager testSubject;
369 String distributionName = "";
372 testSubject = createTestSubject();
373 testSubject.logBeDistributionMissingError(context, distributionName);
378 public void testLogBeGraphObjectMissingError() throws Exception {
379 BeEcompErrorManager testSubject;
381 String objectType = "";
382 String objectName = "";
385 testSubject = createTestSubject();
386 testSubject.logBeGraphObjectMissingError(context, objectType, objectName);
391 public void testLogBeInvalidJsonInput() throws Exception {
392 BeEcompErrorManager testSubject;
396 testSubject = createTestSubject();
397 testSubject.logBeInvalidJsonInput(context);
402 public void testLogBeInitializationError() throws Exception {
403 BeEcompErrorManager testSubject;
407 testSubject = createTestSubject();
408 testSubject.logBeInitializationError(context);
413 public void testLogBeFailedAddingResourceInstanceError() throws Exception {
414 BeEcompErrorManager testSubject;
416 String resourceName = "";
417 String serviceId = "";
420 testSubject = createTestSubject();
421 testSubject.logBeFailedAddingResourceInstanceError(context, resourceName, serviceId);
426 public void testLogBeUebSystemError() throws Exception {
427 BeEcompErrorManager testSubject;
429 String operation = "";
432 testSubject = createTestSubject();
433 testSubject.logBeUebSystemError(context, operation);
438 public void testLogBeDistributionEngineSystemError() throws Exception {
439 BeEcompErrorManager testSubject;
441 String operation = "";
444 testSubject = createTestSubject();
445 testSubject.logBeDistributionEngineSystemError(context, operation);
450 public void testLogBeFailedAddingNodeTypeError() throws Exception {
451 BeEcompErrorManager testSubject;
453 String nodeType = "";
456 testSubject = createTestSubject();
457 testSubject.logBeFailedAddingNodeTypeError(context, nodeType);
462 public void testLogBeDaoSystemError() throws Exception {
463 BeEcompErrorManager testSubject;
467 testSubject = createTestSubject();
468 testSubject.logBeDaoSystemError(context);
473 public void testLogBeSystemError() throws Exception {
474 BeEcompErrorManager testSubject;
478 testSubject = createTestSubject();
479 testSubject.logBeSystemError(context);
484 public void testLogBeExecuteRollbackError() throws Exception {
485 BeEcompErrorManager testSubject;
489 testSubject = createTestSubject();
490 testSubject.logBeExecuteRollbackError(context);
495 public void testLogBeFailedLockObjectError() throws Exception {
496 BeEcompErrorManager testSubject;
502 testSubject = createTestSubject();
503 testSubject.logBeFailedLockObjectError(context, type, id);
508 public void testLogBeFailedCreateNodeError() throws Exception {
509 BeEcompErrorManager testSubject;
511 String nodeName = "";
515 testSubject = createTestSubject();
516 testSubject.logBeFailedCreateNodeError(context, nodeName, status);
521 public void testLogBeFailedUpdateNodeError() throws Exception {
522 BeEcompErrorManager testSubject;
524 String nodeName = "";
528 testSubject = createTestSubject();
529 testSubject.logBeFailedUpdateNodeError(context, nodeName, status);
534 public void testLogBeFailedDeleteNodeError() throws Exception {
535 BeEcompErrorManager testSubject;
537 String nodeName = "";
541 testSubject = createTestSubject();
542 testSubject.logBeFailedDeleteNodeError(context, nodeName, status);
547 public void testLogBeFailedRetrieveNodeError() throws Exception {
548 BeEcompErrorManager testSubject;
550 String nodeName = "";
554 testSubject = createTestSubject();
555 testSubject.logBeFailedRetrieveNodeError(context, nodeName, status);
560 public void testLogBeFailedFindParentError() throws Exception {
561 BeEcompErrorManager testSubject;
567 testSubject = createTestSubject();
568 testSubject.logBeFailedFindParentError(context, node, status);
573 public void testLogBeFailedFindAllNodesError() throws Exception {
574 BeEcompErrorManager testSubject;
576 String nodeType = "";
577 String parentNode = "";
581 testSubject = createTestSubject();
582 testSubject.logBeFailedFindAllNodesError(context, nodeType, parentNode, status);
587 public void testLogBeFailedFindAssociationError() throws Exception {
588 BeEcompErrorManager testSubject;
590 String nodeType = "";
591 String fromNode = "";
595 testSubject = createTestSubject();
596 testSubject.logBeFailedFindAssociationError(context, nodeType, fromNode, status);
601 public void testLogBeComponentCleanerSystemError() throws Exception {
602 BeEcompErrorManager testSubject;
604 String operation = "";
607 testSubject = createTestSubject();
608 testSubject.logBeComponentCleanerSystemError(context, operation);
613 public void testLogBeRestApiGeneralError() throws Exception {
614 BeEcompErrorManager testSubject;
618 testSubject = createTestSubject();
619 testSubject.logBeRestApiGeneralError(context);
624 public void testLogFqdnResolveError() throws Exception {
625 BeEcompErrorManager testSubject;
627 String description = "";
630 testSubject = createTestSubject();
631 testSubject.logFqdnResolveError(context, description);
636 public void testLogSiteSwitchoverInfo() throws Exception {
637 BeEcompErrorManager testSubject;
639 String description = "";
642 testSubject = createTestSubject();
643 testSubject.logSiteSwitchoverInfo(context, description);
648 public void testLogInternalAuthenticationError() throws Exception {
649 BeEcompErrorManager testSubject;
651 String description = "";
652 ErrorSeverity severity = null;
655 testSubject = createTestSubject();
657 testSubject.logInternalAuthenticationError(context, description, severity);
662 public void testLogInternalConnectionError() throws Exception {
663 BeEcompErrorManager testSubject;
665 String description = "";
666 ErrorSeverity severity = null;
669 testSubject = createTestSubject();
671 testSubject.logInternalConnectionError(context, description, severity);
676 public void testLogInternalDataError() throws Exception {
677 BeEcompErrorManager testSubject;
679 String description = "";
680 ErrorSeverity severity = null;
683 testSubject = createTestSubject();
685 testSubject.logInternalDataError(context, description, severity);
690 public void testLogInvalidInputError() throws Exception {
691 BeEcompErrorManager testSubject;
693 String description = "";
694 ErrorSeverity severity = null;
697 testSubject = createTestSubject();
699 testSubject.logInvalidInputError(context, description, severity);
704 public void testLogInternalFlowError() throws Exception {
705 BeEcompErrorManager testSubject;
707 String description = "";
708 ErrorSeverity severity = null;
711 testSubject = createTestSubject();
713 testSubject.logInternalFlowError(context, description, severity);
718 public void testLogInternalUnexpectedError() throws Exception {
719 BeEcompErrorManager testSubject;
721 String description = "";
722 ErrorSeverity severity = null;
725 testSubject = createTestSubject();
727 testSubject.logInternalUnexpectedError(context, description, severity);