use of io.grpc.InternalChannelz.RootChannelList in project grpc-java by grpc.
the class InternalChannelzTest method getRootChannels_onePage.
@Test
public void getRootChannels_onePage() {
InternalInstrumented<ChannelStats> root1 = create();
channelz.addRootChannel(root1);
RootChannelList page = channelz.getRootChannels(/*fromId=*/
0, /*maxPageSize=*/
1);
assertTrue(page.end);
assertThat(page.channels).containsExactly(root1);
}
use of io.grpc.InternalChannelz.RootChannelList in project grpc-java by grpc.
the class InternalChannelzTest method getRootChannels_onePage_multi.
@Test
public void getRootChannels_onePage_multi() {
InternalInstrumented<ChannelStats> root1 = create();
InternalInstrumented<ChannelStats> root2 = create();
channelz.addRootChannel(root1);
channelz.addRootChannel(root2);
RootChannelList page = channelz.getRootChannels(/*fromId=*/
0, /*maxPageSize=*/
2);
assertTrue(page.end);
assertThat(page.channels).containsExactly(root1, root2);
}
use of io.grpc.InternalChannelz.RootChannelList in project grpc-java by grpc.
the class InternalChannelzTest method getRootChannels_empty.
@Test
public void getRootChannels_empty() {
RootChannelList rootChannels = channelz.getRootChannels(/*fromId=*/
0, /*maxPageSize=*/
1);
assertTrue(rootChannels.end);
assertThat(rootChannels.channels).isEmpty();
}
use of io.grpc.InternalChannelz.RootChannelList in project grpc-java by grpc.
the class InternalChannelzTest method getRootChannels_remove.
@Test
public void getRootChannels_remove() {
InternalInstrumented<ChannelStats> root1 = create();
channelz.addRootChannel(root1);
channelz.removeRootChannel(root1);
RootChannelList page = channelz.getRootChannels(/*fromId=*/
0, /*maxPageSize=*/
1);
assertTrue(page.end);
assertThat(page.channels).isEmpty();
}
use of io.grpc.InternalChannelz.RootChannelList in project grpc-java by grpc.
the class InternalChannelzTest method getRootChannels_paginate.
@Test
public void getRootChannels_paginate() {
InternalInstrumented<ChannelStats> root1 = create();
InternalInstrumented<ChannelStats> root2 = create();
channelz.addRootChannel(root1);
channelz.addRootChannel(root2);
RootChannelList page1 = channelz.getRootChannels(/*fromId=*/
0, /*maxPageSize=*/
1);
assertFalse(page1.end);
assertThat(page1.channels).containsExactly(root1);
RootChannelList page2 = channelz.getRootChannels(/*fromId=*/
id(root1) + 1, /*maxPageSize=*/
1);
assertTrue(page2.end);
assertThat(page2.channels).containsExactly(root2);
}
Aggregations