v1_test.go 915 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright 2019 getensh.com. All rights reserved.
  2. // Use of this source code is governed by getensh.com.
  3. package tests
  4. import (
  5. v1 "adm-management/pb/v1"
  6. "context"
  7. "testing"
  8. jsoniter "github.com/json-iterator/go"
  9. )
  10. var json = jsoniter.ConfigCompatibleWithStandardLibrary
  11. /*func TestDataSourceRelation(t *testing.T) {
  12. req := v1.DataSourceRelationRequest{
  13. SourceCode: "ODS001",
  14. }
  15. reply, err := client.DataSourceRelation(context.Background(), &req)
  16. if err != nil {
  17. t.Fatal(err)
  18. } else {
  19. s, _ := json.MarshalToString(reply)
  20. t.Log(s)
  21. }
  22. }*/
  23. func TestOfflineTask(t *testing.T) {
  24. req := v1.CreateRequest{
  25. Source: "t_adm_ods1",
  26. TaskName: "ddddd",
  27. Type: 1,
  28. Sql: "id<10",
  29. }
  30. req.TaskIds = append(req.TaskIds, "dws-task1")
  31. reply, err := client.Create(context.Background(), &req)
  32. if err != nil {
  33. t.Fatal(err)
  34. } else {
  35. s, _ := json.MarshalToString(reply)
  36. t.Log(s)
  37. }
  38. }