本文整理汇总了Java中org.apache.http.impl.conn.DefaultRoutePlanner类的典型用法代码示例。如果您正苦于以下问题:Java DefaultRoutePlanner类的具体用法?Java DefaultRoutePlanner怎么用?Java DefaultRoutePlanner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DefaultRoutePlanner类属于org.apache.http.impl.conn包,在下文中一共展示了DefaultRoutePlanner类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testHost
import org.apache.http.impl.conn.DefaultRoutePlanner; //导入依赖的package包/类
public void testHost() {
HttpClient client = new HttpClientConfigurator().host("bob").getClient();
DefaultRoutePlanner routePlanner = getRoutePlanner(client);
assertThat(routePlanner).isInstanceOf(HttpClientConfigurator.DefaultHostRoutePlanner.class);
assertEquals(((HttpClientConfigurator.DefaultHostRoutePlanner)
routePlanner).getDefaultHost().getHostName(), "bob", "Unexpected host.");
}
开发者ID:alancnet,项目名称:artifactory,代码行数:8,代码来源:HttpClientConfiguratorTest.java
示例2: initITTest
import org.apache.http.impl.conn.DefaultRoutePlanner; //导入依赖的package包/类
/**
* Initilisation procedure for this test case.
*
* @throws UnableToBuildSolRDFClientException in case the client cannot be built.
* @throws Exception in case of Solr startup failure.
*/
@BeforeClass
public static void initITTest() {
System.setProperty("tests.asserts", "false");
System.setProperty("jetty.port", "8080");
System.setProperty("solr.core.name", "store");
System.setProperty("solr.data.dir", initCoreDataDir.getAbsolutePath());
try {
SOLR = createJetty(
"target/solrdf-integration-tests-1.1-dev/solrdf",
JettyConfig.builder()
.setPort(8080)
.setContext("/solr")
.stopAtShutdown(true)
.build());
final HttpClient httpClient = HttpClientBuilder.create()
.setRoutePlanner(
new DefaultRoutePlanner(
new SchemePortResolver() {
@Override
public int resolve(final HttpHost host) throws UnsupportedSchemeException {
return SOLR.getLocalPort();
}
})).build();
SOLRDF_CLIENT = SolRDF.newBuilder()
.withEndpoint("http://127.0.0.1:8080/solr/store")
.withGraphStoreProtocolEndpointPath("/rdf-graph-store")
.withHttpClient(httpClient)
.withSPARQLEndpointPath("/sparql")
.build();
PLAIN_SOLR_CLIENT = new HttpSolrClient(SOLR_URI);
} catch (final Exception exception) {
throw new RuntimeException(exception);
}
}
开发者ID:spaziocodice,项目名称:SolRDF,代码行数:46,代码来源:IntegrationTestSupertypeLayer.java
示例3: getRoutePlanner
import org.apache.http.impl.conn.DefaultRoutePlanner; //导入依赖的package包/类
private DefaultRoutePlanner getRoutePlanner(HttpClient client) {
return TestUtils.getField(client, "routePlanner", DefaultRoutePlanner.class);
}
开发者ID:alancnet,项目名称:artifactory,代码行数:4,代码来源:HttpClientConfiguratorTest.java
注:本文中的org.apache.http.impl.conn.DefaultRoutePlanner类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论