View Javadoc
1   package org.kuali.ole.workflow;
2   
3   import org.apache.commons.io.FileUtils;
4   import org.apache.commons.logging.Log;
5   import org.junit.Test;
6   import org.kuali.ole.workflow.WorfklowFileHandler;
7   import org.slf4j.Logger;
8   import org.slf4j.LoggerFactory;
9   
10  import java.io.File;
11  
12  import static junit.framework.Assert.assertNotNull;
13  import static junit.framework.Assert.assertTrue;
14  
15  /**
16   * Created with IntelliJ IDEA.
17   * User: peris
18   * Date: 12/16/12
19   * Time: 8:17 AM
20   * To change this template use File | Settings | File Templates.
21   */
22  public class WorkflowFileHandler_UT {
23  
24      public static final Logger LOG = LoggerFactory.getLogger(WorkflowFileHandler_UT.class);
25  
26      @Test
27      public void processWorkflows() throws Exception {
28          WorfklowFileHandler worfklowFileHandler = new WorfklowFileHandler();
29          worfklowFileHandler.setWorkflowXMLSrcDir("org/kuali/ole/workflow");
30  
31          String workflowXMLDestDir = System.getProperty("user.home")
32                  + System.getProperty("file.separator")
33                  + "kuali/main/local/olefs-webapp/workflow/pending";
34          worfklowFileHandler.setWorkflowXMLDestDir(workflowXMLDestDir);
35          worfklowFileHandler.execute();
36          File destDir = new File(workflowXMLDestDir);
37          assertNotNull(destDir);
38          File[] files = destDir.listFiles();
39          assertTrue(files.length > 0);
40          for (int i = 0; i < files.length; i++) {
41              LOG.info(files[i].getName());
42          }
43          FileUtils.deleteDirectory(destDir);
44      }
45  }