Sha256: cb48ba07e664e5e4733de5eed85bb16842a0cc8c20b1c2391b891f9bdec28dcf

Contents?: true

Size: 826 Bytes

Versions: 50

Compression:

Stored size: 826 Bytes

Contents

require File.join(File.expand_path(File.dirname(__FILE__)), '../../../..', 'test_helper.rb')

require 'rbbt-util'
require 'rbbt/util/log'
require 'rbbt/util/concurrency/processes/socket'

class TestConcurrency < Test::Unit::TestCase
  def test_socket_push_pop
    obj1 = [1,[2,3,4]] #* 1000
    obj2 = ["1",["2","3","4"]] #* 1000
    obj3 = "some string"
    obj4 = TSV.setup({1 => 1})

    socket = RbbtProcessQueue::RbbtProcessSocket.new 
    10.times do

      socket.push(obj1)
      socket.push(obj2)
      socket.push(obj3)
      socket.push(obj4)

      assert_equal obj1, socket.pop
      assert_equal obj2, socket.pop 
      assert_equal obj3, socket.pop 
      assert_equal obj4, socket.pop 


    end

    socket.swrite.close
    assert_raise ClosedStream do 
      socket.pop
    end

    socket.clean
  end
end


Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
rbbt-util-5.13.16 test/rbbt/util/concurrency/processes/test_socket.rb
rbbt-util-5.13.15 test/rbbt/util/concurrency/processes/test_socket.rb
rbbt-util-5.13.14 test/rbbt/util/concurrency/processes/test_socket.rb
rbbt-util-5.13.13 test/rbbt/util/concurrency/processes/test_socket.rb
rbbt-util-5.13.12 test/rbbt/util/concurrency/processes/test_socket.rb
rbbt-util-5.13.11 test/rbbt/util/concurrency/processes/test_socket.rb
rbbt-util-5.13.10 test/rbbt/util/concurrency/processes/test_socket.rb
rbbt-util-5.13.9 test/rbbt/util/concurrency/processes/test_socket.rb
rbbt-util-5.13.8 test/rbbt/util/concurrency/processes/test_socket.rb
rbbt-util-5.13.7 test/rbbt/util/concurrency/processes/test_socket.rb
rbbt-util-5.13.6 test/rbbt/util/concurrency/processes/test_socket.rb
rbbt-util-5.13.5 test/rbbt/util/concurrency/processes/test_socket.rb
rbbt-util-5.13.4 test/rbbt/util/concurrency/processes/test_socket.rb
rbbt-util-5.13.3 test/rbbt/util/concurrency/processes/test_socket.rb
rbbt-util-5.13.2 test/rbbt/util/concurrency/processes/test_socket.rb
rbbt-util-5.13.1 test/rbbt/util/concurrency/processes/test_socket.rb
rbbt-util-5.13.0 test/rbbt/util/concurrency/processes/test_socket.rb
rbbt-util-5.12.3 test/rbbt/util/concurrency/processes/test_socket.rb
rbbt-util-5.12.2 test/rbbt/util/concurrency/processes/test_socket.rb
rbbt-util-5.12.1 test/rbbt/util/concurrency/processes/test_socket.rb