<commit_before>/*
 * Copyright 2006-2008 The Kuali Foundation
 * 
 * Licensed under the Educational Community License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.opensource.org/licenses/ecl1.php
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.kuali.kra.irb.web;


import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.kuali.rice.test.data.PerSuiteUnitTestData;
import org.kuali.rice.test.data.UnitTestData;
import org.kuali.rice.test.data.UnitTestFile;

import com.gargoylesoftware.htmlunit.html.HtmlPage;

/**
 * 
 * This is the integration test for protocol personnel tab. 
 */
@SuppressWarnings("unchecked")
@PerSuiteUnitTestData(@UnitTestData(sqlFiles = {
        @UnitTestFile(filename = "classpath:sql/dml/load_PROTOCOL_PERSON_ROLE_MAPPING.sql", delimiter = ";")}))
public class ProtocolPersonnelWebTest extends ProtocolWebTestBase{
    
    private HtmlPage personnelPage;
    
    private static final String PRINCIPAL_INVESTIGATOR_NAME = "<NAME>";
    private static final String PERSONNEL_TAB_PAGE = "methodToCall.headerTab.headerDispatch.save.navigateTo.personnel.x";
    private static final String PERSON_LOOKUP = "org.kuali.kra.bo.Person";
    private static final String PERSON_ID_FIELD = "personId";
    private static final String CO_INVESTIGATOR_PERSON_ID = "000000002";
    private static final String CO_INVESTIGATOR_NAME = "<NAME>";
    private static final String CO_INVESTIGATOR_ROLE_ID = "COI";
    private static final String CORRESPONDENT_ROLE_ID = "CRC";
    private static final String NEW_PERSON_NAME_FIELD = "newProtocolPerson.personName";
    private static final String NEW_PERSON_ROLE_ID_FIELD = "newProtocolPerson.protocolPersonRoleId";
    private static final String ADD_PERSON_BUTTON = "methodToCall.addProtocolPerson";
    private static final String CLEAR_PERSON_BUTTON = "methodToCall.clearProtocolPerson";
    private static final String ADD_UNIT_BUTTON = "methodToCall.addProtocolPersonUnit.document.protocol.protocolPersons[0].line";
    private static final String DELETE_UNIT_BUTTON = "methodToCall.deleteProtocolPersonUnit.document.protocol.protocolPersons[0].line1";
    private static final String DELETE_PERSON_BUTTON = "methodToCall.deleteProtocolPerson";
    private static final String UNIT_NUMBER = "IU-UNIV";
    private static final String PERSON_PI_DELETE_FLAG = "document.protocol.protocolPersons[0].delete";
    private static final String PERSON_COI_DELETE_FLAG = "document.protocol.protocolPersons[1].delete";
    private static final String PERSON_PI_ROLE_ID_FIELD = "document.protocol.protocolPersons[0].protocolPersonRoleId";
    private static final String CHECKBOX_CHECKED = "on";
    private static final String ERROR_PROTOCOL_WITHOUT_PI = "A Principal Investigator must be assigned to the Protocol.";
    private static final String ERROR_ROLE_CHANGE_NOT_PERMITTED = "This role change is not permitted.";
    private static final String NEW_PERSON1_UNIT_FIELD = "newProtocolPersonUnits[0].unitNumber";
    private static final String NEW_PERSON2_UNIT_FIELD = "newProtocolPersonUnits[0].unitNumber";
    

