summaryrefslogtreecommitdiffstats
path: root/src/org.gluster.storage.management.core/junit/org/gluster/storage/management/core/model/AlertTest.java
blob: 7ab59398c611d22fa8fac8eab4b83c01b9762a3a (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
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);
	}
}