1 package org.kuali.ole;
2
3 import org.junit.Test;
4 import org.kuali.ole.bo.cql.CQLResponseBO;
5 import org.kuali.ole.bo.cql.CQLSearchClauseTag;
6 import org.kuali.ole.service.OleCQLQueryParserService;
7 import org.kuali.ole.serviceimpl.OleCQLQueryParserServiceImpl;
8 import org.slf4j.Logger;
9 import org.slf4j.LoggerFactory;
10
11 import static junit.framework.Assert.assertNotNull;
12
13
14
15
16
17
18
19
20 public class OleCQLParser_UT extends BaseTestCase{
21 private static Logger LOG = LoggerFactory.getLogger(OleCQLParser_UT.class);
22 private OleCQLQueryParserService oleCQLQueryParserService=new OleCQLQueryParserServiceImpl();
23 private boolean solrQueryFlag=true;
24
25 @Test
26 public void testCQLQueryParser() throws Exception{
27
28 String parserXml=null;
29 parserXml=oleCQLQueryParserService.parseCQLQuery("subject any \"fish frog\"");
30 assertNotNull(parserXml);
31
32 }
33 @Test
34 public void testCQLResponseObject() throws Exception{
35
36
37 String parserXml=oleCQLQueryParserService.parseCQLQuery("(Title=(jon and roy) or Title=james)");
38 CQLResponseBO cQLResponseBO=oleCQLQueryParserService.getCQLResponseObject(parserXml);
39 String solrQuery=oleCQLQueryParserService.getSolrQueryFromCQLBO(cQLResponseBO);
40 assertNotNull(solrQuery);
41
42 }
43
44
45
46 }