c530abf5ea237fe72a4ab22dd822200f601d6b93
[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",
20         Connection.QueryType.PrefixQuery);
21       assertNotNull(set);
22       Record rec = set.getRecord(0);
23       assertNotNull(rec);
24     } catch (ZoomException ze) {
25       fail(ze.getMessage());
26     } finally {
27       con.close();
28     }
29   }
30 }