View Javadoc

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