Sha256: a846e082f878636925a296b48ff7e61ba39e1e4a21ebcf0fe93254524ce34e89

Contents?: true

Size: 690 Bytes

Versions: 8

Compression:

Stored size: 690 Bytes

Contents

require 'test_helper'

class UdpServerTest < Test::Unit::TestCase
  def setup
    @registry = Metriksd::Registry.new
    @server = Metriksd::UdpServer.new(@registry, :port => 30000 + rand(1000))
    @server.start
  end
  
  def teardown
    @server.stop
    @server.join
  end

  def test_data
    # Wait for eventmachine
    thr = Thread.current; EventMachine.next_tick { thr.wakeup }; Thread.stop

    data = Snappy.deflate({ :name => 'a', :client_id => $$, :time => Time.now.to_i, :anything => 'yay' }.to_msgpack)
    socket = UDPSocket.new
    socket.send data, 0, '127.0.0.1', @server.port
    
    sleep 0.1
    
    assert @server.registry.dirty?, @server.registry.inspect
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
metriksd-0.5.7 test/udp_server_test.rb
metriksd-0.5.6 test/udp_server_test.rb
metriksd-0.5.5 test/udp_server_test.rb
metriksd-0.5.4 test/udp_server_test.rb
metriksd-0.5.3 test/udp_server_test.rb
metriksd-0.5.2 test/udp_server_test.rb
metriksd-0.5.1 test/udp_server_test.rb
metriksd-0.5.0 test/udp_server_test.rb