Examples of HTTPTransport


Examples of com.google.api.client.http.HttpTransport

    assertNull(ge.getDetails());
    assertEquals("403", ge.getMessage());
  }

  public void testFrom_errorEmptyContentButWithJsonContentType() throws Exception {
    HttpTransport transport = new ErrorTransport(null, Json.MEDIA_TYPE);
      HttpRequest request =
        transport.createRequestFactory().buildGetRequest(HttpTesting.SIMPLE_GENERIC_URL);
    request.setThrowExceptionOnExecuteError(false);
    HttpResponse response = request.execute();
    GoogleJsonResponseException ge =
        GoogleJsonResponseException.from(GoogleJsonErrorTest.FACTORY, response);
    assertNull(ge.getDetails());
View Full Code Here

Examples of com.google.api.client.http.HttpTransport

    MockAppIdentityService appIdentity = new MockAppIdentityService();
    appIdentity.setAccessTokenText(expectedAccessToken);
    AppIdentityCredential.Builder builder = new AppIdentityCredential.Builder(SCOPES);
    builder.setAppIdentityService(appIdentity);
    AppIdentityCredential appCredential = builder.build();
    HttpTransport transport = new MockHttpTransport();
    HttpRequest request = transport.createRequestFactory().buildRequest(
        "get", null, null);

    appCredential.intercept(request);

    assertEquals(appIdentity.getGetAccessTokenCallCount(), 1);
View Full Code Here

Examples of com.google.api.client.http.HttpTransport

  public void testAppEngineCredentialWrapper() throws IOException {
    final String expectedAccessToken = "ExpectedAccessToken";
    final Collection<String> emptyScopes = Collections.emptyList();

    HttpTransport transport = new MockHttpTransport();
    JsonFactory jsonFactory = new JacksonFactory();

    MockAppIdentityService appIdentity = new MockAppIdentityService();
    appIdentity.setAccessTokenText(expectedAccessToken);

    AppIdentityCredential.Builder builder = new AppIdentityCredential.Builder(emptyScopes);
    builder.setAppIdentityService(appIdentity);
    AppIdentityCredential appCredential = builder.build();

    GoogleCredential wrapper = new
        AppIdentityCredential.AppEngineCredentialWrapper(appCredential, transport, jsonFactory);

    HttpRequest request = transport.createRequestFactory().buildRequest("get", null, null);

    assertTrue(wrapper.createScopedRequired());
    try {
      wrapper.intercept(request);
      fail("Should not be able to use credential without scopes.");
View Full Code Here

Examples of com.google.api.client.http.HttpTransport

    } catch (NullPointerException expected) {
    }
  }

  public void testAppEngineCredentialWrapperNullJsonFactoryThrows() throws IOException {
    HttpTransport transport = new MockHttpTransport();
    try {
      new AppIdentityCredential.AppEngineCredentialWrapper(transport, null);
      fail();
    } catch (NullPointerException expected) {
    }
View Full Code Here

Examples of com.google.api.client.http.HttpTransport

   * @param usePersistedCredentials whether or not to persist the credentials
   * @return a GoogleAuthorizationCodeFlow
   */
  protected GoogleAuthorizationCodeFlow getAuthorizationCodeFlow(boolean usePersistedCredentials)
      throws IOException {
    HttpTransport httpTransport = new NetHttpTransport();
    JsonFactory jsonFactory = new JacksonFactory();
    Collection<String> scopes = Arrays.asList(OAUTH2_SCOPE);
    GoogleClientSecrets clientSecrets = getClientSecrets();
    GoogleAuthorizationCodeFlow flow;
    if (usePersistedCredentials) {
View Full Code Here

Examples of com.google.api.client.http.HttpTransport

   * Use a Compute Engine credential for authentication. Overrides any
   * previously-provided credentials.
   */
  RemoteApiOptions useComputeEngineCredential() {
    try {
      HttpTransport transport = getOrCreateHttpTransportForOAuth();
      ComputeCredential credential = new ComputeCredential(transport, new JacksonFactory());
      credential.refreshToken();
      setOAuthCredential(credential);
    } catch (IOException|GeneralSecurityException e) {
      throw new RuntimeException("Failed to acquire Google Compute Engine credential.", e);
View Full Code Here

Examples of com.sun.faban.driver.HttpTransport

        for (int i = 0; i < n; i++) {
            threads[i] = new Thread(this);
            threads[i].setDaemon(true);
            threads[i].start();
        }
        globalTransport = new HttpTransport();
        pending = 0;
        runHelper = false;
    }
View Full Code Here

Examples of groovyx.remote.transport.http.HttpTransport

    CompilerConfiguration cc = new CompilerConfiguration();
    cc.setTargetDirectory(classesDir);
    this.shell = new GroovyShell(classLoader, binding, cc);

    HttpTransport transport = new HttpTransport(url.toExternalForm());

    // provide transport with custom class-loader which includes generated classes
    List<URL> urls = Lists.newArrayList();
    urls.add(classesDir.toURI().toURL());
    for (File dir : extraDirs) {
View Full Code Here

Examples of io.remotecontrol.transport.http.HttpTransport

      this.path = path;
    }

    @Override
    public Result send(CommandChain<?> commandChain) throws IOException {
      return new HttpTransport(applicationUnderTest.getAddress() + path).send(commandChain);
    }
View Full Code Here

Examples of org.apache.axis.transport.http.HTTPTransport

        }

      args = opts.getRemainingArgs();
      if ( args != null ) action = args[0];

      ServiceClient client = new ServiceClient(new HTTPTransport());
      client.set(HTTPTransport.URL, url);
      client.set(HTTPTransport.ACTION, action);

      Message        reqMsg      = new Message( msg );
      Message        resMsg     = null ;
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.