Repository navigation
Expand file tree
/
Copy pathtest_jruby_4198.rb
More file actions
75 lines (62 loc) · 1.51 KB
/
Copy pathtest_jruby_4198.rb
File metadata and controls
75 lines (62 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
require 'test/unit'
require 'java'
class TestJRuby4198 < Test::Unit::TestCase
def setup
require File.join(File.dirname(__FILE__), 'jruby-4198.jar')
end
def test_jruby_4198_a
java_import 'A'
a = A.new
assert_equal 'private', a.private
assert_equal 'protected', a.protected
assert_equal 'public', a.public
end
def test_jruby_4198_b
java_import 'B'
assert_equal 'static private', B.private
assert_equal 'static protected', B.protected
assert_equal 'static public', B.public
end
end
__END__
jruby-4198.jar contains two class files, A.class and B.class
public class A {
public String getPublic() {
return "public";
}
public String getPublic1() {
return "public";
}
public String getPrivate() {
return "private";
}
public String getPrivate1() {
return "private";
}
public String getProtected() {
return "protected";
}
public String getProtected1() {
return "protected";
}
}
public class B {
public static String getPublic() {
return "static public";
}
public static String getPublic1() {
return "static public";
}
public static String getPrivate() {
return "static private";
}
public static String getPrivate1() {
return "static private";
}
public static String getProtected() {
return "static protected";
}
public static String getProtected1() {
return "static protected";
}
}