use of com.google.cloud.storage.testing.RemoteStorageHelper in project google-cloud-java by GoogleCloudPlatform.
the class ITBigQueryTest method beforeClass.
@BeforeClass
public static void beforeClass() throws InterruptedException, TimeoutException {
RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create();
RemoteStorageHelper storageHelper = RemoteStorageHelper.create();
bigquery = bigqueryHelper.getOptions().getService();
storage = storageHelper.getOptions().getService();
storage.create(BucketInfo.of(BUCKET));
storage.create(BlobInfo.newBuilder(BUCKET, LOAD_FILE).setContentType("text/plain").build(), CSV_CONTENT.getBytes(StandardCharsets.UTF_8));
storage.create(BlobInfo.newBuilder(BUCKET, JSON_LOAD_FILE).setContentType("application/json").build(), JSON_CONTENT.getBytes(StandardCharsets.UTF_8));
DatasetInfo info = DatasetInfo.newBuilder(DATASET).setDescription(DESCRIPTION).setLabels(LABELS).build();
bigquery.create(info);
LoadJobConfiguration configuration = LoadJobConfiguration.newBuilder(TABLE_ID, "gs://" + BUCKET + "/" + JSON_LOAD_FILE, FormatOptions.json()).setCreateDisposition(JobInfo.CreateDisposition.CREATE_IF_NEEDED).setSchema(TABLE_SCHEMA).build();
Job job = bigquery.create(JobInfo.of(configuration));
job = job.waitFor();
assertNull(job.getStatus().getError());
}
use of com.google.cloud.storage.testing.RemoteStorageHelper in project google-cloud-java by GoogleCloudPlatform.
the class ITBucketSnippets method beforeClass.
@BeforeClass
public static void beforeClass() {
RemoteStorageHelper helper = RemoteStorageHelper.create();
storage = helper.getOptions().getService();
bucketSnippets = new BucketSnippets(storage.create(BucketInfo.of(BUCKET)));
}
use of com.google.cloud.storage.testing.RemoteStorageHelper in project google-cloud-java by GoogleCloudPlatform.
the class ITBlobSnippets method beforeClass.
@BeforeClass
public static void beforeClass() {
RemoteStorageHelper helper = RemoteStorageHelper.create();
storage = helper.getOptions().getService();
storage.create(BucketInfo.of(BUCKET));
storage.create(BlobInfo.newBuilder(BUCKET, BLOB).build(), CONTENT);
}
use of com.google.cloud.storage.testing.RemoteStorageHelper in project google-cloud-java by GoogleCloudPlatform.
the class ITStorageHmacKeySnippets method beforeClass.
@BeforeClass
public static void beforeClass() {
RemoteStorageHelper helper = RemoteStorageHelper.create();
storage = helper.getOptions().getService();
storageSnippets = new StorageSnippets(storage);
}
use of com.google.cloud.storage.testing.RemoteStorageHelper in project google-cloud-java by GoogleCloudPlatform.
the class ITGcsNio method beforeClass.
@BeforeClass
public static void beforeClass() throws IOException {
// loads the credentials from local disk as par README
RemoteStorageHelper gcsHelper = RemoteStorageHelper.create();
storageOptions = gcsHelper.getOptions();
storage = storageOptions.getService();
// create and populate test bucket
storage.create(BucketInfo.of(BUCKET));
fillFile(storage, SML_FILE, SML_SIZE);
fillFile(storage, BIG_FILE, BIG_SIZE);
}
Aggregations