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

Function invoke_async_success_w_async_std

rust/src/async_api/mod.rs:190–204  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

188
189 #[async_std::test]
190 async fn invoke_async_success_w_async_std() -> errors::Result<()> {
191 let s_test = "j4rs_rust";
192 let jvm = create_tests_jvm()?;
193 let my_test = jvm.create_instance("org.astonbitecode.j4rs.tests.MyTest", InvocationArg::empty())?;
194 let instance = jvm
195 .invoke_async(
196 &my_test,
197 "getStringWithFuture",
198 &[InvocationArg::try_from(s_test)?],
199 )
200 .await?;
201 let string: String = jvm.to_rust(instance)?;
202 assert_eq!(s_test, string);
203 Ok(())
204 }
205
206 #[async_std::test]
207 async fn invoke_async_failure_w_async_std() -> errors::Result<()> {

Callers

nothing calls this directly

Calls 4

create_tests_jvmFunction · 0.85
create_instanceMethod · 0.80
invoke_asyncMethod · 0.80
to_rustMethod · 0.45

Tested by

no test coverage detected