rjb 1.5.4 → 1.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog +725 -703
  3. data/README.md +65 -0
  4. data/ext/extconf.h +1 -1
  5. data/ext/extconf.rb +1 -0
  6. data/ext/jniwrap.h +34 -34
  7. data/ext/jp_co_infoseek_hp_arton_rjb_RBridge.h +21 -21
  8. data/ext/load.c +2 -0
  9. data/ext/rjb.c +2 -2
  10. data/lib/rjb.rb +3 -0
  11. data/lib/rjb/version.rb +27 -0
  12. data/lib/rjbextension.rb +1 -1
  13. data/readme.sj +27 -27
  14. data/test/exttest.rb +39 -39
  15. data/test/jartest.rb +24 -24
  16. data/test/jartest2.rb +23 -23
  17. data/test/jartest3.rb +28 -28
  18. data/test/jp/co/infoseek/hp/arton/rjb/CallbackTest$Callback.class +0 -0
  19. data/test/jp/co/infoseek/hp/arton/rjb/CallbackTest.class +0 -0
  20. data/test/jp/co/infoseek/hp/arton/rjb/IBase.class +0 -0
  21. data/test/jp/co/infoseek/hp/arton/rjb/JarTest.class +0 -0
  22. data/test/jp/co/infoseek/hp/arton/rjb/JarTest2.class +0 -0
  23. data/test/jp/co/infoseek/hp/arton/rjb/Test$TestTypes.class +0 -0
  24. data/test/jp/co/infoseek/hp/arton/rjb/Test.class +0 -0
  25. data/test/jp/co/infoseek/hp/arton/rjb/Two.class +0 -0
  26. data/test/jp/co/infoseek/hp/arton/rjb/TwoCaller.class +0 -0
  27. data/test/test.rb +26 -26
  28. data/test/test_unload.rb +26 -26
  29. metadata +14 -26
  30. data/test/Base.class +0 -0
  31. data/test/CallbackTest$Callback.class +0 -0
  32. data/test/CallbackTest.class +0 -0
  33. data/test/ExtBase.class +0 -0
  34. data/test/IBase.class +0 -0
  35. data/test/JTest.class +0 -0
  36. data/test/Test$TestTypes.class +0 -0
  37. data/test/Test.class +0 -0
  38. data/test/Two.class +0 -0
  39. data/test/TwoCaller.class +0 -0
  40. data/test/jp/co/infoseek/hp/arton/rjb/JTest.class +0 -0
  41. data/test/js.rb +0 -54
  42. data/test/reader.rb +0 -11
  43. data/test/reader2.rb +0 -12
