ProtocolVersionSupportTest.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:simulacron 作者:
public void testProtocolVersionForCassandraVersion(
    String cassandraVersion, Integer... expectedProtocolVersions) {
  BoundCluster cluster = new BoundCluster(ClusterSpec.builder().build(), 0L, null);
  BoundDataCenter dc = new BoundDataCenter(cluster);
  BoundNode node =
      new BoundNode(
          new LocalAddress(UUID.randomUUID().toString()),
          NodeSpec.builder()
              .withName("node0")
              .withId(0L)
              .withCassandraVersion(cassandraVersion)
              .build(),
          Collections.emptyMap(),
          cluster,
          dc,
          null,
          timer,
          null, // channel reference only needed for closing, not useful in context of this test.
          false);

  assertThat(node.getFrameCodec().getSupportedProtocolVersions())
      .containsOnly(expectedProtocolVersions);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号