Skip to content

Commit

Permalink
Migrate tests to JUnit
Browse files Browse the repository at this point in the history
  • Loading branch information
martint committed Oct 29, 2023
1 parent e23214d commit a07a4f4
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import io.trino.testing.AbstractTestQueryFramework;
import io.trino.testing.DistributedQueryRunner;
import io.trino.testing.QueryRunner;
import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;

import java.io.IOException;
import java.math.BigDecimal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
import io.trino.testing.AbstractTestQueryFramework;
import io.trino.testing.DistributedQueryRunner;
import org.intellij.lang.annotations.Language;
import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;

import java.io.File;
import java.net.URI;
Expand Down Expand Up @@ -65,7 +67,7 @@
import static java.util.stream.Collectors.toCollection;

// single-threaded AccessTrackingFileSystemFactory is shared mutable state
@Test(singleThreaded = true)
@Execution(ExecutionMode.SAME_THREAD)
public class TestDeltaLakeFileOperations
extends AbstractTestQueryFramework
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import io.trino.plugin.deltalake.transactionlog.DeltaLakeTransactionLogEntry;
import io.trino.plugin.deltalake.transactionlog.RemoveFileEntry;
import io.trino.plugin.deltalake.transactionlog.checkpoint.LastCheckpoint;
import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;

import java.io.File;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
import io.trino.testing.MaterializedResult;
import io.trino.testing.QueryRunner;
import org.intellij.lang.annotations.Language;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;

import java.util.Arrays;
import java.util.List;
Expand All @@ -35,8 +36,10 @@
import static io.trino.plugin.deltalake.DeltaLakeQueryRunner.createDeltaLakeQueryRunner;
import static java.lang.String.format;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS;
import static org.testng.Assert.assertEquals;

@TestInstance(PER_CLASS)
public class TestSplitPruning
extends AbstractTestQueryFramework
{
Expand All @@ -62,7 +65,7 @@ protected QueryRunner createQueryRunner()
return createDeltaLakeQueryRunner(DELTA_CATALOG, ImmutableMap.of(), ImmutableMap.of("delta.register-table-procedure.enabled", "true"));
}

@BeforeClass
@BeforeAll
public void registerTables()
{
for (String table : TABLES) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
import io.trino.spi.type.IntegerType;
import io.trino.spi.type.TypeManager;
import io.trino.testing.TestingConnectorContext;
import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -80,11 +81,12 @@
import static java.util.Objects.requireNonNull;
import static java.util.stream.Collectors.toCollection;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.parallel.ExecutionMode.SAME_THREAD;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;

@Test(singleThreaded = true) // e.g. TrackingFileSystemFactory is shared mutable state
@Execution(SAME_THREAD) // e.g. TrackingFileSystemFactory is shared mutable state
public class TestTransactionLogAccess
{
private static final Set<String> EXPECTED_ADD_FILE_PATHS = ImmutableSet.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import io.trino.spi.type.RowType;
import io.trino.spi.type.TypeOperators;
import io.trino.spi.type.VarcharType;
import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;

import java.io.IOException;
import java.net.URISyntaxException;
Expand Down

0 comments on commit a07a4f4

Please sign in to comment.