Skip to content

Commit

Permalink
Use generic trueFalse data provider for timestamp tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kokosing authored and losipiuk committed Sep 10, 2020
1 parent 7a17dce commit cc78151
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*/
package io.prestosql.testing;

import org.testng.annotations.DataProvider;

import java.util.ArrayList;
import java.util.stream.Collector;

Expand All @@ -31,4 +33,10 @@ private TestngUtils() {}
},
builder -> builder.toArray(new Object[][] {}));
}

@DataProvider
public static Object[][] trueFalse()
{
return new Object[][] {{true}, {false}};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import io.prestosql.testing.AbstractTestQueryFramework;
import io.prestosql.testing.QueryRunner;
import io.prestosql.testing.TestingSession;
import io.prestosql.testing.TestngUtils;
import io.prestosql.testing.datatype.CreateAndInsertDataSetup;
import io.prestosql.testing.datatype.CreateAndPrestoInsertDataSetup;
import io.prestosql.testing.datatype.CreateAsSelectDataSetup;
Expand Down Expand Up @@ -1086,7 +1087,7 @@ public Object[][] testTimestampDataProvider()
};
}

@Test(dataProvider = "testTimestampWithTimeZoneDataProvider")
@Test(dataProvider = "trueFalse", dataProviderClass = TestngUtils.class)
public void testTimestampWithTimeZone(boolean insertWithPresto)
{
DataSetup dataSetup;
Expand Down Expand Up @@ -1152,7 +1153,7 @@ public void testCreateTableWithInvalidTimestampWithTimeZone()
"Unsupported column type: timestamp\\(7\\) with time zone");
}

@Test(dataProvider = "testTimestampWithTimeZoneDataProvider")
@Test(dataProvider = "trueFalse", dataProviderClass = TestngUtils.class)
public void testArrayTimestampWithTimeZone(boolean insertWithPresto)
{
DataSetup dataSetup;
Expand Down Expand Up @@ -1198,15 +1199,6 @@ public void testArrayTimestampWithTimeZone(boolean insertWithPresto)
tests.execute(getQueryRunner(), sessionWithArrayAsArray(), dataSetup);
}

@DataProvider
public Object[][] testTimestampWithTimeZoneDataProvider()
{
return new Object[][] {
{true},
{false},
};
}

@Test
public void testJson()
{
Expand Down

0 comments on commit cc78151

Please sign in to comment.