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.

response_message_test.go 2.7 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. package message
  18. import (
  19. "testing"
  20. "github.com/stretchr/testify/assert"
  21. )
  22. func TestRegisterRMResponse_GetTypeCode(t *testing.T) {
  23. assert.Equal(t, MessageTypeRegRmResult, RegisterRMResponse{}.GetTypeCode())
  24. }
  25. func TestRegisterTMResponse_GetTypeCode(t *testing.T) {
  26. assert.Equal(t, MessageTypeRegCltResult, RegisterTMResponse{}.GetTypeCode())
  27. }
  28. func TestGlobalReportResponse_GetTypeCode(t *testing.T) {
  29. assert.Equal(t, MessageTypeGlobalReportResult, GlobalReportResponse{}.GetTypeCode())
  30. }
  31. func TestGlobalLockQueryResponse_GetTypeCode(t *testing.T) {
  32. assert.Equal(t, MessageTypeGlobalLockQueryResult, GlobalLockQueryResponse{}.GetTypeCode())
  33. }
  34. func TestGlobalRollbackResponse_GetTypeCode(t *testing.T) {
  35. assert.Equal(t, MessageTypeGlobalRollbackResult, GlobalRollbackResponse{}.GetTypeCode())
  36. }
  37. func TestGlobalCommitResponse_GetTypeCode(t *testing.T) {
  38. assert.Equal(t, MessageTypeGlobalCommitResult, GlobalCommitResponse{}.GetTypeCode())
  39. }
  40. func TestGlobalBeginResponse_GetTypeCode(t *testing.T) {
  41. assert.Equal(t, MessageTypeGlobalBeginResult, GlobalBeginResponse{}.GetTypeCode())
  42. }
  43. func TestBranchRollbackResponse_GetTypeCode(t *testing.T) {
  44. assert.Equal(t, MessageTypeBranchRollbackResult, BranchRollbackResponse{}.GetTypeCode())
  45. }
  46. func TestBranchCommitResponse_GetTypeCode(t *testing.T) {
  47. assert.Equal(t, MessageTypeBranchCommitResult, BranchCommitResponse{}.GetTypeCode())
  48. }
  49. func TestBranchRegisterResponse_GetTypeCode(t *testing.T) {
  50. assert.Equal(t, MessageTypeBranchRegisterResult, BranchRegisterResponse{}.GetTypeCode())
  51. }
  52. func TestBranchReportResponse_GetTypeCode(t *testing.T) {
  53. assert.Equal(t, MessageTypeBranchStatusReportResult, BranchReportResponse{}.GetTypeCode())
  54. }
  55. func TestGlobalStatusResponse_GetTypeCode(t *testing.T) {
  56. assert.Equal(t, MessageTypeGlobalStatusResult, GlobalStatusResponse{}.GetTypeCode())
  57. }