Skip to content

Commit

Permalink
Inline util class next to only usage
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed Jan 31, 2024
1 parent 7d7eb03 commit 4baa745
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 42 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@
import static io.trino.testing.TestingConnectorBehavior.SUPPORTS_UPDATE;
import static io.trino.testing.TestingNames.randomNameSuffix;
import static io.trino.testing.assertions.Assert.assertEventually;
import static io.trino.testing.assertions.TestUtil.verifyResultOrFailure;
import static io.trino.tpch.TpchTable.CUSTOMER;
import static java.lang.String.format;
import static java.lang.String.join;
Expand Down Expand Up @@ -652,6 +651,23 @@ public void testVarcharCastToDateInPredicate()
}
}

private static <T> void verifyResultOrFailure(Supplier<T> callback, Consumer<T> verifyResults, Consumer<Throwable> verifyFailure)
{
requireNonNull(callback, "callback is null");
requireNonNull(verifyResults, "verifyResults is null");
requireNonNull(verifyFailure, "verifyFailure is null");

T result;
try {
result = callback.get();
}
catch (Throwable t) {
verifyFailure.accept(t);
return;
}
verifyResults.accept(result);
}

@Test
public void testConcurrentScans()
{
Expand Down

0 comments on commit 4baa745

Please sign in to comment.