View Javadoc

1   package org.kuali.ole;
2   
3   import org.junit.Test;
4   import org.kuali.ole.service.OleValidateInputRequestService;
5   import org.kuali.ole.serviceimpl.OleValidateInputRequestServiceImpl;
6   import org.slf4j.Logger;
7   import org.slf4j.LoggerFactory;
8   import java.util.HashMap;
9   import java.util.Map;
10  
11  import static junit.framework.Assert.assertNotNull;
12  /**
13   * Created with IntelliJ IDEA.
14   * User: ?
15   * Date: 7/19/12
16   * Time: 4:59 PM
17   * To change this template use File | Settings | File Templates.
18   */
19  public class OleValidateInputRequestService_UT  extends BaseTestCase{
20  
21      private static Logger LOG = LoggerFactory.getLogger(OleValidateInputRequestService_UT.class);
22      private OleValidateInputRequestService oleValidateInputRequestService=new OleValidateInputRequestServiceImpl();
23  
24      @Test
25      public void testInputRequestValidation() throws Exception{
26  
27          String searchRetireveOperationFlag=oleValidateInputRequestService.inputRequestValidation(getReqParameters());
28          String explainOperationFlag=oleValidateInputRequestService.inputRequestValidation(getReqParameters());
29          assertNotNull(searchRetireveOperationFlag);
30          assertNotNull(explainOperationFlag);
31      }
32  
33      public Map getReqParameters() {
34  
35          HashMap reqParamMap=new HashMap();
36          reqParamMap.put(OleSRUConstants.OPERATION_TYPE,OleSRUConstants.SEARCH_RETRIEVE);
37          reqParamMap.put(OleSRUConstants.VERSION,"1.1");
38          reqParamMap.put(OleSRUConstants.QUERY,"title=jon");
39          reqParamMap.put(OleSRUConstants.START_RECORD,"1");
40          reqParamMap.put(OleSRUConstants.MAXIMUM_RECORDS,"10");
41          reqParamMap.put(OleSRUConstants.RECORD_PACKING,"xml");
42  
43          return reqParamMap;
44  
45      }
46  
47  
48  }