From: Adam Dickmeiss Date: Thu, 17 Sep 2009 12:51:53 +0000 (+0200) Subject: Use ResultSet and Record in test. X-Git-Tag: v1.0~25 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=ade9519200bb73bf580d29fa389bbcb5bc53f32e;p=yaz4j-moved-to-github.git Use ResultSet and Record in test. --- diff --git a/test/ConnectionTest.java b/test/ConnectionTest.java index d1c09d1..2f143af 100644 --- a/test/ConnectionTest.java +++ b/test/ConnectionTest.java @@ -8,7 +8,17 @@ public class ConnectionTest { public void testConnection() { org.yaz4j.Connection con = new org.yaz4j.Connection("z3950.indexdata.dk:210/gils", 0); assertNotNull(con); + con.setSyntax("sutrs"); org.yaz4j.PrefixQuery pqf = new org.yaz4j.PrefixQuery("@attr 1=4 utah"); - con.Search(pqf); + assertNotNull(pqf); + org.yaz4j.ResultSet s = con.Search(pqf); + assertNotNull(s); + assertEquals(s.getSize(), 9); + org.yaz4j.Record rec = s.getRecord(0); + assertNotNull(rec); + byte [] content = rec.getContent(); + // first SUTRS record + assertEquals(content.length, 1940); + assertEquals(content[0], 103); } }