/integrations/engine_group_test.go
https://github.com/xormplus/xorm · Go · 35 lines · 24 code · 8 blank · 3 comment · 2 complexity · c3de0bd24bf3385dbe2f2e68c37a40db MD5 · raw file
- // Copyright 2020 The Xorm Authors. All rights reserved.
- // Use of this source code is governed by a BSD-style
- // license that can be found in the LICENSE file.
- package integrations
- import (
- "testing"
- "github.com/xormplus/xorm"
- "github.com/xormplus/xorm/log"
- "github.com/xormplus/xorm/schemas"
- "github.com/stretchr/testify/assert"
- )
- func TestEngineGroup(t *testing.T) {
- assert.NoError(t, PrepareEngine())
- main := testEngine.(*xorm.Engine)
- if main.Dialect().URI().DBType == schemas.SQLITE {
- t.Skip()
- return
- }
- eg, err := xorm.NewEngineGroup(main, []*xorm.Engine{main})
- assert.NoError(t, err)
- eg.SetMaxIdleConns(10)
- eg.SetMaxOpenConns(100)
- eg.SetTableMapper(main.GetTableMapper())
- eg.SetColumnMapper(main.GetColumnMapper())
- eg.SetLogLevel(log.LOG_INFO)
- eg.ShowSQL(true)
- }