Skip to content

Commit

Permalink
Remove testng from trino-teradata-functions test classpath
Browse files Browse the repository at this point in the history
The module was migrated to JUnit, so it shouldn't use TestNG.
  • Loading branch information
findepi committed Oct 2, 2023
1 parent 4cb9c19 commit e2d8193
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
6 changes: 0 additions & 6 deletions plugin/trino-teradata-functions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,6 @@
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,32 @@

import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.testng.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class TestDateFormatParser
{
@Test
public void testTokenize()
{
assertEquals(
DateFormatParser.tokenize("yyyy mm").stream().map(Token::getType).collect(Collectors.toList()),
asList(DateFormat.YYYY, DateFormat.TEXT, DateFormat.MM));
asList(DateFormat.YYYY, DateFormat.TEXT, DateFormat.MM),
DateFormatParser.tokenize("yyyy mm").stream().map(Token::getType).collect(Collectors.toList()));
}

@Test
public void testGreedinessLongFirst()
{
assertEquals(1, DateFormatParser.tokenize("yy").size());
assertEquals(1, DateFormatParser.tokenize("yyyy").size());
assertEquals(2, DateFormatParser.tokenize("yyyyyy").size());
assertEquals(DateFormatParser.tokenize("yy").size(), 1);
assertEquals(DateFormatParser.tokenize("yyyy").size(), 1);
assertEquals(DateFormatParser.tokenize("yyyyyy").size(), 2);
}

@Test
public void testInvalidTokenTokenize()
{
assertEquals(
DateFormatParser.tokenize("ala").stream().map(Token::getType).collect(Collectors.toList()),
asList(DateFormat.UNRECOGNIZED, DateFormat.UNRECOGNIZED, DateFormat.UNRECOGNIZED));
asList(DateFormat.UNRECOGNIZED, DateFormat.UNRECOGNIZED, DateFormat.UNRECOGNIZED),
DateFormatParser.tokenize("ala").stream().map(Token::getType).collect(Collectors.toList()));
}

@Test
Expand All @@ -69,6 +69,6 @@ public void testInvalidTokenCreate2()
public void testCreateDateTimeFormatter()
{
DateTimeFormatter formatter = DateFormatParser.createDateTimeFormatter("yyyy/mm/dd");
assertEquals(formatter.parseDateTime("1988/04/08"), new DateTime(1988, 4, 8, 0, 0));
assertEquals(new DateTime(1988, 4, 8, 0, 0), formatter.parseDateTime("1988/04/08"));
}
}

0 comments on commit e2d8193

Please sign in to comment.