Skip to content

Commit

Permalink
Unit test for truncate in TablesNamesFinder
Browse files Browse the repository at this point in the history
  • Loading branch information
sarxos committed Dec 5, 2018
1 parent a22a480 commit 476209c
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,14 @@ public void testGetTableListFromDelete2() throws Exception {
assertTrue(tableList.contains("MY_TABLE1"));
}

@Test
public void testGetTableListFromTruncate() throws Exception {
String sql = "TRUNCATE TABLE MY_TABLE1";
List<String> tables = new TablesNamesFinder().getTableList(pm.parse(new StringReader(sql)));
assertEquals(1, tables.size());
assertTrue(tables.contains("MY_TABLE1"));
}

@Test
public void testGetTableListFromDeleteWithJoin() throws Exception {
String sql = "DELETE t1, t2 FROM MY_TABLE1 t1 JOIN MY_TABLE2 t2 ON t1.id = t2.id";
Expand Down

0 comments on commit 476209c

Please sign in to comment.