@@ -1,23 +1,23 @@
1
- #!/usr/local/env ruby -Ku
2
- # encoding: utf-8
3
-
4
- begin
5
- require 'rjb'
6
- rescue LoadError
7
- require 'rubygems'
8
- require 'rjb'
9
- end
10
- require 'test/unit'
11
-
12
- class JarTest < Test::Unit::TestCase
13
- include Rjb
14
-
15
- def setup
16
- Rjb::load()
17
- end
18
-
19
- def test_depends
20
- add_jar([File.expand_path('./jartest2.jar'), File.expand_path('./jartest.jar')])
21
- assert Rjb::import('jp.co.infoseek.hp.arton.rjb.JarTest2')
22
- end
23
- end
1
+ #!/usr/local/env ruby -Ku
2
+ # encoding: utf-8
3
+
4
+ begin
5
+ require 'rjb'
6
+ rescue LoadError
7
+ require 'rubygems'
8
+ require 'rjb'
9
+ end
10
+ require 'test/unit'
11
+
12
+ class JarTest < Test::Unit::TestCase
13
+ include Rjb
14
+
15
+ def setup
16
+ Rjb::load()
17
+ end
18
+
19
+ def test_depends
20
+ add_jar([File.expand_path('./jartest2.jar'), File.expand_path('./jartest.jar')])
21
+ assert Rjb::import('jp.co.infoseek.hp.arton.rjb.JarTest2')
22
+ end
23
+ end
@@ -1,28 +1,28 @@
1
- #!/usr/local/env ruby -Ku
2
- # encoding: utf-8
3
-
4
- begin
5
- require 'rjb'
6
- rescue LoadError
7
- require 'rubygems'
8
- require 'rjb'
9
- end
10
- require 'test/unit'
11
-
12
- class JarTest < Test::Unit::TestCase
13
- include Rjb
14
-
15
- def setup
16
- Rjb::load()
17
- end
18
-
19
- def test_depends
20
- add_jar(File.expand_path('./jartest2.jar'))
21
- begin
22
- Rjb::import('jp.co.infoseek.hp.arton.rjb.JarTest2')
23
- fail 'no exception'
24
- rescue NoClassDefFoundError
25
- assert true
26
- end
27
- end
28
- end
1
+ #!/usr/local/env ruby -Ku
2
+ # encoding: utf-8
3
+
4
+ begin
5
+ require 'rjb'
6
+ rescue LoadError
7
+ require 'rubygems'
8
+ require 'rjb'
9
+ end
10
+ require 'test/unit'
11
+
12
+ class JarTest < Test::Unit::TestCase
13
+ include Rjb
14
+
15
+ def setup
16
+ Rjb::load()
17
+ end
18
+
19
+ def test_depends
20
+ add_jar(File.expand_path('./jartest2.jar'))
21
+ begin
22
+ Rjb::import('jp.co.infoseek.hp.arton.rjb.JarTest2')
23
+ fail 'no exception'
24
+ rescue NoClassDefFoundError
25
+ assert true
26
+ end
27
+ end
28
+ end
@@ -4,8 +4,8 @@
4
4
 
5
5
  begin
6
6
  require 'rjb'
7
- rescue LoadError
8
- require 'rubygems'
7
+ rescue LoadError
8
+ require 'rubygems'
9
9
  require 'rjb'
10
10
  end
11
11
  require 'test/unit'
@@ -139,8 +139,8 @@ class TestRjb < Test::Unit::TestCase
139
139
  oa = a.toArray
140
140
  assert_equal(3, oa.size)
141
141
  assert_equal(1, oa[0].intValue)
142
- assert_equal(2, oa[1].intValue)
143
- assert_equal(3, oa[2].intValue)
142
+ assert_equal(2, oa[1].intValue)
143
+ assert_equal(3, oa[2].intValue)
144
144
  end
145
145
 
146
146
  def test_kjconv()
@@ -638,7 +638,7 @@ class TestRjb < Test::Unit::TestCase
638
638
 
639
639
  #rjb-bugs-15430 rebported by Bryan Duxbury
640
640
  def test_generics_map
641
-
641
+
642
642
  ctest = import('jp.co.infoseek.hp.arton.rjb.Test')
643
643
  test = ctest.new
644
644
  map = test.sorted_map
@@ -650,7 +650,7 @@ class TestRjb < Test::Unit::TestCase
650
650
  map.put('abc', @jString.new('abc').bytes)
651
651
  map.put('012', @jString.new('012').bytes)
652
652
 
653
- Rjb::primitive_conversion = true
653
+ Rjb::primitive_conversion = true
654
654
  map2 = test.throughSortedMap(map)
655
655
  assert_equal '012', map2.get('012')
656
656
  assert_equal 'abc', map2.get('abc')
@@ -666,7 +666,7 @@ class TestRjb < Test::Unit::TestCase
666
666
  assert_equal "can't create Java VM", $!.message
667
667
  end
668
668
  end
669
-
669
+
670
670
  module TestMixin
671
671
  def test_hello(s)
672
672
  'hello ' + s
@@ -686,11 +686,11 @@ class TestRjb < Test::Unit::TestCase
686
686
  end
