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();
31 VesAlarm alarmClone = (VesAlarm)alarm.clone();
32 assertTrue(alarm.hashCode() == alarmClone.hashCode());
36 public void equalsTest() throws Exception {
37 VesAlarm alarm = new VesAlarm();
39 VesAlarm alarmClone = (VesAlarm)alarm.clone();
40 assertTrue(alarm.equals(alarmClone));
44 public void cloneTest() throws Exception {
45 VesAlarm alarm = new VesAlarm();
46 alarm.setDomain("Test");
48 assertThat(alarm, equalTo(alarm.clone()));
52 public void getterAndSetterTest() {
53 VesAlarm alarm = new VesAlarm();
56 alarm.setEventName("");
57 alarm.setEventType("");
58 alarm.setInternalHeaderFields(new Object());
59 alarm.setLastEpochMicrosec(0L);
60 alarm.setNfcNamingCode("");
61 alarm.setNfNamingCode("");
62 alarm.setPriority("");
63 alarm.setReportingEntityId("");
64 alarm.setReportingEntityName("");
66 alarm.setSourceId("");
67 alarm.setSourceName("");
68 alarm.setStartEpochMicrosec(0L);
70 alarm.setAlarmAdditionalInformation(new ArrayList<>());
71 alarm.setAlarmCondition("");
72 alarm.setAlarmInterfaceA("");
73 alarm.setEventCategory("");
74 alarm.setEventSeverity("");
75 alarm.setEventSourceType("");
76 alarm.setFaultFieldsVersion(0L);
77 alarm.setSpecificProblem("");
78 alarm.setVfStatus("");
84 alarm.getInternalHeaderFields();
85 alarm.getLastEpochMicrosec();
86 alarm.getNfcNamingCode();
87 alarm.getNfNamingCode();
89 alarm.getReportingEntityId();
90 alarm.getReportingEntityName();
93 alarm.getSourceName();
94 alarm.getStartEpochMicrosec();
96 alarm.getAlarmAdditionalInformation();
97 alarm.getAlarmCondition();
98 alarm.getAlarmInterfaceA();
99 alarm.getEventCategory();
100 alarm.getEventSeverity();
101 alarm.getEventSourceType();
102 alarm.getFaultFieldsVersion();
103 alarm.getSpecificProblem();