blob: c013f9ea532b777cef3bd977aa4056124f4a0ef7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
/*******************************************************************************
* Copyright (c) 2006-2011 Gluster, Inc. <http://www.gluster.com>
* This file is part of Gluster Management Console.
*
* Gluster Management Console is free software; you can redistribute
* it and/or modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* Gluster Management Console is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see
* <http://www.gnu.org/licenses/>.
*******************************************************************************/
package org.gluster.storage.management.core.model;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import org.gluster.storage.management.core.model.Alert;
import org.gluster.storage.management.core.model.Alert.ALERT_TYPES;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
/**
* The class <code>AlertTest</code> contains tests for the class <code>{@link Alert}</code>.
*
* @generatedBy CodePro at 10/17/11 3:32 PM
* @author root
* @version $Revision: 1.0 $
*/
public class AlertTest {
/**
* Run the void copyFrom(Alert) method test.
*
* @throws Exception
*
* @generatedBy CodePro at 10/17/11 3:32 PM
*/
@Test
public void testCopyFrom_1()
throws Exception {
Alert fixture = new Alert(ALERT_TYPES.DISK_USAGE_ALERT, "server1:sda",
Alert.ALERT_TYPE_STR[ALERT_TYPES.DISK_USAGE_ALERT.ordinal()] + " [85% used] in disk [server1:sda]");
Alert alert = new Alert();
alert.copyFrom(fixture);
assertEquals(fixture.getId(), alert.getId());
assertEquals(fixture.getReference(), alert.getReference());
assertEquals(fixture.getType(), alert.getType());
assertEquals(fixture.getMessage(), alert.getMessage());
assertNotNull(alert);
}
/**
* Perform pre-test initialization.
*
* @throws Exception
* if the initialization fails for some reason
*
* @generatedBy CodePro at 10/17/11 3:32 PM
*/
@Before
public void setUp()
throws Exception {
// add additional set up code here
}
/**
* Perform post-test clean-up.
*
* @throws Exception
* if the clean-up fails for some reason
*
* @generatedBy CodePro at 10/17/11 3:32 PM
*/
@After
public void tearDown()
throws Exception {
// Add additional tear down code here
}
/**
* Launch the test.
*
* @param args the command line arguments
*
* @generatedBy CodePro at 10/17/11 3:32 PM
*/
public static void main(String[] args) {
new org.junit.runner.JUnitCore().run(AlertTest.class);
}
}
|