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

Function variadic_long_primitive_method

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

Source from the content-addressed store, hash-verified

868
869 #[test]
870 fn variadic_long_primitive_method() -> errors::Result<()> {
871 let jvm = create_tests_jvm()?;
872 let values: Vec<i64> = vec![1, 2, 3];
873 let jargs: Vec<_> = values
874 .into_iter()
875 .map(|v| {
876 InvocationArg::try_from(v)
877 .unwrap()
878 .into_primitive()
879 .unwrap()
880 })
881 .collect();
882
883 let arr_instance = jvm.create_java_array("long", &jargs)?;
884
885 let _ = jvm
886 .invoke_static(
887 "org.astonbitecode.j4rs.tests.MyTest",
888 "useLongPrimitivesArray",
889 &[InvocationArg::from(arr_instance)],
890 )
891 ?;
892
893 Ok(())
894 }
895
896 #[test]
897 fn instance_invocation_chain_and_collect() -> errors::Result<()> {

Callers

nothing calls this directly

Calls 6

create_tests_jvmFunction · 0.85
collectMethod · 0.80
mapMethod · 0.80
into_primitiveMethod · 0.80
create_java_arrayMethod · 0.80
invoke_staticMethod · 0.80

Tested by

no test coverage detected