Add scan test
authorJakub Skoczen <jakub@indexdata.dk>
Tue, 4 May 2010 14:01:04 +0000 (16:01 +0200)
committerJakub Skoczen <jakub@indexdata.dk>
Tue, 4 May 2010 14:01:04 +0000 (16:01 +0200)
src/test/org/yaz4j/ConnectionTest.java

index cb2cab9..084d772 100644 (file)
@@ -81,4 +81,24 @@ public class ConnectionTest {
           con.close();
         }
     }
+
+    @Test
+    public void testScan() {
+      System.out.println("Open connection to z3950cat.bl.uk:9909/BLAC");
+      Connection con = new Connection("z3950cat.bl.uk:9909/BLAC", 0);
+      try {
+          con.connect();
+          con.option("number", "20");
+          ScanSet set = con.scan("@attr 1=21 \"development\"");
+          System.out.println("getSize(): " + set.getSize());
+          assertEquals(20, set.getSize());
+        
+      } catch (ZoomException ex) {
+        fail(ex.getMessage());
+      } finally {
+        con.close();
+      }
+    }
+
+
 }