Examples of RequestBuilder


Examples of com.metamx.http.client.RequestBuilder

{
  @Test
  public void testRun() throws Exception
  {
    HttpClient httpClient = EasyMock.createMock(HttpClient.class);
    RequestBuilder requestBuilder = new RequestBuilder(httpClient, HttpMethod.POST, new URL("http://foo.com"));
    EasyMock.expect(httpClient.post(EasyMock.<URL>anyObject())).andReturn(requestBuilder).atLeastOnce();

    SettableFuture futureException = SettableFuture.create();

    SettableFuture<InputStream> futureResult = SettableFuture.create();
View Full Code Here

Examples of com.moesol.geoserver.sync.client.RequestBuilder

    FeatureCollectionType server = make(f("F1",162),f("F5",167),f("F4",169),f("F3",170),f("F2",157),f("F6",164));
   
    GeoserverClientSynchronizer synchronizer = new GeoserverClientSynchronizer(makeConfiguration(), "url", SimulatedRequestBuilder.POST_TEMPLATE);
    Map<Identifier, FeatureAccessor> clientMap = asMap(client);
   
    RequestBuilder builder = new SimulatedRequestBuilder(server);
    synchronizer.setRequestBuilder(builder);
    synchronizer.synchronize(clientMap);

    assertEquals(6, clientMap.size());
    assertEquals(0, synchronizer.getNumCreates());
View Full Code Here

Examples of com.ning.http.client.RequestBuilder

public class APIExceptionTest {

    @Test
    public void testGetMessage() throws Exception {
        final Request request = new RequestBuilder()
                .setUrl("http://user:password@localhost:1234/some/path?query=foo#fragment")
                .build();
        final APIException apiException = new APIException(request, (Response) null);

        final String message = apiException.getMessage();
View Full Code Here

Examples of com.tumblr.jumblr.request.RequestBuilder

    private RequestBuilder requestBuilder;
    private String apiKey;

    public JumblrClient() {
        this.requestBuilder = new RequestBuilder(this);
    }
View Full Code Here

Examples of fitnesse.http.RequestBuilder

  @Test
  public void testShutdownCalledFromServer() throws Exception {
    Thread thread = new Thread() {
      public void run() {
        try {
          RequestBuilder request = new RequestBuilder("/?responder=shutdown");
          ResponseParser.performHttpRequest("localhost", FitNesseUtil.PORT, request);
          doneShuttingDown = true;
        }
        catch (Exception e) {
          e.printStackTrace();
View Full Code Here

Examples of info.bliki.api.query.RequestBuilder

  public static void main(String[] args) {
    User user = new User("", "", "http://en.wikipedia.org/w/api.php");
    Connector connector = new Connector();
    user = connector.login(user);

    RequestBuilder request = OpenSearch.create().search("test").format("json");
    String jsonResponse = connector.sendXML(user, request);
    System.out.println(jsonResponse);
  }
View Full Code Here

Examples of org.apache.http.client.methods.RequestBuilder

    public void testBuildGETwithISO88591() throws Exception {
        assertBuild(Consts.ISO_8859_1);
    }

    private void assertBuild(final Charset charset) throws Exception {
        final RequestBuilder requestBuilder = RequestBuilder.create("GET").setCharset(charset);
        requestBuilder.setUri("https://somehost.com/stuff");
        requestBuilder.addParameters(createParameters());

        final String encodedData1 = URLEncoder.encode("\"1\u00aa position\"", charset.displayName());
        final String encodedData2 = URLEncoder.encode("Jos\u00e9 Abra\u00e3o", charset.displayName());

        final String uriExpected = String.format("https://somehost.com/stuff?parameter1=value1&parameter2=%s&parameter3=%s", encodedData1, encodedData2);

        final HttpUriRequest request = requestBuilder.build();
        Assert.assertEquals(uriExpected, request.getURI().toString());
    }
View Full Code Here

Examples of org.apache.sling.testing.tools.http.RequestBuilder

    public static final String JSON_KEY_DATA = "data";
    public static final String JSON_KEY_STATE = "state";
    public static final String CONSOLE_BUNDLES_PATH = "/system/console/bundles";
   
    public WebconsoleClient(String slingServerUrl, String username, String password) {
        this.builder = new RequestBuilder(slingServerUrl);
        this.executor = new RequestExecutor(new DefaultHttpClient());
        this.username = username;
        this.password = password;
    }
View Full Code Here

Examples of org.apache.sling.testing.tools.http.RequestBuilder

            serverPassword = configuredPassword;
        } else {
            serverPassword = ADMIN;
        }

        builder = new RequestBuilder(slingTestState.getServerBaseUrl());
        webconsoleClient = new WebconsoleClient(slingTestState.getServerBaseUrl(), serverUsername, serverPassword);
        builder = new RequestBuilder(slingTestState.getServerBaseUrl());
        bundlesInstaller = new BundlesInstaller(webconsoleClient);

        if(!slingTestState.isServerInfoLogged()) {
            log.info("Server base URL={}", slingTestState.getServerBaseUrl());
            slingTestState.setServerInfoLogged(true);
View Full Code Here

Examples of org.apache.sling.testing.tools.http.RequestBuilder

   
    public SlingClient(String slingServerUrl, String username, String password) {
        this.slingServerUrl = slingServerUrl;
        this.username = username;
        this.password = password;
        builder = new RequestBuilder(slingServerUrl);
        executor = new RequestExecutor(new DefaultHttpClient());
    }
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.