View Javadoc

1   /**
2    * Copyright 2011-2012 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10   * software distributed under the License is distributed on an "AS IS"
11   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing
13   * permissions and limitations under the License.
14   */
15  package org.kuali.mobility.academics.service;
16  
17  import java.util.List;
18  import static org.junit.Assert.*;
19  
20  import org.apache.log4j.Logger;
21  import org.junit.*;
22  import org.kuali.mobility.academics.entity.SectionImpl;
23  import org.kuali.mobility.academics.entity.TermImpl;
24  import org.springframework.context.ApplicationContext;
25  import org.springframework.context.support.FileSystemXmlApplicationContext;
26  
27  /**
28   *
29   * @author Joe Swanson <joseswan@umich.edu>
30   */
31  public class AcademicsServiceImplTest {
32      private static final Logger LOG = Logger.getLogger( AcademicsServiceImplTest.class );
33  
34      private static ApplicationContext applicationContext;
35  
36      public AcademicsServiceImplTest() {
37      }
38  
39      private static String[] getConfigLocations() {
40          return new String[] { "classpath:/AcademicsSpringBeans.xml" };
41      }
42  
43      @BeforeClass
44      public static void setUpClass() throws Exception {
45          AcademicsServiceImplTest.setApplicationContext( new FileSystemXmlApplicationContext( getConfigLocations() ));
46      }
47  
48      @AfterClass
49      public static void tearDownClass() throws Exception {
50      }
51  
52      @Before
53      public void setUp() {
54      }
55  
56      @After
57      public void tearDown() {
58      }
59  
60  //    @Test
61  //    public void testGetTerms() {
62  //        AcademicsServiceImpl service = (AcademicsServiceImpl) getApplicationContext().getBean("academicsService");
63  //
64  //        List<TermImpl> terms = service.getTerms();
65  //
66  //        LOG.debug( "Terms is "+terms.size()+" items long." );
67  //        assertTrue( "Could not get terms.", terms != null && !terms.isEmpty() );
68  //    }
69  
70  //    @Test
71  //    public void testGetSections() {
72  //        AcademicsServiceImpl service = (AcademicsServiceImpl) getApplicationContext().getBean("academicsService");
73  //
74  //        LOG.debug( "Entering testGetSections." );
75  //        List<SectionImpl> sections = service.getSections("1920", "MATH", "147", "LSA");
76  //        
77  //        assertTrue( "Could not get sections.", sections != null && !sections.isEmpty() );
78  //        LOG.debug( "Leaving testGetSections." );
79  //    }
80  //    
81  //    @Test
82  //    public void testSearchResults() {
83  //        AcademicsServiceImpl service = (AcademicsServiceImpl) getApplicationContext().getBean("academicsService");
84  //
85  //        List<SectionImpl> sections = service.getSearchResults("1920", null, "conduct", null, null, null, null);
86  //
87  //        LOG.debug( "Search results is "+sections.size()+" items long." );
88  //        assertTrue( "Could not get search results.", sections != null && !sections.isEmpty() );
89  //    }
90  
91      /**
92       * @return the applicationContext
93       */
94      public static ApplicationContext getApplicationContext() {
95          return applicationContext;
96      }
97  
98      /**
99       * @param applicationContext the applicationContext to set
100      */
101     public static void setApplicationContext(ApplicationContext newApplicationContext) {
102         applicationContext = newApplicationContext;
103     }
104 }