()
| 839 | |
| 840 | #[test] |
| 841 | fn variadic_int_method() -> errors::Result<()> { |
| 842 | let jvm = create_tests_jvm()?; |
| 843 | let test_instance = jvm |
| 844 | .create_instance("org.astonbitecode.j4rs.tests.MyTest", InvocationArg::empty()) |
| 845 | ?; |
| 846 | |
| 847 | let s1 = InvocationArg::try_from(1)?; |
| 848 | let s2 = InvocationArg::try_from(2)?; |
| 849 | let s3 = InvocationArg::try_from(3)?; |
| 850 | |
| 851 | let arr_instance = jvm |
| 852 | .create_java_array("java.lang.Integer", &vec![s1, s2, s3]) |
| 853 | ?; |
| 854 | |
| 855 | let i = jvm |
| 856 | .invoke( |
| 857 | &test_instance, |
| 858 | "addInts", |
| 859 | &[InvocationArg::from(arr_instance)], |
| 860 | ) |
| 861 | ?; |
| 862 | |
| 863 | let num: i32 = jvm.to_rust(i)?; |
| 864 | assert!(num == 6); |
| 865 | |
| 866 | Ok(()) |
| 867 | } |
| 868 | |
| 869 | #[test] |
| 870 | fn variadic_long_primitive_method() -> errors::Result<()> { |
nothing calls this directly
no test coverage detected