    /**
     * The set up method calls the parent super method and gets the 
     * protocol page after saving initial required fields.
     * Then navigate to personnel page
     * @see org.kuali.kra.irb.web.ProtocolWebTestBase#setUp()
     */
    @Before
    public void setUp() throws Exception {
        super.setUp();
        this.personnelPage = clickOn(getProtocolSavedRequiredFieldsPage(), PERSONNEL_TAB_PAGE);<commit_msg>code cleanup - fix test<commit_after>/*
 * Copyright 2006-2008 The Kuali Foundation
 * 
 * Licensed under the Educational Community License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.opensource.org/licenses/ecl1.php
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.kuali.kra.irb.web;


import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.kuali.rice.test.data.PerSuiteUnitTestData;
import org.kuali.rice.test.data.UnitTestData;
import org.kuali.rice.test.data.UnitTestFile;

import com.gargoylesoftware.htmlunit.html.HtmlPage;

/**
 * 
 * This is the integration test for protocol personnel tab. 
 */
@SuppressWarnings("unchecked")
@PerSuiteUnitTestData(@UnitTestData(sqlFiles = {
        @UnitTestFile(filename = "classpath:sql/dml/load_PROTOCOL_PERSON_ROLE_MAPPING.sql", delimiter = ";")}))
public class ProtocolPersonnelWebTest extends ProtocolWebTestBase{
    
    private HtmlPage personnelPage;
    
    private static final String PRINCIPAL_INVESTIGATOR_NAME = "<NAME>";
    private static final String PERSONNEL_TAB_PAGE = "methodToCall.headerTab.headerDispatch.save.navigateTo.personnel.x";
    private static final String PERSON_LOOKUP = "org.kuali.kra.bo.Person";
    private static final String PERSON_ID_FIELD = "personId";
    private static final String CO_INVESTIGATOR_PERSON_ID = "000000002";
    private static final String CO_INVESTIGATOR_NAME = "<NAME>";
    private static final String CO_INVESTIGATOR_ROLE_ID = "COI";
    private static final String CORRESPONDENT_ROLE_ID = "CRC";
    private static final String NEW_PERSON_NAME_FIELD = "personnelHelper.newProtocolPerson.personName";
    private static final String NEW_PERSON_ROLE_ID_FIELD = "personnelHelper.newProtocolPerson.protocolPersonRoleId";
    private static final String ADD_PERSON_BUTTON = "methodToCall.addProtocolPerson";
    private static final String CLEAR_PERSON_BUTTON = "methodToCall.clearProtocolPerson";
    private static final String ADD_UNIT_BUTTON = "methodToCall.addProtocolPersonUnit.document.protocol.protocolPersons[0].line";
    private static final String DELETE_UNIT_BUTTON = "methodToCall.deleteProtocolPersonUnit.document.protocol.protocolPersons[0].line1";
    private static final String DELETE_PERSON_BUTTON = "methodToCall.deleteProtocolPerson";
    private static final String UNIT_NUMBER = "IU-UNIV";
    private static final String PERSON_PI_DELETE_FLAG = "document.protocol.protocolPersons[0].delete";
    private static final String PERSON_COI_DELETE_FLAG = "document.protocol.protocolPersons[1].delete";
    private static final String PERSON_PI_ROLE_ID_FIELD = "document.protocol.protocolPersons[0].protocolPersonRoleId";
    private static final String CHECKBOX_CHECKED = "on";
    private static final String ERROR_PROTOCOL_WITHOUT_PI = "A Principal Investigator must be assigned to the Protocol.";
    private static final String ERROR_ROLE_CHANGE_NOT_PERMITTED = "This role change is not permitted.";
    private static final String NEW_PERSON1_UNIT_FIELD = "personnelHelper.newProtocolPersonUnits[0].unitNumber";
    private static final String NEW_PERSON2_UNIT_FIELD = "personnelHelper.newProtocolPersonUnits[0].unitNumber";
    

    /**
     * The set up method calls the parent super method and gets the 
     * protocol page after saving initial required fields.
     * Then navigate to personnel page
     * @see org.kuali.kra.irb.web.ProtocolWebTestBase#setUp()
     */
    @Before
    public void setUp() throws Exception {
        super.setUp();
        this.personnelPage = clickOn(getProtocolSavedRequiredFieldsPage(), PERSONNEL_TAB_PAGE);
{'fraction_non_alphanumeric': 0.07809356136820926, 'fraction_numerical': 0.007545271629778672, 'mean_word_length': 4.873707533234859, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3315702', 'n_tokens_mistral': 2305, 'n_tokens_neox': 2260, 'n_words': 634}