()
| 783 | |
| 784 | #[test] |
| 785 | fn variadic_constructor() -> errors::Result<()> { |
| 786 | let jvm = create_tests_jvm()?; |
| 787 | |
| 788 | let s1 = InvocationArg::try_from("abc")?; |
| 789 | let s2 = InvocationArg::try_from("def")?; |
| 790 | let s3 = InvocationArg::try_from("ghi")?; |
| 791 | |
| 792 | let arr_instance = jvm |
| 793 | .create_java_array("java.lang.String", &vec![s1, s2, s3]) |
| 794 | ?; |
| 795 | |
| 796 | let test_instance = jvm |
| 797 | .create_instance( |
| 798 | "org.astonbitecode.j4rs.tests.MyTest", |
| 799 | &[InvocationArg::from(arr_instance)], |
| 800 | ) |
| 801 | ?; |
| 802 | |
| 803 | let i = jvm.invoke(&test_instance, "getMyString", InvocationArg::empty())?; |
| 804 | |
| 805 | let s: String = jvm.to_rust(i)?; |
| 806 | assert!(s == "abc, def, ghi"); |
| 807 | |
| 808 | Ok(()) |
| 809 | } |
| 810 | |
| 811 | #[test] |
| 812 | fn variadic_string_method() -> errors::Result<()> { |
nothing calls this directly
no test coverage detected