Search in sources :

Example 6 with TestChannel

use of io.grpc.protobuf.services.ChannelzTestHelper.TestChannel in project grpc-java by grpc.

the class ChannelzProtoUtilTest method toSubchannel_subchannelChildren.

@Test
public void toSubchannel_subchannelChildren() throws Exception {
    TestChannel subchannel1 = new TestChannel();
    subchannel.stats = toBuilder(subchannel.stats).setSubchannels(ImmutableList.<InternalWithLogId>of(subchannel1)).build();
    assertEquals(subchannelProto.toBuilder().addSubchannelRef(ChannelzProtoUtil.toSubchannelRef(subchannel1)).build(), ChannelzProtoUtil.toSubchannel(subchannel));
    TestChannel subchannel2 = new TestChannel();
    subchannel.stats = toBuilder(subchannel.stats).setSubchannels(ImmutableList.<InternalWithLogId>of(subchannel1, subchannel2)).build();
    assertEquals(subchannelProto.toBuilder().addSubchannelRef(ChannelzProtoUtil.toSubchannelRef(subchannel1)).addSubchannelRef(ChannelzProtoUtil.toSubchannelRef(subchannel2)).build(), ChannelzProtoUtil.toSubchannel(subchannel));
}
Also used : TestChannel(io.grpc.protobuf.services.ChannelzTestHelper.TestChannel) Test(org.junit.Test)

Aggregations

TestChannel (io.grpc.protobuf.services.ChannelzTestHelper.TestChannel)6 Test (org.junit.Test)6 ChannelStats (io.grpc.InternalChannelz.ChannelStats)1 RootChannelList (io.grpc.InternalChannelz.RootChannelList)1