1
1
using Base. Test
2
2
using JavaCall
3
- using Compat
4
3
5
4
6
5
versioninfo ();
@@ -22,8 +21,8 @@ T = @jimport Test
22
21
@test typemax (jint) == jcall (T, " testInt" , jint, (jint,), typemax (jint))
23
22
@test typemax (jlong) == jcall (T, " testLong" , jlong, (jlong,), typemax (jlong))
24
23
@test " Hello Java" == jcall (T, " testString" , JString, (JString,), " Hello Java" )
25
- @test @compat Float64 (10.02 ) == jcall (T, " testDouble" , jdouble, (jdouble,), 10.02 ) # Comparing exact float representations hence ==
26
- @test @compat Float32 (10.02 ) == jcall (T, " testFloat" , jfloat, (jfloat,), 10.02 )
24
+ @test Float64 (10.02 ) == jcall (T, " testDouble" , jdouble, (jdouble,), 10.02 ) # Comparing exact float representations hence ==
25
+ @test Float32 (10.02 ) == jcall (T, " testFloat" , jfloat, (jfloat,), 10.02 )
27
26
@test realmax (jdouble) == jcall (T, " testDouble" , jdouble, (jdouble,), realmax (jdouble))
28
27
@test realmax (jfloat) == jcall (T, " testFloat" , jfloat, (jfloat,), realmax (jfloat))
29
28
@@ -62,9 +61,9 @@ j_u_arrays = @jimport java.util.Arrays
62
61
63
62
a= jcall (j_u_arrays, " copyOf" , Array{jint, 1 }, (Array{jint, 1 }, jint), [1 ,2 ,3 ], 3 )
64
63
@test typeof (a) == Array{jint, 1 }
65
- @test a[1 ] == @compat Int32 (1 )
66
- @test a[2 ] == @compat Int32 (2 )
67
- @test a[3 ] == @compat Int32 (3 )
64
+ @test a[1 ] == Int32 (1 )
65
+ @test a[2 ] == Int32 (2 )
66
+ @test a[3 ] == Int32 (3 )
68
67
69
68
a= jcall (j_u_arrays, " copyOf" , Array{JObject, 1 }, (Array{JObject, 1 }, jint), [" a" ," b" ," c" ], 3 )
70
69
@test 3 == length (a)
@@ -91,7 +90,7 @@ Dates.year(convert(Dates.DateTime, nullcal)) == 1970
91
90
92
91
JHashMap = @jimport (java. util. HashMap)
93
92
p = JHashMap (())
94
- a= @compat Dict (" a" => " A" , " b" => " B" )
93
+ a= Dict (" a" => " A" , " b" => " B" )
95
94
b= convert (@jimport (java. util. Map), JString, JString, a)
96
95
@assert jcall (b, " size" , jint, ()) == 2
97
96
@@ -153,7 +152,7 @@ for i=1:100; @test jcall(ta_20[i], "size", jint, ()) == 0; end
153
152
# Test array conversions
154
153
jobj = jcall (T, " testArrayAsObject" , JObject, ())
155
154
arr = convert (Array{Array{UInt8, 1 }, 1 }, jobj)
156
- @test [" Hello" , " World" ] == map (Compat . String, arr)
155
+ @test [" Hello" , " World" ] == map (String, arr)
157
156
158
157
# Test iterator conversions
159
158
0 commit comments