blob: 448ffcc845358fcf86dc40157d37a02fbd552b3f [file] [log] [blame]
Jonathan Hartaa380972014-04-03 10:24:46 -07001package net.onrc.onos.core.intent;
Toshio Koideeb2d9e52014-03-31 17:52:34 -07002
Jonathan Harta88fd242014-04-03 11:24:54 -07003import static org.junit.Assert.assertEquals;
Ray Milkey269ffb92014-04-03 14:43:30 -07004
Jonathan Hartaa380972014-04-03 10:24:46 -07005import net.onrc.onos.core.intent.ErrorIntent.ErrorType;
Toshio Koideeb2d9e52014-03-31 17:52:34 -07006
7import org.junit.After;
8import org.junit.Before;
9import org.junit.Test;
10
11/**
12 * Unit tests for the ErrorIntent class.
Toshio Koideeb2d9e52014-03-31 17:52:34 -070013 */
14public class ErrorIntentTest {
15
16 @Before
17 public void setUp() throws Exception {
18 }
19
20 @After
21 public void tearDown() throws Exception {
22 }
23
24 /**
25 * Test the result of executing constructor of the ErrorIntent class.
26 * This test checks the fields of id, errorType, message and parentIntent.
27 */
28 @Test
29 public void testCreate() {
30 Intent parentIntent = new Intent("1");
31 ErrorIntent errorIntent = new ErrorIntent(ErrorType.PATH_NOT_FOUND, "path not found", parentIntent);
32
33 assertEquals("1", errorIntent.getId());
34 assertEquals(ErrorType.PATH_NOT_FOUND, errorIntent.errorType);
35 assertEquals("path not found", errorIntent.message);
36 assertEquals(parentIntent, errorIntent.parentIntent);
37 }
38}