View Javadoc

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