Fake DNS query result inside a test

Weijun Wang weijun.wang at oracle.com
Wed Nov 7 01:05:08 UTC 2012


Hi Vinnie

I want to write a regression test so that

    Context ctx = NamingManager.getURLContext("dns", new Hashtable<>(0));
    Attributes attrs =((DirContext)ctx).getAttributes(
                      "_kerberos._udp.ASDF.COM.", SRV_RR_ATTR);

can return some entries without querying a real external server.

Is this possible by registering a local name server provider or else?

Thanks
Max



More information about the core-libs-dev mailing list