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

Function is_null

rust/src/api/instance.rs:240–254  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

238
239 #[test]
240 fn is_null() -> errors::Result<()> {
241 let jvm = create_tests_jvm()?;
242 let test_instance = jvm
243 .create_instance("org.astonbitecode.j4rs.tests.MyTest", InvocationArg::empty())
244 ?;
245 let maybe_null = jvm.invoke(&test_instance, "getNullInteger", InvocationArg::empty())?;
246 let is_null =
247 jvm.invoke_static(
248 "java.util.Objects",
249 "isNull",
250 &[InvocationArg::try_from(maybe_null)?])?;
251 let is_null: bool = jvm.to_rust(is_null)?;
252 assert!(is_null);
253 Ok(())
254 }
255
256 #[test]
257 fn try_from_jobject() -> errors::Result<()> {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected