Skip to content

Commit

Permalink
Fully import ProgressCallback
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsawicki committed Jan 5, 2014
1 parent 89b9a15 commit a0b1bd6
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import static org.junit.Assert.fail;
import com.github.kevinsawicki.http.HttpRequest.HttpRequestException;
import com.github.kevinsawicki.http.HttpRequest.ConnectionFactory;
import com.github.kevinsawicki.http.HttpRequest.ProgressCallback;

import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
Expand Down Expand Up @@ -3479,7 +3480,7 @@ public void handle(Request request, HttpServletResponse response) {
new FileWriter(file).append("hello").close();

final AtomicInteger tx = new AtomicInteger(0);
HttpRequest.ProgressCallback progress = new HttpRequest.ProgressCallback() {
ProgressCallback progress = new ProgressCallback() {
public void onProgress(int transferred, int total) {
assertEquals(file.length(), total);
assertEquals(tx.incrementAndGet(), transferred);
Expand Down Expand Up @@ -3509,7 +3510,7 @@ public void handle(Request request, HttpServletResponse response) {
new FileWriter(file).append("hello").close();
InputStream input = new FileInputStream(file);
final AtomicInteger tx = new AtomicInteger(0);
HttpRequest.ProgressCallback progress = new HttpRequest.ProgressCallback() {
ProgressCallback progress = new ProgressCallback() {
public void onProgress(int transferred, int total) {
assertEquals(0, total);
assertEquals(tx.incrementAndGet(), transferred);
Expand Down Expand Up @@ -3537,7 +3538,7 @@ public void handle(Request request, HttpServletResponse response) {
};

final AtomicInteger tx = new AtomicInteger(0);
HttpRequest.ProgressCallback progress = new HttpRequest.ProgressCallback() {
ProgressCallback progress = new ProgressCallback() {
public void onProgress(int transferred, int total) {
assertEquals(-1, total);
assertEquals(tx.incrementAndGet(), transferred);
Expand Down Expand Up @@ -3568,7 +3569,7 @@ public void handle(Request request, HttpServletResponse response) {
}
}
};
HttpRequest.ProgressCallback progress = new HttpRequest.ProgressCallback() {
ProgressCallback progress = new ProgressCallback() {
int tx = 1;

public void onProgress(int transferred, int total) {
Expand Down

0 comments on commit a0b1bd6

Please sign in to comment.