|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
TestableWebConnection.java | - | 75% | 75% | 75% |
|
1 |
package com.diasparsoftware.htmlunitx;
|
|
2 |
|
|
3 |
import java.io.IOException;
|
|
4 |
import java.net.URL;
|
|
5 |
import java.util.*;
|
|
6 |
|
|
7 |
import org.apache.commons.httpclient.HttpState;
|
|
8 |
|
|
9 |
import com.gargoylesoftware.htmlunit.*;
|
|
10 |
|
|
11 |
public class TestableWebConnection extends WebConnection { |
|
12 |
private Map responses = new HashMap(); |
|
13 |
|
|
14 | 44 |
public TestableWebConnection(WebClient client) {
|
15 | 44 |
super(client);
|
16 |
} |
|
17 |
|
|
18 | 66 |
public WebResponse getResponse(URL url,
|
19 |
SubmitMethod submitMethod, List parameters, |
|
20 |
Map requestHeaders) throws IOException {
|
|
21 |
|
|
22 | 66 |
return (WebResponse) responses.get(url);
|
23 |
} |
|
24 |
|
|
25 | 44 |
public void setResponse(WebResponse response) { |
26 | 44 |
responses.put(response.getUrl(), response); |
27 |
} |
|
28 |
|
|
29 | 0 |
public HttpState getStateForUrl(URL url) {
|
30 | 0 |
return new HttpState(); |
31 |
} |
|
32 |
|
|
33 |
} |
|