1 package org.itracker.services.exceptions;
2
3 import org.junit.Test;
4
5 import junit.framework.TestCase;
6
7 public class WorkflowExceptionTest extends TestCase {
8
9 @Test
10 public void testConstructor() {
11 WorkflowException e = new WorkflowException();
12 assertTrue(e instanceof Exception);
13
14 e = new WorkflowException("my_message");
15 assertEquals("e.message", "my_message", e.getMessage());
16
17 e = new WorkflowException(1);
18 assertEquals("e.type", 1, e.getType());
19
20 e = new WorkflowException("my_message", 1);
21 assertEquals("e.message", "my_message", e.getMessage());
22 assertEquals("e.type", 1, e.getType());
23
24 }
25
26 @Test
27 public void testSetType() {
28 WorkflowException e = new WorkflowException();
29 e.setType(1);
30 assertEquals("e.type", 1, e.getType());
31 }
32
33 }