2 * Copyright 2017 ZTE Corporation.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package org.onap.holmes.common.api.stat;
19 import static org.hamcrest.core.IsEqual.equalTo;
20 import static org.junit.Assert.*;
22 import java.util.ArrayList;
23 import org.junit.Test;
25 public class VesAlarmTest {
28 public void hashCodeTest() throws Exception {
29 VesAlarm alarm = new VesAlarm();
30 alarm.setEventName("unique");
31 alarm.setSourceId("123");
32 VesAlarm alarmClone = (VesAlarm)alarm.clone();
33 assertTrue(alarm.hashCode() == alarmClone.hashCode());
37 public void equalsTest() throws Exception {
38 VesAlarm alarm = new VesAlarm();
39 alarm.setEventName("unique");
40 alarm.setSourceId("123");
41 VesAlarm alarmClone = (VesAlarm)alarm.clone();
42 assertTrue(alarm.equals(alarmClone));
46 public void cloneTest() throws Exception {
47 VesAlarm alarm = new VesAlarm();
48 alarm.setDomain("Test");
49 alarm.setEventName("unique");
50 alarm.setSourceId("123");
51 assertThat(alarm, equalTo(alarm.clone()));
55 public void getterAndSetterTest() {
56 VesAlarm alarm = new VesAlarm();
59 alarm.setEventName("");
60 alarm.setEventType("");
61 alarm.setInternalHeaderFields(new Object());
62 alarm.setLastEpochMicrosec(0L);
63 alarm.setNfcNamingCode("");
64 alarm.setNfNamingCode("");
65 alarm.setPriority("");
66 alarm.setReportingEntityId("");
67 alarm.setReportingEntityName("");
69 alarm.setSourceId("");
70 alarm.setSourceName("");
71 alarm.setStartEpochMicrosec(0L);
73 alarm.setAlarmAdditionalInformation(new ArrayList<>());
74 alarm.setAlarmCondition("");
75 alarm.setAlarmInterfaceA("");
76 alarm.setEventCategory("");
77 alarm.setEventSeverity("");
78 alarm.setEventSourceType("");
79 alarm.setFaultFieldsVersion(0L);
80 alarm.setSpecificProblem("");
81 alarm.setVfStatus("");
87 alarm.getInternalHeaderFields();
88 alarm.getLastEpochMicrosec();
89 alarm.getNfcNamingCode();
90 alarm.getNfNamingCode();
92 alarm.getReportingEntityId();
93 alarm.getReportingEntityName();
96 alarm.getSourceName();
97 alarm.getStartEpochMicrosec();
99 alarm.getAlarmAdditionalInformation();
100 alarm.getAlarmCondition();
101 alarm.getAlarmInterfaceA();
102 alarm.getEventCategory();
103 alarm.getEventSeverity();
104 alarm.getEventSourceType();
105 alarm.getFaultFieldsVersion();
106 alarm.getSpecificProblem();