Mercurial > hg > audiodb
comparison bindings/java/test/TestQuery.java @ 725:7e1fa27b67ee
* Full status support
* Insert support (not fully tested)
* Unit tests for create + initial insert
author | mas01mj |
---|---|
date | Wed, 21 Jul 2010 14:27:07 +0000 |
parents | |
children | fe2282b9bfb0 |
comparison
equal
deleted
inserted
replaced
724:11fd16e1d8b3 | 725:7e1fa27b67ee |
---|---|
1 import junit.framework.*; | |
2 import java.io.File; | |
3 import org.omras2.*; | |
4 | |
5 public class TestQuery extends TestCase | |
6 { | |
7 File testDBFile; | |
8 File testFeatureFile; | |
9 protected void setUp() | |
10 { | |
11 testDBFile = new File("testfiles/test.adb"); | |
12 testFeatureFile = new File("testfiles/testfeature"); | |
13 if(testDBFile.exists()) | |
14 testDBFile.delete(); | |
15 } | |
16 | |
17 public void testQuery() | |
18 { | |
19 // Insert the same feature twice | |
20 AudioDB testDB = new AudioDB(testDBFile); | |
21 assertTrue("DB created", testDB.create(1, 2, 1)); | |
22 testDB.open(AudioDB.Mode.O_RDWR); | |
23 assertTrue("Insert feature file", testDB.insert("feat1", testFeatureFile)); | |
24 assertTrue("Insert feature file again", testDB.insert("feat2", testFeatureFile)); | |
25 testDB.close(); | |
26 | |
27 testDB.open(AudioDB.Mode.O_RDONLY); | |
28 Status status = testDB.getStatus(); | |
29 assertEquals("Two features", 2, status.getNumFiles()); | |
30 } | |
31 | |
32 } |