Skip to content

Commit

Permalink
test: remove integration tests from PR
Browse files Browse the repository at this point in the history
  • Loading branch information
olavloite committed Jul 15, 2020
1 parent ea2d511 commit 51572f3
Showing 1 changed file with 0 additions and 67 deletions.
Expand Up @@ -36,9 +36,7 @@
import com.google.cloud.spanner.Struct;
import com.google.cloud.spanner.TimestampBound;
import com.google.cloud.spanner.Value;
import com.google.common.collect.ImmutableList;
import io.grpc.Context;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -83,15 +81,13 @@ public static void setUpDatabase() {
+ " BytesValue BYTES(MAX),"
+ " TimestampValue TIMESTAMP OPTIONS (allow_commit_timestamp = true),"
+ " DateValue DATE,"
+ " NumericValue NUMERIC,"
+ " BoolArrayValue ARRAY<BOOL>,"
+ " Int64ArrayValue ARRAY<INT64>,"
+ " Float64ArrayValue ARRAY<FLOAT64>,"
+ " StringArrayValue ARRAY<STRING(MAX)>,"
+ " BytesArrayValue ARRAY<BYTES(MAX)>,"
+ " TimestampArrayValue ARRAY<TIMESTAMP>,"
+ " DateArrayValue ARRAY<DATE>,"
+ " NumericArrayValue ARRAY<NUMERIC>,"
+ ") PRIMARY KEY (K)");
client = env.getTestHelper().getDatabaseClient(db);
}
Expand Down Expand Up @@ -356,21 +352,6 @@ public void writeDateNull() {
assertThat(row.isNull(0)).isTrue();
}

@Test
public void writeNumeric() {
write(baseInsert().set("NumericValue").to(new BigDecimal("3.141592")).build());
Struct row = readLastRow("NumericValue");
assertThat(row.isNull(0)).isFalse();
assertThat(row.getBigDecimal(0)).isEqualTo(BigDecimal.valueOf(3141592, 6));
}

@Test
public void writeNumericNull() {
write(baseInsert().set("NumericValue").to((Long) null).build());
Struct row = readLastRow("NumericValue");
assertThat(row.isNull(0)).isTrue();
}

@Test
public void writeBoolArrayNull() {
write(baseInsert().set("BoolArrayValue").toBoolArray((boolean[]) null).build());
Expand Down Expand Up @@ -585,54 +566,6 @@ public void writeDateArray() {
assertThat(row.getDateList(0)).containsExactly(d1, null, d2).inOrder();
}

@Test
public void writeNumericArrayNull() {
write(baseInsert().set("NumericArrayValue").toNumericArray(null).build());
Struct row = readLastRow("NumericArrayValue");
assertThat(row.isNull(0)).isTrue();
}

@Test
public void writeNumericArrayEmpty() {
write(
baseInsert()
.set("NumericArrayValue")
.toNumericArray(ImmutableList.<BigDecimal>of())
.build());
Struct row = readLastRow("NumericArrayValue");
assertThat(row.isNull(0)).isFalse();
assertThat(row.getBigDecimalList(0)).containsExactly();
}

@Test
public void writeNumericArray() {
write(
baseInsert()
.set("NumericArrayValue")
.toNumericArray(
Arrays.asList(new BigDecimal("3.141592"), new BigDecimal("6.626"), null))
.build());
Struct row = readLastRow("NumericArrayValue");
assertThat(row.isNull(0)).isFalse();
assertThat(row.getBigDecimalList(0))
.containsExactly(BigDecimal.valueOf(3141592, 6), BigDecimal.valueOf(6626, 3), null)
.inOrder();
}

@Test
public void writeNumericArrayNoNulls() {
write(
baseInsert()
.set("NumericArrayValue")
.toNumericArray(Arrays.asList(new BigDecimal("3.141592"), new BigDecimal("6.626")))
.build());
Struct row = readLastRow("NumericArrayValue");
assertThat(row.isNull(0)).isFalse();
assertThat(row.getBigDecimalList(0))
.containsExactly(BigDecimal.valueOf(3141592, 6), BigDecimal.valueOf(6626, 3))
.inOrder();
}

@Test
public void tableNotFound() {
// TODO(user): More precise matchers! Customer code needs to discern table not found, column
Expand Down

0 comments on commit 51572f3

Please sign in to comment.