You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it("Calling a method on a released object should throw exception",function(){
12
+
13
+
varerrorMessage="";
14
+
15
+
try{
16
+
varobject1=newjava.lang.Object();
17
+
18
+
global.__releaseNativeCounterpart(object1);
19
+
20
+
object1.toString();
21
+
}catch(e){
22
+
errorMessage=e.message;
23
+
}
24
+
25
+
expect(errorMessage).toBe("Failed calling toString on a java/lang/Object instance. The JavaScript instance no longer has available Java instance counterpart.");
26
+
});
27
+
28
+
it("Calling release on a non native object should throw exception",function(){
29
+
30
+
varerrorMessage="";
31
+
32
+
try{
33
+
varobject2={prop: "test"};
34
+
global.__releaseNativeCounterpart(object2);
35
+
}catch(e){
36
+
errorMessage=e.message;
37
+
}
38
+
39
+
expect(errorMessage).toBe("Trying to release a non native object!");
40
+
});
41
+
42
+
43
+
it("Calling release on a non native primitive type should throw exception",function(){
44
+
45
+
varerrorMessage="";
46
+
47
+
try{
48
+
global.__releaseNativeCounterpart(42);
49
+
}catch(e){
50
+
errorMessage=e.message;
51
+
}
52
+
53
+
expect(errorMessage).toBe("Argument is not an object!");
54
+
});
55
+
56
+
it("Calling the __releaseNativeCounterpart function with 0 arguments should throw exception",function(){
0 commit comments