MCPcopy Index your code
hub / github.com/astonbitecode/j4rs / invoke_map

Function invoke_map

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

Source from the content-addressed store, hash-verified

584
585 #[test]
586 fn invoke_map() -> errors::Result<()> {
587 let jvm = create_tests_jvm()?;
588
589 match jvm.create_instance("org.astonbitecode.j4rs.tests.MyTest", InvocationArg::empty()) {
590 Ok(i) => {
591 let map = HashMap::from([("Potatoes", 3), ("Tomatoes", 33), ("Carrotoes", 333)]);
592 let map_instance = jvm
593 .java_map(JavaClass::String, JavaClass::Integer, map)?;
594 let res = jvm.invoke(&i, "map", &[InvocationArg::from(map_instance)]);
595 assert!(res.is_ok());
596 }
597 Err(error) => {
598 panic!("ERROR when creating Instance: {:?}", error);
599 }
600 }
601
602 Ok(())
603 }
604
605 #[test]
606 fn multithread() -> errors::Result<()> {

Callers

nothing calls this directly

Calls 4

create_tests_jvmFunction · 0.85
create_instanceMethod · 0.80
java_mapMethod · 0.80
invokeMethod · 0.65

Tested by

no test coverage detected