You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

oracle_test.go 2.0 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. package conn
  2. import (
  3. "database/sql/driver"
  4. "testing"
  5. "time"
  6. )
  7. func TestOracleXAConn_Commit(t *testing.T) {
  8. type fields struct {
  9. Conn driver.Conn
  10. }
  11. type args struct {
  12. xid string
  13. onePhase bool
  14. }
  15. var tests []struct {
  16. name string
  17. fields fields
  18. args args
  19. wantErr bool
  20. }
  21. for _, tt := range tests {
  22. t.Run(tt.name, func(t *testing.T) {
  23. c := &OracleXAConn{
  24. Conn: tt.fields.Conn,
  25. }
  26. if err := c.Commit(tt.args.xid, tt.args.onePhase); (err != nil) != tt.wantErr {
  27. t.Errorf("Commit() error = %v, wantErr %v", err, tt.wantErr)
  28. }
  29. })
  30. }
  31. }
  32. func TestOracleXAConn_End(t *testing.T) {
  33. type fields struct {
  34. Conn driver.Conn
  35. }
  36. type args struct {
  37. xid string
  38. flags int
  39. }
  40. var tests []struct {
  41. name string
  42. fields fields
  43. args args
  44. wantErr bool
  45. }
  46. for _, tt := range tests {
  47. t.Run(tt.name, func(t *testing.T) {
  48. c := &OracleXAConn{
  49. Conn: tt.fields.Conn,
  50. }
  51. if err := c.End(tt.args.xid, tt.args.flags); (err != nil) != tt.wantErr {
  52. t.Errorf("End() error = %v, wantErr %v", err, tt.wantErr)
  53. }
  54. })
  55. }
  56. }
  57. func TestOracleXAConn_Forget(t *testing.T) {
  58. type fields struct {
  59. Conn driver.Conn
  60. }
  61. type args struct {
  62. xid string
  63. }
  64. var tests []struct {
  65. name string
  66. fields fields
  67. args args
  68. wantErr bool
  69. }
  70. for _, tt := range tests {
  71. t.Run(tt.name, func(t *testing.T) {
  72. c := &OracleXAConn{
  73. Conn: tt.fields.Conn,
  74. }
  75. if err := c.Forget(tt.args.xid); (err != nil) != tt.wantErr {
  76. t.Errorf("Forget() error = %v, wantErr %v", err, tt.wantErr)
  77. }
  78. })
  79. }
  80. }
  81. func TestOracleXAConn_GetTransactionTimeout(t *testing.T) {
  82. type fields struct {
  83. Conn driver.Conn
  84. }
  85. var tests []struct {
  86. name string
  87. fields fields
  88. want time.Duration
  89. }
  90. for _, tt := range tests {
  91. t.Run(tt.name, func(t *testing.T) {
  92. c := &OracleXAConn{
  93. Conn: tt.fields.Conn,
  94. }
  95. if got := c.GetTransactionTimeout(); got != tt.want {
  96. t.Errorf("GetTransactionTimeout() = %v, want %v", got, tt.want)
  97. }
  98. })
  99. }
  100. }