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.controller;
16
17 import static org.junit.Assert.*;
18
19 import org.apache.log4j.Logger;
20 import org.junit.*;
21 import org.kuali.mobility.academics.controllers.AcademicsControllerImpl;
22 import org.springframework.context.ApplicationContext;
23 import org.springframework.context.support.FileSystemXmlApplicationContext;
24 import org.springframework.ui.ExtendedModelMap;
25
26 /**
27 *
28 * @author Joe Swanson <joseswan@umich.edu>
29 */
30 public class AcademicsControllerImplTest {
31 private static final Logger LOG = Logger.getLogger( AcademicsControllerImplTest.class );
32
33 private static ApplicationContext applicationContext;
34
35 public AcademicsControllerImplTest() {
36 }
37
38 private static String[] getConfigLocations() {
39 return new String[] { "classpath:/AcademicsSpringBeans.xml" };
40 }
41
42 @BeforeClass
43 public static void setUpClass() throws Exception {
44 AcademicsControllerImplTest.setApplicationContext( new FileSystemXmlApplicationContext( getConfigLocations() ));
45 }
46
47 @AfterClass
48 public static void tearDownClass() throws Exception {
49 }
50
51 @Before
52 public void setUp() {
53 }
54
55 @After
56 public void tearDown() {
57 }
58
59 // @Test
60 // public void testgetSections() {
61 //
62 // /* query.put( AcademicsConstants.TERM_ID, "1920" );
63 // query.put( AcademicsConstants.COURSE_ID, "020607" );
64 // query.put( AcademicsConstants.COURSE_OFFER_NBR, "1");
65 // query.put( AcademicsConstants.CLASS_NUBER, "14589");
66 // query.put( AcademicsConstants.SEARCH_MODE, "N");*/
67 // assertTrue( "Failed to find application context.", null != getApplicationContext() );
68 // AcademicsControllerImpl controller = (AcademicsControllerImpl)getApplicationContext().getBean("academicsController");
69 // String termId = "1920";
70 // String subjectId = "MUSED";
71 // String catalogNumber = "203";
72 // String careerId = "UMUS";
73 // String viewName = controller.getSections(null,new ExtendedModelMap(),termId, subjectId, catalogNumber, careerId);
74 // LOG.debug(viewName);
75 // assertTrue( "Failed to find view.", "academics/sections".equalsIgnoreCase(viewName));
76 // }
77
78 // @Test
79 // public void test() {
80 // fail("Not implemented yet.");
81 // }
82
83 /**
84 * @return the applicationContext
85 */
86 public static ApplicationContext getApplicationContext() {
87 return applicationContext;
88 }
89
90 /**
91 * @param applicationContext the applicationContext to set
92 */
93 public static void setApplicationContext(ApplicationContext newApplicationContext) {
94 applicationContext = newApplicationContext;
95 }
96 }