Return null if a record cannot be retrieved.
[yaz4j-moved-to-github.git] / src / test / org / yaz4j / DinosaurTest.java
1 package org.yaz4j;
2
3 import org.junit.*;
4 import static org.junit.Assert.*;
5 import org.yaz4j.exception.ZoomException;
6
7 /**
8  * @author adam
9  */
10 public class DinosaurTest {
11
12     @Test
13     public void test() {
14         Connection con = new Connection("z3950.loc.gov:7090/voyager", 0);
15         try {
16         assertNotNull(con);
17         con.setSyntax("usmarc");
18         con.connect();
19         ResultSet set = con.search("@attr 1=7 0253333490", Connection.QueryType.PrefixQuery);
20         assertNotNull(set);
21         Record rec = set.getRecord(0);
22         assertNotNull(rec);
23         } catch (ZoomException ze) {
24           fail(ze.getMessage());
25         } finally {
26           con.close();
27         }
28     }
29 }