-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from GoogleCloudPlatform/cloud-storage-tests
Add tests for cloud storage cmdline sample.
- Loading branch information
Showing
7 changed files
with
150 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,4 @@ release.properties | |
dependency-reduced-pom.xml | ||
buildNumber.properties | ||
|
||
service-account.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
language: java | ||
jdk: | ||
- oraclejdk7 | ||
env: GOOGLE_APPLICATION_CREDENTIALS=$TRAVIS_BUILD_DIR/service-account.json | ||
before_install: | ||
- openssl aes-256-cbc -K $encrypted_99d8b304f94b_key -iv $encrypted_99d8b304f94b_iv -in service-account.json.enc -out service-account.json -d | ||
|
||
env: | ||
- TEST_DIR=unittests | ||
|
||
script: cd $TEST_DIR && mvn test | ||
script: mvn test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"projectId": "bigquery-devrel-samples", | ||
"datasetId": "test_dataset", | ||
"currentTableId": "test_table", | ||
"newTableId": "test_table2", | ||
"cloudStorageInputURI": "gs://bigquery-devrel-samples-bucket/data.csv", | ||
"cloudStorageOutputURI": "gs://bigquery-devrel-samples-bucket/output.csv", | ||
"projectId": "cloud-samples-tests", | ||
"datasetId": "test_dataset_java", | ||
"currentTableId": "test_table_java", | ||
"newTableId": "test_table_java_2", | ||
"cloudStorageInputURI": "gs://cloud-samples-tests/data.csv", | ||
"cloudStorageOutputURI": "gs://cloud-samples-tests/output.csv", | ||
"query": "SELECT corpus FROM publicdata:samples.shakespeare GROUP BY corpus;" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
cloud-storage/xml-api/cmdline-sample/src/test/java/StorageSampleTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
* Copyright 2015 Google Inc. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
// [START StorageSampleTest] | ||
|
||
import static com.jcabi.matchers.RegexMatchers.*; | ||
import static org.junit.Assert.assertThat; | ||
|
||
import org.junit.Test; | ||
|
||
import java.util.regex.Pattern; | ||
|
||
public class StorageSampleTest { | ||
@Test | ||
public void testListBucket() throws Exception { | ||
String listing = StorageSample.listBucket("cloud-samples-tests"); | ||
assertThat(listing, matchesPattern( | ||
".*<ListBucketResult.*" | ||
+ "<Name>cloud-samples-tests</Name>.*" | ||
+ "</ListBucketResult>.*")); | ||
} | ||
} | ||
|
||
// [END StorageSampleTest] |
Binary file not shown.