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 Jul 8, 2023
1 parent 322d674 commit 3809b78
Show file tree
Hide file tree
Showing 25 changed files with 64 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
package io.trino.util;

import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;

import java.time.DateTimeException;

Expand Down
10 changes: 8 additions & 2 deletions core/trino-server-main/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,14 @@
</dependency>

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
package io.trino.server;

import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;

public class TestDummy
{
Expand Down
16 changes: 11 additions & 5 deletions lib/trino-array/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,26 @@
</dependency>

<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<artifactId>jmh-core</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import io.trino.spi.block.Block;
import io.trino.spi.block.IntArrayBlockBuilder;
import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;

import static io.airlift.slice.SizeOf.instanceSize;
import static org.assertj.core.api.Assertions.assertThat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
package io.trino.array;

import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;

import java.util.Arrays;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
package io.trino.array;

import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;

import java.util.Arrays;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
package io.trino.array;

import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;

import java.util.Arrays;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
package io.trino.array;

import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;

import java.util.Arrays;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
package io.trino.array;

import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;

import java.util.Arrays;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
package io.trino.array;

import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;

import java.util.Arrays;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
package io.trino.array;

import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;

import java.util.Arrays;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@
package io.trino.array;

import io.airlift.slice.Slice;
import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;

import static io.airlift.slice.SizeOf.instanceSize;
import static io.airlift.slice.SizeOf.sizeOf;
import static io.airlift.slice.Slices.wrappedBuffer;
import static org.assertj.core.api.Assertions.assertThat;

@Test
public class TestSliceBigArray
{
private static final long BIG_ARRAY_INSTANCE_SIZE = instanceSize(SliceBigArray.class) + new ReferenceCountMap().sizeOf() + new ObjectBigArray<Slice>().sizeOf();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import io.trino.sql.planner.iterative.rule.test.PlanBuilder;
import io.trino.sql.planner.iterative.rule.test.RuleAssert;
import io.trino.sql.planner.iterative.rule.test.RuleTester;
import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;

import static io.trino.plugin.geospatial.GeometryType.GEOMETRY;
import static io.trino.plugin.geospatial.SphericalGeographyType.SPHERICAL_GEOGRAPHY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import io.trino.sql.planner.iterative.rule.test.BaseRuleTest;
import io.trino.sql.planner.iterative.rule.test.RuleAssert;
import io.trino.sql.planner.iterative.rule.test.RuleTester;
import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;

import static io.trino.plugin.geospatial.GeometryType.GEOMETRY;
import static io.trino.plugin.geospatial.SphericalGeographyType.SPHERICAL_GEOGRAPHY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import org.antlr.v4.runtime.Token;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormatter;
import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;

import java.util.stream.Collectors;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import com.google.common.collect.ImmutableMap;
import io.airlift.units.DataSize;
import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;

import java.util.Map;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import io.trino.spi.connector.SchemaTableName;
import io.trino.spi.predicate.TupleDomain;
import io.trino.spi.type.Type;
import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;

import java.util.ArrayList;
import java.util.Collections;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import io.trino.spi.connector.Connector;
import io.trino.spi.connector.ConnectorFactory;
import io.trino.testing.TestingConnectorContext;
import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;

import java.util.Map;

Expand Down
12 changes: 12 additions & 0 deletions plugin/trino-tpcds/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,18 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
package io.trino.plugin.tpcds;

import com.google.common.collect.ImmutableMap;
import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;

import java.util.Map;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
package io.trino.plugin.tpcds;

import io.trino.spi.connector.ConnectorSession;
import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;

import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import io.trino.tpcds.Table;
import io.trino.tpcds.column.CallCenterColumn;
import io.trino.tpcds.column.WebSiteColumn;
import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;

import java.util.Map;
import java.util.stream.Stream;
Expand Down
12 changes: 12 additions & 0 deletions plugin/trino-tpch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,18 @@
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import io.trino.tpch.PartColumn;
import io.trino.tpch.TpchColumn;
import io.trino.tpch.TpchTable;
import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;

import java.util.List;
import java.util.Map;
Expand Down

0 comments on commit 3809b78

Please sign in to comment.