Java Code Examples for com.google.api.client.googleapis.GoogleUtils#VERSION

The following examples show how to use com.google.api.client.googleapis.GoogleUtils#VERSION . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractGoogleClientRequestTest.java    From google-api-java-client with Apache License 2.0 5 votes vote down vote up
public void testUserAgentSuffix() throws Exception {
  AssertUserAgentTransport transport = new AssertUserAgentTransport();
  // Specify an Application Name.
  String applicationName = "Test Application";
  transport.expectedUserAgent = applicationName + " "
      + "Google-API-Java-Client/" + GoogleUtils.VERSION + " "
      + HttpRequest.USER_AGENT_SUFFIX;
  MockGoogleClient client = new MockGoogleClient.Builder(
      transport, ROOT_URL, SERVICE_PATH, JSON_OBJECT_PARSER, null).setApplicationName(
          applicationName).build();
  MockGoogleClientRequest<Void> request =
      new MockGoogleClientRequest<Void>(client, HttpMethods.GET, URI_TEMPLATE, null, Void.class);
  request.executeUnparsed();
}
 
Example 2
Source File: AbstractGoogleClientRequestTest.java    From google-api-java-client with Apache License 2.0 5 votes vote down vote up
public void testUserAgent() throws IOException {
  AssertUserAgentTransport transport = new AssertUserAgentTransport();
  transport.expectedUserAgent = "Google-API-Java-Client/" + GoogleUtils.VERSION + " "
      + HttpRequest.USER_AGENT_SUFFIX;
  // Don't specify an Application Name.
  MockGoogleClient client = new MockGoogleClient.Builder(
      transport, ROOT_URL, SERVICE_PATH, JSON_OBJECT_PARSER, null).build();
  MockGoogleClientRequest<Void> request =
      new MockGoogleClientRequest<>(client, HttpMethods.GET, URI_TEMPLATE, null, Void.class);
  request.executeUnparsed();
}
 
Example 3
Source File: AbstractGoogleClientRequest.java    From google-api-java-client with Apache License 2.0 4 votes vote down vote up
ApiClientVersion() {
  this(getJavaVersion(), OS_NAME.value(), OS_VERSION.value(), GoogleUtils.VERSION);
}