687
687
  p = point.new(11, 12)
688
688
  assert_equal(11, p.x)
689
- assert_equal(12, p.y)
689
+ assert_equal(12, p.y)
690
690
  assert_equal('hello world', p.test_hello('world'))
691
691
  p = p.location
692
692
  assert_equal(11, p.x)
693
- assert_equal(12, p.y)
693
+ assert_equal(12, p.y)
694
694
  assert_equal('hello world', p.test_hello('world'))
695
695
  end
696
696
  def test_fetch_method_signature
@@ -699,11 +699,11 @@ class TestRjb < Test::Unit::TestCase
699
699
  assert_equal(expected, sig)
700
700
  end
701
701
  def test_fetch_method_without_signature
702
- sig =
702
+ sig =
703
703
  assert_equal([nil], @jString.sigs('toString'))
704
704
  end
705
705
  def test_fetch_static_method_signature
706
- expected = ['Ljava.lang.String;[Ljava.lang.Object;',
706
+ expected = ['Ljava.lang.String;[Ljava.lang.Object;',
707
707
  'Ljava.util.Locale;Ljava.lang.String;[Ljava.lang.Object;']
708
708
  sig = @jString.static_sigs('format').sort
709
709
  assert_equal(expected, sig)
@@ -734,7 +734,7 @@ class TestRjb < Test::Unit::TestCase
734
734
  m =~ /^indexOf/
735
735
  end
736
736
  args = indexof.match(/\[([^\]]+)\]/)[1]
