View Javadoc
1   package org.itracker.model;
2   
3   import org.junit.After;
4   import org.junit.Before;
5   import org.junit.Test;
6   
7   import static org.junit.Assert.assertEquals;
8   
9   public class IssueActivityTypeTest {
10  
11      @Test
12      public void testForCode() {
13          // TODO: Remove call to depreciated code
14          assertEquals(IssueActivityType.ISSUE_CREATED, IssueActivityType.forCode(1));
15          assertEquals(IssueActivityType.STATUS_CHANGE, IssueActivityType.forCode(2));
16          assertEquals(IssueActivityType.OWNER_CHANGE, IssueActivityType.forCode(3));
17          assertEquals(IssueActivityType.SEVERITY_CHANGE, IssueActivityType.forCode(4));
18          assertEquals(IssueActivityType.COMPONENTS_MODIFIED, IssueActivityType.forCode(5));
19          assertEquals(IssueActivityType.VERSIONS_MODIFIED, IssueActivityType.forCode(6));
20          assertEquals(IssueActivityType.REMOVE_HISTORY, IssueActivityType.forCode(7));
21          assertEquals(IssueActivityType.ISSUE_MOVE, IssueActivityType.forCode(8));
22          assertEquals(IssueActivityType.SYSTEM_UPDATE, IssueActivityType.forCode(9));
23          assertEquals(IssueActivityType.TARGETVERSION_CHANGE, IssueActivityType.forCode(10));
24          assertEquals(IssueActivityType.DESCRIPTION_CHANGE, IssueActivityType.forCode(11));
25          assertEquals(IssueActivityType.RESOLUTION_CHANGE, IssueActivityType.forCode(12));
26          assertEquals(IssueActivityType.RELATION_ADDED, IssueActivityType.forCode(13));
27          assertEquals(IssueActivityType.RELATION_REMOVED, IssueActivityType.forCode(14));
28          assertEquals(IssueActivityType.ATTACHMENT_ADDED, IssueActivityType.forCode(15));
29          assertEquals(null, IssueActivityType.forCode(16));
30      }
31  
32      @Test
33      public void testFromCode() {
34          assertEquals(IssueActivityType.ISSUE_CREATED, IssueActivityType.ISSUE_CREATED.fromCode(1));
35          assertEquals(IssueActivityType.STATUS_CHANGE, IssueActivityType.ISSUE_CREATED.fromCode(2));
36          assertEquals(IssueActivityType.OWNER_CHANGE, IssueActivityType.ISSUE_CREATED.fromCode(3));
37          assertEquals(IssueActivityType.SEVERITY_CHANGE, IssueActivityType.ISSUE_CREATED.fromCode(4));
38          assertEquals(IssueActivityType.COMPONENTS_MODIFIED, IssueActivityType.ISSUE_CREATED.fromCode(5));
39          assertEquals(IssueActivityType.VERSIONS_MODIFIED, IssueActivityType.ISSUE_CREATED.fromCode(6));
40          assertEquals(IssueActivityType.REMOVE_HISTORY, IssueActivityType.ISSUE_CREATED.fromCode(7));
41          assertEquals(IssueActivityType.ISSUE_MOVE, IssueActivityType.ISSUE_CREATED.fromCode(8));
42          assertEquals(IssueActivityType.SYSTEM_UPDATE, IssueActivityType.ISSUE_CREATED.fromCode(9));
43          assertEquals(IssueActivityType.TARGETVERSION_CHANGE, IssueActivityType.ISSUE_CREATED.fromCode(10));
44          assertEquals(IssueActivityType.DESCRIPTION_CHANGE, IssueActivityType.ISSUE_CREATED.fromCode(11));
45          assertEquals(IssueActivityType.RESOLUTION_CHANGE, IssueActivityType.ISSUE_CREATED.fromCode(12));
46          assertEquals(IssueActivityType.RELATION_ADDED, IssueActivityType.ISSUE_CREATED.fromCode(13));
47          assertEquals(IssueActivityType.RELATION_REMOVED, IssueActivityType.ISSUE_CREATED.fromCode(14));
48          assertEquals(IssueActivityType.ATTACHMENT_ADDED, IssueActivityType.ISSUE_CREATED.fromCode(15));
49          assertEquals(null, IssueActivityType.ISSUE_CREATED.fromCode(16));
50      }
51  
52  
53      @Before
54      public void setUp() throws Exception {
55      }
56  
57      @After
58      public void tearDown() throws Exception {
59  
60      }
61  
62  }