View Javadoc

1   package org.kuali.ole;
2   
3   import org.junit.Test;
4   import org.kuali.ole.service.OleExplainOperationService;
5   import org.kuali.ole.serviceimpl.OleExplainOperationServiceImpl;
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  /**
15   * Created with IntelliJ IDEA.
16   * User: ?
17   * Date: 7/19/12
18   * Time: 4:34 PM
19   * To change this template use File | Settings | File Templates.
20   */
21  public class OleExplainOperationService_UT extends BaseTestCase{
22  
23      private static Logger LOG = LoggerFactory.getLogger(OleExplainOperationService_UT.class);
24      private OleExplainOperationService oleExplainOperationServiceService = new OleExplainOperationServiceImpl();
25  
26      @Test
27      public void testExplainResponse() throws Exception{
28  
29          String explainXML = null;
30          explainXML = oleExplainOperationServiceService.getExplainResponse(getReqParameters());
31          assertNotNull(explainXML);
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=HTC");
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  }