View Javadoc

1   package org.kuali.ole.ingest;
2   
3   import org.junit.Test;
4   import org.kuali.ole.ingest.pojo.Krms;
5   
6   import java.io.File;
7   import java.net.URL;
8   
9   import static junit.framework.Assert.assertNotNull;
10  
11  /**
12   * Created with IntelliJ IDEA.
13   * User: vivekb
14   * Date: 7/2/12
15   * Time: 11:21 AM
16   * To change this template use File | Settings | File Templates.
17   */
18  public class KrmsObjectGeneratorFromXML_UT {
19      @Test
20      public void testBuildKrmsFromFileContentForLoan() throws Exception {
21          URL resource = getClass().getResource("Loan_Patron.xml");
22          File file = new File(resource.toURI());
23          String krmsXML = new FileUtil().readFile(file);
24  
25          KrmsObjectGeneratorFromXML krmsObjectGeneratorFromXML =
26                  new KrmsObjectGeneratorFromXML();
27  
28          Krms krms = krmsObjectGeneratorFromXML.buildKrmsFromFileContent(krmsXML);
29          assertNotNull(krms);
30  
31      }
32      @Test
33      public void testBuildKrmsFromFileContentForLicense() throws Exception {
34          URL resource = getClass().getResource("license.xml");
35          File file = new File(resource.toURI());
36          String krmsXML = new FileUtil().readFile(file);
37  
38          KrmsObjectGeneratorFromXML krmsObjectGeneratorFromXML =
39                  new KrmsObjectGeneratorFromXML();
40  
41          Krms krms = krmsObjectGeneratorFromXML.buildKrmsFromFileContent(krmsXML);
42          assertNotNull(krms);
43  
44      }
45  }