package io.dongyue.at15.tree.indexer.bptree;

import io.dongyue.at15.tree.indexer.bptree.mellowtech.MellowBPTree;
import org.junit.Assert;
import org.junit.Test;

/**
 * Created by at15 on 15-12-26.
 */
public class MellowtechBtreeTest {
    @Test
    public void testOpen() {
        BPTreeIndex bpTreeIndex = new MellowBPTree();
        Assert.assertEquals(true, bpTreeIndex.open("/tmp/mellowbptreeindex"));
    }

    @Test
    public void testCreate() {
        BPTreeIndex bpTreeIndex = new MellowBPTree();
        Assert.assertEquals(true, bpTreeIndex.create("/tmp/mellowbptreeindex"));
    }

    @Test
    public void testRemove(){
        BPTreeIndex bpTreeIndex = new MellowBPTree();
        bpTreeIndex.removeIfExists("/tmp/mellowbptreeindex");
    }
}

@@ -107,16 +107,40 @@
 BPTree;%0A
+import org.junit.After;%0A
 import o
@@ -255,16 +255,69 @@
 eTest %7B%0A
+    private String path = %22/tmp/mellowbptreeindex%22;%0A%0A
     @Tes
@@ -456,32 +456,12 @@
 pen(
-%22/tmp/mellowbptreeindex%22
+path
 ));%0A
@@ -619,32 +619,238 @@
 ate(
-%22/tmp/mellowbptreei
+path));%0A    %7D%0A%0A    @Test%0A    public void testPut() %7B%0A        BPTreeIndex bpTreeIndex = new MellowBPTree();%0A        bpTreeIndex.create(path);%0A        bpTreeI
 ndex
-%22
+.put(1, %22jack%22);%0A        Assert.assertEquals(%22jack%22, bpTreeIndex.get(1
 ));%0A
@@ -894,16 +894,17 @@
 Remove()
+ 
 %7B%0A      
@@ -990,32 +990,202 @@
 sts(
-%22/tmp/mellowbptreei
+path);%0A    %7D%0A%0A    @After%0A    public void cleanUp()%7B%0A        // in case you just run one test in IDEA%0A        BPTreeIndex bpTreeIndex = new MellowBPTree();%0A        bpTreeI
 ndex
-%22
+.removeIfExists(path
 );%0A 
@@ -1189,10 +1189,12 @@
 ;%0A    %7D%0A
+%0A%0A
 %7D%0A

Add test for put