()
| 629 | |
| 630 | #[test] |
| 631 | fn use_a_java_instance_in_different_thread() -> errors::Result<()> { |
| 632 | let jvm = create_tests_jvm()?; |
| 633 | let instantiation_args = vec![InvocationArg::try_from("3")?]; |
| 634 | let instance = jvm |
| 635 | .create_instance("java.lang.String", instantiation_args.as_ref()) |
| 636 | ?; |
| 637 | |
| 638 | let jh = thread::spawn(move || { |
| 639 | let jvm = create_tests_jvm()?; |
| 640 | let res = jvm.invoke(&instance, "isEmpty", InvocationArg::empty()); |
| 641 | res |
| 642 | }); |
| 643 | |
| 644 | let join_res = jh.join(); |
| 645 | assert!(join_res.is_ok()); |
| 646 | assert!(join_res.unwrap().is_ok()); |
| 647 | |
| 648 | Ok(()) |
| 649 | } |
| 650 | |
| 651 | #[test] |
| 652 | fn drop_and_attach_main_thread() -> errors::Result<()> { |
nothing calls this directly
no test coverage detected