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

Function invoke_static_async

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

Source from the content-addressed store, hash-verified

250
251 #[tokio::test(flavor = "multi_thread", worker_threads = 1)]
252 async fn invoke_static_async() -> errors::Result<()> {
253 let s_test = "j4rs_rust";
254 let jvm = create_tests_jvm()?;
255 let my_test = jvm.static_class("org.astonbitecode.j4rs.tests.MyTest")?;
256 let instance = jvm
257 .invoke_async(
258 &my_test,
259 "getErrorWithFutureStatic",
260 &[InvocationArg::try_from(s_test)?],
261 )
262 .await?;
263 let string: String = jvm.to_rust(instance)?;
264 assert_eq!(s_test, string);
265 Ok(())
266 }
267
268 #[tokio::test(flavor = "multi_thread", worker_threads = 1)]
269 async fn invoke_async_error_before_executing_async() -> errors::Result<()> {

Callers

nothing calls this directly

Calls 4

create_tests_jvmFunction · 0.85
static_classMethod · 0.80
invoke_asyncMethod · 0.80
to_rustMethod · 0.45

Tested by

no test coverage detected