View Javadoc
1   package org.kuali.ole.ingest.controller;
2   
3   import org.junit.Before;
4   import org.junit.Test;
5   
6   import static junit.framework.Assert.assertFalse;
7   import static junit.framework.Assert.assertTrue;
8   
9   /**
10   * Created by IntelliJ IDEA.
11   * User: pvsubrah
12   * Date: 4/11/12
13   * Time: 12:37 PM
14   * To change this template use File | Settings | File Templates.
15   */
16  public class StaffUploadController_UT {
17  
18      public StaffUploadController staffUploadController;
19  
20      @Before
21      public void setUp() throws Exception {
22          staffUploadController = new StaffUploadController();
23      }
24  
25      @Test
26      public void testWhenRawMarcAndRawEDI() throws Exception {
27          assertTrue(staffUploadController.validateFile("iu.mrc", "iu.edi"));
28      }
29  
30  
31      @Test
32      public void testRawMarcAndEdiXML() throws Exception {
33          assertFalse(staffUploadController.validateFile("iu.mrc", "sample-marc.xml"));
34      }
35  
36  
37      @Test
38      public void testMarcXMLAndRawEdi() throws Exception {
39          assertFalse(staffUploadController.validateFile("sample-marc.xml", "iu.edi"));
40      }
41  
42  
43      @Test
44      public void testMarcXMLAndEdiXML() throws Exception {
45          assertTrue(staffUploadController.validateFile("sample-marc.xml", "ybp-sample-profile.xml"));
46      }
47  
48  
49  }