Package com.github.restdriver.clientdriver

Examples of com.github.restdriver.clientdriver.ClientDriver.shutdown()


       
        HttpClient client = new DefaultHttpClient();
        HttpGet getter = new HttpGet(driver.getBaseUrl() + "/request");
        client.execute(getter);
       
        driver.shutdown();
       
    }
   
    @Test
    public void specifyingNumberOfTimesForExpectationExpectsItThatNumberOfTimes() throws Exception {
View Full Code Here


       
        HttpGet getter = new HttpGet(driver.getBaseUrl() + "/request");
        new DefaultHttpClient().execute(getter);
        new DefaultHttpClient().execute(getter);
       
        driver.shutdown();
       
    }
   
    @Test
    public void specifyingNumberOfTimesForExpectationAndNotRequestingCorrectNumberOfTimesFails() throws Exception {
View Full Code Here

        HttpGet getter = new HttpGet(driver.getBaseUrl() + "/request");
        new DefaultHttpClient().execute(getter);
        new DefaultHttpClient().execute(getter);
        new DefaultHttpClient().execute(getter);
       
        driver.shutdown();
       
    }
   
    @Test
    public void specifyingNumberOfTimesFailureHasDecentMessage() throws Exception {
View Full Code Here

        driver.addExpectation(onRequestTo("/request"), giveEmptyResponse()).times(2);
       
        HttpGet getter = new HttpGet(driver.getBaseUrl() + "/request");
        new DefaultHttpClient().execute(getter);
       
        driver.shutdown();
       
    }
   
    @Test
    public void specifyingAnyTimesForExpectationWorks() throws Exception {
View Full Code Here

        HttpGet getter = new HttpGet(driver.getBaseUrl() + "/request");
        new DefaultHttpClient().execute(getter);
        new DefaultHttpClient().execute(getter);
        new DefaultHttpClient().execute(getter);
       
        driver.shutdown();
       
    }
   
    @Test
    public void specifyingAnyTimesForExpectationAnyNotCallingItWorks() throws Exception {
View Full Code Here

    public void specifyingAnyTimesForExpectationAnyNotCallingItWorks() throws Exception {
       
        ClientDriver driver = new ClientDriverFactory().createClientDriver();
        driver.addExpectation(onRequestTo("/request"), giveEmptyResponse()).anyTimes();
       
        driver.shutdown();
       
    }
   
    @Test
    public void specifyingAnyTimesBeforeOtherExpectationsConsidersLaterExpectationsCorrectly() throws Exception {
View Full Code Here

       
        ClientDriver driver = new ClientDriverFactory().createClientDriver();
        driver.addExpectation(onRequestTo("/anytimes"), giveEmptyResponse()).anyTimes();
        driver.addExpectation(onRequestTo("/one"), giveEmptyResponse());
       
        driver.shutdown();
       
    }
   
}
View Full Code Here

       
        client.execute(getter);
       
        // Nothing to assert here without relying on system clock and having a long running test :(
       
        driver.shutdown();
    }
   
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.