Java Code Examples for io.grpc.ConnectivityState#values()

The following examples show how to use io.grpc.ConnectivityState#values() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ChannelzProtoUtilTest.java    From grpc-nebula-java with Apache License 2.0 5 votes vote down vote up
@Test
public void toState() {
  for (ConnectivityState connectivityState : ConnectivityState.values()) {
    assertEquals(
        connectivityState.name(),
        ChannelzProtoUtil.toState(connectivityState).getValueDescriptor().getName());
  }
  assertEquals(State.UNKNOWN, ChannelzProtoUtil.toState(null));
}
 
Example 2
Source File: SubchannelStateManagerImplTest.java    From grpc-java with Apache License 2.0 5 votes vote down vote up
@Test
public void getAggregatedStatus_single() {
  for (ConnectivityState value : ConnectivityState.values()) {
    if (value == ConnectivityState.SHUTDOWN) {
      continue;
    }
    SubchannelStateManager stateManager = new SubchannelStateManagerImpl();

    stateManager.updateState("foo", value);

    assertThat(stateManager.getAggregatedState()).isEqualTo(value);
  }
}
 
Example 3
Source File: ChannelzProtoUtilTest.java    From grpc-java with Apache License 2.0 5 votes vote down vote up
@Test
public void toState() {
  for (ConnectivityState connectivityState : ConnectivityState.values()) {
    assertEquals(
        connectivityState.name(),
        ChannelzProtoUtil.toState(connectivityState).getValueDescriptor().getName());
  }
  assertEquals(State.UNKNOWN, ChannelzProtoUtil.toState(null));
}