@Test
public void testExplicitPropertyMappings()
{
Map<String, String> properties = new ImmutableMap.Builder<String, String>()
.put("thrift.client.transport", "HEADER")
.put("thrift.client.protocol", "COMPACT")
.put("thrift.client.connect-timeout", "99ms")
.put("thrift.client.request-timeout", "33m")
.put("thrift.client.socks-proxy", "localhost:11")
.put("thrift.client.max-frame-size", "55MB")
.put("thrift.client.max-string-size", "66MB")
.put("thrift.client.ssl.enabled", "true")
.put("thrift.client.ssl.trust-certificate", "trust")
.put("thrift.client.ssl.key", "key")
.put("thrift.client.ssl.key-password", "key_password")
.build();
ApacheThriftClientConfig expected = new ApacheThriftClientConfig()
.setTransport(HEADER)
.setProtocol(COMPACT)
.setConnectTimeout(new Duration(99, MILLISECONDS))
.setRequestTimeout(new Duration(33, MINUTES))
.setSocksProxy(HostAndPort.fromParts("localhost", 11))
.setMaxFrameSize(new DataSize(55, MEGABYTE))
.setMaxStringSize(new DataSize(66, MEGABYTE))
.setSslEnabled(true)
.setTrustCertificate(new File("trust"))
.setKey(new File("key"))
.setKeyPassword("key_password");
assertFullMapping(properties, expected);
}
TestApacheThriftClientConfig.java 文件源码
java
阅读 26
收藏 0
点赞 0
评论 0
项目:drift
作者:
评论列表
文章目录