()
| 1548 | } |
| 1549 | |
| 1550 | func init() { |
| 1551 | logs.Init(os.Stderr, "stdFlags") |
| 1552 | adp = backend.GetTestAdapter() |
| 1553 | conffile := flag.String("config", "./test.conf", "config of the database connection") |
| 1554 | |
| 1555 | if file, err := os.Open(*conffile); err != nil { |
| 1556 | log.Fatal("Failed to read config file:", err) |
| 1557 | } else if err = json.NewDecoder(jcr.New(file)).Decode(&config); err != nil { |
| 1558 | log.Fatal("Failed to parse config file:", err) |
| 1559 | } |
| 1560 | |
| 1561 | if adp == nil { |
| 1562 | log.Fatal("Database adapter is missing") |
| 1563 | } |
| 1564 | if adp.IsOpen() { |
| 1565 | log.Print("Connection is already opened") |
| 1566 | } |
| 1567 | |
| 1568 | err := adp.Open(config.Adapters[adp.GetName()]) |
| 1569 | if err != nil { |
| 1570 | log.Fatal(err) |
| 1571 | } |
| 1572 | |
| 1573 | conn = adp.GetTestDB().(*rdb.Session) |
| 1574 | testData = test_data.InitTestData() |
| 1575 | if testData == nil { |
| 1576 | log.Fatal("Failed to initialize test data") |
| 1577 | } |
| 1578 | store.SetTestUidGenerator(*testData.UGen) |
| 1579 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…