Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c2ee8d6e1cdf
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 953a44f2edab
Choose a head ref
  • 2 commits
  • 4 files changed
  • 1 contributor

Commits on Aug 25, 2015

  1. 3
    Copy the full SHA
    f5c974a View commit details
  2. Copy the full SHA
    953a44f View commit details
Showing with 36 additions and 13 deletions.
  1. +10 −10 test/test_command_line_switches.rb
  2. +16 −0 test/test_helper.rb
  3. +1 −1 test/test_java_extension.rb
  4. +9 −2 test/test_load_gem_extensions.rb
20 changes: 10 additions & 10 deletions test/test_command_line_switches.rb
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ def test_dash_little_c_checks_syntax_only
end
end
end

# TODO -l: no idea what line ending processing is
def test_dash_little_n_wraps_script_with_while_gets
# FIXME: currently fails on windows and IBM JDK
@@ -97,7 +97,7 @@ def test_dash_little_r_provides_program_name_to_loaded_library
end
end

# This test is difficult to indicate meaning with. I am calling
# This test is difficult to indicate meaning with. I am calling
# jgem, as it should not exist outside the jruby.bin directory.
def test_dash_big_S_executes_script_in_jruby_bin_dir
assert_match /^\d+\.\d+\.\d+/, `#{RUBY} -S jgem --version`
@@ -114,7 +114,7 @@ def test_dash_big_S_resolves_absolute___FILE___correctly
end

def test_dash_big_S_resolves_relative___FILE___correctly

with_temp_script(%q{puts __FILE__}) do |s|
Dir.chdir(Dir.tmpdir) do
relative_tmp = File.basename(s.path)
@@ -216,7 +216,7 @@ def test_dash_big_w_sets_warning_level
assert_match /warning/, jruby("-W2 #{s.path} 2>&1")
assert_equal 0, $?.exitstatus
end
end
end
end

def test_dash_big_x_sets_extended_options
@@ -252,7 +252,7 @@ def test_dash_dash_version_shows_version
if java.lang.System.get_property('java.vm.name') =~ /HotSpot/
# JRUBY-2648 [Note: jre6 on windows does not ship server VM - use jdk]
def test_server_vm_option
skip("test needs fix for jruby-complete.jar") if IS_JAR_EXECUTION
return skip("test needs fix for jruby-complete.jar") if IS_JAR_EXECUTION
# server VM when explicitly set --server
result = jruby(%Q{--server -rjava \
-e "print java.lang.management.ManagementFactory.getCompilationMXBean.name"})
@@ -261,7 +261,7 @@ def test_server_vm_option
end

# JRUBY-2648 [Note: Originally these tests had tests for default vm and
# also for -J options in addition to jruby options (-J-client versus
# also for -J options in addition to jruby options (-J-client versus
# --client). In other tests we test that -J works and passes thru and
# we should not assume to know what versions of Java will have as their
# default VM.
@@ -295,7 +295,7 @@ def test_args_with_rubyopt
ENV['RUBYOPT'] = rubyopt_org
end
end

# JRUBY-2821
def test_with_interesting_file_names
names = ["test-q", "test-d", "test--", "test-_", "test_U", "test_S_", "___D_",
@@ -346,7 +346,7 @@ def test_uppercase_exe
end
end
end

# JRUBY-4290
if (WINDOWS)
def test_uppercase_in_process
@@ -360,7 +360,7 @@ def test_uppercase_in_process
def test_rubyopts_with_require
rubyopt_org = ENV['RUBYOPT']
ENV['RUBYOPT'] = '-r rubygems'

args = "-e 'p 0'"
assert_nothing_raised { jruby(args) }
ensure
@@ -408,7 +408,7 @@ def test_rubyopts_is_not_used_to_set_the_script
end

def test_inproc_execute_with_globs
skip("test needs fix for jruby-complete.jar") if IS_JAR_EXECUTION
return skip("test needs fix for jruby-complete.jar") if IS_JAR_EXECUTION
args = %{-Xlaunch.inproc=true -e 'system %{jruby -e "p ARGV.sort" test/dir{1,2}/target*}'}
assert_equal %{["test/dir1/target.rb", "test/dir2/target.class"]\n}, jruby(args)
end
16 changes: 16 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -106,3 +106,19 @@ def assert_in_sub_runtime(script)
assert run_in_sub_runtime(script)
end
end

require 'test/unit'

class Test::Unit::TestCase

unless method_defined?(:skip)
if method_defined?(:omit)
alias skip omit
else
def skip(msg = nil)
warn "Skipped: #{caller[0]} #{msg}"
end
end
end

end
2 changes: 1 addition & 1 deletion test/test_java_extension.rb
Original file line number Diff line number Diff line change
@@ -294,7 +294,7 @@ def protected_method; "HELLO!" end
end

def test_calling_abstract_method_in_java_constructor
skip('this leaking in super constructor (calling Ruby implemented methods)')
return skip('this leaking in super constructor (calling Ruby implemented methods)')
a = CallAbstractInConstructor.new
assert_equal "HELLO!", a.result
end
11 changes: 9 additions & 2 deletions test/test_load_gem_extensions.rb
Original file line number Diff line number Diff line change
@@ -19,16 +19,23 @@ def teardown
end

def test_require_extension_file_via_uri_protocol
skip 'needs jruby-home from filesystem' if JRuby.runtime.instance_config.jruby_home =~ /META-INF/
return skip 'needs jruby-home from filesystem' if inside_jar?
require 'uri:file:./lib/ruby/shared/json/ext/parser'
# just check if extension class exists
JSON::Ext::Parser
end

def test_require_extension_file_via_uri_classloader_protocol
skip 'needs jruby-home from filesystem' if JRuby.runtime.instance_config.jruby_home =~ /META-INF/
return skip 'needs jruby-home from filesystem' if inside_jar?
require 'uri:classloader:/lib/ruby/shared/json/ext/generator'
# just check if extension class exists
JSON::Ext::Generator
end

private

def inside_jar?
JRuby.runtime.instance_config.jruby_home =~ /META-INF/
end

end