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