737
- assert_equal('Ljava.lang.String;I, II, I, Ljava.lang.String;'.split(/,\s*/).sort,
737
+ assert_equal('Ljava.lang.String;I, II, I, Ljava.lang.String;'.split(/,\s*/).sort,
738
738
  args.split(/,\s*/).sort)
739
739
  end
740
740
  def test_java_class_methods
@@ -785,9 +785,9 @@ class TestRjb < Test::Unit::TestCase
785
785
  assert_equal -5, index
786
786
  end
787
787
  def test_impl
788
- two = import('Two')
788
+ two = import('jp.co.infoseek.hp.arton.rjb.Two')
789
789
  t = two.impl { |m| m.to_s }
790
- a = import('TwoCaller').new
790
+ a = import('jp.co.infoseek.hp.arton.rjb.TwoCaller').new
791
791
  ret = a.foo(t)
792
792
  assert_equal 'method1', ret[0]
793
793
  assert_equal 'method2', ret[1]
@@ -822,7 +822,7 @@ class TestRjb < Test::Unit::TestCase
822
822
  assert_equal('java.lang.IllegalArgumentException', ia._classname)
823
823
  end
824
824
  end
825
-
825
+
826
826
  class CbTest
827
827
  def method(l, s, i, d, str)
828
828
  "test_ok:#{l}-#{s}-#{i}-#{d}-#{str}"
@@ -833,7 +833,7 @@ class TestRjb < Test::Unit::TestCase
833
833
  test = import('jp.co.infoseek.hp.arton.rjb.CallbackTest')
834
834
  assert_equal 'test_ok:1234-1234-1234-1234.5-1234', test.callCallback(cb)
835
835
  end
836
-
836
+
837
837
  class TestIterEx < TestIter
838
838
  def initialize()
839
839
  super
@@ -852,7 +852,7 @@ class TestRjb < Test::Unit::TestCase
852
852
  a = test.new
853
853
  assert_equal("43210", a.concat(it))
854
854
  assert(it.respond_to?(:numattr))
855
- assert(it.respond_to?(:multargs))
855
+ assert(it.respond_to?(:multargs))
856
856
  assert_equal(32, it.numattr)
857
857
  assert_equal('strattr', it.strattr)
858
858
  it.numattr += 1
@@ -862,15 +862,15 @@ class TestRjb < Test::Unit::TestCase
862
862
  def test_noarg_invoke()
863
863
  str = @jString.new('abc')
864
864
  assert_equal('abc', str._invoke('toString', ''))
865
- assert_equal('abc', str._invoke('toString', nil))
866
- assert_equal('abc', str._invoke('toString'))
865
+ assert_equal('abc', str._invoke('toString', nil))
866
+ assert_equal('abc', str._invoke('toString'))
867
867
  end
868
868
  def test_noarg_sinvoke()
869
- sys = import('java.lang.System')
870
- cons = sys.console
871
- assert_equal(cons._classname, sys._invoke('console', '')._classname)
872
- assert_equal(cons._classname, sys._invoke('console', nil)._classname)
873
- assert_equal(cons._classname, sys._invoke('console')._classname)
869
+ loader= import('java.lang.ClassLoader')
870
+ sloader = loader.system_class_loader
871
+ assert_equal(sloader._classname, loader._invoke('getSystemClassLoader', '')._classname)
872
+ assert_equal(sloader._classname, loader._invoke('getSystemClassLoader', nil)._classname)
873
+ assert_equal(sloader._classname, loader._invoke('getSystemClassLoader')._classname)
874
874
  end
875
875
  def test_longarg
876
876
  skip('rbx can handle 64bits long') if RUBY_ENGINE == 'rbx'
@@ -897,7 +897,7 @@ class TestRjb < Test::Unit::TestCase
897
897
  ret = test.java_typed_array(['a', 'b', 'c'], [1, 2, 3], [uri.new('http://www.artonx.org')])
898
898
  assert_equal '[Ljava.lang.String;', ret[0]
899
899
  assert_equal '[Ljava.lang.Integer;', ret[1]
900
- assert_equal '[Ljava.net.URI;', ret[2]
900
+ assert_equal '[Ljava.net.URI;', ret[2]
901
901
  end
902
902
 
903
903
  SJIS_STR = "\x8a\xbf\x8e\x9a\x83\x65\x83\x4c\x83\x58\x83\x67"
@@ -923,7 +923,7 @@ class TestRjb < Test::Unit::TestCase
923
923
  assert_equal s1.toString, e.toString
924
924
  assert_equal s1.toString, u.toString
925
925
  end
926
-
926
+
927
927
  def test_bothdirection_chararray
928
928
  charArrayReader = import('java.io.CharArrayReader')
929
929
  org = [48, 49, 50, 51, 52, 53]
@@ -1,26 +1,26 @@
1
- #!/usr/local/env ruby -Ku
2
- # encoding: utf-8
3
- # $Id: test.rb 176 2011-11-09 14:27:28Z arton $
4
-
5
- begin
6
- require 'rjb'
7
- rescue LoadError
8
- require 'rubygems'
9
- require 'rjb'
10
- end
11
- require 'test/unit'
12
-
13
- class TestUnloadRjb < Test::Unit::TestCase
14
- include Rjb
15
- def setup
16
- Rjb::load('.')
17
- end
18
-
19
- def test_unload
20
- jString = import('java.lang.String')
21
- assert_equal 0, Rjb::unload
22
- jString = nil
23
- GC.start
24
- end
25
- end
26
-
1
+ #!/usr/local/env ruby -Ku
2
+ # encoding: utf-8
3
+ # $Id: test.rb 176 2011-11-09 14:27:28Z arton $
4
+
5
+ begin
6
+ require 'rjb'
7
+ rescue LoadError
8
+ require 'rubygems'
9
+ require 'rjb'
10
+ end
11
+ require 'test/unit'
12
+
13
+ class TestUnloadRjb < Test::Unit::TestCase
14
+ include Rjb
15
+ def setup
16
+ Rjb::load('.')
17
+ end
18
+
19
+ def test_unload
20
+ jString = import('java.lang.String')
21
+ assert_equal 0, Rjb::unload
22
+ jString = nil
23
+ GC.start
24
+ end
25
+ end
26
+
metadata CHANGED
@@ -1,19 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rjb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.4
4
+ version: 1.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - arton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-26 00:00:00.000000000 Z
11
+ date: 2016-10-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: 'RJB is a bridge program that connect between Ruby and Java with Java
13
+ description: RJB is a Bridge library which connects Ruby and Java code using the Java
14
14
  Native Interface.
15
-
16
- '
17
15
  email: artonx@gmail.com
18
16
  executables: []
19
17
  extensions:
@@ -22,6 +20,7 @@ extra_rdoc_files: []
22
20
  files:
23
21
  - COPYING
24
22
  - ChangeLog
23
+ - README.md
25
24
  - data/rjb/jp/co/infoseek/hp/arton/rjb/RBridge.class
26
25
  - ext/RBridge.java
27
26
  - ext/depend
@@ -38,21 +37,12 @@ files:
38
37
  - lib/rjb.rb
39
38
  - lib/rjb/extension.rb
40
39
  - lib/rjb/list.rb
40
+ - lib/rjb/version.rb
41
41
  - lib/rjbextension.rb
42
42
  - readme.sj
43
43
  - readme.txt
44
44
  - samples/filechooser.rb
45
45
  - samples/unzip.rb
46
- - test/Base.class
47
- - test/CallbackTest$Callback.class
48
- - test/CallbackTest.class
49
- - test/ExtBase.class
50
- - test/IBase.class
51
- - test/JTest.class
52
- - test/Test$TestTypes.class
53
- - test/Test.class
54
- - test/Two.class
55
- - test/TwoCaller.class
56
46
  - test/exttest.rb
57
47
  - test/gctest.rb
58
48
  - test/jartest.jar
@@ -63,14 +53,14 @@ files:
63
53
  - test/jp/co/infoseek/hp/arton/rjb/CallbackTest$Callback.class
64
54
  - test/jp/co/infoseek/hp/arton/rjb/CallbackTest.class
65
55
  - test/jp/co/infoseek/hp/arton/rjb/IBase.class
66
- - test/jp/co/infoseek/hp/arton/rjb/JTest.class
56
+ - test/jp/co/infoseek/hp/arton/rjb/JarTest.class
57
+ - test/jp/co/infoseek/hp/arton/rjb/JarTest2.class
67
58
  - test/jp/co/infoseek/hp/arton/rjb/Test$TestTypes.class
68
59
  - test/jp/co/infoseek/hp/arton/rjb/Test.class
69
- - test/js.rb
60
+ - test/jp/co/infoseek/hp/arton/rjb/Two.class
61
+ - test/jp/co/infoseek/hp/arton/rjb/TwoCaller.class
70
62
  - test/listtest.rb
71
63
  - test/osx_jvmcheck.rb
72
- - test/reader.rb
73
- - test/reader2.rb
74
64
  - test/rjbtest.jar
75
65
  - test/test.rb
76
66
  - test/test_osxjvm.rb
@@ -78,7 +68,7 @@ files:
78
68
  - test/test_unload.rb
79
69
  homepage: http://www.artonx.org/collabo/backyard/?RubyJavaBridge
80
70
  licenses:
81
- - LGPL
71
+ - LGPL-2.1
82
72
  metadata: {}
83
73
  post_install_message:
84
74
  rdoc_options: []
@@ -95,12 +85,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
85
  - !ruby/object:Gem::Version
96
86
  version: '0'
97
87
  requirements:
98
- - none
99
88
  - JDK 5.0
100
- rubyforge_project: rjb
101
- rubygems_version: 2.5.0
89
+ rubyforge_project:
90
+ rubygems_version: 2.6.4
102
91
  signing_key:
103
92
  specification_version: 4
104
- summary: Ruby Java bridge
105
- test_files:
106
- - test/test.rb
93
+ summary: Ruby Java Bridge
94
+ test_files: []
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file