Skip to content

Commit

Permalink
test: use statement with same error code on emulator
Browse files Browse the repository at this point in the history
  • Loading branch information
olavloite committed Jul 30, 2020
1 parent af50669 commit f30334e
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,7 @@ public void testTxWithCaughtError() {
@Override
public Long run(TransactionContext transaction) throws Exception {
try {
transaction.executeUpdate(
Statement.of("UPDATE NonExistingTable SET Foo=1 WHERE Bar=2"));
transaction.executeUpdate(Statement.of("UPDATE T SET V=2 WHERE"));
fail("missing expected exception");
} catch (SpannerException e) {
assertThat(e.getErrorCode()).isEqualTo(ErrorCode.INVALID_ARGUMENT);
Expand All @@ -585,8 +584,7 @@ public void testTxWithUncaughtError() {
new TransactionCallable<Long>() {
@Override
public Long run(TransactionContext transaction) throws Exception {
return transaction.executeUpdate(
Statement.of("UPDATE NonExistingTable SET Foo=1 WHERE Bar=2"));
return transaction.executeUpdate(Statement.of("UPDATE T SET V=2 WHERE"));
}
});
fail("missing expected exception");
Expand All @@ -607,8 +605,7 @@ public void testTxWithUncaughtErrorAfterSuccessfulBegin() {
@Override
public Long run(TransactionContext transaction) throws Exception {
transaction.executeUpdate(Statement.of("INSERT INTO T (K, V) VALUES ('One', 1)"));
return transaction.executeUpdate(
Statement.of("UPDATE NonExistingTable SET Foo=1 WHERE Bar=2"));
return transaction.executeUpdate(Statement.of("UPDATE T SET V=2 WHERE"));
}
});
fail("missing expected exception");
Expand Down

0 comments on commit f30334e

Please sign in to comment.