001package org.kuali.ole; 002 003 004import org.junit.Test; 005import org.kuali.ole.service.OleValidateInputRequestService; 006import org.kuali.ole.serviceimpl.OleValidateInputRequestServiceImpl; 007import org.slf4j.Logger; 008import org.slf4j.LoggerFactory; 009import java.util.HashMap; 010import java.util.Map; 011 012import static junit.framework.Assert.assertNotNull; 013/** 014 * Created with IntelliJ IDEA. 015 * User: ? 016 * Date: 7/19/12 017 * Time: 4:59 PM 018 * To change this template use File | Settings | File Templates. 019 */ 020public class OleValidateInputRequestService_UT extends BaseTestCase{ 021 022 private static Logger LOG = LoggerFactory.getLogger(OleValidateInputRequestService_UT.class); 023 private OleValidateInputRequestService oleValidateInputRequestService=new OleValidateInputRequestServiceImpl(); 024 025 @Test 026 public void testInputRequestValidation() throws Exception{ 027 028 String searchRetireveOperationFlag=oleValidateInputRequestService.inputRequestValidation(getReqParameters()); 029 String explainOperationFlag=oleValidateInputRequestService.inputRequestValidation(getReqParameters()); 030 assertNotNull(searchRetireveOperationFlag); 031 assertNotNull(explainOperationFlag); 032 } 033 034 public Map getReqParameters() { 035 036 HashMap reqParamMap=new HashMap(); 037 reqParamMap.put(OleSRUConstants.OperationType,OleSRUConstants.SEARCH_RETRIEVE); 038 reqParamMap.put(OleSRUConstants.VERSION,"1.1"); 039 reqParamMap.put(OleSRUConstants.QUERY,"title=jon"); 040 reqParamMap.put(OleSRUConstants.START_RECORD,"1"); 041 reqParamMap.put(OleSRUConstants.MAXIMUM_RECORDS,"10"); 042 reqParamMap.put(OleSRUConstants.RECORD_PACKING,"xml"); 043 reqParamMap.put(OleSRUConstants.RECORD_SCHEMA,"recordSchema"); 044 045 return reqParamMap; 046 047 } 048 049 050}