Fix JVM segv on null pointers
[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 @SuppressWarnings("deprecation")
11 public class DinosaurTest {
12
13   @Test
14   public void test() {
15     Connection con = new Connection("z3950.loc.gov:7090/voyager", 0);
16     try {
17       assertNotNull(con);
18       con.setSyntax("usmarc");
19       con.connect();
20       ResultSet set = con.search("@attr 1=7 0253333490",
21         Connection.QueryType.PrefixQuery);
22       assertNotNull(set);
23       Record rec = set.getRecord(0);
24       assertNotNull(rec);
25     } catch (ZoomException ze) {
26       fail(ze.getMessage());
27     } finally {
28       con.close();
29     }
30   }
31 }