update end 2 end test

This commit is contained in:
Darien Raymond committed 2015-12-02 23:41:34 +00:00
1 parent 5003afc85c
commit 9b830fc432
7 files changed
+111 -22

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
package testing
type RouterConfig struct {
StrategyValue string
SettingsValue interface{}
}
func (this *RouterConfig) Strategy() string {
return this.StrategyValue
}
func (this *RouterConfig) Settings() interface{} {
return this.SettingsValue
}
+17
View File
@@ -0,0 +1,17 @@
package testing
import (
"github.com/v2ray/v2ray-core/app/router/rules/config"
)
type RouterRuleConfig struct {
RuleList []*TestRule
}
func (this *RouterRuleConfig) Rules() []config.Rule {
rules := make([]config.Rule, len(this.RuleList))
for idx, rule := range this.RuleList {
rules[idx] = rule
}
return rules
}
+1 -2
View File
@@ -5,7 +5,6 @@ import (
"github.com/v2ray/v2ray-core/app/router"
"github.com/v2ray/v2ray-core/app/router/rules/config"
"github.com/v2ray/v2ray-core/app/router/rules/config/json"
v2net "github.com/v2ray/v2ray-core/common/net"
)
@@ -31,7 +30,7 @@ type RouterFactory struct {
}
func (this *RouterFactory) Create(rawConfig interface{}) (router.Router, error) {
config := rawConfig.(*json.RouterRuleConfig)
config := rawConfig.(config.RouterRuleConfig)
rules := config.Rules()
for _, rule := range rules {
if rule == nil {