001: /*
002: * Copyright 2005-2007 The Kuali Foundation.
003: *
004: *
005: * Licensed under the Educational Community License, Version 1.0 (the "License");
006: * you may not use this file except in compliance with the License.
007: * You may obtain a copy of the License at
008: *
009: * http://www.opensource.org/licenses/ecl1.php
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: /*
018: * Copyright 2005-2006 The Kuali Foundation.
019: *
020: *
021: * Licensed under the Educational Community License, Version 1.0 (the "License");
022: * you may not use this file except in compliance with the License.
023: * You may obtain a copy of the License at
024: *
025: * http://www.opensource.org/licenses/ecl1.php
026: *
027: * Unless required by applicable law or agreed to in writing, software
028: * distributed under the License is distributed on an "AS IS" BASIS,
029: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
030: * See the License for the specific language governing permissions and
031: * limitations under the License.
032: */
033: package edu.iu.uis.eden.edl;
034:
035: import java.net.URL;
036:
037: import org.junit.Ignore;
038: import org.junit.Test;
039: import org.kuali.workflow.test.WorkflowTestCase;
040:
041: import com.gargoylesoftware.htmlunit.WebClient;
042: import com.gargoylesoftware.htmlunit.html.HtmlForm;
043: import com.gargoylesoftware.htmlunit.html.HtmlPage;
044: import com.gargoylesoftware.htmlunit.html.HtmlTextInput;
045:
046: /**
047: * Tests the web GUI for the ActionList.
048: *
049: * @author ewestfal
050: */
051: public class OfficeOfAffirmativeActionTest extends WorkflowTestCase {
052:
053: private static final String URL_PREFIX = "http://localhost:9912/en-test/";
054: private static final String OAA_DIR = "edoclite/OfficeOfAffirmativeAction/";
055:
056: protected void loadTestData() throws Exception {
057: // workgroups
058: loadXmlFile("OAATestWorkgroups.xml");
059:
060: // attributes
061: loadXmlFileFromFileSystem(OAA_DIR
062: + "EdocliteDepartmentSearchAttribute.xml");
063: loadXmlFileFromFileSystem(OAA_DIR
064: + "EdocliteExpectedStartDateSearchAttribute.xml");
065: loadXmlFileFromFileSystem(OAA_DIR
066: + "EdocliteInitiatorAttribute.xml");
067: loadXmlFileFromFileSystem(OAA_DIR
068: + "EdocliteOAASearchAttribute.xml");
069: loadXmlFileFromFileSystem(OAA_DIR
070: + "EdocliteSalaryGradeSearchAttribute.xml");
071: loadXmlFileFromFileSystem(OAA_DIR
072: + "EdocliteSchoolAttribute.xml");
073: loadXmlFileFromFileSystem(OAA_DIR
074: + "EdocliteSchoolSearchAttribute.xml");
075: loadXmlFileFromFileSystem(OAA_DIR
076: + "EdocliteTotalAMFSearchAttribute.xml");
077: loadXmlFileFromFileSystem(OAA_DIR
078: + "EdocliteTotalApplicantsSearchAttribute.xml");
079:
080: // templates
081: loadXmlFileFromFileSystem(OAA_DIR
082: + "OfficeOfAffirmativeActionInitiatorAcknowledgmentRuleTemplate.xml");
083: loadXmlFileFromFileSystem(OAA_DIR
084: + "OfficeOfAffirmativeActionOfficerRuleTemplate.xml");
085: loadXmlFileFromFileSystem(OAA_DIR
086: + "OfficeOfAffirmativeActionSchoolAcknowledgementRuleTemplate.xml");
087: loadXmlFileFromFileSystem(OAA_DIR
088: + "OfficeOfAffirmativeActionSchoolRuleTemplate.xml");
089: loadXmlFileFromFileSystem(OAA_DIR
090: + "OfficeOfAffirmativeActionViceChancellorRuleTemplate.xml");
091:
092: // document types
093: loadXmlFileFromFileSystem(OAA_DIR
094: + "OfficeOfAffirmativeActionDocType.xml");
095: loadXmlFileFromFileSystem(OAA_DIR
096: + "InterviewRequestDocType.xml");
097: loadXmlFileFromFileSystem(OAA_DIR + "OfferRequestDocType.xml");
098: loadXmlFileFromFileSystem(OAA_DIR + "SearchStatusDocType.xml");
099: loadXmlFileFromFileSystem(OAA_DIR + "VacancyNoticeDocType.xml");
100: loadXmlFileFromFileSystem(OAA_DIR + "WaiverRequestDocType.xml");
101:
102: // forms
103: loadXmlFileFromFileSystem(OAA_DIR + "InterviewRequestForm.xml");
104: loadXmlFileFromFileSystem(OAA_DIR + "OfferRequestForm.xml");
105: loadXmlFileFromFileSystem(OAA_DIR + "SearchStatusForm.xml");
106: loadXmlFileFromFileSystem(OAA_DIR + "VacancyNoticeForm.xml");
107: loadXmlFileFromFileSystem(OAA_DIR + "WaiverRequestForm.xml");
108:
109: // rules
110: loadXmlFileFromFileSystem(OAA_DIR
111: + "OfficeOfAffirmativeActionPilotRules.xml");
112:
113: // widgets
114: loadXmlFileFromFileSystem("edoclite/widgets.xml");
115: }
116:
117: /**
118: * Tests the Office of Affirmative Action interview request.
119: */
120: @Ignore
121: @Test
122: public void testInterviewRequest() throws Exception {
123: WebClient webClient = new WebClient();
124:
125: URL url = new URL(
126: URL_PREFIX
127: + "EDocLite?userAction=initiate&edlName=InterviewRequest");
128: HtmlPage page = (HtmlPage) webClient.getPage(url);
129:
130: // On the first access, we should end up on the backdoor and login as quickstart
131: HtmlForm form = (HtmlForm) page.getForms().get(0);
132: HtmlTextInput textInput = (HtmlTextInput) form
133: .getInputByName("__login_user");
134: assertEquals("quickstart", textInput.getDefaultValue());
135: page = (HtmlPage) form.submit();
136:
137: // we should be on the EDL form now, check that theres a form here
138: assertEquals("Should be one form.", 1, page.getForms().size());
139:
140: // TOOD, fill out the form, route it, verify it goes where it needs to go
141: // do a few different permutations of data on a few different EDL's
142: }
143:
144: @Test
145: public void testOfferRequest() throws Exception {
146: // TODO
147: }
148:
149: @Test
150: public void testSearchStatus() throws Exception {
151: // TODO
152: }
153:
154: @Test
155: public void testVacancyNotice() throws Exception {
156: // TODO
157: }
158:
159: @Test
160: public void testWaiverRequest() throws Exception {
161: // TODO
162: }
163:
164: }
|