22
33import java .io .StringReader ;
44
5- import junit .framework .TestCase ;
65import net .sf .jsqlparser .JSQLParserException ;
76import net .sf .jsqlparser .parser .CCJSqlParserManager ;
87import net .sf .jsqlparser .statement .create .index .CreateIndex ;
98import static net .sf .jsqlparser .test .TestUtils .*;
9+ import static org .junit .Assert .assertEquals ;
10+ import static org .junit .Assert .assertNull ;
11+ import org .junit .Test ;
1012
1113/**
1214 * @author Raymond Augé
1315 */
14- public class CreateIndexTest extends TestCase {
16+ public class CreateIndexTest {
1517
16- private CCJSqlParserManager parserManager = new CCJSqlParserManager ();
17-
18- public CreateIndexTest (String arg0 ) {
19- super (arg0 );
20- }
18+ private final CCJSqlParserManager parserManager = new CCJSqlParserManager ();
2119
20+ @ Test
2221 public void testCreateIndex () throws JSQLParserException {
2322 String statement =
2423 "CREATE INDEX myindex ON mytab (mycol, mycol2)" ;
@@ -31,6 +30,7 @@ public void testCreateIndex() throws JSQLParserException {
3130 assertEquals (statement , "" +createIndex );
3231 }
3332
33+ @ Test
3434 public void testCreateIndex2 () throws JSQLParserException {
3535 String statement =
3636 "CREATE mytype INDEX myindex ON mytab (mycol, mycol2)" ;
@@ -43,6 +43,7 @@ public void testCreateIndex2() throws JSQLParserException {
4343 assertEquals (statement , "" +createIndex );
4444 }
4545
46+ @ Test
4647 public void testCreateIndex3 () throws JSQLParserException {
4748 String statement =
4849 "CREATE mytype INDEX myindex ON mytab (mycol ASC, mycol2, mycol3)" ;
@@ -54,6 +55,7 @@ public void testCreateIndex3() throws JSQLParserException {
5455 assertEquals ("mycol3" , createIndex .getIndex ().getColumnsNames ().get (2 ));
5556 }
5657
58+ @ Test
5759 public void testCreateIndex4 () throws JSQLParserException {
5860 String statement =
5961 "CREATE mytype INDEX myindex ON mytab (mycol ASC, mycol2 (75), mycol3)" ;
@@ -65,6 +67,7 @@ public void testCreateIndex4() throws JSQLParserException {
6567 assertEquals ("mycol3" , createIndex .getIndex ().getColumnsNames ().get (2 ));
6668 }
6769
70+ @ Test
6871 public void testCreateIndex5 () throws JSQLParserException {
6972 String statement =
7073 "CREATE mytype INDEX myindex ON mytab (mycol ASC, mycol2 (75), mycol3) mymodifiers" ;
@@ -76,6 +79,7 @@ public void testCreateIndex5() throws JSQLParserException {
7679 assertEquals ("mycol3" , createIndex .getIndex ().getColumnsNames ().get (2 ));
7780 }
7881
82+ @ Test
7983 public void testCreateIndex6 () throws JSQLParserException {
8084 String stmt = "CREATE INDEX myindex ON mytab (mycol, mycol2)" ;
8185 assertSqlCanBeParsedAndDeparsed (stmt );
0 commit comments