Changeset 708

Show
Ignore:
Timestamp:
06/20/08 14:50:27 (4 months ago)
Author:
raggi
Message:
  • Added @Override back on DefaultConnectionFactory? - 1.6 only java though.
  • Added patch from #19 by Chuck Remes, with minor adjustments
  • Made rake test:partial work in a pure jruby environment
  • Added test:testjava in the spirit of testpr - these all need refactoring though
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/raggi/java/src/com/rubyeventmachine/DefaultConnectionFactory.java

    r691 r708  
    4040         * useful for unit testing. 
    4141         */ 
    42 //     @Override 
     42  @Override 
    4343        public Connection connection() { 
    4444                return new Connection(); 
  • branches/raggi/lib/eventmachine.rb

    r700 r708  
    4242# 
    4343 
    44 =begin 
    45 $eventmachine_library ||= nil 
     44 
     45$eventmachine_library ||= ENV['EVENTMACHINE_LIBRARY'] || :cascade 
     46$eventmachine_library = $eventmachine_library.to_sym 
     47 
    4648case $eventmachine_library 
    4749when :pure_ruby 
     
    4951when :extension 
    5052  require 'rubyeventmachine' 
    51 else 
     53when :java 
     54  require 'jeventmachine' 
     55else # :cascade 
    5256  # This is the case that most user code will take. 
    5357  # Prefer the extension if available. 
    5458  begin 
    55     require 'rubyeventmachine' 
     59    if RUBY_PLATFORM =~ /java/ 
     60      require 'java' 
     61      require 'jeventmachine' 
     62    else 
     63      require 'rubyeventmachine' 
     64    end 
    5665  rescue LoadError 
     66    warn "# EventMachine fell back to pure ruby mode" if $DEBUG 
    5767    require 'pr_eventmachine' 
    5868  end 
    5969end 
    60 =end 
    61  
    62  
    63 if RUBY_PLATFORM =~ /java/ 
    64         require 'java' 
    65         require 'jeventmachine' 
    66 else 
    67         if $eventmachine_library == :pure_ruby or ENV['EVENTMACHINE_LIBRARY'] == "pure_ruby" 
    68                 require 'pr_eventmachine' 
    69         else 
    70                 require 'rubyeventmachine' 
    71         end 
    72 end 
    73  
    7470 
    7571require "eventmachine_version" 
  • branches/raggi/lib/jeventmachine.rb

    r692 r708  
    2929# which is a garden-variety Ruby-extension glue module. 
    3030 
    31  
     31require 'java' 
    3232require 'em_reactor' 
    3333 
  • branches/raggi/Rakefile

    r707 r708  
    3737# e.g. rake EM_JAVA=true for forcing java build tasks as defaults! 
    3838java = ENV['EM_JAVA'] || RUBY_PLATFORM =~ /java/ 
     39$eventmachine_library = :java if java 
    3940 
    4041# If running under rubygems... 
  • branches/raggi/tasks/tests.rake

    r691 r708  
    4141  desc "Run tests for #{Spec.name}." 
    4242  task :partial do |t| 
    43     run_tests t, :extension, [ 
     43    lib = RUBY_PLATFORM =~ /java/ ? :java : :extension 
     44    run_tests t, lib, [ 
    4445      "test_basic.rb", 
    4546      "test_epoll.rb", 
     
    6768      "test_ud.rb", 
    6869    ] 
     70  end 
     71   
     72  desc "Run java tests for #$name." 
     73  task :testjava do |t| 
     74    run_tests t, :java 
    6975  end 
    7076 
     
    185191  desc "Test SASL" 
    186192  task :sasl do |t| 
    187     run_tests t, :extension, "test_sasl*.rb" 
     193    run_tests t, :java, "test_sasl*.rb" 
    188194  end 
    189195end