Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
21478 rajender 1
/*
2
 * Copyright (C) 2015 The Android Open Source Project
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *      http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
 
17
package com.android.volley.toolbox;
18
 
19
import com.android.volley.Cache;
20
import com.android.volley.NetworkResponse;
21
import com.android.volley.Request;
22
import com.android.volley.RequestQueue;
23
import com.android.volley.Response;
24
import com.android.volley.RetryPolicy;
25
import com.android.volley.VolleyError;
26
 
27
import org.junit.Test;
28
import org.junit.runner.RunWith;
29
import org.robolectric.RobolectricTestRunner;
30
 
31
import static org.junit.Assert.assertNotNull;
32
 
33
@RunWith(RobolectricTestRunner.class)
34
public class RequestTest {
35
 
36
    @Test
37
    public void publicMethods() throws Exception {
38
        // Catch-all test to find API-breaking changes.
39
        assertNotNull(Request.class.getConstructor(int.class, String.class,
40
                Response.ErrorListener.class));
41
 
42
        assertNotNull(Request.class.getMethod("getMethod"));
43
        assertNotNull(Request.class.getMethod("setTag", Object.class));
44
        assertNotNull(Request.class.getMethod("getTag"));
45
        assertNotNull(Request.class.getMethod("getErrorListener"));
46
        assertNotNull(Request.class.getMethod("getTrafficStatsTag"));
47
        assertNotNull(Request.class.getMethod("setRetryPolicy", RetryPolicy.class));
48
        assertNotNull(Request.class.getMethod("addMarker", String.class));
49
        assertNotNull(Request.class.getDeclaredMethod("finish", String.class));
50
        assertNotNull(Request.class.getMethod("setRequestQueue", RequestQueue.class));
51
        assertNotNull(Request.class.getMethod("setSequence", int.class));
52
        assertNotNull(Request.class.getMethod("getSequence"));
53
        assertNotNull(Request.class.getMethod("getUrl"));
54
        assertNotNull(Request.class.getMethod("getCacheKey"));
55
        assertNotNull(Request.class.getMethod("setCacheEntry", Cache.Entry.class));
56
        assertNotNull(Request.class.getMethod("getCacheEntry"));
57
        assertNotNull(Request.class.getMethod("cancel"));
58
        assertNotNull(Request.class.getMethod("isCanceled"));
59
        assertNotNull(Request.class.getMethod("getHeaders"));
60
        assertNotNull(Request.class.getDeclaredMethod("getParams"));
61
        assertNotNull(Request.class.getDeclaredMethod("getParamsEncoding"));
62
        assertNotNull(Request.class.getMethod("getBodyContentType"));
63
        assertNotNull(Request.class.getMethod("getBody"));
64
        assertNotNull(Request.class.getMethod("setShouldCache", boolean.class));
65
        assertNotNull(Request.class.getMethod("shouldCache"));
66
        assertNotNull(Request.class.getMethod("getPriority"));
67
        assertNotNull(Request.class.getMethod("getTimeoutMs"));
68
        assertNotNull(Request.class.getMethod("getRetryPolicy"));
69
        assertNotNull(Request.class.getMethod("markDelivered"));
70
        assertNotNull(Request.class.getMethod("hasHadResponseDelivered"));
71
        assertNotNull(Request.class.getDeclaredMethod("parseNetworkResponse", NetworkResponse.class));
72
        assertNotNull(Request.class.getDeclaredMethod("parseNetworkError", VolleyError.class));
73
        assertNotNull(Request.class.getDeclaredMethod("deliverResponse", Object.class));
74
        assertNotNull(Request.class.getMethod("deliverError", VolleyError.class));
75
    }
76
}