类 DelegatingWebConnection
java.lang.Object
cn.taketoday.test.web.servlet.htmlunit.DelegatingWebConnection
- 所有已实现的接口:
AutoCloseable,org.htmlunit.WebConnection
Implementation of
WebConnection that allows delegating to various
WebConnection implementations.
For example, if you host your JavaScript on the domain code.jquery.com,
you might want to use the following.
WebClient webClient = new WebClient();
MockMvc mockMvc = ...
MockMvcWebConnection mockConnection = new MockMvcWebConnection(mockMvc, webClient);
WebRequestMatcher cdnMatcher = new UrlRegexRequestMatcher(".*?//code.jquery.com/.*");
WebConnection httpConnection = new HttpWebConnection(webClient);
WebConnection webConnection = new DelegatingWebConnection(mockConnection, new DelegateWebConnection(cdnMatcher, httpConnection));
webClient.setWebConnection(webConnection);
WebClient webClient = new WebClient();
webClient.setWebConnection(webConnection);
- 从以下版本开始:
- 4.0
- 作者:
- Rob Winch, Sam Brannen
-
嵌套类概要
嵌套类修饰符和类型类说明static final classThe delegate web connection. -
字段概要
字段修饰符和类型字段说明private final List<DelegatingWebConnection.DelegateWebConnection>private final org.htmlunit.WebConnection -
构造器概要
构造器构造器说明DelegatingWebConnection(org.htmlunit.WebConnection defaultConnection, DelegatingWebConnection.DelegateWebConnection... connections) DelegatingWebConnection(org.htmlunit.WebConnection defaultConnection, List<DelegatingWebConnection.DelegateWebConnection> connections) -
方法概要
-
字段详细资料
-
connections
-
defaultConnection
private final org.htmlunit.WebConnection defaultConnection
-
-
构造器详细资料
-
DelegatingWebConnection
public DelegatingWebConnection(org.htmlunit.WebConnection defaultConnection, List<DelegatingWebConnection.DelegateWebConnection> connections) -
DelegatingWebConnection
public DelegatingWebConnection(org.htmlunit.WebConnection defaultConnection, DelegatingWebConnection.DelegateWebConnection... connections)
-
-
方法详细资料
-
getResponse
- 指定者:
getResponse在接口中org.htmlunit.WebConnection- 抛出:
IOException
-
close
public void close()- 指定者:
close在接口中AutoCloseable- 指定者:
close在接口中org.htmlunit.WebConnection
-