aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/com/android/volley/RequestTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/com/android/volley/RequestTest.java')
-rw-r--r--src/test/java/com/android/volley/RequestTest.java25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/test/java/com/android/volley/RequestTest.java b/src/test/java/com/android/volley/RequestTest.java
index d5beca5..e2dd655 100644
--- a/src/test/java/com/android/volley/RequestTest.java
+++ b/src/test/java/com/android/volley/RequestTest.java
@@ -16,17 +16,20 @@
package com.android.volley;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
import com.android.volley.Request.Priority;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
-import static org.junit.Assert.*;
-
@RunWith(RobolectricTestRunner.class)
public class RequestTest {
-
- @Test public void compareTo() {
+
+ @Test
+ public void compareTo() {
int sequence = 0;
TestRequest low = new TestRequest(Priority.LOW);
low.setSequence(sequence++);
@@ -45,8 +48,9 @@ public class RequestTest {
assertTrue(immediate.compareTo(high) < 0);
}
- private class TestRequest extends Request<Object> {
+ private static class TestRequest extends Request<Object> {
private Priority mPriority = Priority.NORMAL;
+
public TestRequest(Priority priority) {
super(Request.Method.GET, "", null);
mPriority = priority;
@@ -58,8 +62,7 @@ public class RequestTest {
}
@Override
- protected void deliverResponse(Object response) {
- }
+ protected void deliverResponse(Object response) {}
@Override
protected Response<Object> parseNetworkResponse(NetworkResponse response) {
@@ -67,7 +70,8 @@ public class RequestTest {
}
}
- @Test public void urlParsing() {
+ @Test
+ public void urlParsing() {
UrlParseRequest nullUrl = new UrlParseRequest(null);
assertEquals(0, nullUrl.getTrafficStatsTag());
UrlParseRequest emptyUrl = new UrlParseRequest("");
@@ -80,14 +84,13 @@ public class RequestTest {
assertFalse(0 == goodProtocol.getTrafficStatsTag());
}
- private class UrlParseRequest extends Request<Object> {
+ private static class UrlParseRequest extends Request<Object> {
public UrlParseRequest(String url) {
super(Request.Method.GET, url, null);
}
@Override
- protected void deliverResponse(Object response) {
- }
+ protected void deliverResponse(Object response) {}
@Override
protected Response<Object> parseNetworkResponse(NetworkResponse response) {