MCPcopy Create free account
hub / github.com/astonbitecode/j4rs / variadic_int_method

Function variadic_int_method

rust/src/lib.rs:841–867  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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<()> {

Callers

nothing calls this directly

Calls 5

create_tests_jvmFunction · 0.85
create_instanceMethod · 0.80
create_java_arrayMethod · 0.80
invokeMethod · 0.65
to_rustMethod · 0.45

Tested by

no test coverage detected