Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,6 @@ public void bindDateNull() {

@Test
public void bindUuid() {
// TODO: Remove once it is enabled in emulator.
assumeFalse("Emulator does not support UUID yet", isUsingEmulator());
// TODO: Remove once it is enabled in production universe.
assumeTrue("UUID is currently only supported in cloud-devel", isUsingCloudDevel());

UUID uuid = UUID.randomUUID();
Struct row = execute(Statement.newBuilder(selectValueQuery).bind("p1").to(uuid), Type.uuid());
assertThat(row.isNull(0)).isFalse();
Expand All @@ -441,11 +436,6 @@ public void bindUuid() {

@Test
public void bindUuidNull() {
// TODO: Remove once it is enabled in emulator.
assumeFalse("Emulator does not support UUID yet", isUsingEmulator());
// TODO: Remove once it is enabled in production universe.
assumeTrue("UUID is currently only supported in cloud-devel", isUsingCloudDevel());

Struct row =
execute(Statement.newBuilder(selectValueQuery).bind("p1").to((UUID) null), Type.uuid());
assertThat(row.isNull(0)).isTrue();
Expand Down Expand Up @@ -848,11 +838,6 @@ public void bindDateArrayNull() {

@Test
public void bindUuidArray() {
// TODO: Remove once it is enabled in emulator.
assumeFalse("Emulator does not support UUID yet", isUsingEmulator());
// TODO: Remove once it is enabled in production universe.
assumeTrue("UUID is currently only supported in cloud-devel", isUsingCloudDevel());

UUID u1 = UUID.randomUUID();
UUID u2 = UUID.randomUUID();

Expand All @@ -866,11 +851,6 @@ public void bindUuidArray() {

@Test
public void bindUuidArrayEmpty() {
// TODO: Remove once it is enabled in emulator.
assumeFalse("Emulator does not support UUID yet", isUsingEmulator());
// TODO: Remove once it is enabled in production universe.
assumeTrue("UUID is currently only supported in cloud-devel", isUsingCloudDevel());

Struct row =
execute(
Statement.newBuilder(selectValueQuery).bind("p1").toUuidArray(Collections.emptyList()),
Expand All @@ -881,11 +861,6 @@ public void bindUuidArrayEmpty() {

@Test
public void bindUuidArrayNull() {
// TODO: Remove once it is enabled in emulator.
assumeFalse("Emulator does not support UUID yet", isUsingEmulator());
// TODO: Remove once it is enabled in production universe.
assumeTrue("UUID is currently only supported in cloud-devel", isUsingCloudDevel());

Struct row =
execute(
Statement.newBuilder(selectValueQuery).bind("p1").toUuidArray(null),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.google.cloud.spanner.it;

import static com.google.common.base.Strings.isNullOrEmpty;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
Expand Down Expand Up @@ -61,23 +60,11 @@ public class ITUuidTest {

@ClassRule public static IntegrationTestEnv env = new IntegrationTestEnv();

private static boolean isUsingCloudDevel() {
String jobType = System.getenv("JOB_TYPE");

// Assumes that the jobType contains the string "cloud-devel" to signal that
// the environment is cloud-devel.
return !isNullOrEmpty(jobType) && jobType.contains("cloud-devel");
}

@Parameterized.Parameters(name = "Dialect = {0}")
public static List<DialectTestParameter> data() {
// TODO: Remove once it is enabled in production universe.
if (isUsingCloudDevel()) {
return Arrays.asList(
new DialectTestParameter(Dialect.GOOGLE_STANDARD_SQL),
new DialectTestParameter(Dialect.POSTGRESQL));
}
return Collections.emptyList();
return Arrays.asList(
new DialectTestParameter(Dialect.GOOGLE_STANDARD_SQL),
new DialectTestParameter(Dialect.POSTGRESQL));
}

@Parameterized.Parameter() public DialectTestParameter dialect;
Expand Down
Loading