Sha256: e774684c49a65321a7322505702f9c2075d9d7b7a526c201bd8f10b4f2a07bc1

Contents?: true

Size: 1.19 KB

Versions: 4

Compression:

Stored size: 1.19 KB

Contents

if !(RUBY_PLATFORM =~ /java/)
  puts "Ignoring tests in #{__FILE__}.  They must be run in JRuby "
else
  require 'test/unit'
  require 'jeventmachine'

  class TestJEventmachine < Test::Unit::TestCase

    def setup
      EventMachine.instance_variable_set("@em", nil)
      load 'jeventmachine.rb'
    end

    def test_can_make_calls_without_errors_before_initialization
      assert_equal nil, EventMachine.signal_loopbreak
      assert_equal nil, EventMachine.stop_tcp_server(123)
      assert_equal nil, EventMachine.send_data(123, "rewr", 4)
      assert_equal nil, EventMachine.close_connection(332, nil)
    end

    def test_create
      EventMachine::initialize_event_machine
      em = EventMachine::instance_variable_get("@em")
      assert_equal true, em.is_a?(Java::com.rubyeventmachine.EmReactor)
    end

    def test_can_make_calls_without_errors_after_release
      EventMachine.initialize_event_machine
      EventMachine.release_machine

      assert_equal nil, EventMachine.signal_loopbreak
      assert_equal nil, EventMachine.stop_tcp_server(123)
      assert_equal nil, EventMachine.send_data(123, "rewr", 4)
      assert_equal nil, EventMachine.close_connection(332, nil)
    end

  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
eventmachine-mkroman-1.3.0.dev.1 tests/jruby/test_jeventmachine.rb
wj_eventmachine-1.3.2 tests/jruby/test_jeventmachine.rb
wj_eventmachine-1.3.1 tests/jruby/test_jeventmachine.rb
wj_eventmachine-1.3.0.dev.1 tests/jruby/test_jeventmachine.rb