19
19
import static com .google .cloud .spanner .connection .ITAbstractSpannerTest .extractConnectionUrl ;
20
20
import static com .google .cloud .spanner .connection .ITAbstractSpannerTest .getKeyFile ;
21
21
import static com .google .cloud .spanner .connection .ITAbstractSpannerTest .hasValidKeyFile ;
22
- import static com .google .cloud .spanner .testing .EmulatorSpannerHelper .isUsingEmulator ;
23
22
import static com .google .common .truth .Truth .assertThat ;
24
23
import static org .junit .Assert .assertEquals ;
25
24
import static org .junit .Assert .assertTrue ;
26
- import static org .junit .Assume .assumeFalse ;
27
25
28
26
import com .google .cloud .ByteArray ;
29
27
import com .google .cloud .Timestamp ;
@@ -96,10 +94,7 @@ public class ITBatchReadTest {
96
94
public static List <DialectTestParameter > data () {
97
95
List <DialectTestParameter > params = new ArrayList <>();
98
96
params .add (new DialectTestParameter (Dialect .GOOGLE_STANDARD_SQL ));
99
- // PG dialect tests are not supported by the emulator
100
- if (!isUsingEmulator ()) {
101
- params .add (new DialectTestParameter (Dialect .POSTGRESQL ));
102
- }
97
+ params .add (new DialectTestParameter (Dialect .POSTGRESQL ));
103
98
return params ;
104
99
}
105
100
@@ -135,30 +130,28 @@ public static void setUpDatabase() throws Exception {
135
130
List <DatabaseClient > databaseClients = new ArrayList <>();
136
131
databaseClients .add (env .getTestHelper ().getDatabaseClient (googleStandardDatabase ));
137
132
138
- if (!isUsingEmulator ()) {
139
- postgreSQLDatabase =
140
- env .getTestHelper ().createTestDatabase (Dialect .POSTGRESQL , Collections .emptyList ());
141
- env .getTestHelper ()
142
- .getClient ()
143
- .getDatabaseAdminClient ()
144
- .updateDatabaseDdl (
145
- env .getTestHelper ().getInstanceId ().getInstance (),
146
- postgreSQLDatabase .getId ().getDatabase (),
147
- ImmutableList .of (
148
- "CREATE TABLE "
149
- + TABLE_NAME
150
- + " ("
151
- + " Key bigint not null primary key,"
152
- + " Data bytea,"
153
- + " Fingerprint bigint,"
154
- + " Size bigint"
155
- + ")" ,
156
- "CREATE INDEX " + INDEX_NAME + " ON " + TABLE_NAME + "(Fingerprint)" ),
157
- null )
158
- .get ();
159
- postgreSQLBatchClient = env .getTestHelper ().getBatchClient (postgreSQLDatabase );
160
- databaseClients .add (env .getTestHelper ().getDatabaseClient (postgreSQLDatabase ));
161
- }
133
+ postgreSQLDatabase =
134
+ env .getTestHelper ().createTestDatabase (Dialect .POSTGRESQL , Collections .emptyList ());
135
+ env .getTestHelper ()
136
+ .getClient ()
137
+ .getDatabaseAdminClient ()
138
+ .updateDatabaseDdl (
139
+ env .getTestHelper ().getInstanceId ().getInstance (),
140
+ postgreSQLDatabase .getId ().getDatabase (),
141
+ ImmutableList .of (
142
+ "CREATE TABLE "
143
+ + TABLE_NAME
144
+ + " ("
145
+ + " Key bigint not null primary key,"
146
+ + " Data bytea,"
147
+ + " Fingerprint bigint,"
148
+ + " Size bigint"
149
+ + ")" ,
150
+ "CREATE INDEX " + INDEX_NAME + " ON " + TABLE_NAME + "(Fingerprint)" ),
151
+ null )
152
+ .get ();
153
+ postgreSQLBatchClient = env .getTestHelper ().getBatchClient (postgreSQLDatabase );
154
+ databaseClients .add (env .getTestHelper ().getDatabaseClient (postgreSQLDatabase ));
162
155
163
156
List <Integer > rows = manyRows ();
164
157
numRows = rows .size ();
@@ -210,9 +203,6 @@ private Database getDatabase() {
210
203
211
204
@ Test
212
205
public void read () {
213
- assumeFalse (
214
- "PostgreSQL does not support the PartitionRead RPC" , dialect .dialect == Dialect .POSTGRESQL );
215
-
216
206
BitSet seenRows = new BitSet (numRows );
217
207
TimestampBound bound = getRandomBound ();
218
208
PartitionOptions partitionParams = getRandomPartitionOptions ();
@@ -229,9 +219,6 @@ public void read() {
229
219
230
220
@ Test
231
221
public void readUsingIndex () {
232
- assumeFalse (
233
- "PostgreSQL does not support the PartitionRead RPC" , dialect .dialect == Dialect .POSTGRESQL );
234
-
235
222
TimestampBound bound = getRandomBound ();
236
223
PartitionOptions partitionParams = getRandomPartitionOptions ();
237
224
batchTxn = getBatchClient ().batchReadOnlyTransaction (bound );
@@ -258,8 +245,6 @@ public void readUsingIndex() {
258
245
259
246
@ Test
260
247
public void dataBoostRead () {
261
- assumeFalse ("Emulator does not support data boost read" , isUsingEmulator ());
262
-
263
248
BitSet seenRows = new BitSet (numRows );
264
249
TimestampBound bound = getRandomBound ();
265
250
PartitionOptions partitionParams = getRandomPartitionOptions ();
@@ -312,7 +297,6 @@ private PartitionOptions getRandomPartitionOptions() {
312
297
313
298
@ Test
314
299
public void dataBoostQuery () {
315
- assumeFalse ("Emulator does not support data boost query" , isUsingEmulator ());
316
300
BitSet seenRows = new BitSet (numRows );
317
301
TimestampBound bound = getRandomBound ();
318
302
PartitionOptions partitionParams = getRandomPartitionOptions ();
0 commit comments