Add basic store object
This commit is contained in:
@@ -12,7 +12,8 @@ public class DataFileTest
|
||||
public void test1() throws IOException
|
||||
{
|
||||
File file = new File("d:/rs/07/test/test.dat");
|
||||
DataFile df = new DataFile(42, file);
|
||||
Store store = new Store();
|
||||
DataFile df = new DataFile(store, 42, file);
|
||||
int sector = df.write(3, ByteBuffer.wrap("test".getBytes()));
|
||||
ByteBuffer buf = df.read(3, sector, 4);
|
||||
String str = new String(buf.array());
|
||||
@@ -27,7 +28,8 @@ public class DataFileTest
|
||||
for (int i = 0; i < 1024; ++i) b[i] = (byte) i;
|
||||
|
||||
File file = new File("d:/rs/07/test/test.dat");
|
||||
DataFile df = new DataFile(42, file);
|
||||
Store store = new Store();
|
||||
DataFile df = new DataFile(store, 42, file);
|
||||
int sector = df.write(0x1FFFF, ByteBuffer.wrap(b));
|
||||
ByteBuffer buf = df.read(0x1FFFF, sector, b.length);
|
||||
Assert.assertArrayEquals(b, buf.array());
|
||||
|
||||
@@ -11,7 +11,8 @@ public class IndexFileTest
|
||||
public void test1() throws IOException
|
||||
{
|
||||
File file = new File("d:/rs/07/test/test.dat");
|
||||
IndexFile index = new IndexFile(5, file);
|
||||
Store store = new Store();
|
||||
IndexFile index = new IndexFile(store, 5, file);
|
||||
IndexEntry entry = new IndexEntry(index, 7, 8, 9);
|
||||
index.write(entry);
|
||||
IndexEntry entry2 = index.read(7);
|
||||
|
||||
Reference in New Issue
Block a user