Skip to content

Commit

Permalink
Store test data in the same place the other tests use.
Browse files Browse the repository at this point in the history
  • Loading branch information
chirino committed Jan 6, 2012
1 parent 6f37785 commit 0e93f11
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion leveldb/src/test/java/org/iq80/leveldb/impl/ApiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import junit.framework.TestCase;
import org.iq80.leveldb.*;
import org.iq80.leveldb.util.FileUtils;

import java.io.File;
import java.io.IOException;
Expand All @@ -32,6 +33,8 @@
*/
public class ApiTest extends TestCase {

File databaseDir = FileUtils.createTempDir("leveldb");

public static byte[] bytes(String value) {
if( value == null) {
return null;
Expand Down Expand Up @@ -61,7 +64,7 @@ public void assertEquals(byte[] arg1, byte[] arg2) {
DBFactory factory = Iq80DBFactory.factory;

File getTestDirectory(String name) throws IOException {
File rc = new File(new File("test-data"), name);
File rc = new File(databaseDir, name);
factory.destroy(rc, new Options().createIfMissing(true));
rc.mkdirs();
return rc;
Expand Down

0 comments on commit 0e93f11

Please sign in to comment.