001package org.kuali.ole.web;
002
003import org.junit.After;
004import org.junit.Before;
005import org.junit.Test;
006import org.kuali.ole.docstore.discovery.servlet.DocumentConfigServlet;
007import org.kuali.ole.docstore.discovery.web.struts.action.DiscoveryAction;
008import org.springframework.mock.web.MockHttpServletRequest;
009import org.springframework.mock.web.MockHttpServletResponse;
010
011import javax.servlet.ServletException;
012import java.io.*;
013import java.net.URL;
014
015/**
016 * Created with IntelliJ IDEA.
017 * User: ?
018 * Date: 12/17/12
019 * Time: 1:52 AM
020 * To change this template use File | Settings | File Templates.
021 */
022public class DocumentConfigServlet_UT {
023    private MockHttpServletRequest  mockRequest  = new MockHttpServletRequest();
024    private MockHttpServletResponse mockResponse = new MockHttpServletResponse();
025    DocumentConfigServlet documentConfigServlet = new DocumentConfigServlet();
026
027    /**
028     * Method to setUp
029     *
030     * @throws Exception
031     */
032    @Before
033    public void setUp() throws Exception {
034    }
035
036    /**
037     * Method to tearDown
038     *
039     * @throws Exception
040     */
041    @After
042    public void tearDown() throws Exception {
043    }
044
045    @Test
046    public void testDocumentConfig() throws Exception {
047        URL resource = getClass().getResource("/DocumentConfig.xml");
048        File file = new File(resource.toURI());
049        System.setProperty("document.config.file", file.getPath());
050        documentConfigServlet.doGet(mockRequest, mockResponse);
051    }
052}