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

Function instance_invocation_chain_and_to_rust

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

Source from the content-addressed store, hash-verified

924
925 #[test]
926 fn instance_invocation_chain_and_to_rust() -> errors::Result<()> {
927 let jvm = create_tests_jvm()?;
928 let instance = jvm
929 .create_instance(
930 "org.astonbitecode.j4rs.tests.MyTest",
931 &[InvocationArg::try_from("string")?],
932 )
933 ?;
934
935 let product: isize = jvm
936 .into_chain(instance)
937 .invoke(
938 "appendToMyString",
939 &[InvocationArg::try_from("_is_appended")?],
940 )
941 ?
942 .invoke("length", InvocationArg::empty())
943 ?
944 .to_rust()
945 ?;
946
947 assert!(product == 18);
948
949 Ok(())
950 }
951
952 #[test]
953 fn static_invocation_chain_and_to_rust() -> errors::Result<()> {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected