View Javadoc

1   package org.kuali.ole.docstore.process;
2   
3   import org.junit.After;
4   import org.junit.Before;
5   import org.junit.Test;
6   
7   import java.net.URL;
8   
9   import static org.junit.Assert.fail;
10  
11  /**
12   * Created by IntelliJ IDEA.
13   * User: ND6967
14   * Date: 3/13/12
15   * Time: 5:58 PM
16   * To change this template use File | Settings | File Templates.
17   */
18  public class BulkLoadHandler_AT {
19      private String jobId;
20  
21      /**
22       * Method to setUp
23       * 
24       * @throws java.lang.Exception
25       */
26      @Before
27      public void setUp() throws Exception {
28          DocStoreCamelContext.getInstance();
29      }
30  
31      /**
32       * Method to tearDown
33       * 
34       * @throws java.lang.Exception
35       */
36      @After
37      public void tearDown() throws Exception {
38          for (int i = 0; i < 5; i++) {
39              Thread.sleep(5000);
40              System.out.println("Status: " + BulkLoadHandler.getInstance().getStatus());
41          }
42          DocStoreCamelContext.getInstance().stop();
43          Thread.sleep(5000);
44          System.out.println("Status: " + BulkLoadHandler.getInstance().getStatus());
45  
46      }
47  
48      /**
49       * Test method for {@link org.kuali.ole.docstore.process.DocStoreCamelContext#addBulkIngestNIndexProcess(java.lang.String, java.lang.String, java.lang.String)}.
50       */
51      @Test
52      public final void testBulkIngestAndIndex() {
53          URL url = ClassLoader.getSystemClassLoader().getResource("org/kuali/ole/bulkIngest/");
54          try {
55              jobId = url.getFile();
56              BulkLoadHandler.getInstance().loadBulk(jobId, ProcessParameters.BULK_DEFAULT_USER, ProcessParameters.BULK_DEFUALT_ACTION);
57          } catch (Exception e) {
58              e.printStackTrace();
59              fail("Bulk Ingest Failed...");
60  
61          }
62      }
63  
64       @Test
65      public final void testBulkIngestAndIndexMetric() {
66          URL url = ClassLoader.getSystemClassLoader().getResource("org/kuali/ole/bulkIngest/bulkIngestNIndexMetrics");
67          try {
68              jobId = url.getFile();
69              BulkLoadHandler.getInstance().loadBulk(jobId, ProcessParameters.BULK_DEFAULT_USER, ProcessParameters.BULK_DEFUALT_ACTION);
70          } catch (Exception e) {
71              e.printStackTrace();
72              fail("Bulk Ingest Failed...");
73  
74          }
75      }
76  
77  
78  }