mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 09:05:55 +00:00
ignore cass test if cass not running
This commit is contained in:
parent
cceddf08b5
commit
635db82765
1 changed files with 21 additions and 12 deletions
|
|
@ -1,7 +1,10 @@
|
|||
package index
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
// "io/ioutil"
|
||||
// "time"
|
||||
|
|
@ -25,19 +28,25 @@ func TestStorage(t *testing.T) {
|
|||
So(BitCount(bm), ShouldEqual, 3)
|
||||
|
||||
})
|
||||
Convey("cassandra", t, func() {
|
||||
storage := NewCassStorage("127.0.0.1", "hotbox")
|
||||
c, err := net.DialTimeout("tcp", "127.0.0.1:9042", 100*time.Millisecond)
|
||||
if err != nil {
|
||||
fmt.Println("NO cassandra skipping test")
|
||||
} else {
|
||||
c.Close()
|
||||
Convey("cassandra", t, func() {
|
||||
storage := NewCassStorage("127.0.0.1", "hotbox")
|
||||
|
||||
bm := storage.Fetch(bitmap_id, db, slice)
|
||||
SetBit(bm, 0)
|
||||
SetBit(bm, 1)
|
||||
SetBit(bm, 2)
|
||||
storage.Store(int64(bitmap_id), db, slice, bm.(*Bitmap))
|
||||
bm2 := storage.Fetch(bitmap_id, db, slice)
|
||||
So(BitCount(bm), ShouldEqual, BitCount(bm2))
|
||||
So(BitCount(bm), ShouldEqual, bm.Count())
|
||||
So(BitCount(bm), ShouldEqual, 3)
|
||||
bm := storage.Fetch(bitmap_id, db, slice)
|
||||
SetBit(bm, 0)
|
||||
SetBit(bm, 1)
|
||||
SetBit(bm, 2)
|
||||
storage.Store(int64(bitmap_id), db, slice, bm.(*Bitmap))
|
||||
bm2 := storage.Fetch(bitmap_id, db, slice)
|
||||
So(BitCount(bm), ShouldEqual, BitCount(bm2))
|
||||
So(BitCount(bm), ShouldEqual, bm.Count())
|
||||
So(BitCount(bm), ShouldEqual, 3)
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue