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.
- checksums.yaml +4 -4
- data/ChangeLog +725 -703
- data/README.md +65 -0
- data/ext/extconf.h +1 -1
- data/ext/extconf.rb +1 -0
- data/ext/jniwrap.h +34 -34
- data/ext/jp_co_infoseek_hp_arton_rjb_RBridge.h +21 -21
- data/ext/load.c +2 -0
- data/ext/rjb.c +2 -2
- data/lib/rjb.rb +3 -0
- data/lib/rjb/version.rb +27 -0
- data/lib/rjbextension.rb +1 -1
- data/readme.sj +27 -27
- data/test/exttest.rb +39 -39
- data/test/jartest.rb +24 -24
- data/test/jartest2.rb +23 -23
- data/test/jartest3.rb +28 -28
- data/test/jp/co/infoseek/hp/arton/rjb/CallbackTest$Callback.class +0 -0
- data/test/jp/co/infoseek/hp/arton/rjb/CallbackTest.class +0 -0
- data/test/jp/co/infoseek/hp/arton/rjb/IBase.class +0 -0
- data/test/jp/co/infoseek/hp/arton/rjb/JarTest.class +0 -0
- data/test/jp/co/infoseek/hp/arton/rjb/JarTest2.class +0 -0
- data/test/jp/co/infoseek/hp/arton/rjb/Test$TestTypes.class +0 -0
- data/test/jp/co/infoseek/hp/arton/rjb/Test.class +0 -0
- data/test/jp/co/infoseek/hp/arton/rjb/Two.class +0 -0
- data/test/jp/co/infoseek/hp/arton/rjb/TwoCaller.class +0 -0
- data/test/test.rb +26 -26
- data/test/test_unload.rb +26 -26
- metadata +14 -26
- data/test/Base.class +0 -0
- data/test/CallbackTest$Callback.class +0 -0
- data/test/CallbackTest.class +0 -0
- data/test/ExtBase.class +0 -0
- data/test/IBase.class +0 -0
- data/test/JTest.class +0 -0
- data/test/Test$TestTypes.class +0 -0
- data/test/Test.class +0 -0
- data/test/Two.class +0 -0
- data/test/TwoCaller.class +0 -0
- data/test/jp/co/infoseek/hp/arton/rjb/JTest.class +0 -0
- data/test/js.rb +0 -54
- data/test/reader.rb +0 -11
- data/test/reader2.rb +0 -12
data/test/Two.class
DELETED
Binary file
|
data/test/TwoCaller.class
DELETED
Binary file
|
Binary file
|
data/test/js.rb
DELETED
@@ -1,54 +0,0 @@
|
|
1
|
-
begin
|
2
|
-
require 'rjb'
|
3
|
-
rescue LoadError
|
4
|
-
require 'rubygems'
|
5
|
-
require 'rjb'
|
6
|
-
end
|
7
|
-
require 'test/unit'
|
8
|
-
require 'fileutils'
|
9
|
-
|
10
|
-
FileUtils.rm_f 'jp/co/infoseek/hp/arton/rjb/Base.class'
|
11
|
-
FileUtils.rm_f 'jp/co/infoseek/hp/arton/rjb/ExtBase.class'
|
12
|
-
|
13
|
-
puts "start RJB(#{Rjb::VERSION}) test"
|
14
|
-
class TestRjb < Test::Unit::TestCase
|
15
|
-
include Rjb
|
16
|
-
def setup
|
17
|
-
Rjb::load('.')
|
18
|
-
Rjb::add_jar(File.expand_path('rjbtest.jar'))
|
19
|
-
Rjb::primitive_conversion = false
|
20
|
-
|
21
|
-
@jString = import('java.lang.String')
|
22
|
-
@jInteger = import('java.lang.Integer')
|
23
|
-
@jShort = import('java.lang.Short')
|
24
|
-
@jDouble = import('java.lang.Double')
|
25
|
-
@jFloat = import('java.lang.Float')
|
26
|
-
@jBoolean = import('java.lang.Boolean')
|
27
|
-
@jByte = import('java.lang.Byte')
|
28
|
-
@jLong = import('java.lang.Long')
|
29
|
-
@jChar = import('java.lang.Character')
|
30
|
-
end
|
31
|
-
|
32
|
-
SJIS_STR = "\x8a\xbf\x8e\x9a\x83\x65\x83\x4c\x83\x58\x83\x67"
|
33
|
-
EUCJP_STR = "\xb4\xc1\xbb\xfa\xa5\xc6\xa5\xad\xa5\xb9\xa5\xc8"
|
34
|
-
UTF8_STR = "\xE6\xBC\xA2\xE5\xAD\x97\xE3\x83\x86\xE3\x82\xAD\xE3\x82\xB9\xE3\x83\x88"
|
35
|
-
def test_jsconv
|
36
|
-
sys = import('java.lang.System')
|
37
|
-
encoding = sys.property('file.encoding')
|
38
|
-
s = @jString.new(SJIS_STR.force_encoding Encoding::SHIFT_JIS)
|
39
|
-
e = @jString.new(EUCJP_STR.force_encoding Encoding::EUC_JP)
|
40
|
-
u = @jString.new(UTF8_STR.force_encoding Encoding::UTF_8)
|
41
|
-
if encoding == 'MS932'
|
42
|
-
s1 = @jString.new(SJIS_STR.bytes)
|
43
|
-
elsif encoding.upcase == 'EUC-JP'
|
44
|
-
s1 = @jString.new(EUCJP_STR.bytes)
|
45
|
-
elsif encoding.upcase == 'UTF-8'
|
46
|
-
s1 = @jString.new(UTF8_STR.bytes)
|
47
|
-
else
|
48
|
-
skip 'no checkable encoding'
|
49
|
-
end
|
50
|
-
assert_equal s1.toString, s.toString
|
51
|
-
assert_equal s1.toString, e.toString
|
52
|
-
assert_equal s1.toString, u.toString
|
53
|
-
end
|
54
|
-
end
|
data/test/reader.rb
DELETED
data/test/reader2.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'rjb'
|
2
|
-
p Rjb::VERSION
|
3
|
-
Rjb::load
|
4
|
-
JString = Rjb::import('java.lang.String')
|
5
|
-
CharArrayReader = Rjb::import('java.io.CharArrayReader')
|
6
|
-
reader = CharArrayReader.new([48, 49, 50, 51, 52, 53])
|
7
|
-
buffer = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
8
|
-
p buffer
|
9
|
-
len = reader.read(buffer, 0, buffer.length)
|
10
|
-
p len
|
11
|
-
p buffer
|
12
|
-
reader.close
|