# File test/test_client.rb, line 235
  def test_tran_ack_abrt_newcli_auto
    @client.close if @client && @client.open? # allow tests to close
    @client = get_client()
    q = make_destination
    data = message_text
    @client.publish q, data

    @client.begin 'tx1'
    message = nil
    sid = nil
    if @client.protocol() == Stomp::SPL_10
      @client.subscribe(q, :ack => 'client') {|m| message = m}
    else # 1.1 and 1.2 are the same for this
      sid = @client.uuid()
      @client.subscribe(q, :ack => 'client', :id => sid) {|m| message = m}
    end
    sleep 0.01 until message
    assert_equal data, message.body
    assert_nothing_raised {
      case @client.protocol()
        when Stomp::SPL_10
          @client.acknowledge message, :transaction => 'tx1'
          checkEmsg(@client)
        when Stomp::SPL_11
          @client.acknowledge message, :transaction => 'tx1', :subscription => message.headers['subscription']
          checkEmsg(@client)
        else # 1.2+
          @client.acknowledge message, :transaction => 'tx1', :id => message.headers['ack']
          checkEmsg(@client)
      end
      message = nil # reset
      @client.abort 'tx1' # now abort
    }
    checkEmsg(@client)
    # lets recreate the connection
    @client.close

    @client = get_client()
    sid = nil
    message2 = nil
    @client.begin 'tx2'
    assert_nothing_raised {
      if @client.protocol() == Stomp::SPL_10
        @client.subscribe(q, :ack => 'auto') {|m| message2 = m}
      else # 1.1 and 1.2 are the same for this
        sid = @client.uuid()
        @client.subscribe(q, :ack => 'auto', :id => sid) {|m| message2 = m}
      end
    }
    sleep 0.01 until message2
    assert_not_nil message2
    assert_equal data, message2.body
    @client.commit 'tx2'
    checkEmsg(@client)
    @client.close
  end