001/**
002 * Copyright 2011-2012 The Kuali Foundation Licensed under the
003 * Educational Community License, Version 2.0 (the "License"); you may
004 * not use this file except in compliance with the License. You may
005 * obtain a copy of the License at
006 *
007 * http://www.osedu.org/licenses/ECL-2.0
008 *
009 * Unless required by applicable law or agreed to in writing,
010 * software distributed under the License is distributed on an "AS IS"
011 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
012 * or implied. See the License for the specific language governing
013 * permissions and limitations under the License.
014 */
015package org.kuali.mobility.academics.controller;
016
017import static org.junit.Assert.*;
018
019import org.slf4j.Logger;
020import org.slf4j.LoggerFactory;
021import org.junit.*;
022import org.kuali.mobility.academics.controllers.AcademicsControllerImpl;
023import org.springframework.context.ApplicationContext;
024import org.springframework.context.support.FileSystemXmlApplicationContext;
025import org.springframework.ui.ExtendedModelMap;
026
027/**
028 *
029 * @author Joe Swanson <joseswan@umich.edu>
030 */
031public class AcademicsControllerImplTest {
032    private static final Logger LOG = LoggerFactory.getLogger( AcademicsControllerImplTest.class );
033
034    private static ApplicationContext applicationContext;
035
036    public AcademicsControllerImplTest() {
037    }
038
039    private static String[] getConfigLocations() {
040        return new String[] { "classpath:/AcademicsSpringBeans.xml" };
041    }
042
043    @BeforeClass
044    public static void setUpClass() throws Exception {
045        AcademicsControllerImplTest.setApplicationContext( new FileSystemXmlApplicationContext( getConfigLocations() ));
046    }
047
048    @AfterClass
049    public static void tearDownClass() throws Exception {
050    }
051
052    @Before
053    public void setUp() {
054    }
055
056    @After
057    public void tearDown() {
058    }
059    
060//    @Test
061//    public void testgetSections() {
062//      
063//      /*  query.put( AcademicsConstants.TERM_ID, "1920" );
064//        query.put( AcademicsConstants.COURSE_ID, "020607" );
065//        query.put( AcademicsConstants.COURSE_OFFER_NBR, "1");
066//        query.put( AcademicsConstants.CLASS_NUBER, "14589");
067//        query.put( AcademicsConstants.SEARCH_MODE, "N");*/
068//        assertTrue( "Failed to find application context.", null != getApplicationContext() );
069//        AcademicsControllerImpl controller = (AcademicsControllerImpl)getApplicationContext().getBean("academicsController");
070//        String termId = "1920";
071//        String subjectId = "MUSED";
072//        String catalogNumber = "203";
073//        String careerId = "UMUS";
074//        String viewName = controller.getSections(null,new ExtendedModelMap(),termId, subjectId, catalogNumber, careerId);
075//        LOG.debug(viewName);
076//        assertTrue( "Failed to find view.", "academics/sections".equalsIgnoreCase(viewName));
077//    }
078
079//    @Test
080//    public void test() {
081//        fail("Not implemented yet.");
082//    }
083
084    /**
085     * @return the applicationContext
086     */
087    public static ApplicationContext getApplicationContext() {
088        return applicationContext;
089    }
090
091    /**
092     * @param applicationContext the applicationContext to set
093     */
094    public static void setApplicationContext(ApplicationContext newApplicationContext) {
095        applicationContext = newApplicationContext;
096    }
097}