FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
node-java/test/java-ambiguousMethod-test.js at master · reke592/node-java · GitHub
reke592
/
node-java
Public
forked from
joeferner/node-java
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
node-java
/
test
/
java-ambiguousMethod-test.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
106 lines (93 loc) · 3.39 KB
Breadcrumbs
node-java
/
test
/
java-ambiguousMethod-test.js
Copy path
File metadata and controls
106 lines (93 loc) · 3.39 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
var
java
=
require
(
"../testHelpers"
)
.
java
;
var
nodeunit
=
require
(
"nodeunit"
)
;
var
util
=
require
(
"util"
)
;
exports
[
'Java - Call Ambiguous Method'
]
=
nodeunit
.
testCase
(
{
"staticMethodAmbiguous (sync) - int passed to double"
:
function
(
test
)
{
var
result
=
java
.
callStaticMethodSync
(
'Test'
,
'staticMethodAmbiguous(Ljava/lang/Double;)I'
,
1
)
;
test
.
equal
(
result
,
1
)
;
test
.
done
(
)
;
}
,
"staticMethodAmbiguous (sync) - double passed to int"
:
function
(
test
)
{
var
result
=
java
.
callStaticMethodSync
(
'Test'
,
'staticMethodAmbiguous(Ljava/lang/Integer;)I'
,
1.1
)
;
test
.
equal
(
result
,
2
)
;
test
.
done
(
)
;
}
,
"staticMethodAmbiguous (sync) - method not found wrong argument type"
:
function
(
test
)
{
try
{
java
.
callStaticMethodSync
(
'Test'
,
'staticMethodAmbiguous(Ljava/lang/String;)I'
,
1
)
;
test
.
fail
(
"should throw"
)
;
}
catch
(
e
)
{
console
.
log
(
e
)
;
}
test
.
done
(
)
;
}
,
"staticMethodAmbiguous (sync) - method failed because argument count mismatch"
:
function
(
test
)
{
try
{
java
.
callStaticMethodSync
(
'Test'
,
'staticMethodAmbiguous(Ljava/lang/Integer;)I'
,
1
,
2
)
;
test
.
fail
(
"should throw argument length mismatch"
)
;
}
catch
(
e
)
{
console
.
log
(
e
)
;
}
test
.
done
(
)
;
}
,
"staticMethodAmbiguous - int passed to double"
:
function
(
test
)
{
java
.
callStaticMethod
(
'Test'
,
'staticMethodAmbiguous(Ljava/lang/Double;)I'
,
1
,
function
(
err
,
result
)
{
test
.
ok
(
!
err
)
;
test
.
equal
(
result
,
1
)
;
test
.
done
(
)
;
}
)
}
,
"staticMethodAmbiguous - double passed to int"
:
function
(
test
)
{
java
.
callStaticMethod
(
'Test'
,
'staticMethodAmbiguous(Ljava/lang/Integer;)I'
,
1.1
,
function
(
err
,
result
)
{
test
.
ok
(
!
err
)
;
test
.
equal
(
result
,
2
)
;
test
.
done
(
)
;
}
)
;
}
,
"staticMethodAmbiguous - method not found"
:
function
(
test
)
{
java
.
callStaticMethod
(
'Test'
,
'staticMethodAmbiguous(Ljava/lang/String;)I'
,
1
,
function
(
err
,
result
)
{
test
.
ok
(
err
)
;
console
.
log
(
err
)
;
test
.
done
(
)
;
}
)
;
}
,
"staticMethodAmbiguous - method argument count mismatch"
:
function
(
test
)
{
java
.
callStaticMethod
(
'Test'
,
'staticMethodAmbiguous(Ljava/lang/Integer;)I'
,
1
,
2
,
function
(
err
,
result
)
{
test
.
ok
(
err
)
;
console
.
log
(
err
)
;
test
.
done
(
)
;
}
)
;
}
,
"methodAmbiguous (sync) - int passed to double"
:
function
(
test
)
{
var
myTest
=
java
.
newInstanceSync
(
"Test"
)
;
var
result
=
java
.
callMethodSync
(
myTest
,
'methodAmbiguous(Ljava/lang/Double;)I'
,
1
)
;
test
.
equal
(
result
,
1
)
;
test
.
done
(
)
;
}
,
"methodAmbiguous (sync) - double passed to int"
:
function
(
test
)
{
var
myTest
=
java
.
newInstanceSync
(
"Test"
)
;
var
result
=
java
.
callMethodSync
(
myTest
,
'methodAmbiguous(Ljava/lang/Integer;)I'
,
1.1
)
;
test
.
equal
(
result
,
2
)
;
test
.
done
(
)
;
}
,
"methodAmbiguous (sync) - method not found wrong argument type"
:
function
(
test
)
{
var
myTest
=
java
.
newInstanceSync
(
"Test"
)
;
try
{
java
.
callMethodSync
(
myTest
,
'methodAmbiguous(Ljava/lang/String;)I'
,
1
)
;
test
.
fail
(
"should throw"
)
;
}
catch
(
e
)
{
console
.
log
(
e
)
;
}
test
.
done
(
)
;
}
,
"methodAmbiguous (sync) - method failed because argument count mismatch"
:
function
(
test
)
{
var
myTest
=
java
.
newInstanceSync
(
"Test"
)
;
try
{
java
.
callMethodSync
(
myTest
,
'methodAmbiguous(Ljava/lang/Integer;)I'
,
1
,
2
)
;
test
.
fail
(
"should throw argument length mismatch"
)
;
}
catch
(
e
)
{
console
.
log
(
e
)
;
}
test
.
done
(
)
;
}
}
)
;
Back
|
FazBrowse Home
|
New Git URL