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 org.apache.log4j.Logger;
18 import org.junit.After;
19 import org.junit.AfterClass;
20 import org.junit.Before;
21 import org.junit.BeforeClass;
22 import org.springframework.context.ApplicationContext;
23 import org.springframework.context.support.FileSystemXmlApplicationContext;
24
25 /**
26 *
27 * @author Joe Swanson <joseswan@umich.edu>
28 */
29 public class AcademicsServiceImplTest {
30 private static final Logger LOG = Logger.getLogger( AcademicsServiceImplTest.class );
31
32 private static ApplicationContext applicationContext;
33
34 public AcademicsServiceImplTest() {
35 }
36
37 private static String[] getConfigLocations() {
38 return new String[] { "classpath:/AcademicsSpringBeans.xml" };
39 }
40
41 @BeforeClass
42 public static void setUpClass() throws Exception {
43 AcademicsServiceImplTest.setApplicationContext( new FileSystemXmlApplicationContext( getConfigLocations() ));
44 }
45
46 @AfterClass
47 public static void tearDownClass() throws Exception {
48 }
49
50 @Before
51 public void setUp() {
52 }
53
54 @After
55 public void tearDown() {
56 }
57
58 // @Test
59 // public void testGetTerms() {
60 // AcademicsServiceImpl service = (AcademicsServiceImpl) getApplicationContext().getBean("academicsService");
61 //
62 // List<Term> terms = service.getTerms();
63 //
64 // LOG.debug( "Terms is "+terms.size()+" items long." );
65 // assertTrue( "Could not get terms.", terms != null && !terms.isEmpty() );
66 // }
67
68 // @Test
69 // public void testGetSections() {
70 // AcademicsServiceImpl service = (AcademicsServiceImpl) getApplicationContext().getBean("academicsService");
71 //
72 // LOG.debug( "Entering testGetSections." );
73 // List<Section> sections = service.getSections("1920", "MATH", "147", "LSA");
74 //
75 // assertTrue( "Could not get sections.", sections != null && !sections.isEmpty() );
76 // LOG.debug( "Leaving testGetSections." );
77 // }
78 //
79 // @Test
80 // public void testSearchResults() {
81 // AcademicsServiceImpl service = (AcademicsServiceImpl) getApplicationContext().getBean("academicsService");
82 //
83 // List<Section> sections = service.getSearchResults("1920", null, "conduct", null, null, null, null);
84 //
85 // LOG.debug( "Search results is "+sections.size()+" items long." );
86 // assertTrue( "Could not get search results.", sections != null && !sections.isEmpty() );
87 // }
88
89 /**
90 * @return the applicationContext
91 */
92 public static ApplicationContext getApplicationContext() {
93 return applicationContext;
94 }
95
96 /**
97 * @param applicationContext the applicationContext to set
98 */
99 public static void setApplicationContext(ApplicationContext newApplicationContext) {
100 applicationContext = newApplicationContext;
101 }
102 }