Package therandomhomepage.lookup.client

Examples of therandomhomepage.lookup.client.GDataRequest


* Time: 3:40:06 PM
*/
public class GDataRequest_UT extends TheRandomHomepageAbstract_UT {

    public void testInit() {
        GDataRequest request = new GDataRequest("test");
        assertNotNull(request);
    }
View Full Code Here


        assertNotNull(request);
    }

    public void testInvalidURL() {
        try {
            new GDataRequest("");
        } catch (IllegalArgumentException e) {
            assertEquals("url can not be empty", e.getMessage());
        }
    }
View Full Code Here

        }
    }

    public void testNullURL() {
        try {
            new GDataRequest(null);
        } catch (NullPointerException e) {
            assertEquals("url can not be null", e.getMessage());
        }
    }
View Full Code Here

        }
    }

    public void testInvalidMethod() {
        try {
            new GDataRequest("", "asdasd");
        } catch (IllegalArgumentException e) {
            assertEquals("httpMethod can not be empty", e.getMessage());
        }
    }
View Full Code Here

        }
    }

    public void testNullMethod() {
        try {
            new GDataRequest(null,"ajdkasd");
        } catch (NullPointerException e) {
            assertEquals("httpMethod can not be null", e.getMessage());
        }
    }
View Full Code Here

            assertEquals("httpMethod can not be null", e.getMessage());
        }
    }

    public void testSendAsyncGetRequest() throws Exception{
        GDataRequest gdataRequest = new GDataRequest("http://www.therandomhomepage.com");
       
        Request sentRequest = gdataRequest.sendGetRequest(new RequestCallback(){

            public void onResponseReceived(Request request, Response response) {
                assertTrue(!request.isPending());
                System.out.println("response = " + response.getText());
                finishTest();
View Full Code Here

        assertTrue(sentRequest.isPending());
        delayTestFinish(1000 * 60);
    }

    public void testSendSyncGetRequest() throws Exception{
        GDataRequest gdataRequest = new GDataRequest("http://www.therandomhomepage.com");

        final MyRequestCallback requestCallback = new MyRequestCallback();
        Request sentRequest = gdataRequest.sendGetRequest(requestCallback);

        Timer timer = new Timer(){

            public void run() {
                System.out.println("requestCallback.isRequestComplete() = " + requestCallback.isRequestComplete());
View Full Code Here

TOP

Related Classes of therandomhomepage.lookup.client.GDataRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.