View Javadoc
1   package org.kuali.ole;
2   
3   import org.junit.Test;
4   import org.junit.runner.RunWith;
5   import org.kuali.ole.docstore.common.constants.DocstoreConstants;
6   import org.kuali.ole.docstore.discovery.service.SolrServerManager;
7   import org.kuali.ole.docstore.discovery.util.DiscoveryEnvUtil;
8   import org.slf4j.Logger;
9   import org.slf4j.LoggerFactory;
10  import org.springframework.beans.factory.annotation.Autowired;
11  import org.springframework.context.ApplicationContext;
12  import org.springframework.test.context.ContextConfiguration;
13  import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
14  import org.springframework.transaction.annotation.Transactional;
15  
16  import java.io.File;
17  
18  import static junit.framework.TestCase.assertNotNull;
19  
20  /**
21   * Created with IntelliJ IDEA.
22   * User: sambasivam
23   * Date: 12/18/13
24   * Time: 11:40 AM
25   * To change this template use File | Settings | File Templates.
26   */
27  @RunWith(SpringJUnit4ClassRunner.class)
28  @ContextConfiguration("classpath:org/kuali/ole/BootStrapSpringBeans.xml")
29  //@ContextConfiguration("file:ole-docstore/ole-docstore-webapp/src/main/resources/org/kuali/ole/BootStrapSpringBeans.xml")
30  public class SpringBaseTestCase implements DocstoreConstants {
31  
32      protected final Logger LOG = LoggerFactory.getLogger(this.getClass());
33      protected String classesDir;
34      protected String solrHome;
35      protected DiscoveryEnvUtil discoveryEnvUtil = new DiscoveryEnvUtil();
36  
37  
38      public SpringBaseTestCase() {
39          classesDir = getClass().getResource("/").getPath();
40  //        printLogInfo("classesDir = " + new File(classesDir).getAbsolutePath());
41          discoveryEnvUtil.initTestEnvironment();
42          discoveryEnvUtil.printEnvironment();
43  //        System.setProperty(SolrServerManager.SOLR_SERVER_EMBEDDED, "true");
44      }
45          @Autowired
46      private ApplicationContext context;
47  
48      protected ApplicationContext getContext() {
49          return context;
50      }
51  
52      @Test
53      public void applicationContextNotNull() throws Exception {
54          assertNotNull(context);
55      }
56  }