Search in sources :

Example 1 with JndiRecordFetcher

use of io.grpc.internal.JndiResourceResolverFactory.JndiRecordFetcher in project grpc-java by grpc.

the class JndiResourceResolverTest method jndiResolverWorks.

@IgnoreJRERequirement
@Test
public void jndiResolverWorks() throws Exception {
    Assume.assumeNoException(new JndiResourceResolverFactory().unavailabilityCause());
    RecordFetcher recordFetcher = new JndiRecordFetcher();
    try {
        recordFetcher.getAllRecords("SRV", "dns:///localhost");
    } catch (javax.naming.CommunicationException e) {
        Assume.assumeNoException(e);
    } catch (javax.naming.NameNotFoundException e) {
        Assume.assumeNoException(e);
    }
}
Also used : JndiRecordFetcher(io.grpc.internal.JndiResourceResolverFactory.JndiRecordFetcher) RecordFetcher(io.grpc.internal.JndiResourceResolverFactory.RecordFetcher) JndiRecordFetcher(io.grpc.internal.JndiResourceResolverFactory.JndiRecordFetcher) IgnoreJRERequirement(org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement) Test(org.junit.Test)

Aggregations

JndiRecordFetcher (io.grpc.internal.JndiResourceResolverFactory.JndiRecordFetcher)1 RecordFetcher (io.grpc.internal.JndiResourceResolverFactory.RecordFetcher)1 IgnoreJRERequirement (org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement)1 Test (org.junit.Test)1