()
| 810 | |
| 811 | #[test] |
| 812 | fn variadic_string_method() -> errors::Result<()> { |
| 813 | let jvm = create_tests_jvm()?; |
| 814 | let test_instance = jvm |
| 815 | .create_instance("org.astonbitecode.j4rs.tests.MyTest", InvocationArg::empty()) |
| 816 | ?; |
| 817 | |
| 818 | let s1 = InvocationArg::try_from("abc")?; |
| 819 | let s2 = InvocationArg::try_from("def")?; |
| 820 | let s3 = InvocationArg::try_from("ghi")?; |
| 821 | |
| 822 | let arr_instance = jvm |
| 823 | .create_java_array("java.lang.String", &vec![s1, s2, s3]) |
| 824 | ?; |
| 825 | |
| 826 | let i = jvm |
| 827 | .invoke( |
| 828 | &test_instance, |
| 829 | "getMyWithArgsList", |
| 830 | &[InvocationArg::from(arr_instance)], |
| 831 | ) |
| 832 | ?; |
| 833 | |
| 834 | let s: String = jvm.to_rust(i)?; |
| 835 | assert!(s == "abcdefghi"); |
| 836 | |
| 837 | Ok(()) |
| 838 | } |
| 839 | |
| 840 | #[test] |
| 841 | fn variadic_int_method() -> errors::Result<()> { |
nothing calls this directly
no test coverage detected