|
| 1 | +/* |
| 2 | + * Copyright (c) 2015 Google Inc. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 5 | + * not use this file except in compliance with the License. You may obtain a |
| 6 | + * copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 12 | + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 13 | + * License for the specific language governing permissions and limitations under |
| 14 | + * the License. |
| 15 | + */ |
| 16 | + |
1 | 17 | package com.google.cloud.bigquery.samples.test;
|
2 | 18 |
|
3 | 19 | import com.google.cloud.bigquery.samples.BigqueryUtils;
|
4 | 20 | import com.google.gson.Gson;
|
5 | 21 | import com.google.gson.JsonIOException;
|
6 | 22 | import com.google.gson.JsonSyntaxException;
|
7 | 23 |
|
8 |
| -import java.io.*; |
9 |
| -import java.nio.file.Path; |
10 |
| -import java.nio.file.Paths; |
11 |
| - |
| 24 | +import java.io.FileNotFoundException; |
| 25 | +import java.io.InputStream; |
| 26 | +import java.io.InputStreamReader; |
12 | 27 |
|
13 | 28 | /**
|
14 |
| - * TODO: Insert description here. (generated by elibixby) |
| 29 | + * Superclass for tests for samples. |
15 | 30 | */
|
16 | 31 | public class BigquerySampleTest extends BigqueryUtils {
|
17 | 32 |
|
18 |
| - protected static class Constants{ |
| 33 | + protected static class Constants { |
19 | 34 | private String projectId;
|
20 | 35 | private String datasetId;
|
21 | 36 | private String currentTableId;
|
22 | 37 | private String newTableId;
|
23 |
| - private String cloudStorageInputURI; |
24 |
| - private String cloudStorageOutputURI; |
| 38 | + private String cloudStorageInputUri; |
| 39 | + private String cloudStorageOutputUri; |
25 | 40 | private String query;
|
26 |
| - /** |
27 |
| - * @return the projectId |
28 |
| - */ |
| 41 | + |
29 | 42 | public String getProjectId() {
|
30 | 43 | return projectId;
|
31 | 44 | }
|
32 |
| - /** |
33 |
| - * @return the datasetId |
34 |
| - */ |
| 45 | + |
35 | 46 | public String getDatasetId() {
|
36 | 47 | return datasetId;
|
37 | 48 | }
|
38 |
| - /** |
39 |
| - * @return the currentTableId |
40 |
| - */ |
| 49 | + |
41 | 50 | public String getCurrentTableId() {
|
42 | 51 | return currentTableId;
|
43 | 52 | }
|
44 |
| - /** |
45 |
| - * @return the newTableId |
46 |
| - */ |
| 53 | + |
47 | 54 | public String getNewTableId() {
|
48 | 55 | return newTableId;
|
49 | 56 | }
|
50 |
| - /** |
51 |
| - * @return the query |
52 |
| - */ |
| 57 | + |
53 | 58 | public String getQuery() {
|
54 | 59 | return query;
|
55 | 60 | }
|
56 |
| - /** |
57 |
| - * @return the cloudStorageOutputURI |
58 |
| - */ |
59 |
| - public String getCloudStorageOutputURI() { |
60 |
| - return cloudStorageOutputURI; |
| 61 | + |
| 62 | + public String getCloudStorageOutputUri() { |
| 63 | + return cloudStorageOutputUri; |
61 | 64 | }
|
62 |
| - /** |
63 |
| - * @return the cloudStorageInputURI |
64 |
| - */ |
65 |
| - public String getCloudStorageInputURI() { |
66 |
| - return cloudStorageInputURI; |
| 65 | + |
| 66 | + public String getCloudStorageInputUri() { |
| 67 | + return cloudStorageInputUri; |
67 | 68 | }
|
68 | 69 | }
|
69 | 70 |
|
70 |
| - protected static Constants CONSTANTS = null ; |
| 71 | + @SuppressWarnings("checkstyle:abbreviationaswordinname") |
| 72 | + protected static Constants CONSTANTS = null; |
71 | 73 |
|
72 |
| - protected BigquerySampleTest() throws JsonSyntaxException, JsonIOException, FileNotFoundException{ |
73 |
| - if(CONSTANTS == null){ |
74 |
| - InputStream is = this.getClass().getResourceAsStream |
75 |
| - ("/constants.json"); |
76 |
| - CONSTANTS = (new Gson()).<Constants>fromJson( |
77 |
| - new InputStreamReader(is), |
78 |
| - Constants.class); |
| 74 | + protected BigquerySampleTest() |
| 75 | + throws JsonSyntaxException, JsonIOException, FileNotFoundException { |
| 76 | + if (CONSTANTS == null) { |
| 77 | + InputStream is = this.getClass().getResourceAsStream("/constants.json"); |
| 78 | + CONSTANTS = (new Gson()).<Constants>fromJson(new InputStreamReader(is), Constants.class); |
79 | 79 | }
|
80 | 80 | }
|
81 |
| - |
82 |
| - |
83 |
| - |
84 | 81 | }
|
0 commit comments