View Javadoc

1   package org.kuali.ole;
2   
3   import org.apache.commons.io.FileUtils;
4   import org.junit.Test;
5   import org.junit.runner.RunWith;
6   import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
7   import org.springframework.test.context.ContextConfiguration;
8   import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
9   import org.springframework.test.context.transaction.TransactionConfiguration;
10  
11  import java.io.File;
12  
13  /**
14  * Created with IntelliJ IDEA.
15  * User: peris
16  * Date: 10/31/12
17  * Time: 4:54 PM
18  * To change this template use File | Settings | File Templates.
19  */
20  @ContextConfiguration(locations = {"classpath:/SpringBeans.xml"})
21  @RunWith(value = SpringJUnit4ClassRunner.class)
22  @TransactionConfiguration(defaultRollback = true)
23  public class LoadDefaultWorkflowsBean_UT {
24      @Test
25      public void unpackWorkflowXMLs() throws Exception {
26          String userHome = System.getProperty("user.home");
27          String folderPathSeperator = System.getProperty("file.separator");
28          StringBuilder destPath = new StringBuilder();
29          destPath.append(userHome).append(folderPathSeperator).append("kuali")
30                  .append(folderPathSeperator).
31                  append("main")
32                  .append(folderPathSeperator)
33                  .append("dev")
34                  .append(folderPathSeperator)
35                  .append("olerice2")
36                  .append(folderPathSeperator)
37                  .append("workflow")
38                  .append(folderPathSeperator)
39                  .append("pending")
40                  .append(folderPathSeperator);
41          FileUtils.deleteDirectory(new File(destPath.toString()));
42          LoadDefaultWorkflowsBean loadDefaultWorkflowsBean = GlobalResourceLoader.getService("loadDefaultWorkflowsBean");
43          loadDefaultWorkflowsBean.unpackWorkflows();
44      }
45  }