Use temp dir under target/ for derby test, ensure we actually do delete the directory afterwards.

Resolves issue 129.
This commit is contained in:
Mike Hearn 2012-02-07 22:49:40 +01:00
parent 6f8ab7b40b
commit d5aad396a3

View file

@ -15,24 +15,34 @@
*/
package com.google.bitcoin.store;
import static org.junit.Assert.assertEquals;
import com.google.bitcoin.core.Address;
import com.google.bitcoin.core.ECKey;
import com.google.bitcoin.core.NetworkParameters;
import com.google.bitcoin.core.StoredBlock;
import org.junit.After;
import org.junit.Test;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import static org.junit.Assert.assertEquals;
public class DerbyBlockStoreTest {
/**
* This path will be deleted recursively!
*/
private static final String DB_NAME = ".bitcoinj.unittest.derby";
private static final String DB_NAME = "target/bitcoinj.unittest.derby";
@After
public void clear() {
try {
deleteRecursively(new File(DB_NAME));
} catch (IOException e) {
e.printStackTrace();
// Does not really matter.
}
}
@Test
public void testStorage() throws Exception {