001    /**
002     * Copyright 2005-2011 The Kuali Foundation
003     *
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     * http://www.opensource.org/licenses/ecl2.php
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    
017    package org.kuali.rice.edl.impl;
018    
019    import org.junit.Test;
020    import org.kuali.rice.kew.test.KEWTestCase;
021    
022    /**
023     * Tests the web GUI for the ActionList.
024     *
025     * @author Kuali Rice Team (rice.collab@kuali.org)
026     */
027    public class OfficeOfAffirmativeActionTest extends KEWTestCase {
028    
029            //private static final String URL_PREFIX = "http://localhost:9952/en-test/";
030            private final String OAA_DIR = getBaseDir() + "/src/test/config/edoclite/OfficeOfAffirmativeAction/";
031    
032            protected void loadTestData() throws Exception {
033                    // workgroups
034                    loadXmlFile("OAATestWorkgroups.xml");
035    
036                    // attributes
037                    loadXmlFileFromFileSystem(OAA_DIR + "EdocliteDepartmentSearchAttribute.xml");
038                    loadXmlFileFromFileSystem(OAA_DIR + "EdocliteExpectedStartDateSearchAttribute.xml");
039            loadXmlFileFromFileSystem(OAA_DIR + "EdocliteInitiatorAttribute.xml");
040            loadXmlFileFromFileSystem(OAA_DIR + "EdocliteOAASearchAttribute.xml");
041            loadXmlFileFromFileSystem(OAA_DIR + "EdocliteSalaryGradeSearchAttribute.xml");
042            loadXmlFileFromFileSystem(OAA_DIR + "EdocliteSchoolAttribute.xml");
043            loadXmlFileFromFileSystem(OAA_DIR + "EdocliteSchoolSearchAttribute.xml");
044            loadXmlFileFromFileSystem(OAA_DIR + "EdocliteTotalAMFSearchAttribute.xml");
045            loadXmlFileFromFileSystem(OAA_DIR + "EdocliteTotalApplicantsSearchAttribute.xml");
046    
047            // templates
048            loadXmlFileFromFileSystem(OAA_DIR + "OfficeOfAffirmativeActionInitiatorAcknowledgmentRuleTemplate.xml");
049            loadXmlFileFromFileSystem(OAA_DIR + "OfficeOfAffirmativeActionOfficerRuleTemplate.xml");
050            loadXmlFileFromFileSystem(OAA_DIR + "OfficeOfAffirmativeActionSchoolAcknowledgementRuleTemplate.xml");
051            loadXmlFileFromFileSystem(OAA_DIR + "OfficeOfAffirmativeActionSchoolRuleTemplate.xml");
052            loadXmlFileFromFileSystem(OAA_DIR + "OfficeOfAffirmativeActionViceChancellorRuleTemplate.xml");
053    
054            // document types
055            loadXmlFileFromFileSystem(OAA_DIR + "OfficeOfAffirmativeActionDocType.xml");
056            loadXmlFileFromFileSystem(OAA_DIR + "InterviewRequestDocType.xml");
057            loadXmlFileFromFileSystem(OAA_DIR + "OfferRequestDocType.xml");
058            loadXmlFileFromFileSystem(OAA_DIR + "SearchStatusDocType.xml");
059            loadXmlFileFromFileSystem(OAA_DIR + "VacancyNoticeDocType.xml");
060            loadXmlFileFromFileSystem(OAA_DIR + "WaiverRequestDocType.xml");
061    
062            // forms
063            loadXmlFileFromFileSystem(OAA_DIR + "InterviewRequestForm.xml");
064            loadXmlFileFromFileSystem(OAA_DIR + "OfferRequestForm.xml");
065            loadXmlFileFromFileSystem(OAA_DIR + "SearchStatusForm.xml");
066            loadXmlFileFromFileSystem(OAA_DIR + "VacancyNoticeForm.xml");
067            loadXmlFileFromFileSystem(OAA_DIR + "WaiverRequestForm.xml");
068    
069            // rules
070            loadXmlFileFromFileSystem(OAA_DIR + "OfficeOfAffirmativeActionPilotRules.xml");
071    
072            // widgets
073            loadXmlFile(EDLXmlUtils.class, "default-widgets.xml");
074        }
075    
076            @Test public void testOAAEdocLiteLoad() {
077                // just a test to allow the setup method above to run and verify the xml import
078                // of these files
079            }
080    
081            /**
082             * Tests the Office of Affirmative Action interview request.
083             */
084    //      @Test public void testInterviewRequest() throws Exception {
085    //              WebClient webClient = new WebClient();
086    //
087    //              URL url = new URL (URL_PREFIX + "EDocLite?userAction=initiate&edlName=InterviewRequest");
088    //              HtmlPage page = (HtmlPage)webClient.getPage(url);
089    //
090    //              // On the first access, we should end up on the backdoor and login as quickstart
091    //              HtmlForm form = (HtmlForm) page.getForms().get(0);
092    //              HtmlTextInput textInput = (HtmlTextInput)form.getInputByName("__login_user");
093    //              assertEquals("quickstart", textInput.getDefaultValue());
094    //              page = (HtmlPage)form.submit();
095    //
096    //              // we should be on the EDL form now, check that theres a form here
097    //              assertEquals("Should be one form.", 1, page.getForms().size());
098    //
099    //              // TOOD, fill out the form, route it, verify it goes where it needs to go
100    //              // do a few different permutations of data on a few different EDL's
101    //      }
102    //
103    //
104    //      @Test public void testOfferRequest() throws Exception {
105    //              // TODO
106    //      }
107    //
108    //      @Test public void testSearchStatus() throws Exception {
109    //              // TODO
110    //      }
111    //
112    //      @Test public void testVacancyNotice() throws Exception {
113    //              // TODO
114    //      }
115    //
116    //      @Test public void testWaiverRequest() throws Exception {
117    //              // TODO
118    //      }
119    
120    }