01: /*
02: * @(#)OxyusSearchTest.java Created on 29 sept. 2004
03: *
04: * Copyright 1999 PUCE [http://www.puce.edu.ec]
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */
18: package org.oxyus.search;
19:
20: import org.apache.log4j.Logger;
21: import org.oxyus.admin.Configuration;
22: import org.oxyus.admin.ConfigurationException;
23: import org.oxyus.util.TestAdapter;
24:
25: /**
26: * @author Carlos Saltos (csaltos[@]users.sourceforge.net)
27: */
28: public class SearchTest extends TestAdapter {
29:
30: public void testSearch() throws ConfigurationException,
31: SearchException {
32: Logger log = Logger.getLogger(SearchTest.class);
33: String queryString = Configuration
34: .getTestProperty("oxyus.test.querystring");
35: Search search = new Search(queryString);
36: int total = search.getTotalResults();
37: if (total > 0) {
38: log.info("Title " + search.getTitle(0));
39: log.info("Summary " + search.getSummary(0));
40: log.info("Url " + search.getUrl(0));
41: }
42: }
43:
44: }
|