ds_ctp_test.go 654 B

12345678910111213141516171819202122232425262728293031323334
  1. // +build linux windows,386
  2. // Copyright 2013-2014 Fuzamei tech Ltd. All rights reserved.
  3. package tick
  4. /*
  5. #cgo LDFLAGS: -L./lib
  6. */
  7. import (
  8. "log"
  9. //"market"
  10. "testing"
  11. )
  12. func TestCtp(t *testing.T) {
  13. conf := &DsConf{
  14. BrokerId: "66666",
  15. User: "1011000",
  16. PassWord: "317496",
  17. Url: "tcp://ctp1-front5.citicsf.com:41205",
  18. Url2: "tcp://ctp1-md5.citicsf.com:41213",
  19. Symbols: "AG1512,IF1509",
  20. }
  21. ds := NewDataSource("ctp", conf)
  22. if ds == nil {
  23. t.Fatal("NewDataSource ctp error")
  24. }
  25. go ds.Run()
  26. chmk := ds.GetMarket()
  27. for mk := range chmk {
  28. log.Println(getTime(mk.Timestamp), mk.InsId)
  29. }
  30. log.Println("@@@@@@@:go here")
  31. }