moved test data to separate folder

This commit is contained in:
Radu Ioan Fericean
2012-03-02 20:58:37 +02:00
parent 33c42788bf
commit e13c99bda6
11 changed files with 40 additions and 42 deletions

View File

@@ -25,7 +25,7 @@ import (
)
func TestApRestoreKyoto(t *testing.T) {
getter, _ := NewKyotoStorage("test.kch")
getter, _ := NewKyotoStorage("../data/test.kch")
defer getter.Close()
cd := &CallDescriptor{CstmId: "vdf", Subject: "rif", DestinationPrefix: "0257", storageGetter: getter}

View File

@@ -36,7 +36,7 @@ BenchmarkMongoGetCost 10000 323262 ns/op
*/
func TestKyotoSplitSpans(t *testing.T) {
getter, _ := NewKyotoStorage("test.kch")
getter, _ := NewKyotoStorage("../data/test.kch")
defer getter.Close()
t1 := time.Date(2012, time.February, 2, 17, 30, 0, 0, time.UTC)
@@ -68,7 +68,7 @@ func TestRedisSplitSpans(t *testing.T) {
}
func TestKyotoGetCost(t *testing.T) {
getter, _ := NewKyotoStorage("test.kch")
getter, _ := NewKyotoStorage("../data/test.kch")
defer getter.Close()
t1 := time.Date(2012, time.February, 2, 17, 30, 0, 0, time.UTC)
@@ -307,7 +307,7 @@ func BenchmarkRedisGetCost(b *testing.B) {
func BenchmarkKyotoGetting(b *testing.B) {
b.StopTimer()
getter, _ := NewKyotoStorage("test.kch")
getter, _ := NewKyotoStorage("../data/test.kch")
defer getter.Close()
t1 := time.Date(2012, time.February, 2, 17, 30, 0, 0, time.UTC)
@@ -322,7 +322,7 @@ func BenchmarkKyotoGetting(b *testing.B) {
func BenchmarkKyotoRestoring(b *testing.B) {
b.StopTimer()
getter, _ := NewKyotoStorage("test.kch")
getter, _ := NewKyotoStorage("../data/test.kch")
defer getter.Close()
t1 := time.Date(2012, time.February, 2, 17, 30, 0, 0, time.UTC)
@@ -336,7 +336,7 @@ func BenchmarkKyotoRestoring(b *testing.B) {
func BenchmarkSplitting(b *testing.B) {
b.StopTimer()
getter, _ := NewKyotoStorage("test.kch")
getter, _ := NewKyotoStorage("../data/test.kch")
defer getter.Close()
t1 := time.Date(2012, time.February, 2, 17, 30, 0, 0, time.UTC)
@@ -351,7 +351,7 @@ func BenchmarkSplitting(b *testing.B) {
func BenchmarkKyotoGetCost(b *testing.B) {
b.StopTimer()
getter, _ := NewKyotoStorage("test.kch")
getter, _ := NewKyotoStorage("../data/test.kch")
defer getter.Close()
t1 := time.Date(2012, time.February, 2, 17, 30, 0, 0, time.UTC)
@@ -393,7 +393,7 @@ func BenchmarkMongoGetCost(b *testing.B) {
func BenchmarkKyotoSingleGetSessionTime(b *testing.B) {
b.StopTimer()
getter, _ := NewKyotoStorage("test.kch")
getter, _ := NewKyotoStorage("../data/test.kch")
defer getter.Close()
cd := &CallDescriptor{CstmId: "vdf", Subject: "minutosu", DestinationPrefix: "0723", storageGetter: getter, Amount: 100}
b.StartTimer()
@@ -404,7 +404,7 @@ func BenchmarkKyotoSingleGetSessionTime(b *testing.B) {
func BenchmarkKyotoMultipleGetSessionTime(b *testing.B) {
b.StopTimer()
getter, _ := NewKyotoStorage("test.kch")
getter, _ := NewKyotoStorage("../data/test.kch")
defer getter.Close()
cd := &CallDescriptor{CstmId: "vdf", Subject: "minutosu", DestinationPrefix: "0723", storageGetter: getter, Amount: 5400}
b.StartTimer()

View File

@@ -23,17 +23,17 @@ import (
)
func TestDestinationStoreRestore(t *testing.T) {
nationale = &Destination{Id: "nat", Prefixes: []string{"0257", "0256", "0723"}}
s := nationale.store()
d1 := &Destination{Id: "nat"}
d1.restore(s)
if d1.store() != s {
t.Errorf("Expected %q was %q", s, d1.store())
}
nationale = &Destination{Id: "nat", Prefixes: []string{"0257", "0256", "0723"}}
s := nationale.store()
d1 := &Destination{Id: "nat"}
d1.restore(s)
if d1.store() != s {
t.Errorf("Expected %q was %q", s, d1.store())
}
}
func TestDestinationKyotoStore(t *testing.T) {
getter, _ := NewKyotoStorage("test.kch")
getter, _ := NewKyotoStorage("../data/test.kch")
defer getter.Close()
nationale = &Destination{Id: "nat", Prefixes: []string{"0257", "0256", "0723"}}
getter.SetDestination(nationale)
@@ -85,7 +85,7 @@ func TestDestinationContainsPrefix(t *testing.T) {
/********************************* Benchmarks **********************************/
func BenchmarkDestinationKyotoStoreRestore(b *testing.B) {
getter, _ := NewKyotoStorage("test.kch")
getter, _ := NewKyotoStorage("../data/test.kch")
defer getter.Close()
nationale = &Destination{Id: "nat", Prefixes: []string{"0257", "0256", "0723"}}
for i := 0; i < b.N; i++ {

View File

@@ -24,28 +24,26 @@ import (
)
func TestTariffPlanStoreRestore(t *testing.T) {
b1 := &MinuteBucket{Seconds: 10, Priority: 10, Price: 0.01, DestinationId: "nationale"}
b2 := &MinuteBucket{Seconds: 100, Priority: 20, Price: 0.0, DestinationId: "retea"}
rcb := &RecivedCallBonus{Credit: 100}
vd := &VolumeDiscount{100, 10}
seara := &TariffPlan{Id: "seara_voo",
SmsCredit: 100,
ReceivedCallSecondsLimit: 0,
RecivedCallBonus: rcb,
MinuteBuckets: []*MinuteBucket{b1, b2},
VolumeDiscountThresholds: []*VolumeDiscount{vd}}
s := seara.store()
tp1 := &TariffPlan{Id: "seara_voo"}
tp1.restore(s)
if tp1.store() != s {
t.Errorf("Expected %q was %q", s, tp1.store())
}
b1 := &MinuteBucket{Seconds: 10, Priority: 10, Price: 0.01, DestinationId: "nationale"}
b2 := &MinuteBucket{Seconds: 100, Priority: 20, Price: 0.0, DestinationId: "retea"}
rcb := &RecivedCallBonus{Credit: 100}
vd := &VolumeDiscount{100, 10}
seara := &TariffPlan{Id: "seara_voo",
SmsCredit: 100,
ReceivedCallSecondsLimit: 0,
RecivedCallBonus: rcb,
MinuteBuckets: []*MinuteBucket{b1, b2},
VolumeDiscountThresholds: []*VolumeDiscount{vd}}
s := seara.store()
tp1 := &TariffPlan{Id: "seara_voo"}
tp1.restore(s)
if tp1.store() != s {
t.Errorf("Expected %q was %q", s, tp1.store())
}
}
func TestTariffPlanKyotoStore(t *testing.T) {
getter, _ := NewKyotoStorage("test.kch")
getter, _ := NewKyotoStorage("../data/test.kch")
defer getter.Close()
b1 := &MinuteBucket{Seconds: 10, Priority: 10, Price: 0.01, DestinationId: "nationale"}
b2 := &MinuteBucket{Seconds: 100, Priority: 20, Price: 0.0, DestinationId: "retea"}
@@ -94,7 +92,7 @@ func TestTariffPlanMongoStore(t *testing.T) {
/********************************* Benchmarks **********************************/
func BenchmarkTariffPlanKyotoStoreRestore(b *testing.B) {
getter, _ := NewKyotoStorage("test.kch")
getter, _ := NewKyotoStorage("../data/test.kch")
defer getter.Close()
b1 := &MinuteBucket{Seconds: 10, Priority: 10, Price: 0.01, DestinationId: "nationale"}
b2 := &MinuteBucket{Seconds: 100, Priority: 20, Price: 0.0, DestinationId: "retea"}

View File

@@ -184,7 +184,7 @@ func TestSplitByActivationTime(t *testing.T) {
}
func TestTimespanGetCost(t *testing.T) {
getter, _ := NewKyotoStorage("test.kch")
getter, _ := NewKyotoStorage("../data/test.kch")
defer getter.Close()
t1 := time.Date(2012, time.February, 5, 17, 45, 0, 0, time.UTC)
t2 := time.Date(2012, time.February, 5, 17, 55, 0, 0, time.UTC)

View File

@@ -68,7 +68,7 @@ func TestGetPricedSeconds(t *testing.T) {
}
func TestUserBudgetKyotoStore(t *testing.T) {
getter, _ := NewKyotoStorage("test.kch")
getter, _ := NewKyotoStorage("../data/test.kch")
defer getter.Close()
b1 := &MinuteBucket{Seconds: 10, Priority: 10, Price: 0.01, DestinationId: "nationale"}
b2 := &MinuteBucket{Seconds: 100, Priority: 20, Price: 0.0, DestinationId: "retea"}
@@ -377,7 +377,7 @@ func TestGetVolumeDiscountSteps(t *testing.T) {
}
func TestRecivedCallsBonus(t *testing.T) {
getter, _ := NewKyotoStorage("test.kch")
getter, _ := NewKyotoStorage("../data/test.kch")
defer getter.Close()
rcb := &RecivedCallBonus{Credit: 100}
seara := &TariffPlan{Id: "seara_voo", SmsCredit: 100, ReceivedCallSecondsLimit: 10, RecivedCallBonus: rcb}
@@ -404,7 +404,7 @@ func BenchmarkGetSecondForPrefix(b *testing.B) {
}
func BenchmarkUserBudgetKyotoStoreRestore(b *testing.B) {
getter, _ := NewKyotoStorage("test.kch")
getter, _ := NewKyotoStorage("../data/test.kch")
defer getter.Close()
b1 := &MinuteBucket{Seconds: 10, Priority: 10, Price: 0.01, DestinationId: "nationale"}
b2 := &MinuteBucket{Seconds: 100, Priority: 20, Price: 0.0, DestinationId: "retea"}