View Javadoc
1   package org.kuali.ole.web;
2   
3   import org.apache.commons.io.FileUtils;
4   import org.junit.After;
5   import org.junit.Before;
6   import org.junit.Ignore;
7   import org.junit.Test;
8   import org.kuali.ole.base.BaseTestCase;
9   import org.kuali.ole.utility.Constants;
10  import org.springframework.util.FileCopyUtils;
11  
12  import javax.servlet.ServletContextEvent;
13  import java.io.File;
14  import java.net.URL;
15  import java.util.Properties;
16  
17  /**
18   * Created with IntelliJ IDEA.
19   * User: ?
20   * Date: 12/26/12
21   * Time: 3:43 PM
22   * To change this template use File | Settings | File Templates.
23   */
24  public class DocStoreContextListener_UT
25          extends BaseTestCase {
26  
27      DocStoreContextListener docStoreContextListener = new DocStoreContextListener();
28      ServletContextEvent     servletContextEvent     = null;
29  
30      @Override
31      @Before
32      public void setUp() throws Exception {
33          super.setUp();    //To change body of overridden methods use File | Settings | File Templates.
34      }
35  
36      @After
37      public void tearDown() throws Exception {
38      }
39  
40  
41      @Test
42      public void testContextInitialized() throws Exception {
43          File inputDir = new File(this.getClass().getResource("repository").toURI());
44          System.out.println(inputDir.getPath());
45          System.setProperty(Constants.OLE_DOCSTORE_HOME_SYSTEM_PROPERTY, inputDir.getPath());
46          docStoreContextListener.getDocStoreEnvUtil().setVendor("derby");
47          docStoreContextListener.getDocStoreEnvUtil().setProperties(new Properties());
48          docStoreContextListener.contextInitialized(servletContextEvent);
49      }
50  }